Пример #1
0
 private void OnButtonPress(TrawnButton button, TrawnPlayer player)
 {
     if (!_isLoading && button == TrawnButton.Blue)
     {
         LoadGameScene();
     }
 }
Пример #2
0
 private void OnButtonPress(TrawnButton button, TrawnPlayer player)
 {
     if (button == TrawnButton.Menu && Time.unscaledTime - _startTime > 1f)
     {
         _launcherScene.LoadScene();
     }
 }
Пример #3
0
 public static bool IsActionButton(TrawnButton button)
 {
     if (button == TrawnButton.Blue ||
         button == TrawnButton.Purple ||
         button == TrawnButton.Green)
     {
         return(true);
     }
     return(false);
 }
Пример #4
0
    public bool GetButton(TrawnButton button, TrawnPlayer player = TrawnPlayer.None)
    {
        var key = _inputKeys.GetKey(button, player);

        if (key == null)
        {
            return(false);
        }
        return(Input.GetButton(key));
    }
Пример #5
0
 public static bool IsStickButton(TrawnButton button)
 {
     if (button == TrawnButton.Left ||
         button == TrawnButton.Right ||
         button == TrawnButton.Up ||
         button == TrawnButton.Down)
     {
         return(true);
     }
     return(false);
 }
Пример #6
0
 private void OnButtonPress(TrawnButton button, TrawnPlayer player)
 {
     if (button == TrawnButton.Menu)
     {
         Application.Quit();
     }
     else if (button == TrawnButton.Blue)
     {
         StartGame();
     }
 }
Пример #7
0
 private void OnButtonPress(TrawnButton button, TrawnPlayer player)
 {
     if (!_interactionEnabled)
     {
         return;
     }
     if (button == TrawnButton.Menu)
     {
         _lobbyScene.LoadScene();
     }
     if (button == TrawnButton.Blue)
     {
         SceneManager.LoadScene(SceneManager.GetActiveScene().name);
     }
 }
Пример #8
0
 private void OnButtonPress(TrawnButton button, TrawnPlayer player)
 {
     if ((int)player != _playerIndex)
     {
         return;
     }
     if (!TrawnButtonHelper.IsActionButton(button))
     {
         return;
     }
     if (!_hasJoined)
     {
         Join();
     }
     else if (button == TrawnButton.Green)
     {
         Unjoin();
     }
 }
Пример #9
0
 public string GetKey(TrawnButton button, TrawnPlayer player = TrawnPlayer.None)
 {
     if (button == TrawnButton.Menu)
     {
         return("Cancel");
     }
     if (_keyLookup == null)
     {
         return(null);
     }
     if (!_keyLookup.ContainsKey(player))
     {
         return(null);
     }
     if (_keyLookup[player] == null)
     {
         return(null);
     }
     if (!_keyLookup[player].ContainsKey(button))
     {
         return(null);
     }
     return(_keyLookup[player][button]);
 }