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; } }
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>(); }
public float maxWaitTime; //max waktu diam private void Awake() { agent = GetComponent <NavMeshAgent>(); animator = GetComponent <Animator>(); monsterAttack = GetComponent <IMonsterAttack>(); }
private void Start() { monsterAttack = GetComponentInParent <IMonsterAttack>(); }