void HitStart(AttackActionInfo info)
 {
     if (OnHitStart != null)
     {
         OnHitStart.OnNext(info);
     }
 }
示例#2
0
    void OnTriggerEnter(Collider other)
    {
        if (mAttackActionInfo == null)
        {
            return;
        }

        if (other.gameObject == mOwner.gameObject)
        {
            return;
        }

        HitCollider hitObj = other.gameObject.GetComponent <HitCollider>();

        if (hitObj == null)
        {
            return;
        }

        CharacterProperty character = hitObj.mOwner;

        if (character)
        {
            float hitTime = Time.time - t;

            character.Hit(mOwner, mAttackActionInfo.value);
            //character.HitRate
            GameObject hitEffect = Instantiate(Resources.Load("Effects/Hits/SimpleHitFlash"), CheckCollider.ClosestPointOnBounds(other.transform.position), Quaternion.identity) as GameObject;
            Destroy(hitEffect, 3.0f);

            mAttackActionInfo     = null;
            CheckCollider.enabled = false;
        }
    }
 void HitEnd(AttackActionInfo info)
 {
     if (OnHitEnd != null)
     {
         OnHitEnd.OnNext(info);
     }
 }