Ejemplo n.º 1
0
        internal void SetupModule(int newModuleIndex)
        {
            m_ModuleViewElement.Clear();
            if (m_RegisteredModules.Count > newModuleIndex)
            {
                m_CurrentModuleIndex = newModuleIndex;
                if (m_CurrentModule != null)
                {
                    m_CurrentModule.OnModuleDeactivate();
                }

                m_CurrentModule = null;

                m_CurrentModule = m_RegisteredModules[newModuleIndex];

                m_CurrentModule.OnModuleActivate();
            }
            if (m_MainViewElement != null)
            {
                m_MainViewElement.MarkDirtyRepaint();
            }
            if (m_ModuleViewElement != null)
            {
                m_ModuleViewElement.MarkDirtyRepaint();
            }
        }
Ejemplo n.º 2
0
        void RegisterModule(SpriteEditorModuleBase module)
        {
            var type       = module.GetType();
            var attributes = type.GetCustomAttributes(typeof(RequireSpriteDataProviderAttribute), false);

            if (attributes.Length == 1)
            {
                m_ModuleRequireSpriteDataProvider.Add(type, (RequireSpriteDataProviderAttribute)attributes[0]);
            }
            m_AllRegisteredModules.Add(module);
        }