void OnEnable() { _headerTexture = EntitasEditorLayout.LoadTexture("l:EntitasHeader"); _localVersion = EntitasCheckForUpdates.GetLocalVersion(); _config = EntitasPreferences.LoadConfig(); _preferencesDrawers = Assembly.GetAssembly(typeof(IEntitasPreferencesDrawer)).GetTypes() .Where(type => type.ImplementsInterface <IEntitasPreferencesDrawer>()) .Select(type => (IEntitasPreferencesDrawer)Activator.CreateInstance(type)) .OrderBy(drawer => drawer.priority) .ToArray(); foreach (var drawer in _preferencesDrawers) { drawer.Initialize(_config); } }
void OnEnable() { var guid = AssetDatabase.FindAssets("l:Entitas-Header")[0]; if (guid != null) { var path = AssetDatabase.GUIDToAssetPath(guid); _headerTexture = AssetDatabase.LoadAssetAtPath <Texture2D>(path); } _localVersion = EntitasCheckForUpdates.GetLocalVersion(); _config = EntitasPreferences.LoadConfig(); _preferencesDrawers = Assembly.GetAssembly(typeof(IEntitasPreferencesDrawer)).GetTypes() .Where(type => type.GetInterfaces().Contains(typeof(IEntitasPreferencesDrawer))) .OrderBy(type => type.FullName) .Select(type => (IEntitasPreferencesDrawer)Activator.CreateInstance(type)) .ToArray(); foreach (var drawer in _preferencesDrawers) { drawer.Initialize(_config); } }
public static void OpenPreferences() { EntitasEditorLayout.ShowWindow <EntitasPreferencesWindow>("Entitas " + EntitasCheckForUpdates.GetLocalVersion()); }