public override void Event_MoveFxToOpponent(AnimationEvent animEvent) { if (currentSkill == null || currentSkill is Object && currentSkill.Equals(null)) { return; } if (!_opponents.Any()) { return; } currentOpponent = _opponents[animEvent.intParameter]; if (currentOpponent == null || currentOpponent is Object && currentOpponent.Equals(null)) { return; } var fx = currentSkill.GetEffect(animEvent.stringParameter, _baseCharacter); if (fx == null || fx is Object && fx.Equals(null)) { return; } var frameRate = animEvent.animatorClipInfo.clip.frameRate; var length = CalculatorUtility.TimeByFrame(animEvent.floatParameter, frameRate); StartCoroutine(TransformUtility.MoveToTarget(fx, fx.transform.position, currentOpponent.hitPoint.transform.position, length, () => { Destroy(fx.gameObject); })); }
public override void Event_MoveBack(AnimationEvent animEvent) { if (currentOpponent == null || currentOpponent is Object && currentOpponent.Equals(null)) { return; } var frameRate = animEvent.animatorClipInfo.clip.frameRate; var length = CalculatorUtility.TimeByFrame(animEvent.floatParameter, frameRate); StartCoroutine(TransformUtility.MoveToTarget(transform, currentOpponent.impactPoint.transform.position, _originalPosition, length)); }