private void Awake()
    {
        behaviourHandler.SetParameter("transform", transform);
        behaviourHandler.SetParameter("direction", 1f);

        behaviourHandler.AddBehaviours(new BehaviourPatrol(behaviourHandler));
        behaviourHandler.AddBehaviours(new BehaviourFireSalvo(behaviourHandler));
        behaviourHandler.AddBehaviours(new BehaviourFireDrones(behaviourHandler));

        behaviourHandler.ShiftBehaviour("Patrol");
        behaviourHandler.StartCooldown("FireDrones", 30f);
    }
예제 #2
0
    protected async void ShiftBehaviourAfterWait(string name, float duration)
    {
        await Task.Delay(System.TimeSpan.FromSeconds(duration));

        handler.ShiftBehaviour(name);
    }