예제 #1
0
        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();
        }
예제 #2
0
        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));
        }
예제 #3
0
        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;
 }
예제 #5
0
 public ActorClickedSingleEvent(GameObject sender, ActorProperties actorProperties) : base(sender, actorProperties)
 {
 }
 public void Initialize(ActorProperties actorProperties)
 {
     _properties = actorProperties;
 }
예제 #7
0
 public SpawnCorpseEvent(GameObject sender, ActorProperties actorProperties) : base(sender, actorProperties)
 {
 }