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); }
protected async void ShiftBehaviourAfterWait(string name, float duration) { await Task.Delay(System.TimeSpan.FromSeconds(duration)); handler.ShiftBehaviour(name); }