Ejemplo n.º 1
0
        protected virtual void StartHolding()
        {
            Camera c = Camera.main;

            if (c)
            {
                FBasic_TPPCameraBehaviour tpp = c.GetComponent<FBasic_TPPCameraBehaviour>();
                if (tpp) tpp.enabled = false;
                else
                {
                    FBasic_FreeCameraBehaviour freeC = c.GetComponent<FBasic_FreeCameraBehaviour>();
                    if (freeC) freeC.enabled = false;
                }
            }

            if (!Holding)
            {
                previousCursorLockMode = Cursor.lockState;
                previousCursorVisibility = Cursor.visible;

                Holding = true;
                holdStartPosition = Input.mousePosition;
                holdStartValueY = YValue;
                holdStartValueX = XValue;
                mouseEntered = true;

                Cursor.visible = false;
                Cursor.lockState = CursorLockMode.None;
            }
        }
Ejemplo n.º 2
0
        protected override void StopHolding()
        {
            base.StopHolding();

            Camera c = Camera.main;

            if (c)
            {
                FBasic_TPPCameraBehaviour tpp = c.GetComponent <FBasic_TPPCameraBehaviour>();
                if (tpp)
                {
                    tpp.enabled = true;
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Resetting values for holding object
        /// </summary>
        protected virtual void StopHolding()
        {
            EventOnKeyUpInteraction.Invoke();
            if (ResetValue)
            {
                YValue = 0f;
            }

            Cursor.lockState = previousCursorLockMode;
            Cursor.visible   = previousCursorVisibility;

            startedByMouseClick = false;
            mouseEntered        = false;
            Holding             = false;

            Camera c = Camera.main;

            if (c)
            {
                FBasic_TPPCameraBehaviour tpp = c.GetComponent <FBasic_TPPCameraBehaviour>();
                if (tpp)
                {
                    tpp.enabled = true;
                }
                else
                {
                    FBasic_FreeCameraBehaviour freeC = c.GetComponent <FBasic_FreeCameraBehaviour>();
                    if (freeC)
                    {
                        freeC.enabled = true;
                    }
                }
            }

            //v1.1
            if (!Entered)
            {
                if (CanBePulledByMouse)
                {
                    if (OverrideCanBePulledByMouse)
                    {
                        StopAllCoroutines();
                        OnExit();
                        Entered = false;
                    }
                }
            }
        }