first commit
This commit is contained in:
79
Assets/Plugins/ParadoxNotion/NodeCanvas/Editor/Commands.cs
Normal file
79
Assets/Plugins/ParadoxNotion/NodeCanvas/Editor/Commands.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
#if UNITY_EDITOR
|
||||
|
||||
using UnityEditor;
|
||||
using ParadoxNotion.Design;
|
||||
using NodeCanvas.Framework;
|
||||
|
||||
namespace NodeCanvas.Editor
|
||||
{
|
||||
|
||||
public static class Commands
|
||||
{
|
||||
|
||||
///----------------------------------------------------------------------------------------------
|
||||
|
||||
[UnityEditor.InitializeOnLoadMethod]
|
||||
public static void SetNodeCanvasDefine() {
|
||||
DefinesManager.SetDefineActiveForCurrentTargetGroup("NODECANVAS", true);
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------------------------
|
||||
|
||||
[MenuItem("Assets/Create/ParadoxNotion/NodeCanvas/New Task")]
|
||||
[MenuItem("Tools/ParadoxNotion/NodeCanvas/Create/New Task", false, 90)]
|
||||
public static void ShowTaskWizard() {
|
||||
TaskWizardWindow.ShowWindow();
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------------------------
|
||||
|
||||
[MenuItem("Tools/ParadoxNotion/NodeCanvas/Create/Global Scene Blackboard", false, 10)]
|
||||
public static void CreateGlobalSceneBlackboard() {
|
||||
Selection.activeObject = GlobalBlackboard.Create();
|
||||
}
|
||||
|
||||
[MenuItem("Tools/ParadoxNotion/NodeCanvas/Preferred Types Editor")]
|
||||
public static void ShowPrefTypes() {
|
||||
TypePrefsEditorWindow.ShowWindow();
|
||||
}
|
||||
|
||||
[MenuItem("Tools/ParadoxNotion/NodeCanvas/Graph Console")]
|
||||
public static void OpenConsole() {
|
||||
GraphConsole.ShowWindow();
|
||||
}
|
||||
|
||||
[MenuItem("Tools/ParadoxNotion/NodeCanvas/Graph Explorer")]
|
||||
public static void OpenExplorer() {
|
||||
GraphExplorer.ShowWindow();
|
||||
}
|
||||
|
||||
[MenuItem("Tools/ParadoxNotion/NodeCanvas/Graph Refactor")]
|
||||
public static void OpenRefactor() {
|
||||
GraphRefactor.ShowWindow();
|
||||
}
|
||||
|
||||
[MenuItem("Tools/ParadoxNotion/NodeCanvas/Active Owners Overview")]
|
||||
public static void OpenOwnersOverview() {
|
||||
ActiveOwnersOverview.ShowWindow();
|
||||
}
|
||||
|
||||
[MenuItem("Tools/ParadoxNotion/NodeCanvas/External Inspector Panel")]
|
||||
public static void ShowExternalInspector() {
|
||||
ExternalInspectorWindow.ShowWindow();
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------------------------
|
||||
|
||||
[MenuItem("Tools/ParadoxNotion/NodeCanvas/Welcome Window")]
|
||||
public static void ShowWelcome() {
|
||||
WelcomeWindow.ShowWindow(typeof(NodeCanvas.BehaviourTrees.BehaviourTree));
|
||||
}
|
||||
|
||||
[MenuItem("Tools/ParadoxNotion/NodeCanvas/Website...")]
|
||||
public static void VisitWebsite() {
|
||||
Help.BrowseURL("https://nodecanvas.paradoxnotion.com");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 97bfc0240961cfa46965bb2a0b5cd48c
|
||||
timeCreated: 1462124021
|
||||
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/Commands.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 83195f27791c80849984b2dfe458acea
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,23 @@
|
||||
#if UNITY_EDITOR
|
||||
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
using NodeCanvas.DialogueTrees;
|
||||
|
||||
namespace NodeCanvas.Editor
|
||||
{
|
||||
|
||||
///<summary>A drawer for dialogue tree statements</summary>
|
||||
public class StatementDrawer : ObjectDrawer<Statement>
|
||||
{
|
||||
public override Statement OnGUI(GUIContent content, Statement instance) {
|
||||
if ( instance == null ) { instance = new Statement("..."); }
|
||||
instance.text = UnityEditor.EditorGUILayout.TextArea(instance.text, Styles.wrapTextArea, GUILayout.Height(100));
|
||||
instance.audio = UnityEditor.EditorGUILayout.ObjectField("Audio File", instance.audio, typeof(AudioClip), false) as AudioClip;
|
||||
instance.meta = UnityEditor.EditorGUILayout.TextField("Metadata", instance.meta);
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0bfe262bb61820c468a50914a8a115fa
|
||||
timeCreated: 1514571230
|
||||
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/Drawers/StatementDrawer.cs
|
||||
uploadId: 704937
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 03b4f67804ea6004ca5a0d6d3c2fa242
|
||||
folderAsset: yes
|
||||
timeCreated: 1538791284
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user