Example #1
0
        /// <summary>
        ///     Draws the foreground button.
        /// </summary>
        /// <param name="position">Position.</param>
        /// <param name="locked">Locked.</param>
        private void DrawForegroundButton(Rect position, bool locked)
        {
            string name = m_CurveXProperty.GetHashCode().ToString();

            GUI.SetNextControlName(name);

            bool pressed =
                HydraEditorUtils.DrawUnindented(
                    () => GUI.Button(position, GUIContent.none, HydraEditorGUIStyles.vector3CurvesForegroundStyle));

            if (!pressed)
            {
                return;
            }

            GUI.FocusControl(name);

            Vector3CurvesAttribute parent = m_CurveXProperty.GetParent() as Vector3CurvesAttribute;

            if (locked)
            {
                EditCurve(parent.curveX, "Edit XYZ", s_LockedColor);
            }
            else
            {
                GenericMenu menu = new GenericMenu();

                menu.AddItem(new GUIContent("Edit X"), false, () => EditCurve(parent.curveX, "Edit X", s_ColorX));
                menu.AddItem(new GUIContent("Edit Y"), false, () => EditCurve(parent.curveY, "Edit Y", s_ColorY));
                menu.AddItem(new GUIContent("Edit Z"), false, () => EditCurve(parent.curveZ, "Edit Z", s_ColorZ));

                menu.ShowAsContext();
            }
        }
Example #2
0
        /// <summary>
        ///     Call this method before the object goes out of scope to ensure
        ///     any Object resources are destroyed.
        /// </summary>
        public override object Destroy()
        {
            m_ConstValueA = Destroy(m_ConstValueA);
            m_ConstValueB = Destroy(m_ConstValueB);

            m_CurvesA = Destroy(m_CurvesA);
            m_CurvesB = Destroy(m_CurvesB);

            return(base.Destroy());
        }
		/// <summary>
		/// 	Call this method before the object goes out of scope to ensure
		/// 	any Object resources are destroyed.
		/// </summary>
		public override object Destroy()
		{
			m_ConstValueA = Destroy(m_ConstValueA);
			m_ConstValueB = Destroy(m_ConstValueB);

			m_CurvesA = Destroy(m_CurvesA);
			m_CurvesB = Destroy(m_CurvesB);

			return base.Destroy();
		}