public override bool Update(MonoBehaviour behaviour, Sequencer.StateInstance state)
    {
        HUDAnnounce announce = UIManager.instance.hud.announce;

        bool isDone = false;

        switch((State)state.counter) {
        case State.AnnounceWave:
            if(state.IsDelayReached(waveDelay)) {
                if(isBossAnnounce) {
                    announce.state = HUDAnnounce.State.None;
                    isDone = true;
                }
                else {
                    announce.state = HUDAnnounce.State.Display;
                    announce.message = goString;

                    state.startTime = Time.time;
                    state.counter++;
                }
            }
            break;

        case State.AnnounceGo:
            if(state.IsDelayReached(waveDelay)) {
                announce.state = HUDAnnounce.State.FadeScaleOut;

                state.counter++;
            }
            break;

        case State.AnnounceWaitEnd:
            isDone = announce.state == HUDAnnounce.State.None;
            break;
        }

        return isDone;
    }
Exemple #2
0
    public override bool Update(MonoBehaviour behaviour, Sequencer.StateInstance state)
    {
        bool done = true;

        if(followPlayer && !state.IsDelayReached(followPlayerDuration)) {
            Entity ai = (Entity)behaviour;
            PlanetAttach pa = ai.planetAttach;
            AIState aiState = (AIState)state;
            Player player = SceneLevel.instance.player;

            aiState.curPlanetDir = pa.GetDirTo(player.planetAttach, followPlayerHorizontal);

            if(followPlayerHorizontal) {
                pa.velocity = new Vector2(Mathf.Abs(pa.velocity.x)*aiState.curPlanetDir.x, pa.velocity.y);
            }
            else {
                pa.velocity = aiState.curPlanetDir*pa.velocity.magnitude;
            }

            done = false;
        }

        return done;
    }
Exemple #3
0
 public override bool Update(MonoBehaviour behaviour, Sequencer.StateInstance state)
 {
     //take into account time since animations were played so we are still in sync even after pause/resume of the sequencer
     return state.IsDelayReached(wait);
 }