LMQT/Assets/TouchScript/Examples/Cube/Scripts/LayerDelegate.cs
2024-12-10 09:03:45 +08:00

27 lines
639 B
C#

/*
* @author Valentin Simonov / http://va.lent.in/
*/
using UnityEngine;
using TouchScript.Layers;
using TouchScript.Pointers;
using TouchScript.InputSources;
namespace TouchScript.Examples.Cube
{
/// <exclude />
public class LayerDelegate : MonoBehaviour, ILayerDelegate
{
public RedirectInput Source;
public TouchLayer RenderTextureLayer;
public bool ShouldReceivePointer(TouchLayer layer, IPointer pointer)
{
if (layer == RenderTextureLayer)
return pointer.InputSource == (IInputSource)Source;
return pointer.InputSource != (IInputSource)Source;
}
}
}