void OnTriggerStay(Collider collision) { IA_Hob_Code script = holder.GetComponent <IA_Hob_Code>(); if (IsHiting && collision.gameObject == script.GetTarget()) { Debug.Log("hit"); script.ApplyDamage(collision.gameObject); IsHiting = false; } }
void OnTriggerStay(Collider collision) { IA_Hob_Code script = holder.GetComponent <IA_Hob_Code>(); if (IsHiting && collision.gameObject == script.GetTarget()) { Debug.Log("hit"); if (Random.Range(0, 10) == 1) { collision.gameObject.GetComponent <UnarmedCharacter>().status = Status.Stunned; if (collision.gameObject.GetComponent <PlayerStat>().coroutine != null) { StopCoroutine(collision.gameObject.GetComponent <PlayerStat>().coroutine); } collision.gameObject.GetComponent <PlayerStat>().SetDOT_Time(2); collision.gameObject.GetComponent <PlayerStat>().coroutine = StartCoroutine(collision.gameObject.GetComponent <PlayerStat>().GetOverTime()); } script.ApplyDamage(collision.gameObject); IsHiting = false; } }