using System; using System.Collections.Generic; using UnityEngine; using UnityEditor; using GraphProcessor; using System.Reflection; using GameplayIngredients.Hooks; using GameplayIngredients.Logic; using GameplayIngredients.Actions; public class SceneLogicEditor : BaseGraphWindow { [MenuItem("Window/Gameplay Ingredients/Scene Logic")] static void OpenLogicEditor() { GetWindow(); } protected override void Initialize(BaseGraph graph) { titleContent = Contents.title; } static class Contents { public static readonly GUIContent title = new GUIContent("Scene Logic"); } public List hookTypes; public List logicTypes; public List actionTypes; void PopulateAllTypes() { var result = new List(); Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); var hookBase = typeof(HookBase); var logicBase = typeof(LogicBase); var actionBase = typeof(ActionBase); hookTypes = new List(); logicTypes = new List(); actionTypes = new List(); foreach (var assemly in assemblies) { Type[] types = assemly.GetTypes(); foreach (var type in types) { if (hookBase.IsAssignableFrom(type) && !type.IsAbstract) { hookTypes.Add(type); } else if (logicBase.IsAssignableFrom(type) && !type.IsAbstract) { logicTypes.Add(type); } else if (hookBase.IsAssignableFrom(type) && !type.IsAbstract) { actionTypes.Add(type); } } } } }