private void Awake()
    {
        var player = GameObject.FindGameObjectWithTag("PLAYER");

        if (player != null)
        {
            playerTr = player.GetComponent <Transform>();
        }
        gManager  = GameObject.Find("GameManager").GetComponent <GameManager>();
        enemyTr   = GetComponent <Transform>();
        moveAgent = GetComponent <MoveAgent>();
        erAttack  = GetComponent <EnemyRangeAttack>();
        bManager  = GameObject.FindGameObjectWithTag("BUILD").GetComponent <BuildManager>();
        if (GameObject.Find("SpawnManager") != null)
        {
            sManager = GameObject.Find("SpawnManager").GetComponent <SpawnManager>();
        }
        if (GameObject.Find("GraveSpawnManager") != null)
        {
            gsManager = GameObject.Find("GraveSpawnManager").GetComponent <GraveSpawnManager>();
        }
        uiManager = GameObject.Find("UIManager").GetComponent <UIManager>();
        animator  = GetComponent <Animator>();
        wSecond   = new WaitForSeconds(0.2f);
    }
Beispiel #2
0
 public void Initialize(EnemyRangeAttack parent)
 {
     this.target      = parent.Target;
     this.parent      = parent;
     this.elementType = parent.ElementType;
 }