示例#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);
        }
示例#2
0
 public bool OnCurveAreaMouseDown(int button, Rect drawRect, Rect curveRanges)
 {
     if (button == 0)
     {
         this.ToggleCurveInEditor();
         return(true);
     }
     if (button == 1)
     {
         AnimationCurveContextMenu.Show(drawRect, this.maxCurve, this.GetMinCurve(), this.scalar, curveRanges, this.m_Module.GetParticleSystemCurveEditor());
         return(true);
     }
     return(false);
 }
 internal static void Show(Rect position, SerializedProperty property, SerializedProperty property2, SerializedProperty scalar, Rect curveRanges, ParticleSystemCurveEditor curveEditor)
 {
   GUIContent content1 = new GUIContent("Copy");
   GUIContent content2 = new GUIContent("Paste");
   GenericMenu genericMenu = new GenericMenu();
   bool flag1 = property != null && property2 != null;
   bool flag2 = flag1 && ParticleSystemClipboard.HasDoubleAnimationCurve() || !flag1 && ParticleSystemClipboard.HasSingleAnimationCurve();
   AnimationCurveContextMenu curveContextMenu = new AnimationCurveContextMenu(property, property2, scalar, curveRanges, curveEditor);
   genericMenu.AddItem(content1, false, new GenericMenu.MenuFunction(curveContextMenu.Copy));
   if (flag2)
     genericMenu.AddItem(content2, false, new GenericMenu.MenuFunction(curveContextMenu.Paste));
   else
     genericMenu.AddDisabledItem(content2);
   genericMenu.DropDown(position);
 }
 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 menu = new GenericMenu();
     bool flag = (property != null) && (property2 != null);
     bool flag2 = (flag && ParticleSystemClipboard.HasDoubleAnimationCurve()) || (!flag && ParticleSystemClipboard.HasSingleAnimationCurve());
     AnimationCurveContextMenu menu2 = new AnimationCurveContextMenu(property, property2, scalar, curveRanges, curveEditor);
     menu.AddItem(content, false, new GenericMenu.MenuFunction(menu2.Copy));
     if (flag2)
     {
         menu.AddItem(content2, false, new GenericMenu.MenuFunction(menu2.Paste));
     }
     else
     {
         menu.AddDisabledItem(content2);
     }
     menu.DropDown(position);
 }
        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);
        }
        public bool OnCurveAreaMouseDown(int button, Rect drawRect, Rect curveRanges)
        {
            bool result;

            if (button == 0)
            {
                this.ToggleCurveInEditor();
                result = true;
            }
            else if (button == 1)
            {
                SerializedProperty serializedProperty = this.GetMinCurve();
                AnimationCurveContextMenu.Show(drawRect, (this.maxCurve == null) ? null : this.maxCurve.Copy(), (serializedProperty == null) ? null : serializedProperty.Copy(), (this.scalar == null) ? null : this.scalar.Copy(), curveRanges, this.m_Module.GetParticleSystemCurveEditor());
                result = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }
示例#7
0
        public bool OnCurveAreaMouseDown(int button, Rect drawRect, Rect curveRanges)
        {
            if (button == 0)
            {
                ToggleCurveInEditor();
                return(true);
            }

            if (button == 1)
            {
                SerializedProperty minCurve = GetMinCurve();
                AnimationCurveContextMenu.Show(drawRect,
                                               maxCurve != null ? maxCurve.Copy() : null,
                                               minCurve != null ? minCurve.Copy() : null,
                                               scalar != null ? scalar.Copy() : null,
                                               curveRanges, m_Module.GetParticleSystemCurveEditor());
                return(true);
            }

            return(false);
        }