示例#1
0
	/// <summary>
	/// Creates a swipe detector with no related UI
	/// </summary>
	public static UISwipeDetector create( UIToolkit manager, Rect frame, int depth )
	{
		// create the swipe detector
		var detector = new UISwipeDetector( frame, depth, UIUVRect.zero );
		manager.addTouchableSprite( detector );
		
		return detector;
	}
示例#2
0
    /// <summary>
    /// Creates a swipe detector with no related UI
    /// </summary>
    public static UISwipeDetector create(UIToolkit manager, Rect frame, int depth)
    {
        // create the swipe detector
        var detector = new UISwipeDetector(frame, depth, UIUVRect.zero);

        manager.addTouchableSprite(detector);

        return(detector);
    }
示例#3
0
	/// <summary>
	/// Creates a swipe detector with a texture backing the hit area
	/// </summary>
	public static UISwipeDetector create( UIToolkit manager, string filename, int xPos, int yPos, int depth )
	{
		// grab the texture details
		var normalTI = manager.textureInfoForFilename( filename );
		var frame = new Rect( xPos, yPos, normalTI.frame.width, normalTI.frame.height );

		// create the swipe detector
		var detector = new UISwipeDetector( frame, depth, normalTI.uvRect );
		manager.addTouchableSprite( detector );
		
		return detector;
	}
示例#4
0
    /// <summary>
    /// Creates a swipe detector with a texture backing the hit area
    /// </summary>
    public static UISwipeDetector create(UIToolkit manager, string filename, int xPos, int yPos, int depth)
    {
        // grab the texture details
        var normalTI = manager.textureInfoForFilename(filename);
        var frame    = new Rect(xPos, yPos, normalTI.frame.width, normalTI.frame.height);

        // create the swipe detector
        var detector = new UISwipeDetector(frame, depth, normalTI.uvRect);

        manager.addTouchableSprite(detector);

        return(detector);
    }
 // Swipe callback
 public void onSwipe( UISwipeDetector sender, SwipeDirection direction )
 {
     swipeText.text = direction.ToString();
 }
示例#6
0
    void Start()
    {
        var swipeDetector = UISwipeDetector.create(new Rect(0, 0, Screen.width, Screen.height), 1);

        swipeDetector.onSwipe += detectedSwipe;
    }
示例#7
0
 void detectedSwipe(UISwipeDetector sender, SwipeDirection direction)
 {
     Debug.Log("swipe direction: " + direction);
 }
示例#8
0
	void detectedSwipe( UISwipeDetector sender, SwipeDirection direction )
	{
		Debug.Log( "swipe direction: " + direction );
	}
示例#9
0
 // Swipe callback
 public void onSwipe(UISwipeDetector sender, SwipeDirection direction)
 {
     swipeText.text = direction.ToString();
 }