コード例 #1
0
    private void SendHitFlyImpact(GameObject obj, ImpactInfo impactInfo)
    {
        ImpactMicroGHitFly mircoGHitFly = obj.GetComponent <ImpactMicroGHitFly>();
        ImpactHitFly       hitFlyLogic  = obj.GetComponent <ImpactHitFly>();

        if (null != mircoGHitFly && mircoGHitFly.IsAcitve)
        {
            if (ImpactType.HitFly != mircoGHitFly.GetImpactType())
            {
                mircoGHitFly.StopImpact();
                if (null != hitFlyLogic)
                {
                    hitFlyLogic.StartImpact(impactInfo);
                    return;
                }
            }
            else
            {
                mircoGHitFly.OnHitInFly();
            }
            return;
        }
        ImpactGrab grabLogic = obj.GetComponent <ImpactGrab>();

        if (null != grabLogic && grabLogic.IsAcitve)
        {
            return;
        }
        ImpactKnockDown knockDownLogic = obj.GetComponent <ImpactKnockDown>();

        if (null != knockDownLogic && knockDownLogic.IsAcitve)
        {
            knockDownLogic.StopImpact();
        }
        ImpactStiffness stiffnessLogic = obj.GetComponent <ImpactStiffness>();

        if (null != stiffnessLogic && stiffnessLogic.IsAcitve)
        {
            stiffnessLogic.StopImpact();
        }
        if (null != hitFlyLogic)
        {
            /*if (hitFlyLogic.IsAcitve) {
             * hitFlyLogic.OnHitInFly();
             * return;
             * }*/
            hitFlyLogic.StopImpact();
            hitFlyLogic.StartImpact(impactInfo);
        }
    }
コード例 #2
0
    public void StopImpact(GameObject obj, ImpactType impactType)
    {
        switch (impactType)
        {
        case ImpactType.HitFly:
            ImpactHitFly hitFlyLogic = obj.GetComponent <ImpactHitFly>();
            if (null != hitFlyLogic && hitFlyLogic.IsAcitve)
            {
                hitFlyLogic.StopImpact();
            }
            break;

        case ImpactType.Stiffness:
            ImpactStiffness stiffnessLogic = obj.GetComponent <ImpactStiffness>();
            if (null != stiffnessLogic && stiffnessLogic.IsAcitve)
            {
                stiffnessLogic.StopImpact();
            }
            break;

        case ImpactType.KnockDown:
            ImpactKnockDown knockDownLogic = obj.GetComponent <ImpactKnockDown>();
            if (null != knockDownLogic && knockDownLogic.IsAcitve)
            {
                knockDownLogic.StopImpact();
            }
            break;

        case ImpactType.ThunderStroke:
            break;

        case ImpactType.Grab:
            ImpactGrab grabLogic = obj.GetComponent <ImpactGrab>();
            if (null != grabLogic && grabLogic.IsAcitve)
            {
                grabLogic.StopImpact();
            }
            break;
        }
    }