예제 #1
0
 void RunDemo()
 {
     if (m_currTestIndex < 0)
     {
         return;
     }
     if (m_currentDemo != null)
     {
         m_currentDemo.Exit();
     }
     m_currentDemo = m_alDemos[m_currTestIndex] as MtActionDemo;
     if (m_currentDemo != null)
     {
         m_currentDemo.Enter();
     }
     m_txtTitle.text    = string.Format("{0}. {1}", m_currTestIndex + 1, m_currentDemo.Title());
     m_txtSubTitle.text = m_currentDemo.SubTitle();
 }
예제 #2
0
    void InitDemos()
    {
        m_alDemos = new ArrayList();
        Assembly assembly  = Assembly.GetAssembly(typeof(MtActionDemo));
        Type     baseClass = typeof(MtActionDemo);

        Type[] arrType = assembly.GetTypes();
        foreach (var type in arrType)
        {
            if (type.IsSubclassOf(baseClass))
            {
                MtActionDemo actionDemo = (MtActionDemo)Activator.CreateInstance(type);
                actionDemo.OnSubTitleChange = OnSubTitleChange;
                actionDemo.CubeTransform    = m_tfCube;
                m_alDemos.Add(actionDemo);
            }
        }
        RunDemo();
    }