public override void Apply(Entity e, ModuleWorker worker) { if (e.SetBehaviour(behaviour)) { if (path != null) { e.Behaviour.LoadPath(path); } if (worker.linkedSpawnPath != null) { e.Behaviour.LoadSpecialPath(worker.linkedSpawnPath); } } worker.ProcessNext(e); }
public override void Apply(Entity e, ModuleWorker worker) { if (e.SetBehaviour(behaviour)) { if (paths.Count > 0) { PatrolPath path = paths[Random.Range(0, paths.Count - 1)]; e.Behaviour.LoadPath(path); } if (worker.linkedSpawnPath != null) { e.Behaviour.LoadSpecialPath(worker.linkedSpawnPath); } } worker.ProcessNext(e); }
public override void Apply(Entity e, ModuleWorker worker) { if (behaviours.Count == 0) { throw new System.Exception("No behaviours to apply!"); } Intelligence behaviour = behaviours[Random.Range(0, behaviours.Count - 1)]; if (e.SetBehaviour(behaviour)) { if (path != null) { e.Behaviour.LoadPath(path); } if (worker.linkedSpawnPath != null) { e.Behaviour.LoadSpecialPath(worker.linkedSpawnPath); } } worker.ProcessNext(e); }