private void OnButtonPressed(TestButton source)
        {
            if (ObjectToScale)
            {
                switch (buttonAction)
                {
                case ButtonAction.Reset:
                    Debug.Log(InitialScale);
                    ObjectToScale.transform.localScale = InitialScale;
                    break;

                case ButtonAction.Grow:
                    ObjectToScale.transform.localScale = new Vector3((ObjectToScale.transform.localScale.x + ScaleIncrement), (ObjectToScale.transform.localScale.y + ScaleIncrement), (ObjectToScale.transform.localScale.z + ScaleIncrement));
                    break;

                case ButtonAction.Shrink:
                    if ((ObjectToScale.transform.localScale.x - ScaleIncrement) < 0.0f)
                    {
                        ObjectToScale.transform.localScale = new Vector3(0, 0, 0);
                    }
                    else
                    {
                        ObjectToScale.transform.localScale = new Vector3((ObjectToScale.transform.localScale.x - ScaleIncrement), (ObjectToScale.transform.localScale.y - ScaleIncrement), (ObjectToScale.transform.localScale.z - ScaleIncrement));
                    }
                    break;
                }
            }

            button.Selected = false;
        }
Example #2
0
        private void OnCancelPressed(TestButton source)
        {
            if (cancelledCallback != null)
            {
                cancelledCallback();
            }

            Dismiss();
        }
        private void ShowPopup(TestButton source)
        {
            if (popupMenu != null)
            {
                if (popupMenu.CurrentPopupState == PopupMenu.PopupState.Closed)
                {
                    popupMenu.Show();

                    StartCoroutine(WaitForPopupToClose());
                }
            }
        }
Example #4
0
 private void OnButtonPressed(TestButton source)
 {
     InputManager.Instance.PushInputDisable();
     StartCoroutine(WaitForTime(TimeToWait));
 }