Exemple #1
0
        private void Awake()
        {
            // AxisController is for development only and should not exist--and certainly not be used--in
            // any non-Editor scenario.
#if !UNITY_EDITOR
            Destroy(this);
#else
            // Workaround for Remote Desktop.  Ctrl-mouse, Shift-mouse, and Alt-mouse don't work, so they should be avoided.
            if (IsRunningUnderRemoteDesktop())
            {
                if (this.buttonType == ButtonController.ButtonType.Control)
                {
                    this.buttonType = ButtonController.ButtonType.Left;
                    Debug.LogWarning("Running under Remote Desktop, so changed AxisContol method to Left mouse button");
                }
                if (this.buttonType == ButtonController.ButtonType.Alt)
                {
                    this.buttonType = ButtonController.ButtonType.Right;
                    Debug.LogWarning("Running under Remote Desktop, so changed AxisContol method to Right mouse button");
                }
                if (this.buttonType == ButtonController.ButtonType.Shift)
                {
                    this.buttonType = ButtonController.ButtonType.Middle;
                    Debug.LogWarning("Running under Remote Desktop, so changed AxisContol method to Middle mouse button");
                }
            }

            UnityEngine.Cursor.lockState = CursorLockMode.None;
            UnityEngine.Cursor.visible   = true;
#endif
        }
Exemple #2
0
        // Use this for initialization
        void Start()
        {
            gestureSource         = GameObject.FindObjectOfType <InteractionInputSource>();
            mouseButtonController = GameObject.FindObjectOfType <ButtonController>();
            bcType = mouseButtonController.buttonType;
            EventManager.StartListening("OwnTurn", HandleOwnTurnStart);
            EventManager.StartListening("EnemyTurn", HandleEnemyTurnStart);
            EventManager.StartListening("Win", HandleWin);
            EventManager.StartListening("Loss", HandleLoss);
            EventManager.StartListening("Draw", HandleDraw);

            if (isServer)
            {
                turnPlayerId = PickFirstPlayer();
            }
        }
        private void Awake()
        {
            // AxisController is for development only and should not exist--and certainly not be used--in
            // any non-Editor scenario.
            #if !UNITY_EDITOR
            Destroy(this);
            #else
            // Workaround for Remote Desktop.  Ctrl-mouse, Shift-mouse, and Alt-mouse don't work, so they should be avoided.
            if (IsRunningUnderRemoteDesktop())
            {
                if (this.buttonType == ButtonController.ButtonType.Control)
                {
                    this.buttonType = ButtonController.ButtonType.Left;
                    Debug.LogWarning("Running under Remote Desktop, so changed AxisContol method to Left mouse button");
                }
                if (this.buttonType == ButtonController.ButtonType.Alt)
                {
                    this.buttonType = ButtonController.ButtonType.Right;
                    Debug.LogWarning("Running under Remote Desktop, so changed AxisContol method to Right mouse button");
                }
                if (this.buttonType == ButtonController.ButtonType.Shift)
                {
                    this.buttonType = ButtonController.ButtonType.Middle;
                    Debug.LogWarning("Running under Remote Desktop, so changed AxisContol method to Middle mouse button");
                }
            }

            UnityEngine.Cursor.lockState = CursorLockMode.None;
            UnityEngine.Cursor.visible = true;
            #endif
        }