Пример #1
0
    private void Start()
    {
        unitAttack = this.gameObject.AddComponent <UnitAttack>();
        unitAttack.Initialize(this.gameObject);
        unitProfile = this.gameObject.AddComponent <UnitProfile>();
        unitProfile.Initialize();
        movement = this.gameObject.AddComponent <Movement>();
        movement.Initialize(groundTilemap, collisionTilemap);

        startingPosition = gameObject.transform.position;
    }
Пример #2
0
 private void Start()
 {
     if (this.gameObject.GetComponent <AttackManager>() == true)
     {
         attackManager = this.gameObject.GetComponent <AttackManager>();
     }
     else
     {
         attackManager = new AttackManager();
     }
     if (player == null)
     {
         player = GameObject.Find("Player");
     }
     unitAttack = this.gameObject.AddComponent <UnitAttack>();
     unitAttack.Initialize(this.gameObject);
     if (this.gameObject.GetComponent <UnitProfile>() == null)
     {
         unitProfile = this.gameObject.AddComponent <UnitProfile>();
         unitProfile.Initialize();
     }
     movement = this.gameObject.AddComponent <Movement>(); //Enemy doesn't need to initialize
 }