Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    protected async void ShiftBehaviourAfterWait(string name, float duration)
    {
        await Task.Delay(System.TimeSpan.FromSeconds(duration));

        handler.ShiftBehaviour(name);
    }