コード例 #1
0
ファイル: SelectionScreen.cs プロジェクト: ToxicMask/Gamecine
 // Start is called before the first frame update
 void Start()
 {
     // Set as Disabled
     current.gameObject.SetActive(false);
     foreach (var m in minigames)
     {
         m.onSelect += () => StartMinigame(m.sceneName);
         m.AddListener();
     }
     minigames[0].OnSelect();
     currentMinigame = minigames[0];
 }
コード例 #2
0
ファイル: SelectionScreen.cs プロジェクト: ToxicMask/Gamecine
 void KeyboardControl()
 {
     if (Input.GetAxis("Horizontal") == -1)
     {
         if (canCommand)
         {
             index++;
             IndexNumber(index);
             canCommand = false;
         }
     }
     if (Input.GetAxis("Horizontal") == 1)
     {
         if (canCommand)
         {
             index--;
             IndexNumber(index);
             canCommand = false;
         }
     }
     currentMinigame.OnDeselect();
     minigames[index].OnSelect();
     currentMinigame = minigames[index];
 }