private void SendKnockDownImpact(GameObject obj, ImpactInfo impactInfo) { ImpactMicroGHitFly mircoGHitFly = obj.GetComponent <ImpactMicroGHitFly>(); ImpactKnockDown knockDownLogic = obj.GetComponent <ImpactKnockDown>(); if (null != mircoGHitFly && mircoGHitFly.IsAcitve) { if (ImpactType.HitFly != mircoGHitFly.GetImpactType()) { mircoGHitFly.StopImpact(); if (null != knockDownLogic) { knockDownLogic.StartImpact(impactInfo); return; } } return; } ImpactGrab grabLogic = obj.GetComponent <ImpactGrab>(); if (null != grabLogic && grabLogic.IsAcitve) { return; } ImpactHitFly hitFlyLogic = obj.GetComponent <ImpactHitFly>(); if (null != hitFlyLogic && hitFlyLogic.IsAcitve && ImpactType.UnKnown == hitFlyLogic.GetImpactType()) { hitFlyLogic.StopImpact(); if (null != knockDownLogic) { knockDownLogic.StartImpact(impactInfo); return; } } if (null != hitFlyLogic && hitFlyLogic.IsAcitve && ImpactType.UnKnown != hitFlyLogic.GetImpactType()) { hitFlyLogic.OnKnockDown(); return; } if (null != knockDownLogic && !knockDownLogic.IsAcitve) { knockDownLogic.StartImpact(impactInfo); } }
private void SendStiffnessImpact(GameObject obj, ImpactInfo impactInfo) { ImpactMicroGHitFly mircoGHitFly = obj.GetComponent <ImpactMicroGHitFly>(); ImpactStiffness StiffnessLogic = obj.GetComponent <ImpactStiffness>(); if (null != mircoGHitFly && mircoGHitFly.IsAcitve) { if (ImpactType.HitFly != mircoGHitFly.GetImpactType()) { mircoGHitFly.StopImpact(); if (null != StiffnessLogic) { StiffnessLogic.StartImpact(impactInfo); } return; } else { mircoGHitFly.OnStiffness(impactInfo); } return; } ImpactGrab grabLogic = obj.GetComponent <ImpactGrab>(); if (null != grabLogic && grabLogic.IsAcitve) { return; } ImpactHitFly hitFlyLogic = obj.GetComponent <ImpactHitFly>(); ImpactKnockDown KnockDownLogic = obj.GetComponent <ImpactKnockDown>(); // 击飞后端,停止击飞做硬直 if (null != hitFlyLogic && hitFlyLogic.IsAcitve && ImpactType.UnKnown == hitFlyLogic.GetImpactType()) { hitFlyLogic.StopImpact(); if (null != StiffnessLogic) { StiffnessLogic.StartImpact(impactInfo); } return; } // 如果被击飞,只做受击 if (null != hitFlyLogic && hitFlyLogic.IsAcitve && ImpactType.UnKnown != hitFlyLogic.GetImpactType()) { if (null != StiffnessLogic) { hitFlyLogic.OnHitInFly(); return; } } // 击倒前段, 不处理 if (null != KnockDownLogic && KnockDownLogic.IsAcitve && ImpactType.UnKnown != KnockDownLogic.GetImpactType()) { return; } if (null != KnockDownLogic && KnockDownLogic.IsAcitve && ImpactType.UnKnown == KnockDownLogic.GetImpactType()) { KnockDownLogic.StopImpact(); if (null != StiffnessLogic) { StiffnessLogic.StartImpact(impactInfo); return; } } if (null != StiffnessLogic) { StiffnessLogic.StartImpact(impactInfo); } }