private void Update()
    {
        // The 'Z' key initiates undos and redos
        if (Input.GetKeyDown(KeyCode.Z))
        {
            // Check if a control key is pressed
            if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl))
            {
                bool operationPerformed;

                // If shift is also pressed it should be a redo
                if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
                {
                    operationPerformed = Redo();
                }
                // No shifts means undo
                else
                {
                    operationPerformed = Undo();
                }

                // Play the flip sound for the event
                if (operationPerformed)
                {
                    UISettings.PlayButtonSound(ButtonSound.Flip);
                }
            }
        }
    }
示例#2
0
 public void PunchSize(ButtonSound sound)
 {
     UISettings.PlayButtonSound(sound);
     UISettings.PunchOperator(selectable.transform);
 }