动态控制EZGUI控件的动画

以UIStateToggleBtn为例:

public UIStateToggleBtn m_Tag;

 void Start()
    {
        if (m_Tag.GetTransitions(0).list[0].IsRunning())
            m_Tag.GetTransitions(0).list[0].Pause();
        transitions = m_Tag.GetTransitions(0).list;
        for (int i = 0; i < transitions.Length; i++)
        {
            if (transitions[i].IsRunningAtAll())
            {
                transitions[i].StopSafe();
            }
        }
    }

void OnGUI()
    {
        if (GUI.Button(new Rect(), "play"))
        {
            for (int i = 0; i < transitions.Length; i++)
            {
                transitions[i].Start();
            }
        }
    }

 

posted @ 2013-01-03 18:07  Marble  阅读(158)  评论(0编辑  收藏