private void Attack() { //Cannot attack during pause or while the colors are shuffeling if (pause || shuffeling) { return; } if (iManager.GetButtonDown("Fire1")) { FireTo(colors[0]); } if (iManager.GetButtonDown("Jump")) { FireTo(colors[1]); } if (iManager.GetButtonDown("Fire2")) { FireTo(colors[2]); } if (iManager.GetButtonDown("Fire3")) { FireTo(colors[3]); } }
// Update is called once per frame void Update() { if (!active) { return; } if (!movement) { if (inputsManager.GetButton("Fire3")) { MoveRight(); } else if (inputsManager.GetButton("Fire1")) { MoveLeft(); } if (inputsManager.GetButtonDown("Fire2")) { StartCoroutine(EnterLevel()); } } if (movement) { MoveTowardDestination(); } }
void Update() { if (inputsManager.GetButtonDown("Jump")) { state = (state == 0 ? 1 : state - 1); switch (state) { case (int)MenuState.HERO: SwapToHero(); break; case (int)MenuState.MENU: OpenMenu((int)MenuState.MENU); break; } } if (Input.GetButtonDown("Cancel")) { SceneManager.LoadScene("MainMenu"); } }