Gameplay Ingredients是一组用于 Unity 游戏的运行时和编辑器工具:一组脚本的集合,可在制作游戏和原型时简化简单的任务。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

67 行
1.8 KiB

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<SceneLogicEditor>();
}
protected override void Initialize(BaseGraph graph)
{
titleContent = Contents.title;
}
static class Contents
{
public static readonly GUIContent title = new GUIContent("Scene Logic");
}
public List<Type> hookTypes;
public List<Type> logicTypes;
public List<Type> actionTypes;
void PopulateAllTypes()
{
var result = new List<Type>();
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
var hookBase = typeof(HookBase);
var logicBase = typeof(LogicBase);
var actionBase = typeof(ActionBase);
hookTypes = new List<Type>();
logicTypes = new List<Type>();
actionTypes = new List<Type>();
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);
}
}
}
}
}