first commit

This commit is contained in:
Chris
2025-03-12 14:22:16 -04:00
commit 0ad0c01249
1999 changed files with 189708 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
namespace NodeCanvas.Editor
{
[CustomEditor(typeof(ActionListPlayer))]
public class ActionListPlayerInspector : UnityEditor.Editor
{
private ActionListPlayer list {
get { return (ActionListPlayer)target; }
}
public override void OnInspectorGUI() {
GUI.skin.label.richText = true;
GUILayout.Space(10);
list.playOnAwake = EditorGUILayout.Toggle("Play On Awake", list.playOnAwake);
list.blackboard = (Blackboard)EditorGUILayout.ObjectField("Target Blackboard", (Blackboard)list.blackboard, typeof(Blackboard), true);
TaskEditor.TaskFieldSingle(list.actionList, null, false);
EditorUtils.EndOfInspector();
if ( Event.current.isMouse || list.actionList.isRunning ) {
Repaint();
}
}
}
}
#endif

View File

@@ -0,0 +1,19 @@
fileFormatVersion: 2
guid: fbf729746d7bc944680ce1f47ea78b92
timeCreated: 1435079900
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 14914
packageName: NodeCanvas
packageVersion: 3.3.1
assetPath: Assets/ParadoxNotion/NodeCanvas/Editor/Inspectors/ActionListPlayerInspector.cs
uploadId: 704937

View File

@@ -0,0 +1,31 @@
#if UNITY_EDITOR
using NodeCanvas.BehaviourTrees;
using ParadoxNotion;
using UnityEditor;
using UnityEngine;
namespace NodeCanvas.Editor
{
[CustomEditor(typeof(BehaviourTreeOwner))]
public class BehaviourTreeOwnerInspector : GraphOwnerInspector
{
private BehaviourTreeOwner owner {
get { return target as BehaviourTreeOwner; }
}
protected override void OnPreExtraGraphOptions() {
ParadoxNotion.Design.EditorUtils.Separator();
owner.repeat = EditorGUILayout.Toggle("Repeat", owner.repeat);
if ( owner.repeat ) {
GUI.color = Color.white.WithAlpha(owner.updateInterval > 0 ? 1 : 0.5f);
owner.updateInterval = EditorGUILayout.FloatField("Update Interval", owner.updateInterval);
GUI.color = Color.white;
}
}
}
}
#endif

View File

@@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: 2c0a6b566c1d2e24eab536c326773e7d
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
AssetOrigin:
serializedVersion: 1
productId: 14914
packageName: NodeCanvas
packageVersion: 3.3.1
assetPath: Assets/ParadoxNotion/NodeCanvas/Editor/Inspectors/BehaviourTreeOwnerInspector.cs
uploadId: 704937

View File

@@ -0,0 +1,23 @@
#if UNITY_EDITOR
using NodeCanvas.DialogueTrees;
using UnityEditor;
namespace NodeCanvas.Editor
{
[CustomEditor(typeof(DialogueTreeController))]
public class DialogueTreeControllerInspector : GraphOwnerInspector
{
private DialogueTreeController controller {
get { return target as DialogueTreeController; }
}
protected override void OnPostExtraGraphOptions() {
if ( controller.graph != null ) { DialogueTreeInspector.ShowActorParameters((DialogueTree)controller.graph); }
}
}
}
#endif

View File

@@ -0,0 +1,19 @@
fileFormatVersion: 2
guid: 7500d819cd85a144097dbf09c905400c
timeCreated: 1478952843
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 14914
packageName: NodeCanvas
packageVersion: 3.3.1
assetPath: Assets/ParadoxNotion/NodeCanvas/Editor/Inspectors/DialogueTreeControllerInspector.cs
uploadId: 704937

View File

@@ -0,0 +1,84 @@
#if UNITY_EDITOR
using System.Linq;
using NodeCanvas.DialogueTrees;
using ParadoxNotion.Design;
using UnityEditor;
using UnityEngine;
namespace NodeCanvas.Editor
{
[CustomEditor(typeof(DialogueTree))]
public class DialogueTreeInspector : GraphInspector
{
private DialogueTree dialogue {
get { return target as DialogueTree; }
}
public override void OnInspectorGUI() {
base.OnInspectorGUI();
ShowActorParameters(dialogue);
EditorUtils.EndOfInspector();
if ( GUI.changed ) { UndoUtility.SetDirty(dialogue); }
}
//static because it's also used from DialogueTreeController
public static void ShowActorParameters(DialogueTree dialogue) {
EditorUtils.CoolLabel("Dialogue Actor Parameters");
EditorGUILayout.HelpBox("Enter the Key-Value pair for Dialogue Actors involved in the Dialogue.\nThe reference Object must be an IDialogueActor or have an IDialogueActor component.\nReferencing a Dialogue Actor is optional.", MessageType.Info);
GUILayout.BeginVertical(GUI.skin.box);
if ( GUILayout.Button("Add Actor Parameter") ) {
UndoUtility.RecordObject(dialogue, "New Actor Parameter");
dialogue.actorParameters.Add(new DialogueTree.ActorParameter("actor parameter name"));
UndoUtility.SetDirty(dialogue);
}
EditorGUILayout.LabelField(DialogueTree.INSTIGATOR_NAME + " --> Replaced by the Actor starting the Dialogue");
var options = new EditorUtils.ReorderableListOptions();
options.allowAdd = false;
options.allowRemove = true;
options.unityObjectContext = dialogue;
EditorUtils.ReorderableList(dialogue.actorParameters, options, (i, picked) =>
{
var reference = dialogue.actorParameters[i];
GUILayout.BeginHorizontal();
if ( dialogue.actorParameters.Where(r => r != reference).Select(r => r.name).Contains(reference.name) ) {
GUI.backgroundColor = Color.red;
}
var newRefName = EditorGUILayout.DelayedTextField(reference.name);
if ( newRefName != reference.name ) {
UndoUtility.RecordObject(dialogue, "Actor Parameter Name Change");
reference.name = newRefName;
UndoUtility.SetDirty(dialogue);
}
GUI.backgroundColor = Color.white;
var newReference = (Object)EditorGUILayout.ObjectField(reference.actor as Object, typeof(Object), true);
if ( !ReferenceEquals(newReference, reference.actor) ) {
UndoUtility.RecordObject(dialogue, "Actor Assignment");
//all this jazz because ObjectField does not work with interfaces...
if ( newReference == null ) {
reference.actor = null;
} else {
if ( newReference is Component ) { newReference = ( newReference as Component ).GetComponent(typeof(IDialogueActor)); }
if ( newReference is GameObject ) { newReference = ( newReference as GameObject ).GetComponent(typeof(IDialogueActor)); }
if ( newReference is IDialogueActor ) {
reference.actor = (IDialogueActor)newReference;
} else { ParadoxNotion.Services.Logger.LogWarning("Object is not an IDialogueActor and none of the components attached is an IDialogueActor either."); }
}
UndoUtility.SetDirty(dialogue);
}
GUILayout.EndHorizontal();
});
GUILayout.EndVertical();
}
}
}
#endif

View File

@@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: 8eb93d789c99f9740a5607b35373ba73
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
AssetOrigin:
serializedVersion: 1
productId: 14914
packageName: NodeCanvas
packageVersion: 3.3.1
assetPath: Assets/ParadoxNotion/NodeCanvas/Editor/Inspectors/DialogueTreeInspector.cs
uploadId: 704937