public override void SetDefaultValues(AppearanceDefaultValues data)
        {
            effectDuration = data.defaults.verticalExpandDuration;

            if (data.defaults.verticalFromBottom) //From bottom to top
            {
                //top left copies bottom left
                startA  = 0;
                targetA = 1;

                //top right copies bottom right
                startB  = 3;
                targetB = 2;
            }
            else //from top to bottom
            {
                //bottom left copies top left
                startA  = 1;
                targetA = 0;

                //bottom right copies top right
                startB  = 2;
                targetB = 3;
            }
        }
        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();
        }
        public override void SetDefaultValues(AppearanceDefaultValues data)
        {
            effectDuration = data.defaults.diagonalExpandDuration;

            if (data.defaults.diagonalFromBttmLeft) //expands bottom left and top right
            {
                targetA = 0;
                targetB = 2;
            }
            else //expands bottom right and top left
            {
                targetA = 1;
                targetB = 3;
            }
        }
        public override void SetDefaultValues(AppearanceDefaultValues data)
        {
            effectDuration = 0;

            enabled = false;

            void AssignValues(PresetAppearanceValues result)
            {
                enabled = SetPreset(
                    true,
                    result,
                    ref movement,
                    ref effectDuration,
                    ref rotation,
                    ref scale,
                    ref rotationQua,
                    ref hasTransformEffects,
                    ref setColor,
                    ref colorCurve);
            }

            PresetAppearanceValues 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.TryGetGlobalPresetAppearance(effectTag, out values))
            {
                AssignValues(values);
                return;
            }
        }
 public override void SetDefaultValues(AppearanceDefaultValues data)
 {
     effectDuration = data.defaults.horizontalExpandDuration;
     type           = data.defaults.horizontalExpandStart;
 }
示例#6
0
 public override void SetDefaultValues(AppearanceDefaultValues data)
 {
     showDuration = data.defaults.fadeDuration;
 }
示例#7
0
 public override void SetDefaultValues(AppearanceDefaultValues data)
 {
     showDuration = data.defaults.rotationDuration;
     targetAngle  = data.defaults.rotationStartAngle;
 }
示例#8
0
 public override void SetDefaultValues(AppearanceDefaultValues data)
 {
     direction    = data.defaults.offsetDir;
     amount       = data.defaults.offsetAmplitude * effectIntensity;
     showDuration = data.defaults.offsetDuration;
 }
示例#9
0
        public override void SetDefaultValues(AppearanceDefaultValues data)
        {
            int GetPresetIndex()
            {
                for (int i = 0; i < data.presets.Length; i++)
                {
                    if (data.presets[i].effectTag == effectTag)
                    {
                        return(i);
                    }
                }
                return(-1);
            }

            showDuration = 0;

            int presetIndex = GetPresetIndex();

            if (presetIndex >= 0) //found preset
            {
                movementVec = Vector3.zero;

                data.presets[presetIndex].Initialize();
                showDuration = data.presets[presetIndex].GetMaxDuration();

                setMovement = data.presets[presetIndex].movementX.enabled || data.presets[presetIndex].movementY.enabled || data.presets[presetIndex].movementZ.enabled;
                if (setMovement)
                {
                    movementX = data.presets[presetIndex].movementX;
                    movementY = data.presets[presetIndex].movementY;
                    movementZ = data.presets[presetIndex].movementZ;
                }

                scaleVec = Vector3.one;
                setScale = data.presets[presetIndex].scaleX.enabled || data.presets[presetIndex].scaleY.enabled;
                if (setScale)
                {
                    scaleX = data.presets[presetIndex].scaleX;
                    scaleY = data.presets[presetIndex].scaleY;

                    scaleVec.z = 1;

                    scaleXDuration = scaleX.GetDuration();
                    scaleYDuration = scaleY.GetDuration();
                }

                setRotation = data.presets[presetIndex].rotX.enabled || data.presets[presetIndex].rotY.enabled || data.presets[presetIndex].rotZ.enabled;
                rotationQua = Quaternion.identity;
                if (setRotation)
                {
                    rotX = data.presets[presetIndex].rotX;
                    rotY = data.presets[presetIndex].rotY;
                    rotZ = data.presets[presetIndex].rotZ;
                }

                hasTransformEffects = setMovement || setRotation || setScale;

                setColor = data.presets[presetIndex].color.enabled;
                if (setColor)
                {
                    colorCurve = data.presets[presetIndex].color;
                    colorCurve.Initialize();
                }

                enabled = hasTransformEffects || setColor;
            }
        }