void Attack() { PlayerHealth playerHealth = player.GetComponent <PlayerHealth>(); playerHealth.TakeDamage(5); PlayerConfidence playerConfidence = player.GetComponent <PlayerConfidence>(); playerConfidence.decreaseConfidenceLevel(5); }
void OnParticleCollision(GameObject other) { PlayerHealth playerHealth = player.GetComponent <PlayerHealth>(); PlayerConfidence playerConfidence = player.GetComponent <PlayerConfidence>(); if (other.gameObject.CompareTag("Player")) { Debug.Log("Flame collided w player!"); playerHealth.TakeDamage(5); playerConfidence.decreaseConfidenceLevel(10); } }
void Awake() { // Setting up the references. anim = GetComponent <Animator>(); capsuleCollider = GetComponent <CapsuleCollider>(); monsterController = GetComponent <MonsterController>(); playerConfidence = player.GetComponent <PlayerConfidence>(); // Setting the current health when the enemy first spawns. //currentHealth = startingHealth; currentHealth = 100; Ignit = this.gameObject.transform.GetChild(1).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(1).GetChild(0).GetChild(0).gameObject; Ignition = Ignit.GetComponent <ParticleSystem>(); Flame = this.gameObject.transform.GetChild(1).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(1).GetChild(0).GetChild(2).gameObject; Flames = Flame.GetComponent <ParticleSystem>(); Light = this.gameObject.transform.GetChild(1).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(1).GetChild(0).GetChild(3).gameObject; Lights = Light.GetComponent <ParticleSystem>(); }
// Start is called before the first frame update void Start() { currentHealth = startingHealth; smallMonsterController = smallMonster.GetComponent <SmallMonsterController>(); playerConfidence = player.GetComponent <PlayerConfidence>(); }