protected virtual void die() { if (myAnimator != null) { myAnimator.SetBool("Dieing", true); } dieing = true; if (stunVFX != null) { stunVFX.Die(); stunVFX = null; } if (fireVFX != null) { fireVFX.Die(); fireVFX = null; } stunned = false; onFire = false; float chance = Random.Range(0, 100); if (chance < lootDropChance) { //Debug.Log("Loot Dropped with " + chance.ToString() + "at position " + transform.position.ToString()); PlayerData.Player.AddGold(Random.Range(lootDropMin, lootDropMax + 1)); AudioControlScript.mAC.PlayGetCoin(); } checkIfRelatedQuest(); }
public void SetAlight(float burnLength = 2.0f) { onFire = true; fireTime = burnLength; fireVFX = GameManagerScript.G.GetFireVFX(); fireVFX.OnSpawn(gameObject); }
void burn() { if (onFire) { if (fireTime <= 0) { onFire = false; fireVFX.Die(); fireVFX = null; } fireTime -= Time.deltaTime; } }