protected override void Awake() { base.Awake(); AI = GetComponent <AIController>(); Anim = VisualHolder.GetComponent <Animator>(); VisualHolder.GetComponent <SpriteRenderer>().sortingLayerName = SortingLayer.Object; }
//Combat override public void DeductHealth(Damage dmg) { IC.PopUpText(dmg); if (dmg.Crit) { Animator Anim = VisualHolder.GetComponent <Animator>(); Anim.Play("crit"); //if (dmg.SFX_Update) // AudioSource.PlayClipAtPoint(crit_hurt, transform.position, GameManager.SFX_Volume); } //} else { // if (dmg.SFX_Update) // AudioSource.PlayClipAtPoint(hurt, transform.position, GameManager.SFX_Volume); //} if (CurrStats.Get(STATSTYPE.HEALTH) - dmg.Amount <= 0 && Alive) { ON_DEATH_UPDATE += Die; ON_DEATH_UPDATE(); ON_DEATH_UPDATE -= Die; } else { CurrStats.Dec(STATSTYPE.HEALTH, dmg.Amount); } }