Beispiel #1
0
        private void Awake()
        {
            DPad.gameObject.SetActive(false);

            RightStick.EnableStickButton(true);
            LeftStick.EnableStickButton(true);
        }
Beispiel #2
0
        private void Update()
        {
            var player = UIManager.Instance.Player;



            if (HasSelectedObject)
            {
                #region Right bumper
                if (player.GetButtonDown("RB") && MainScreen_UI.activeInHierarchy)
                {
                    MainScreen_UI.SetActive(false);
                    SnappingModeUI.SetActive(true);
                }
                if (player.GetButton("RB"))
                {
                    return;
                }
                if (player.GetButtonUp("RB") && SnappingModeUI.activeInHierarchy)
                {
                    MainScreen_UI.SetActive(true);
                    SnappingModeUI.SetActive(false);
                }
                #endregion

                #region Left Bumper
                if (player.GetButtonDown("LB") && MainScreen_UI.activeInHierarchy)
                {
                    MainScreen_UI.SetActive(false);
                    RotateAndScaleModeUI.SetActive(true);
                }
                if (player.GetButton("LB"))
                {
                    return;
                }
                if (player.GetButtonUp("LB") && RotateAndScaleModeUI.activeInHierarchy)
                {
                    MainScreen_UI.SetActive(true);
                    RotateAndScaleModeUI.SetActive(false);
                }
                #endregion
            }
            else
            {
                MainScreen_UI.SetActive(true);
                SnappingModeUI.SetActive(false);
                RotateAndScaleModeUI.SetActive(false);
            }


            if (player.GetButtonDown("DPadX"))
            {
                LockCam = !LockCam;
            }
            if (player.GetNegativeButtonDown("DPadX"))
            {
                GroundTracking = !GroundTracking;
            }

            AXYBButtons.XButton.UpdateButton("Edit", HasSelectedObject || HasHighlightedObject);
            AXYBButtons.YButton.UpdateButton("Delete", HasSelectedObject || HasHighlightedObject);
            AXYBButtons.AButton.UpdateButton($"{(HasSelectedObject ? "Place" : "Select")}/Duplicate", HasSelectedObject || HasHighlightedObject);
            AXYBButtons.BButton.UpdateButton(HasSelectedObject ? "Cancel" : "Exit");

            DirectionalPad.RightLabel.SetText($"Lock Cam: {Utilities.Color.ColorTag}{(LockCam ? "On" : "Off")}");
            DirectionalPad.LeftLabel.SetText($"Ground Tracking: {Utilities.Color.ColorTag}{(GroundTracking ? "On" : "Off")}");

            Bumpers.RightBumper.EnableButton(HasSelectedObject);
            Bumpers.LeftBumper.EnableButton(HasSelectedObject);

            RightStick.EnableStickButton(true);
            LeftStick.EnableStickButton(HasSelectedObject);

            //BottomRow.EnableSelectButton = BottomRow.EnableStartButton = true;
        }