public override void SetDefaultValues(AppearanceDefaultValues data)
        {
            movementVec = Vector3.zero;

            showDuration = 0;

            enabled = false;

            void AssignValues(PresetAppearanceValues result)
            {
                enabled = SetPreset(
                    true,
                    result,
                    ref movementX,
                    ref movementY,
                    ref movementZ,
                    ref setMovement,
                    ref showDuration,
                    ref scaleVec,
                    ref setScale,
                    ref scaleX,
                    ref scaleY,
                    ref scaleXDuration,
                    ref scaleYDuration,
                    ref setRotation,
                    ref rotationQua,
                    ref rotX,
                    ref rotY,
                    ref rotZ,
                    ref hasTransformEffects,
                    ref setColor,
                    ref colorCurve);
            }

            void TryAssigningPreset()
            {
                PresetAppearanceValues result;

                //searches for local presets first, which override global presets
                if (TAnimBuilder.GetPresetFromArray(effectTag, data.presets, out result))
                {
                    AssignValues(result);
                    return;
                }

                //global presets
                if (TAnimBuilder.TryGetGlobalPresetAppearance(effectTag, out result))
                {
                    AssignValues(result);
                    return;
                }
            }

            TryAssigningPreset();
        }
示例#2
0
        public override void SetDefaultValues(BehaviorDefaultValues data)
        {
            weightMult = 1;
            timeSpeed  = 1;

            uniformEffectTime = 0;
            weight            = 0;
            isOnOneCharacter  = false;

            enabled = false;


            void AssignValues(PresetBehaviorValues result)
            {
                float showDuration = 0;

                emissionControl = result.emission;

                enabled = PresetAppearance.SetPreset(
                    false,
                    result,
                    ref movement,
                    ref showDuration,
                    ref rotation,
                    ref scale,
                    ref rotationQua,
                    ref hasTransformEffects,
                    ref setColor,
                    ref colorCurve);

                emissionControl.Initialize(showDuration);
            }

            PresetBehaviorValues values;

            //searches for local presets first, which override global presets
            if (TAnimBuilder.GetPresetFromArray(effectTag, data.presets, out values))
            {
                AssignValues(values);
                return;
            }

            //global presets
            if (TAnimBuilder.TryGetGlobalPresetBehavior(effectTag, out values))
            {
                AssignValues(values);
                return;
            }
        }