void Spawn()
 {
     for (int i = 0; i < 1; i++)
     {
         IMonsterAttack newMonster = Instantiate(spawnPrefab, transform.position, Quaternion.identity).GetComponent <IMonsterAttack>();
         newMonster.target        = GameObject.FindGameObjectWithTag("Player").transform;
         newMonster.playerOnSight = true;
     }
 }
Beispiel #2
0
 public string nameSpawn; //blue/green/red/fly
 private void Awake()
 {
     animator        = GetComponent <Animator>();
     monsterMovement = GetComponent <NewMonsterMovement>();
     monsterAttack   = GetComponent <IMonsterAttack>();
     rigid           = GetComponent <Rigidbody>();
     agent           = GetComponent <NavMeshAgent>();
     interactable    = GetComponent <Interactable>();
     collider        = GetComponent <Collider>();
 }
Beispiel #3
0
    public float maxWaitTime; //max waktu diam

    private void Awake()
    {
        agent         = GetComponent <NavMeshAgent>();
        animator      = GetComponent <Animator>();
        monsterAttack = GetComponent <IMonsterAttack>();
    }
Beispiel #4
0
 private void Start()
 {
     monsterAttack = GetComponentInParent <IMonsterAttack>();
 }