Ejemplo n.º 1
0
        private void OnGUI()
        {
            if (m_animator == null)
            {
                m_animator = Selection.activeGameObject.GetComponent <UIAnimator>();

                if (m_animator == null)
                {
                    return;
                }
            }

            m_position = new Vector2(20.0f, 55.0f);
            m_space    = new Vector2(95.0f, 20.0f);

            float desireX = 0.0F;

            for (int n = 0; n < m_animator.AnimationList.Count; n++)
            {
                desireX = m_position.x;

                DrawUIAnimation(m_animator.AnimationList[n]);

                float newSliderValue = EditorGUI.Slider(new Rect(desireX, m_position.y += m_space.y += 5.0f, m_width * 2.0f, m_height), m_sliderValue, 0.0f, 1.0f);

                if (newSliderValue != m_sliderValue)
                {
                    m_animator.Construct();

                    m_sliderValue = newSliderValue;
                    m_animator.AnimationList[n].EvaluateAtTime(newSliderValue);
                }

                if (GUI.Button(new Rect(desireX, m_position.y += m_space.y += 5.0f, m_width, m_height), "Play"))
                {
                    m_animator.Construct();

                    m_animator.AnimationList[n].Play();
                }
            }


            /*
             * if (GUI.Button(new Rect(m_position.x, m_position.y += m_space.y += 5.0f, 20.0f, 20.0f), "+"))
             * {
             *  m_animator.AnimationList.Add(new UIAnimation());
             * }
             */
        }