Ejemplo n.º 1
0
    public override void BeHit(AbilityResultInfo _info)
    {
        if (isDummy || !inited)
        {
            return;
        }
        if (animFSM != null)
        {
            animFSM.BeRigidity(_info.curRigidityTime);
            if (!isDead)
            {
                switch (_info.DefType)
                {
                case DefResultType.DEF_SORT_KICK2:
                    animFSM.BeKickDown(_info.curMoveTime, _info.curRigidityTime);
                    break;

                case DefResultType.DEF_SORT_KICK:
                    animFSM.BeKickFly(_info.curMoveTime, _info.curRigidityTime);
                    break;

                default:
                    animFSM.BeHit(0.3f, 1.0f, _info.curDefAnimation);
                    break;
                }
            }
        }
        if (headTextCtrl != null && !IsActor)
        {
            if (isDead || !MainPlayerFocus)
            {
                //headTextCtrl.HideBlood();
            }
            else
            {
                //headTextCtrl.SetBlood(actorInfo.MaxHP <= 0 ? 0 : (actorInfo.CurHP + _info.TotalDamage - _info.HasShowDamage) / (float)actorInfo.MaxHP, IsFriend);
                //headTextCtrl.SetBloodEnable(actorInfo.OwnerID <= 0 || actorInfo.OwnerID == GameCenter.curMainPlayer.id);
            }
        }
        if (fxCtrl != null)
        {
            if (this.transform.position == _info.UserActor.transform.position)
            {
                fxCtrl.DoDefEffectFixedPosition(_info.curDefEffect, _info.curDefTime, Vector3.one, Quaternion.identity, HitPoint);
            }
            else
            {
                fxCtrl.DoDefEffectFixedPosition(_info.curDefEffect, _info.curDefTime, Vector3.one, Quaternion.LookRotation(this.transform.position - _info.UserActor.transform.position), HitPoint);
            }
        }
        if (moveFSM != null)
        {
            if (_info.curRigidityTime > 0)
            {
                moveFSM.StopMovingTo();
            }
            moveFSM.UseAbility(_info);
        }

        if (_info.UserActor == GameCenter.curMainPlayer && rendererCtrl != null && !rendererCtrl.ArmorDirty && rendererCtrl.PendingArmors == 0)
        {
            rendererCtrl.Blink(Shader.Find("Unlit/Transparent Cutout/Rim"), Color.white, 0.5f);
        }
    }