void Awake() { _actorProperties = GetComponent <ActorProperties>(); _properties = GetComponent <EnemyProperties>(); _mover = GetComponent <IEnemyMover>(); _inputResponse = GetComponent <IActorInputResponse>(); _seeker = GetComponent <Seeker>(); _physicsEvents = GetComponent <EnemyPhysicsEvents>(); _inputResponse.Initialize(_actorProperties); _physicsEvents.Initialize(_actorProperties); CreateDestinations(); }
void SpawnEnemy() { GameObject go = _actorManager.GetActorObj(_actorType); go.transform.position = transform.position; EnemyController controller = go.GetComponent <EnemyController>(); controller.Initialize(); ActorProperties properties = go.GetComponent <ActorProperties>(); OnActorSpawned(new ActorPropertiesEventArgs(go, properties)); }
void Awake() { foreach (var actor in _actors) { ActorProperties properties = actor.GetComponent <ActorProperties>(); GameObject newActor; if (!ActorsGameObjects.TryGetValue(properties.ActorType, out newActor)) { ActorsGameObjects.Add(properties.ActorType, actor); } ActorProperties newProperties; if (!ActorsProperties.TryGetValue(properties.ActorType, out newProperties)) { ActorsProperties.Add(properties.ActorType, properties); } } }
public ActorPropertiesEvent(GameObject sender, ActorProperties actorProperties) { Sender = sender; ActorProperties = actorProperties; }
public ActorClickedSingleEvent(GameObject sender, ActorProperties actorProperties) : base(sender, actorProperties) { }
public void Initialize(ActorProperties actorProperties) { _properties = actorProperties; }
public SpawnCorpseEvent(GameObject sender, ActorProperties actorProperties) : base(sender, actorProperties) { }