// Update is called once per frame void Update() { lifeTime -= Time.deltaTime; stateTimeCountdown -= Time.deltaTime; if (stateTimeCountdown <= 0) { // move to next state stateMachine.AI(); stateTimeCountdown = stateTimeInterval; } if (lifeTime <= (lifeTime / 2)) { // shoot harder shootIntensity = ShootIntensity.NORMAL; } if (lifeTime <= (lifeTime / 10)) { // shoot harder shootIntensity = ShootIntensity.HARD; } if (lifeTime <= 0) { //boss die or player win BossDisapear(); // player win, go to next round GameManager.Instance.SetNextLevel(GameManager.Instance.GetNextLevel()); } }
void Awake() { stateMachine = new MyStateMachine(this.gameObject); stateMachine.currentState = StateMachine.State.ANIM; shootIntensity = ShootIntensity.SOFT; }