Exemple #1
0
        private Actor Spawn(ActorType type, ActorSpec spec)
        {
            var actor = Instantiate(this.prefab, this.actorParent);

            actor.Initialize(FieldController.Size, type, spec);
            return(actor);
        }
Exemple #2
0
        public void SpawnEnemy(ActorSpec spec, Point position)
        {
            var actor = this.Spawn(ActorType.Enemy, spec);

            actor.SetPosition(position);
            EnemyController.Create(actor);
        }
Exemple #3
0
 public void Initialize(float size, ActorType type, ActorSpec spec)
 {
     this.Type = type;
     this.cachedTransform.sizeDelta = Vector2.one * size;
     this.Spec             = spec;
     this.CurrentParameter = new ActorParameter(this.Spec.Parameter);
     this.AI = this.Spec.ClonedAI;
     this.AI.Initialize(this);
     this.image.texture = this.Spec.Texture;
     this.image.color   = this.Spec.Color;
 }