void Move() { if (DrawAnimatorState.GetDrawState().Equals(Enums.GAME_STATE.Move) && isMoving) { transform.position += Vector3.left * movementSpeed * Time.deltaTime; } else { Enums.GAME_STATE state = DrawAnimatorState.GetDrawState(); isMoving = false; if (state.Equals(Enums.GAME_STATE.Wait)) { return; } transform.localScale = new Vector3(Mathf.Abs(transform.localScale.x), transform.localScale.y, transform.localScale.z); if (state.Equals(Enums.GAME_STATE.Fail) || state.Equals(Enums.GAME_STATE.Foul)) { anim.SetBool(Enums.GAME_STATE.Pass.ToString(), true); } else { anim.SetBool(Enums.GAME_STATE.Fail.ToString(), true); } } }
public void SetResult(Enums.GAME_STATE state) { int strikes = LevelManager.instance.strikes.Count; sprite.enabled = true; switch (state) { case Enums.GAME_STATE.Pass: sprite.sprite = passFoulFail [0]; anim.SetTrigger("toUI_pass"); LevelManager.instance.AddScore(); break; case Enums.GAME_STATE.Foul: sprite.sprite = passFoulFail [1]; anim.SetTrigger("toUI_" + strikes); LevelManager.instance.strikes.Add(state.Equals(Enums.GAME_STATE.Foul)); break; case Enums.GAME_STATE.Fail: sprite.sprite = passFoulFail [2]; anim.SetTrigger("toUI_" + strikes); LevelManager.instance.strikes.Add(state.Equals(Enums.GAME_STATE.Foul)); break; } ; Invoke("LoadNextLevel", LevelManager.instance.loadTime); }
public static Enums.GAME_STATE UserInput() { user_drawn = true; if (state.Equals(Enums.GAME_STATE.Wait)) { state = Enums.GAME_STATE.Pass; } else if (state.Equals(Enums.GAME_STATE.Move)) { state = Enums.GAME_STATE.Foul; } return(state); }