DoorwayCleanup is now obselete
Created new scripting system Added toggle for EventCallbackScenario for DevDebug window
This commit is contained in:
parent
4af194e0f4
commit
25530ebbb3
36 changed files with 2467 additions and 24 deletions
|
@ -73,10 +73,12 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DunGenExtenderPropertyDrawer.cs" />
|
||||
<Compile Include="NamedGameObjectReferencePropertyDrawer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="PropertyDrawerUtility.cs" />
|
||||
<Compile Include="PropertyOverridePropertyDrawer.cs" />
|
||||
<Compile Include="ReadOnlyPropertyDrawer.cs" />
|
||||
<Compile Include="ScriptActionPropertyDrawer.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using DunGenPlus;
|
||||
using DunGenPlus.Collections;
|
||||
using DunGenPlus.Components.Scripting;
|
||||
using UnityEditor.UIElements;
|
||||
|
||||
namespace DunGenPlusEditor {
|
||||
|
||||
[CustomPropertyDrawer(typeof(NamedGameObjectReference))]
|
||||
public class NamedGameObjectReferencePropertyDrawer : PropertyDrawer {
|
||||
public override VisualElement CreatePropertyGUI(SerializedProperty property) {
|
||||
|
||||
var container = new VisualElement();
|
||||
container.Add(new PropertyField(property.FindPropertyRelative("name")));
|
||||
container.Add(new PropertyField(property.FindPropertyRelative("gameObjects")));
|
||||
container.Add(new PropertyField(property.FindPropertyRelative("overrideState")));
|
||||
|
||||
return container;
|
||||
}
|
||||
}
|
||||
}
|
43
DunGenPlus/DunGenPlusEditor/ScriptActionPropertyDrawer.cs
Normal file
43
DunGenPlus/DunGenPlusEditor/ScriptActionPropertyDrawer.cs
Normal file
|
@ -0,0 +1,43 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using DunGenPlus;
|
||||
using DunGenPlus.Collections;
|
||||
using DunGenPlus.Components.Scripting;
|
||||
using UnityEditor.UIElements;
|
||||
|
||||
namespace DunGenPlusEditor {
|
||||
|
||||
[CustomPropertyDrawer(typeof(ScriptAction))]
|
||||
public class ScriptActionPropertyDrawer : PropertyDrawer {
|
||||
public override VisualElement CreatePropertyGUI(SerializedProperty property) {
|
||||
|
||||
var container = new VisualElement();
|
||||
var typeProperty = property.FindPropertyRelative("type");
|
||||
container.Add(new PropertyField(typeProperty));
|
||||
|
||||
switch((ScriptActionType)typeProperty.intValue){
|
||||
case ScriptActionType.SetNamedReferenceState:
|
||||
AddPropertyFields(container, property, ("namedReference", "Named Reference"), ("boolValue", "State"));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
container.Add(new PropertyField(property.FindPropertyRelative("overrideState")));
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
private void AddPropertyFields(VisualElement container, SerializedProperty property, params (string field, string label)[] pairs){
|
||||
foreach(var pair in pairs){
|
||||
container.Add(new PropertyField(property.FindPropertyRelative(pair.field), pair.label));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue