예제 #1
0
        static internal void Show(Rect position, SerializedProperty property, SerializedProperty property2, SerializedProperty scalar, Rect curveRanges, ParticleSystemCurveEditor curveEditor)
        {
            // Curve context menu
            GUIContent copy  = EditorGUIUtility.TrTextContent("Copy");
            GUIContent paste = EditorGUIUtility.TrTextContent("Paste");

            GenericMenu menu = new GenericMenu();

            bool isRegion   = property != null && property2 != null;
            bool validPaste = (isRegion && ParticleSystemClipboard.HasDoubleAnimationCurve()) || (!isRegion && ParticleSystemClipboard.HasSingleAnimationCurve());

            AnimationCurveContextMenu obj = new AnimationCurveContextMenu(property, property2, scalar, curveRanges, curveEditor);

            menu.AddItem(copy, false, obj.Copy);
            if (validPaste)
            {
                menu.AddItem(paste, false, obj.Paste);
            }
            else
            {
                menu.AddDisabledItem(paste);
            }

            menu.DropDown(position);
        }
        private void Copy()
        {
            AnimationCurve animationCurveValue = this.m_Prop1?.animationCurveValue;
            AnimationCurve curve2 = this.m_Prop2?.animationCurveValue;
            float          scalar = (this.m_Scalar == null) ? 1f : this.m_Scalar.floatValue;

            ParticleSystemClipboard.CopyAnimationCurves(animationCurveValue, curve2, scalar);
        }
예제 #3
0
        private void Copy()
        {
            AnimationCurve animCurve1 = m_Prop1 != null ? m_Prop1.animationCurveValue : null;
            AnimationCurve animCurve2 = m_Prop2 != null ? m_Prop2.animationCurveValue : null;
            float          scalar     = m_Scalar != null ? m_Scalar.floatValue : 1.0f;

            ParticleSystemClipboard.CopyAnimationCurves(animCurve1, animCurve2, scalar);
        }
        private void Copy()
        {
            AnimationCurve animCurve  = (this.m_Prop1 == null) ? null : this.m_Prop1.animationCurveValue;
            AnimationCurve animCurve2 = (this.m_Prop2 == null) ? null : this.m_Prop2.animationCurveValue;
            float          scalar     = (this.m_Scalar == null) ? 1f : this.m_Scalar.floatValue;

            ParticleSystemClipboard.CopyAnimationCurves(animCurve, animCurve2, scalar);
        }
 private void Paste()
 {
     ParticleSystemClipboard.PasteGradient(m_Prop1, null);
     if (m_Prop1 != null)
     {
         m_Prop1.serializedObject.ApplyModifiedProperties();
     }
     UnityEditorInternal.GradientPreviewCache.ClearCache();
 }
예제 #6
0
 private void Paste()
 {
     ParticleSystemClipboard.PasteGradient(this.m_Prop1, null);
     if (this.m_Prop1 != null)
     {
         this.m_Prop1.serializedObject.ApplyModifiedProperties();
     }
     GradientPreviewCache.ClearCache();
 }
예제 #7
0
 private void Paste()
 {
     ParticleSystemClipboard.PasteAnimationCurves(m_Prop1, m_Prop2, m_Scalar, m_CurveRanges, m_ParticleSystemCurveEditor);
     if (m_Prop1 != null)
     {
         m_Prop1.serializedObject.ApplyModifiedProperties();
     }
     if (m_Prop2 != null)
     {
         m_Prop2.serializedObject.ApplyModifiedProperties();
     }
     if (m_Scalar != null)
     {
         m_Scalar.serializedObject.ApplyModifiedProperties();
     }
 }
        internal static void Show(SerializedProperty prop)
        {
            GUIContent  content     = new GUIContent("Copy");
            GUIContent  content2    = new GUIContent("Paste");
            GenericMenu genericMenu = new GenericMenu();

            genericMenu.AddItem(content, false, new GenericMenu.MenuFunction(new GradientContextMenu(prop).Copy));
            if (ParticleSystemClipboard.HasSingleGradient())
            {
                genericMenu.AddItem(content2, false, new GenericMenu.MenuFunction(new GradientContextMenu(prop).Paste));
            }
            else
            {
                genericMenu.AddDisabledItem(content2);
            }
            genericMenu.ShowAsContext();
        }
예제 #9
0
        internal static void Show(SerializedProperty prop)
        {
            GUIContent          content     = EditorGUIUtility.TrTextContent("Copy", null, null);
            GUIContent          content2    = EditorGUIUtility.TrTextContent("Paste", null, null);
            GenericMenu         genericMenu = new GenericMenu();
            GradientContextMenu @object     = new GradientContextMenu(prop);

            genericMenu.AddItem(content, false, new GenericMenu.MenuFunction(@object.Copy));
            if (ParticleSystemClipboard.HasSingleGradient())
            {
                genericMenu.AddItem(content2, false, new GenericMenu.MenuFunction(@object.Paste));
            }
            else
            {
                genericMenu.AddDisabledItem(content2);
            }
            genericMenu.ShowAsContext();
        }
        internal static void Show(Rect position, SerializedProperty property, SerializedProperty property2, SerializedProperty scalar, Rect curveRanges, ParticleSystemCurveEditor curveEditor)
        {
            GUIContent  content               = new GUIContent("Copy");
            GUIContent  content2              = new GUIContent("Paste");
            GenericMenu genericMenu           = new GenericMenu();
            bool        flag                  = property != null && property2 != null;
            bool        flag2                 = (flag && ParticleSystemClipboard.HasDoubleAnimationCurve()) || (!flag && ParticleSystemClipboard.HasSingleAnimationCurve());
            AnimationCurveContextMenu @object = new AnimationCurveContextMenu(property, property2, scalar, curveRanges, curveEditor);

            genericMenu.AddItem(content, false, new GenericMenu.MenuFunction(@object.Copy));
            if (flag2)
            {
                genericMenu.AddItem(content2, false, new GenericMenu.MenuFunction(@object.Paste));
            }
            else
            {
                genericMenu.AddDisabledItem(content2);
            }
            genericMenu.DropDown(position);
        }
        static internal void Show(SerializedProperty prop)
        {
            // Curve context menu
            GUIContent copy  = EditorGUIUtility.TrTextContent("Copy");
            GUIContent paste = EditorGUIUtility.TrTextContent("Paste");

            GenericMenu menu         = new GenericMenu();
            var         gradientMenu = new GradientContextMenu(prop);

            menu.AddItem(copy, false, gradientMenu.Copy);
            if (ParticleSystemClipboard.HasSingleGradient())
            {
                menu.AddItem(paste, false, gradientMenu.Paste);
            }
            else
            {
                menu.AddDisabledItem(paste);
            }

            menu.ShowAsContext();
        }
 public static void PasteAnimationCurves(SerializedProperty animCurveProperty, SerializedProperty animCurveProperty2, SerializedProperty scalarProperty, Rect curveRanges, ParticleSystemCurveEditor particleSystemCurveEditor)
 {
     if (animCurveProperty != null && ParticleSystemClipboard.m_AnimationCurve1 != null)
     {
         animCurveProperty.animationCurveValue = ParticleSystemClipboard.m_AnimationCurve1;
         ParticleSystemClipboard.ClampCurve(animCurveProperty, curveRanges);
     }
     if (animCurveProperty2 != null && ParticleSystemClipboard.m_AnimationCurve2 != null)
     {
         animCurveProperty2.animationCurveValue = ParticleSystemClipboard.m_AnimationCurve2;
         ParticleSystemClipboard.ClampCurve(animCurveProperty2, curveRanges);
     }
     if (scalarProperty != null)
     {
         scalarProperty.floatValue = ParticleSystemClipboard.m_AnimationCurveScalar;
     }
     if (particleSystemCurveEditor != null)
     {
         particleSystemCurveEditor.Refresh();
     }
 }
예제 #13
0
        private void Copy()
        {
            Gradient gradient = (this.m_Prop1 == null) ? null : this.m_Prop1.gradientValue;

            ParticleSystemClipboard.CopyGradient(gradient, null);
        }
 private void Copy()
 {
     ParticleSystemClipboard.CopyAnimationCurves(this.m_Prop1 == null ? (AnimationCurve)null : this.m_Prop1.animationCurveValue, this.m_Prop2 == null ? (AnimationCurve)null : this.m_Prop2.animationCurveValue, this.m_Scalar == null ? 1f : this.m_Scalar.floatValue);
 }
예제 #15
0
 private void Paste()
 {
     ParticleSystemClipboard.PasteGradient(this.m_Prop1, null);
     GradientPreviewCache.ClearCache();
 }
        private void Copy()
        {
            Gradient gradient1 = m_Prop1 != null ? m_Prop1.gradientValue : null;

            ParticleSystemClipboard.CopyGradient(gradient1, null);
        }
        private void Copy()
        {
            Gradient gradientValue = this.m_Prop1?.gradientValue;

            ParticleSystemClipboard.CopyGradient(gradientValue, null);
        }
 private void Paste()
 {
     ParticleSystemClipboard.PasteAnimationCurves(this.m_Prop1, this.m_Prop2, this.m_Scalar, this.m_CurveRanges, this.m_ParticleSystemCurveEditor);
 }
예제 #19
0
 private void Copy()
 {
     ParticleSystemClipboard.CopyGradient(this.m_Prop1 == null ? (Gradient)null : this.m_Prop1.gradientValue, (Gradient)null);
 }