public override void ParringAttackDamage() { Vector3 pos = RotateAngle == 0.0f ? gameObject.transform.position + Vector3.right : gameObject.transform.position + Vector3.left; GameObject TriggerObj = Instantiate <GameObject>(CResourceMgr.LoadTrigger("DamageCircleTrigger"), pos, Quaternion.identity); CDamageTrigger Trigger = TriggerObj.GetComponent <CDamageTrigger>(); Trigger.Owner = gameObject; CSturnAni ani = gameObject.GetComponentInChildren <CSturnAni>(); Trigger.AliveTime = 0.1f; Trigger.Damage = 10; Trigger.ApplyAliveTime(); Trigger.bSturn = true; Trigger.HitAniType = EHitAniType.Type1; SoundMgr.PlaySound("Attack", ESoundType.Motion); }
public void Hit(int Damage) { HP -= Damage; if (HP < DefaultHP / 2) { SpriteRender.sprite = NextSprites[0]; Vector3 pos = gameObject.transform.position; GameObject TriggerObj = Instantiate <GameObject>(CResourceMgr.LoadTrigger("TrapDamageTrigger"), pos, Quaternion.identity); CDamageTrigger Trigger = TriggerObj.GetComponent <CDamageTrigger>(); Trigger.Owner = gameObject; Trigger.HitMove = 0.2f; Trigger.AliveTime = 0.5f; Trigger.Damage = 10; Trigger.ApplyAliveTime(); Invoke("EndSprite", 0.5f); } }