Press() public method

Calculate the bounds of all widgets under this game object.
public Press ( bool isPressed ) : void
isPressed bool
return void
コード例 #1
0
ファイル: UIDragCamera.cs プロジェクト: DonDracula/Unity_Demo
    /// <summary>
    /// Forward the press event to the draggable camera.
    /// </summary>

    void OnPress(bool isPressed)
    {
        if (enabled && gameObject.active && draggableCamera != null)
        {
            draggableCamera.Press(isPressed);
        }
    }
コード例 #2
0
ファイル: UIDragCamera.cs プロジェクト: Luciano-0/2048-Demo
    /// <summary>
    /// Forward the press event to the draggable camera.
    /// </summary>

    void OnPress(bool isPressed)
    {
        if (enabled && NGUITools.GetActive(gameObject) && draggableCamera != null)
        {
            draggableCamera.Press(isPressed);
        }
    }
コード例 #3
0
 private void OnPress(bool isPressed)
 {
     //IL_000c: Unknown result type (might be due to invalid IL or missing references)
     //IL_0011: Expected O, but got Unknown
     if (this.get_enabled() && NGUITools.GetActive(this.get_gameObject()) && draggableCamera != null)
     {
         draggableCamera.Press(isPressed);
     }
 }
コード例 #4
0
    /// <summary>
    /// Forward the press event to the draggable camera.
    /// </summary>

    void OnPress(bool isPressed)
    {
                #pragma warning disable 0618
        if (enabled && gameObject.active && draggableCamera != null)
        {
            draggableCamera.Press(isPressed);
        }
                #pragma warning restore 0618
    }
コード例 #5
0
    void OnPress(bool isPressed)
    {
        if (enabled && NGUITools.GetActive(gameObject) && Draggable != null)
        {
            Draggable.Press(isPressed);
        }

        if (IsDrag && !isPressed)
        {
            IsDrag = false;
        }
        else if (!isPressed)
        {
            if (Draggable != null)
            {
                Vector3 targetPos = Vector3.zero;
                if (Application.isEditor)
                {
                    targetPos = UICamera.currentCamera.ScreenToWorldPoint(Input.mousePosition);
                }
                else
                {
                    if (Input.touchCount == 0)
                    {
                        return;
                    }

                    targetPos = UICamera.currentCamera.ScreenToWorldPoint(Input.touches[0].position);
                }

                targetPos.x += Draggable.transform.position.x;
                Vector3 hitPos = targetPos;
                int     count  = Grid.transform.childCount;
                for (int i = 0; i < count; i++)
                {
                    Transform tf  = Grid.transform.GetChild(i);
                    Vector3   min = tf.collider.bounds.min;     //tf.position-(tf.collider.bounds.extents/2);//(*0.002777123f)GetComponent<BoxCollider>().size
                    Vector3   max = tf.collider.bounds.max;     //tf.position+(tf.collider.bounds.extents/2);

                    if (min.x <= hitPos.x && hitPos.x <= max.x) // && min.y <= hitPos.y && hitPos.y <= max.y)
                    {
                        UIEventTrigger tri = tf.GetComponent <UIEventTrigger>();
                        if (tri != null)
                        {
                            EventDelegate.Execute(tri.onClick);
                        }
                        break;
                    }
                }
            }
        }
    }
コード例 #6
0
 static public int Press(IntPtr l)
 {
     try {
         UIDraggableCamera self = (UIDraggableCamera)checkSelf(l);
         System.Boolean    a1;
         checkType(l, 2, out a1);
         self.Press(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #7
0
    /// <summary>
    /// Forward the press event to the draggable camera.
    /// </summary>

    void OnPress(bool isPressed)
    {
        if (enabled && NGUITools.GetActive(gameObject) && draggableCamera != null)
        {
            if (null != ThirdCamera.instance._MainPlayer)
            {
                player = ThirdCamera.instance._MainPlayer;
                ThirdCamera.instance._MainPlayer = null;
            }
            draggableCamera.Press(isPressed);
            if (!isPressed)
            {
                if (null != player && !GameLibrary.SceneType(SceneType.PVP3))
                {
                    ThirdCamera.instance._MainPlayer = player;
                }
            }
        }
    }