Exemple #1
0
        public static EditorBase CreateEditor(Type t)
        {
            EditorBase editor = null;

            if (m_typeMap[t] != null)
            {
                Type EditorType = m_typeMap[t];
                editor = System.Activator.CreateInstance(EditorType) as EditorBase;
                Console.WriteLine("Editor type " + EditorType.Name);
            }
            return(editor);
        }
        static void Main(string[] args)
        {
            AttributeManager.Init();

            Effect    effect    = new Effect();
            Animation animation = new Animation();

            EditorBase effectEditor    = AttributeManager.CreateEditor(effect.GetType());
            EditorBase animationEditor = AttributeManager.CreateEditor(animation.GetType());

            effectEditor.OnGUI();
            animationEditor.OnGUI();

            Console.ReadKey();
        }