public void ApplyPositioning(IEffectEntity effectEntity, IEffectPositionerSettings settings)
        {
            Transform targetTag;

            switch (settings.EffectTagType)
            {
            case EffectTagType.Bottom:
                targetTag = bottomTag ?? defaultTag;
                break;

            case EffectTagType.Foot:
                targetTag = footTag ?? defaultTag;
                break;

            case EffectTagType.Impact:
                targetTag = impactTag ?? defaultTag;
                break;

            case EffectTagType.ImpactStatic:
                targetTag = impactStaticTag ?? defaultTag;
                break;

            case EffectTagType.RightHand:
                targetTag = rightHandTag ?? defaultTag;
                break;

            case EffectTagType.LeftHand:
                targetTag = leftHandTag ?? defaultTag;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(settings.EffectTagType));
            }

            if (settings.AttachToTag)
            {
                effectEntity.Transform.SetParent(targetTag);
            }

            effectEntity.KeepAliveWithNoParticles = settings.KeepAliveWithNoParticles;
            effectEntity.KeepOriginalRotation     = settings.KeepOriginalRotation;
            effectEntity.Transform.position       = targetTag.position;
        }
Пример #2
0
 public static void ApplyPositioning(this IEffectEntity effectEntity, IEffectPositioner positioner, IEffectPositionerSettings settings)
 {
     positioner.ApplyPositioning(effectEntity, settings);
 }