void StartGamne() { ShooterControl game = GameObject.FindObjectOfType <ShooterControl>(); if (game != null) { game.SetState(ShooterControl.GameState.BEFORE_FIRE); } }
void OnTriggerEnter(Collider other) { ShooterControl player = GameObject.FindObjectOfType <ShooterControl>(); if (player != null) { player.SetState(ShooterControl.GameState.CLEAR); GetComponent <Animator>().SetTrigger("Clear"); } }
void Update() { if (shooter.State == ShooterControl.GameState.BULLET_FLYING) { float h = Input.GetAxis("Horizontal"); float v = Input.GetAxis("Vertical"); Vector3 tmp = bullet_predict.transform.localPosition; tmp.x += h * shiftSpeed; tmp.y += v * shiftSpeed; bullet_predict.transform.localPosition = tmp; if (Input.GetButton("Jump")) { bullet_predict.transform.localPosition = Vector3.zero; hitIndex = -1; shooter.SetState(ShooterControl.GameState.BULLET_MISS); } } }