private void OnEnemyCreated(Enemy enemy) { DropsItems di = enemy.gameObject.AddComponent <DropsItems>(); DropsItems.DropData bombData = new DropsItems.DropData(); bombData.itemName = "Bomb"; bombData.rate = 33; bombData.amount = 1; di.arbitraryDrops = new DropsItems.DropData[] { bombData }; }
void Start() { chaser = GetComponent<ChasesPlayer>(); hurt = GetComponent<Hurtable>(); faces = GetComponent<FacesPlayer>(); drops = GetComponent<DropsItems>(); attacks = GetComponent<AttacksPlayer>(); anim = GetComponent<Animator>(); hurt.onDeath += hurt_onDeath; hurt.onHurt += hurt_onHurt; }
void Start() { playerTrans = GameObject.FindGameObjectWithTag("Player").GetComponent<Transform>(); agent = GetComponent<NavMeshAgent>(); anim = GetComponent<Animator>(); randMov = GetComponent<MovesRandomly>(); drops = GetComponent<DropsItems>(); audSrc = GetComponent<AudioSource>(); hurt = GetComponent<Hurtable>(); hurt.onDeath += hurt_onDeath; }
void Start() { anim = GetComponent<Animator>(); dropper = GetComponent<DropsItems>(); chaser = GetComponent<ChasesPlayer>(); faces = GetComponent<FacesPlayer>(); hurt = GetComponent<Hurtable>(); hurt.onDeath += hurt_onDeath; hurt.onHurt += hurt_onHurt; audioSrc = GetComponent<AudioSource>(); attacks = GetComponent<AttacksPlayer>(); attacks.onPlayerDeath += attacks_onPlayerDeath; }
void Start() { anim = GetComponent<Animator>(); dropper = GetComponent<DropsItems>(); chaser = GetComponent<ChasesPlayer>(); faces = GetComponent<FacesPlayer>(); audSrc = GetComponent<AudioSource>(); attacks = GetComponent<AttacksPlayer>(); attacks.onPlayerHit += attacks_onPlayerHit; hurt = GetComponent<Hurtable>(); hurt.onDeath += hurt_onDeath; hurt.onHurt += hurt_onHurt; tag = "enemy"; //For items to detect and deliver damage }
void Start() { playerTrans = GameObject.FindGameObjectWithTag("Player").GetComponent<Transform>(); fireBreath = GetComponentInChildren<DamagingParticleSystem>(); anim = GetComponent<Animator>(); audSrc = GetComponent<AudioSource>(); drops = GetComponent<DropsItems>(); hurt = GetComponent<Hurtable>(); hurt.onDeath += hurt_onDeath; }