├── .gitignore ├── .vscode └── settings.json ├── Assets ├── Plugins.meta ├── Plugins │ ├── Node_Editor.meta │ ├── Node_Editor │ │ ├── Default.meta │ │ ├── Default │ │ │ ├── Calculation Base.meta │ │ │ ├── Calculation Base │ │ │ │ ├── CalculationCanvasType.cs │ │ │ │ ├── CalculationCanvasType.cs.meta │ │ │ │ ├── CanvasCalculator.cs │ │ │ │ ├── CanvasCalculator.cs.meta │ │ │ │ ├── FloatCalculation.cs │ │ │ │ └── FloatCalculation.cs.meta │ │ │ ├── Graph Example.meta │ │ │ ├── Graph Example │ │ │ │ ├── GraphCanvasType.cs │ │ │ │ ├── GraphCanvasType.cs.meta │ │ │ │ ├── GraphTraversal.cs │ │ │ │ └── GraphTraversal.cs.meta │ │ │ ├── IO Formats.meta │ │ │ ├── IO Formats │ │ │ │ ├── XMLImportExport.cs │ │ │ │ └── XMLImportExport.cs.meta │ │ │ ├── Runtime Examples.meta │ │ │ └── Runtime Examples │ │ │ │ ├── RTCanvasCalculator.cs │ │ │ │ ├── RTCanvasCalculator.cs.meta │ │ │ │ ├── RTNodeEditor.cs │ │ │ │ └── RTNodeEditor.cs.meta │ │ ├── Editor.meta │ │ ├── Editor │ │ │ ├── Node_Editor.meta │ │ │ └── Node_Editor │ │ │ │ ├── CanvasInspector.cs │ │ │ │ ├── CanvasInspector.cs.meta │ │ │ │ ├── LastSession.asset │ │ │ │ ├── LastSession.asset.meta │ │ │ │ ├── NodeEditorWindow.cs │ │ │ │ ├── NodeEditorWindow.cs.meta │ │ │ │ ├── NodeInspector.cs │ │ │ │ ├── NodeInspector.cs.meta │ │ │ │ ├── RTCanvasCalculatorEditor.cs │ │ │ │ ├── RTCanvasCalculatorEditor.cs.meta │ │ │ │ ├── RTNodeEditorInspector.cs │ │ │ │ └── RTNodeEditorInspector.cs.meta │ │ ├── Framework.meta │ │ ├── Framework │ │ │ ├── Core.meta │ │ │ ├── Core │ │ │ │ ├── ConnectionKnob.cs │ │ │ │ ├── ConnectionKnob.cs.meta │ │ │ │ ├── ConnectionPort.cs │ │ │ │ ├── ConnectionPort.cs.meta │ │ │ │ ├── ConnectionPortManager.cs │ │ │ │ ├── ConnectionPortManager.cs.meta │ │ │ │ ├── Node.cs │ │ │ │ ├── Node.cs.meta │ │ │ │ ├── NodeCanvas.cs │ │ │ │ ├── NodeCanvas.cs.meta │ │ │ │ ├── NodeCanvasTraversal.cs │ │ │ │ ├── NodeCanvasTraversal.cs.meta │ │ │ │ ├── NodeEditorState.cs │ │ │ │ ├── NodeEditorState.cs.meta │ │ │ │ ├── NodeGroup.cs │ │ │ │ ├── NodeGroup.cs.meta │ │ │ │ ├── ValueConnectionKnob.cs │ │ │ │ └── ValueConnectionKnob.cs.meta │ │ │ ├── CoreExtensions.meta │ │ │ ├── CoreExtensions │ │ │ │ ├── ConnectionPortStyles.cs │ │ │ │ ├── ConnectionPortStyles.cs.meta │ │ │ │ ├── NodeCanvasTypes.cs │ │ │ │ ├── NodeCanvasTypes.cs.meta │ │ │ │ ├── NodeTypes.cs │ │ │ │ └── NodeTypes.cs.meta │ │ │ ├── Interface.meta │ │ │ ├── Interface │ │ │ │ ├── NodeEditorCallbackReceiver.cs │ │ │ │ ├── NodeEditorCallbackReceiver.cs.meta │ │ │ │ ├── NodeEditorGUI.cs │ │ │ │ ├── NodeEditorGUI.cs.meta │ │ │ │ ├── NodeEditorInputControls.cs │ │ │ │ ├── NodeEditorInputControls.cs.meta │ │ │ │ ├── NodeEditorInputSystem.cs │ │ │ │ ├── NodeEditorInputSystem.cs.meta │ │ │ │ ├── NodeEditorInterface.cs │ │ │ │ └── NodeEditorInterface.cs.meta │ │ │ ├── NodeEditor.cs │ │ │ ├── NodeEditor.cs.meta │ │ │ ├── SaveSystem.meta │ │ │ └── SaveSystem │ │ │ │ ├── ImportExportFormat.cs │ │ │ │ ├── ImportExportFormat.cs.meta │ │ │ │ ├── ImportExportManager.cs │ │ │ │ ├── ImportExportManager.cs.meta │ │ │ │ ├── ImportExportStructure.cs │ │ │ │ ├── ImportExportStructure.cs.meta │ │ │ │ ├── NodeCanvasSceneSave.cs │ │ │ │ ├── NodeCanvasSceneSave.cs.meta │ │ │ │ ├── NodeEditorSaveManager.cs │ │ │ │ ├── NodeEditorSaveManager.cs.meta │ │ │ │ ├── NodeEditorUserCache.cs │ │ │ │ └── NodeEditorUserCache.cs.meta │ │ ├── Nodes.meta │ │ ├── Nodes │ │ │ ├── Example.meta │ │ │ ├── Example │ │ │ │ ├── AllAroundNode.cs │ │ │ │ ├── AllAroundNode.cs.meta │ │ │ │ ├── ExampleNode.cs │ │ │ │ ├── ExampleNode.cs.meta │ │ │ │ ├── FlowNode.cs │ │ │ │ ├── FlowNode.cs.meta │ │ │ │ ├── ResizingNode.cs │ │ │ │ ├── ResizingNode.cs.meta │ │ │ │ ├── RootGraphNode.cs │ │ │ │ └── RootGraphNode.cs.meta │ │ │ ├── FloatCalc.meta │ │ │ └── FloatCalc │ │ │ │ ├── CalcNode.cs │ │ │ │ ├── CalcNode.cs.meta │ │ │ │ ├── DisplayNode.cs │ │ │ │ ├── DisplayNode.cs.meta │ │ │ │ ├── InputNode.cs │ │ │ │ └── InputNode.cs.meta │ │ ├── Resources.meta │ │ ├── Resources │ │ │ ├── Saves.meta │ │ │ ├── Saves │ │ │ │ ├── Calculation Canvas.asset │ │ │ │ ├── Calculation Canvas.asset.meta │ │ │ │ ├── Graph Canvas.asset │ │ │ │ └── Graph Canvas.asset.meta │ │ │ ├── Shader.meta │ │ │ ├── Shader │ │ │ │ ├── LineShader.shader │ │ │ │ └── LineShader.shader.meta │ │ │ ├── Textures.meta │ │ │ └── Textures │ │ │ │ ├── AALine.png │ │ │ │ ├── AALine.png.meta │ │ │ │ ├── Icon_Dark.png │ │ │ │ ├── Icon_Dark.png.meta │ │ │ │ ├── Icon_Light.png │ │ │ │ ├── Icon_Light.png.meta │ │ │ │ ├── In_Knob.png │ │ │ │ ├── In_Knob.png.meta │ │ │ │ ├── In_Knob_02.png │ │ │ │ ├── In_Knob_02.png.meta │ │ │ │ ├── Knobs.xcf │ │ │ │ ├── Knobs.xcf.meta │ │ │ │ ├── NE_Box.png │ │ │ │ ├── NE_Box.png.meta │ │ │ │ ├── NE_Button.png │ │ │ │ ├── NE_Button.png.meta │ │ │ │ ├── NE_GUI.xcf │ │ │ │ ├── NE_GUI.xcf.meta │ │ │ │ ├── NE_Toolbar.png │ │ │ │ ├── NE_Toolbar.png.meta │ │ │ │ ├── NE_ToolbarButton.png │ │ │ │ ├── NE_ToolbarButton.png.meta │ │ │ │ ├── Out_Knob.png │ │ │ │ ├── Out_Knob.png.meta │ │ │ │ ├── Out_Knob_02.png │ │ │ │ ├── Out_Knob_02.png.meta │ │ │ │ ├── background.png │ │ │ │ ├── background.png.meta │ │ │ │ ├── expandRight.png │ │ │ │ └── expandRight.png.meta │ │ ├── Utilities.meta │ │ └── Utilities │ │ │ ├── EditorLoadingControl.cs │ │ │ ├── EditorLoadingControl.cs.meta │ │ │ ├── GUI.meta │ │ │ ├── GUI │ │ │ ├── GUIScaleUtility.cs │ │ │ ├── GUIScaleUtility.cs.meta │ │ │ ├── OverlayGUI.cs │ │ │ ├── OverlayGUI.cs.meta │ │ │ ├── RTEditorGUI.cs │ │ │ └── RTEditorGUI.cs.meta │ │ │ ├── ReflectionUtility.cs │ │ │ ├── ReflectionUtility.cs.meta │ │ │ ├── ResourceManager.cs │ │ │ ├── ResourceManager.cs.meta │ │ │ ├── link.xml │ │ │ └── link.xml.meta │ ├── StateMachine.meta │ └── StateMachine │ │ ├── Core.meta │ │ ├── Core │ │ ├── Canvas.meta │ │ ├── Canvas │ │ │ ├── StateMachineCanvas.cs │ │ │ └── StateMachineCanvas.cs.meta │ │ ├── HMathf.cs │ │ ├── HMathf.cs.meta │ │ ├── Nodes.meta │ │ └── Nodes │ │ │ ├── BaseStateNode.cs │ │ │ ├── BaseStateNode.cs.meta │ │ │ ├── ConditionNode.cs │ │ │ ├── ConditionNode.cs.meta │ │ │ ├── StateInfoNode.cs │ │ │ ├── StateInfoNode.cs.meta │ │ │ ├── StateNode.cs │ │ │ └── StateNode.cs.meta │ │ ├── Resources.meta │ │ ├── Source.meta │ │ └── Source │ │ ├── BaseCondition.cs │ │ ├── BaseCondition.cs.meta │ │ ├── BaseState.cs │ │ ├── BaseState.cs.meta │ │ ├── BaseStateInfo.cs │ │ ├── BaseStateInfo.cs.meta │ │ ├── ConditionMapping.cs │ │ ├── ConditionMapping.cs.meta │ │ ├── SerializableDelegate.cs │ │ ├── SerializableDelegate.cs.meta │ │ ├── StateMachine.cs │ │ ├── StateMachine.cs.meta │ │ ├── StateMachineRunner.cs │ │ ├── StateMachineRunner.cs.meta │ │ ├── StateMapping.cs │ │ └── StateMapping.cs.meta ├── Scenes.meta ├── Scenes │ ├── SampleScene.unity │ └── SampleScene.unity.meta ├── Test.meta └── Test │ ├── NPC_001.prefab │ ├── NPC_001.prefab.meta │ ├── SMI_NPC_001.cs │ ├── SMI_NPC_001.cs.meta │ ├── SMS_NPC_001.cs │ ├── SMS_NPC_001.cs.meta │ ├── SM_NPC_001.asset │ └── SM_NPC_001.asset.meta ├── LICENSE ├── Packages └── manifest.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset └── UnityConnectSettings.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | /[Bb]uilds/ 6 | /Assets/AssetStoreTools* 7 | 8 | # Visual Studio 2015 cache directory 9 | /.vs/ 10 | 11 | # Autogenerated VS/MD/Consulo solution and project files 12 | ExportedObj/ 13 | .consulo/ 14 | *.csproj 15 | *.unityproj 16 | *.sln 17 | *.suo 18 | *.tmp 19 | *.user 20 | *.userprefs 21 | *.pidb 22 | *.booproj 23 | *.svd 24 | *.pdb 25 | 26 | # Unity3D generated meta files 27 | *.pidb.meta 28 | 29 | # Unity3D Generated File On Crash Reports 30 | sysinfo.txt 31 | 32 | # Builds 33 | *.apk 34 | *.unitypackage 35 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": 3 | { 4 | "**/.DS_Store":true, 5 | "**/.git":true, 6 | "**/.gitignore":true, 7 | "**/.gitmodules":true, 8 | "**/*.booproj":true, 9 | "**/*.pidb":true, 10 | "**/*.suo":true, 11 | "**/*.user":true, 12 | "**/*.userprefs":true, 13 | "**/*.unityproj":true, 14 | "**/*.dll":true, 15 | "**/*.exe":true, 16 | "**/*.pdf":true, 17 | "**/*.mid":true, 18 | "**/*.midi":true, 19 | "**/*.wav":true, 20 | "**/*.gif":true, 21 | "**/*.ico":true, 22 | "**/*.jpg":true, 23 | "**/*.jpeg":true, 24 | "**/*.png":true, 25 | "**/*.psd":true, 26 | "**/*.tga":true, 27 | "**/*.tif":true, 28 | "**/*.tiff":true, 29 | "**/*.3ds":true, 30 | "**/*.3DS":true, 31 | "**/*.fbx":true, 32 | "**/*.FBX":true, 33 | "**/*.lxo":true, 34 | "**/*.LXO":true, 35 | "**/*.ma":true, 36 | "**/*.MA":true, 37 | "**/*.obj":true, 38 | "**/*.OBJ":true, 39 | "**/*.asset":true, 40 | "**/*.cubemap":true, 41 | "**/*.flare":true, 42 | "**/*.mat":true, 43 | "**/*.meta":true, 44 | "**/*.prefab":true, 45 | "**/*.unity":true, 46 | "build/":true, 47 | "Build/":true, 48 | "Library/":true, 49 | "library/":true, 50 | "obj/":true, 51 | "Obj/":true, 52 | "ProjectSettings/":true, 53 | "temp/":true, 54 | "Temp/":true 55 | } 56 | } -------------------------------------------------------------------------------- /Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f709322e38ddd694d9446b1723d64d66 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 47fc8b473e7de484d940c2e33790ba3b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 643d1b93313e42d428d722fdf6740d0d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Calculation Base.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c7e08e7b960f2245ac429199d2e0764 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Calculation Base/CalculationCanvasType.cs: -------------------------------------------------------------------------------- 1 | namespace NodeEditorFramework.Standard 2 | { 3 | [NodeCanvasType("Calculation")] 4 | public class CalculationCanvasType : NodeCanvas 5 | { 6 | public override string canvasName { get { return "Calculation Canvas"; } } 7 | 8 | protected override void OnCreate () 9 | { 10 | Traversal = new CanvasCalculator (this); 11 | } 12 | 13 | public void OnEnable () 14 | { 15 | // Register to other callbacks, f.E.: 16 | //NodeEditorCallbacks.OnDeleteNode += OnDeleteNode; 17 | } 18 | 19 | protected override void ValidateSelf () 20 | { 21 | if (Traversal == null) 22 | Traversal = new CanvasCalculator (this); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Calculation Base/CalculationCanvasType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26a89c36c30b2e940804d7efcccaf0bd 3 | timeCreated: 1481402892 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Calculation Base/CanvasCalculator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | 4 | namespace NodeEditorFramework.Standard 5 | { 6 | public class CanvasCalculator : NodeCanvasTraversal 7 | { 8 | // A list of Nodes from which calculation originates -> Call StartCalculation 9 | public List workList; 10 | 11 | public CanvasCalculator (NodeCanvas canvas) : base(canvas) {} 12 | 13 | /// 14 | /// Recalculate from every node regarded as an input node 15 | /// 16 | public override void TraverseAll () 17 | { 18 | workList = new List (); 19 | for (int i = 0; i < nodeCanvas.nodes.Count; i++) 20 | { 21 | Node node = nodeCanvas.nodes[i]; 22 | if (node.isInput ()) 23 | { // Add all Inputs 24 | node.ClearCalculation (); 25 | workList.Add (node); 26 | } 27 | } 28 | StartCalculation (); 29 | } 30 | 31 | /// 32 | /// Recalculate from the specified node 33 | /// 34 | public override void OnChange (Node node) 35 | { 36 | node.ClearCalculation (); 37 | workList = new List { node }; 38 | StartCalculation (); 39 | } 40 | 41 | /// 42 | /// Iteratively calculates all nodes from the worklist, including child nodes, until no further calculation is possible 43 | /// 44 | private void StartCalculation () 45 | { 46 | if (workList == null || workList.Count == 0) 47 | return; 48 | 49 | bool limitReached = false; 50 | while (!limitReached) 51 | { // Runs until the whole workList is calculated thoroughly or no further calculation is possible 52 | limitReached = true; 53 | for (int workCnt = 0; workCnt < workList.Count; workCnt++) 54 | { // Iteratively check workList 55 | if (ContinueCalculation (workList[workCnt])) 56 | limitReached = false; 57 | } 58 | } 59 | if (workList.Count > 0) 60 | { 61 | Debug.LogError("Did not complete calculation! " + workList.Count + " nodes block calculation from advancing!"); 62 | foreach (Node node in workList) 63 | Debug.LogError("" + node.name + " blocks calculation!"); 64 | } 65 | } 66 | 67 | /// 68 | /// Recursively calculates this node and it's children 69 | /// All nodes that could not be calculated in the current state are added to the workList for later calculation 70 | /// Returns whether calculation could advance at all 71 | /// 72 | private bool ContinueCalculation (Node node) 73 | { 74 | if (node.calculated && !node.AllowRecursion) 75 | { // Already calulated 76 | workList.Remove (node); 77 | return true; 78 | } 79 | if (node.descendantsCalculated () && node.Calculate ()) 80 | { // Calculation was successful 81 | node.calculated = true; 82 | workList.Remove (node); 83 | if (node.ContinueCalculation) 84 | { // Continue with children 85 | for (int i = 0; i < node.outputPorts.Count; i++) 86 | { 87 | ConnectionPort outPort = node.outputPorts[i]; 88 | for (int t = 0; t < outPort.connections.Count; t++) 89 | ContinueCalculation(outPort.connections[t].body); 90 | } 91 | } 92 | return true; 93 | } 94 | else if (!workList.Contains (node)) 95 | { // Calculation failed, record to calculate later on 96 | workList.Add (node); 97 | } 98 | return false; 99 | } 100 | } 101 | } 102 | 103 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Calculation Base/CanvasCalculator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82570dd096e3133488c3ad08f4bd59e9 3 | timeCreated: 1481043527 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Calculation Base/FloatCalculation.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | 4 | namespace NodeEditorFramework.Standard 5 | { 6 | public class FloatConnectionType : ValueConnectionType 7 | { 8 | public override string Identifier { get { return "Float"; } } 9 | public override Color Color { get { return Color.cyan; } } 10 | public override Type Type { get { return typeof(float); } } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Calculation Base/FloatCalculation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6d37d55559ce304fb864e95081c872e 3 | timeCreated: 1484482479 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Graph Example.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39ab6154dcc485b4ba4a9095b290e30e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Graph Example/GraphCanvasType.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace NodeEditorFramework.Standard 4 | { 5 | [NodeCanvasType("Graph Canvas")] 6 | public class GraphCanvasType : NodeCanvas 7 | { 8 | public override string canvasName { get { return "Graph"; } } 9 | 10 | private string rootNodeID { get { return "rootGraphNode"; } } 11 | public RootGraphNode rootNode; 12 | 13 | protected override void OnCreate () 14 | { 15 | Traversal = new GraphTraversal (this); 16 | rootNode = Node.Create (rootNodeID, Vector2.zero) as RootGraphNode; 17 | } 18 | 19 | private void OnEnable () 20 | { 21 | if (Traversal == null) 22 | Traversal = new GraphTraversal (this); 23 | // Register to other callbacks 24 | //NodeEditorCallbacks.OnDeleteNode += CheckDeleteNode; 25 | } 26 | 27 | protected override void ValidateSelf () 28 | { 29 | if (Traversal == null) 30 | Traversal = new GraphTraversal (this); 31 | if (rootNode == null && (rootNode = nodes.Find ((Node n) => n.GetID == rootNodeID) as RootGraphNode) == null) 32 | rootNode = Node.Create (rootNodeID, Vector2.zero) as RootGraphNode; 33 | } 34 | 35 | public override bool CanAddNode (string nodeID) 36 | { 37 | //Debug.Log ("Check can add node " + nodeID); 38 | if (nodeID == rootNodeID) 39 | return !nodes.Exists ((Node n) => n.GetID == rootNodeID); 40 | return true; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Graph Example/GraphCanvasType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a9396c92b94b064883de5903a0ec1b2 3 | timeCreated: 1481376409 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Graph Example/GraphTraversal.cs: -------------------------------------------------------------------------------- 1 | namespace NodeEditorFramework.Standard 2 | { 3 | public class GraphTraversal : NodeCanvasTraversal 4 | { 5 | GraphCanvasType Canvas; 6 | 7 | public GraphTraversal (GraphCanvasType canvas) : base(canvas) 8 | { 9 | Canvas = canvas; 10 | } 11 | 12 | /// 13 | /// Traverse the canvas and evaluate it 14 | /// 15 | public override void TraverseAll () 16 | { 17 | RootGraphNode rootNode = Canvas.rootNode; 18 | rootNode.Calculate (); 19 | //Debug.Log ("RootNode is " + rootNode); 20 | } 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Graph Example/GraphTraversal.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0213ae6a74c95e441b1e35934fcdd810 3 | timeCreated: 1481402048 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/IO Formats.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25ba1affc07642d4a8f3e3194d1dec62 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/IO Formats/XMLImportExport.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b4fed10ebd11f149aca4caaba5a4c9b 3 | timeCreated: 1497983217 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Runtime Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5874816982823840845789671653609 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Runtime Examples/RTCanvasCalculator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace NodeEditorFramework.Standard 6 | { 7 | /// 8 | /// Example of accessing and using the canvas at runtime 9 | /// 10 | public class RTCanvasCalculator : MonoBehaviour 11 | { 12 | public NodeCanvas canvas; 13 | 14 | /// 15 | /// Assures the canvas is loaded 16 | /// 17 | public void AssureCanvas () 18 | { 19 | if (canvas == null) 20 | throw new UnityException ("No canvas specified to calculate on " + name + "!"); 21 | } 22 | 23 | /// 24 | /// Calculates the currently loaded canvas and debugs the various outputs 25 | /// 26 | public void CalculateCanvas () 27 | { 28 | AssureCanvas (); 29 | NodeEditor.checkInit (false); 30 | canvas.Validate (); 31 | canvas.TraverseAll (); 32 | DebugOutputResults (); 33 | } 34 | 35 | /// 36 | /// Debugs the values of all possible output nodes 37 | /// Could be done more precisely but it atleast shows how to get them 38 | /// 39 | private void DebugOutputResults () 40 | { 41 | AssureCanvas (); 42 | Debug.Log ("Calculating '" + canvas.saveName + "':"); 43 | List outputNodes = getOutputNodes (); 44 | foreach (Node outputNode in outputNodes) 45 | { // Display value of all output nodes 46 | string outValueLog = "(OUT) " + outputNode.name + ": "; 47 | // Use knob values - either output knobs, or input knobs if there are now output knobs 48 | List sourceValueKnobs = outputNode.outputKnobs.Count == 0? outputNode.inputKnobs : outputNode.outputKnobs; 49 | foreach (ValueConnectionKnob knob in sourceValueKnobs.OfType ()) 50 | outValueLog += knob.styleID + " " + knob.name + " = " + (knob.IsValueNull? "NULL" : knob.GetValue ().ToString ()) + "; "; 51 | Debug.Log (outValueLog); 52 | } 53 | } 54 | 55 | /// 56 | /// Gets all nodes that either have no inputs or no input connections assigned 57 | /// 58 | public List getInputNodes () 59 | { 60 | AssureCanvas (); 61 | return canvas.nodes.Where ((Node node) => node.isInput ()).ToList (); 62 | } 63 | 64 | /// 65 | /// Gets all nodes that either have no output or no output connections leading to a followup node 66 | /// 67 | public List getOutputNodes () 68 | { 69 | AssureCanvas (); 70 | return canvas.nodes.Where ((Node node) => node.isOutput ()).ToList (); 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Runtime Examples/RTCanvasCalculator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11b12ccbf5533274f9abf5008f057a67 3 | timeCreated: 1472742778 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Runtime Examples/RTNodeEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using NodeEditorFramework.Utilities; 3 | 4 | namespace NodeEditorFramework.Standard 5 | { 6 | /// 7 | /// Example of displaying the Node Editor at runtime including GUI 8 | /// 9 | public class RTNodeEditor : MonoBehaviour 10 | { 11 | // Startup-canvas, cache and interface 12 | public NodeCanvas canvas; 13 | public string loadSceneName; 14 | private NodeEditorUserCache canvasCache; 15 | private NodeEditorInterface editorInterface; 16 | 17 | // GUI rects 18 | public bool screenSize = false; 19 | public Rect specifiedRootRect = new Rect(0, 0, 1000, 500); 20 | public Rect specifiedCanvasRect = new Rect(50, 50, 900, 400); 21 | public Rect rootRect { get { return new Rect(screenSize ? screenRect : specifiedRootRect); } } 22 | public Rect canvasRect { get { return screenSize ? screenRect : specifiedCanvasRect; } } 23 | private Rect screenRect { get { return new Rect(0, 0, Screen.width, Screen.height); } } 24 | 25 | 26 | private void Start () 27 | { 28 | NormalReInit(); 29 | } 30 | 31 | private void Update () 32 | { 33 | NodeEditor.Update (); 34 | } 35 | 36 | private void NormalReInit() 37 | { 38 | NodeEditor.ReInit(false); 39 | AssureSetup(); 40 | if (canvasCache.nodeCanvas) 41 | canvasCache.nodeCanvas.Validate(); 42 | } 43 | 44 | private void AssureSetup() 45 | { 46 | if (canvasCache == null) 47 | { // Create cache and load startup-canvas 48 | canvasCache = new NodeEditorUserCache(); 49 | if (canvas != null) 50 | canvasCache.SetCanvas(NodeEditorSaveManager.CreateWorkingCopy(canvas)); 51 | else if (!string.IsNullOrEmpty (loadSceneName)) 52 | canvasCache.LoadSceneNodeCanvas(loadSceneName); 53 | } 54 | canvasCache.AssureCanvas(); 55 | if (editorInterface == null) 56 | { // Setup editor interface 57 | editorInterface = new NodeEditorInterface(); 58 | editorInterface.canvasCache = canvasCache; 59 | } 60 | } 61 | 62 | private void OnGUI () 63 | { 64 | // Initiation 65 | NodeEditor.checkInit(true); 66 | if (NodeEditor.InitiationError) 67 | { 68 | GUILayout.Label("Node Editor Initiation failed! Check console for more information!"); 69 | return; 70 | } 71 | AssureSetup(); 72 | 73 | // ROOT: Start Overlay GUI for popups 74 | OverlayGUI.StartOverlayGUI("RTNodeEditor"); 75 | 76 | // Set various nested groups 77 | GUI.BeginGroup(rootRect, GUI.skin.box); 78 | 79 | // Begin Node Editor GUI and set canvas rect 80 | NodeEditorGUI.StartNodeGUI(false); 81 | canvasCache.editorState.canvasRect = new Rect (canvasRect.x, canvasRect.y + editorInterface.toolbarHeight, canvasRect.width, canvasRect.height - editorInterface.toolbarHeight); 82 | 83 | try 84 | { // Perform drawing with error-handling 85 | NodeEditor.DrawCanvas (canvasCache.nodeCanvas, canvasCache.editorState); 86 | } 87 | catch (UnityException e) 88 | { // On exceptions in drawing flush the canvas to avoid locking the UI 89 | canvasCache.NewNodeCanvas (); 90 | NodeEditor.ReInit (true); 91 | Debug.LogError ("Unloaded Canvas due to exception in Draw!"); 92 | Debug.LogException (e); 93 | } 94 | 95 | // Draw Interface 96 | editorInterface.DrawToolbarGUI(canvasRect); 97 | editorInterface.DrawModalPanel(); 98 | 99 | // End Node Editor GUI 100 | NodeEditorGUI.EndNodeGUI(); 101 | 102 | // End various nested groups 103 | GUI.EndGroup(); 104 | 105 | // END ROOT: End Overlay GUI and draw popups 106 | OverlayGUI.EndOverlayGUI(); 107 | } 108 | } 109 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Default/Runtime Examples/RTNodeEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 058701fb26fe9874f8dffda7e66a0fe9 3 | timeCreated: 1450128681 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b9c0b75febd8114b87c64386c8b5b43 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Editor/Node_Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2159bf09a35059439011655521166fe 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Editor/Node_Editor/CanvasInspector.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | namespace NodeEditorFramework.Standard 5 | { 6 | [CustomEditor(typeof(NodeCanvas), true)] 7 | public class CanvasInspector : Editor 8 | { 9 | public static GUIStyle titleStyle; 10 | public static GUIStyle subTitleStyle; 11 | public static GUIStyle boldLabelStyle; 12 | 13 | public NodeCanvas canvas; 14 | 15 | public void OnEnable() 16 | { 17 | canvas = (NodeCanvas)target; 18 | canvas.Validate(); 19 | } 20 | 21 | public override void OnInspectorGUI() 22 | { 23 | if (canvas == null) 24 | canvas = (NodeCanvas)target; 25 | if (canvas == null) 26 | return; 27 | if (titleStyle == null) 28 | { 29 | titleStyle = new GUIStyle(GUI.skin.label); 30 | titleStyle.fontStyle = FontStyle.Bold; 31 | titleStyle.alignment = TextAnchor.MiddleCenter; 32 | titleStyle.fontSize = 16; 33 | } 34 | if (subTitleStyle == null) 35 | { 36 | subTitleStyle = new GUIStyle(GUI.skin.label); 37 | subTitleStyle.fontStyle = FontStyle.Bold; 38 | subTitleStyle.alignment = TextAnchor.MiddleCenter; 39 | subTitleStyle.fontSize = 12; 40 | } 41 | if (boldLabelStyle == null) 42 | { 43 | boldLabelStyle = new GUIStyle(GUI.skin.label); 44 | boldLabelStyle.fontStyle = FontStyle.Bold; 45 | } 46 | 47 | EditorGUI.BeginChangeCheck(); 48 | 49 | GUILayout.Space(10); 50 | 51 | GUILayout.Label(new GUIContent(canvas.saveName, canvas.savePath), titleStyle); 52 | GUILayout.Label(canvas.livesInScene? "Scene Save" : "Asset Save", subTitleStyle); 53 | GUILayout.Label("Type: " + canvas.canvasName, subTitleStyle); 54 | 55 | GUILayout.Space(10); 56 | 57 | EditorGUI.BeginDisabledGroup(NodeEditor.curNodeCanvas != null && NodeEditor.curNodeCanvas.savePath == canvas.savePath); 58 | if (GUILayout.Button("Open")) 59 | { 60 | string NodeCanvasPath = AssetDatabase.GetAssetPath(canvas); 61 | NodeEditorWindow.OpenNodeEditor().canvasCache.LoadNodeCanvas(NodeCanvasPath); 62 | } 63 | EditorGUI.EndDisabledGroup(); 64 | 65 | GUILayout.Space(10); 66 | 67 | GUILayout.Label("Nodes", boldLabelStyle); 68 | foreach (Node node in canvas.nodes) 69 | { 70 | string label = node.Title; 71 | EditorGUILayout.ObjectField(label, node, node.GetType(), true); 72 | } 73 | 74 | GUILayout.Space(10); 75 | 76 | canvas.DrawCanvasPropertyEditor(); 77 | 78 | if (EditorGUI.EndChangeCheck()) 79 | NodeEditor.RepaintClients(); 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Editor/Node_Editor/CanvasInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec97af71a9e87434d8c9b0011d371c42 3 | timeCreated: 1482685504 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Editor/Node_Editor/LastSession.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14d6bb0739122df41852d41304582f97 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Editor/Node_Editor/NodeEditorWindow.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.IO; 4 | 5 | using NodeEditorFramework.Utilities; 6 | 7 | namespace NodeEditorFramework.Standard 8 | { 9 | public class NodeEditorWindow : EditorWindow 10 | { 11 | // Information about current instance 12 | private static NodeEditorWindow _editor; 13 | public static NodeEditorWindow editor { get { AssureEditor(); return _editor; } } 14 | public static void AssureEditor() { if (_editor == null) OpenNodeEditor(); } 15 | 16 | // Canvas cache 17 | public NodeEditorUserCache canvasCache; 18 | public NodeEditorInterface editorInterface; 19 | 20 | // GUI 21 | private Rect canvasWindowRect { get { return new Rect(0, editorInterface.toolbarHeight, position.width, position.height - editorInterface.toolbarHeight); } } 22 | 23 | 24 | #region General 25 | 26 | /// 27 | /// Opens the Node Editor window and loads the last session 28 | /// 29 | [MenuItem("Window/Node Editor")] 30 | public static NodeEditorWindow OpenNodeEditor () 31 | { 32 | _editor = GetWindow(); 33 | _editor.minSize = new Vector2(400, 200); 34 | 35 | NodeEditor.ReInit (false); 36 | Texture iconTexture = ResourceManager.LoadTexture (EditorGUIUtility.isProSkin? "Textures/Icon_Dark.png" : "Textures/Icon_Light.png"); 37 | _editor.titleContent = new GUIContent ("Node Editor", iconTexture); 38 | 39 | return _editor; 40 | } 41 | 42 | /* 43 | /// 44 | /// Assures that the canvas is opened when double-clicking a canvas asset 45 | /// 46 | [UnityEditor.Callbacks.OnOpenAsset(1)] 47 | private static bool AutoOpenCanvas(int instanceID, int line) 48 | { 49 | if (Selection.activeObject != null && Selection.activeObject is NodeCanvas) 50 | { 51 | string NodeCanvasPath = AssetDatabase.GetAssetPath(instanceID); 52 | OpenNodeEditor().canvasCache.LoadNodeCanvas(NodeCanvasPath); 53 | return true; 54 | } 55 | return false; 56 | } 57 | */ 58 | 59 | private void OnEnable() 60 | { 61 | _editor = this; 62 | NormalReInit(); 63 | 64 | // Subscribe to events 65 | NodeEditor.ClientRepaints -= Repaint; 66 | NodeEditor.ClientRepaints += Repaint; 67 | EditorLoadingControl.justLeftPlayMode -= NormalReInit; 68 | EditorLoadingControl.justLeftPlayMode += NormalReInit; 69 | EditorLoadingControl.justOpenedNewScene -= NormalReInit; 70 | EditorLoadingControl.justOpenedNewScene += NormalReInit; 71 | SceneView.onSceneGUIDelegate -= OnSceneGUI; 72 | SceneView.onSceneGUIDelegate += OnSceneGUI; 73 | } 74 | 75 | private void OnDestroy() 76 | { 77 | // Unsubscribe from events 78 | NodeEditor.ClientRepaints -= Repaint; 79 | EditorLoadingControl.justLeftPlayMode -= NormalReInit; 80 | EditorLoadingControl.justOpenedNewScene -= NormalReInit; 81 | SceneView.onSceneGUIDelegate -= OnSceneGUI; 82 | 83 | // Clear Cache 84 | canvasCache.ClearCacheEvents(); 85 | } 86 | 87 | private void OnLostFocus () 88 | { // Save any changes made while focussing this window 89 | // Will also save before possible assembly reload, scene switch, etc. because these require focussing of a different window 90 | canvasCache.SaveCache(); 91 | } 92 | 93 | private void OnFocus () 94 | { // Make sure the canvas hasn't been corrupted externally 95 | NormalReInit(); 96 | } 97 | 98 | private void NormalReInit() 99 | { 100 | NodeEditor.ReInit(false); 101 | AssureSetup(); 102 | if (canvasCache.nodeCanvas) 103 | canvasCache.nodeCanvas.Validate(); 104 | } 105 | 106 | private void AssureSetup() 107 | { 108 | if (canvasCache == null) 109 | { // Create cache 110 | canvasCache = new NodeEditorUserCache(Path.GetDirectoryName(AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this)))); 111 | } 112 | canvasCache.AssureCanvas(); 113 | if (editorInterface == null) 114 | { // Setup editor interface 115 | editorInterface = new NodeEditorInterface(); 116 | editorInterface.canvasCache = canvasCache; 117 | editorInterface.ShowNotificationAction = ShowNotification; 118 | } 119 | } 120 | 121 | #endregion 122 | 123 | #region GUI 124 | 125 | private void OnGUI() 126 | { 127 | // Initiation 128 | NodeEditor.checkInit(true); 129 | if (NodeEditor.InitiationError) 130 | { 131 | GUILayout.Label("Node Editor Initiation failed! Check console for more information!"); 132 | return; 133 | } 134 | AssureEditor (); 135 | AssureSetup(); 136 | 137 | // ROOT: Start Overlay GUI for popups 138 | OverlayGUI.StartOverlayGUI("NodeEditorWindow"); 139 | 140 | // Begin Node Editor GUI and set canvas rect 141 | NodeEditorGUI.StartNodeGUI(true); 142 | canvasCache.editorState.canvasRect = canvasWindowRect; 143 | 144 | try 145 | { // Perform drawing with error-handling 146 | NodeEditor.DrawCanvas(canvasCache.nodeCanvas, canvasCache.editorState); 147 | } 148 | catch (UnityException e) 149 | { // On exceptions in drawing flush the canvas to avoid locking the UI 150 | canvasCache.NewNodeCanvas(); 151 | NodeEditor.ReInit(true); 152 | Debug.LogError("Unloaded Canvas due to an exception during the drawing phase!"); 153 | Debug.LogException(e); 154 | } 155 | 156 | // Draw Interface 157 | editorInterface.DrawToolbarGUI(new Rect(0, 0, Screen.width, 0)); 158 | editorInterface.DrawModalPanel(); 159 | 160 | // End Node Editor GUI 161 | NodeEditorGUI.EndNodeGUI(); 162 | 163 | // END ROOT: End Overlay GUI and draw popups 164 | OverlayGUI.EndOverlayGUI(); 165 | } 166 | 167 | private void OnSceneGUI(SceneView sceneview) 168 | { 169 | AssureSetup(); 170 | if (canvasCache.editorState != null && canvasCache.editorState.selectedNode != null) 171 | canvasCache.editorState.selectedNode.OnSceneGUI(); 172 | SceneView.lastActiveSceneView.Repaint(); 173 | } 174 | 175 | #endregion 176 | } 177 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Editor/Node_Editor/NodeEditorWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba199a36d34de0b45b5bc689cf5d53c9 3 | timeCreated: 1482685504 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Editor/Node_Editor/NodeInspector.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using NodeEditorFramework.Utilities; 4 | 5 | namespace NodeEditorFramework.Standard 6 | { 7 | [CustomEditor(typeof(Node), true)] 8 | public class NodeInspector : Editor 9 | { 10 | public static GUIStyle titleStyle; 11 | public static GUIStyle boldLabelStyle; 12 | public Node node; 13 | 14 | public void OnEnable() 15 | { 16 | node = (Node)target; 17 | } 18 | 19 | public override void OnInspectorGUI() 20 | { 21 | if (node == null) 22 | node = (Node)target; 23 | if (node == null) 24 | return; 25 | if (titleStyle == null) 26 | { 27 | titleStyle = new GUIStyle(GUI.skin.label); 28 | titleStyle.fontStyle = FontStyle.Bold; 29 | titleStyle.alignment = TextAnchor.MiddleCenter; 30 | titleStyle.fontSize = 16; 31 | } 32 | if (boldLabelStyle == null) 33 | { 34 | boldLabelStyle = new GUIStyle(GUI.skin.label); 35 | boldLabelStyle.fontStyle = FontStyle.Bold; 36 | } 37 | 38 | OverlayGUI.StartOverlayGUI("NodeInspector"); 39 | 40 | EditorGUI.BeginChangeCheck(); 41 | 42 | GUILayout.Space(10); 43 | 44 | GUILayout.Label(node.Title, titleStyle); 45 | 46 | GUILayout.Space(10); 47 | 48 | GUILayout.Label("Rect: " + node.rect.ToString()); 49 | node.backgroundColor = EditorGUILayout.ColorField("Color", node.backgroundColor); 50 | 51 | GUILayout.Space(10); 52 | 53 | GUILayout.Label("Connection Ports", boldLabelStyle); 54 | foreach (ConnectionPort port in node.connectionPorts) 55 | { 56 | string labelPrefix = port.direction == Direction.In ? "Input " : (port.direction == Direction.Out ? "Output " : ""); 57 | string label = labelPrefix + port.styleID + " '" + port.name + "'"; 58 | EditorGUILayout.ObjectField(label, port, port.GetType(), true); 59 | } 60 | 61 | GUILayout.Space(10); 62 | 63 | GUILayout.Label("Property Editor", boldLabelStyle); 64 | node.DrawNodePropertyEditor(); 65 | 66 | if (EditorGUI.EndChangeCheck()) 67 | NodeEditor.RepaintClients(); 68 | 69 | OverlayGUI.EndOverlayGUI(); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Editor/Node_Editor/NodeInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f4b4fa804bb6a641b473d0ca1e833b7 3 | timeCreated: 1482685504 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Editor/Node_Editor/RTCanvasCalculatorEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using NodeEditorFramework; 6 | 7 | namespace NodeEditorFramework.Standard 8 | { 9 | [CustomEditor (typeof(RTCanvasCalculator))] 10 | public class RTCanvasCalculatorEditor : Editor 11 | { 12 | public RTCanvasCalculator RTCalc; 13 | 14 | public List inputNodes; 15 | 16 | public void OnEnable () 17 | { 18 | RTCalc = (RTCanvasCalculator)target; 19 | } 20 | 21 | public override void OnInspectorGUI () 22 | { 23 | RTCalc.canvas = EditorGUILayout.ObjectField ("Canvas", RTCalc.canvas, typeof(NodeCanvas), false) as NodeCanvas; 24 | if (RTCalc.canvas == null) 25 | return; 26 | 27 | if (GUILayout.Button ("Calculate and debug Output")) 28 | RTCalc.CalculateCanvas (); 29 | 30 | DisplayInputValues (); 31 | } 32 | 33 | private void DisplayInputValues () 34 | { 35 | if (inputNodes == null) 36 | inputNodes = RTCalc.getInputNodes (); 37 | foreach (Node inputNode in inputNodes) 38 | { 39 | string outValueLog = "(IN) " + inputNode.name + ": "; 40 | foreach (ValueConnectionKnob knob in inputNode.outputKnobs.OfType ()) 41 | outValueLog += knob.styleID + " " + knob.name + " = " + (knob.IsValueNull? "NULL" : knob.GetValue ().ToString ()) + "; "; 42 | GUILayout.Label (outValueLog); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Editor/Node_Editor/RTCanvasCalculatorEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a27c7af4ec1f131429372fc89cb3cabc 3 | timeCreated: 1482685504 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Editor/Node_Editor/RTNodeEditorInspector.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | namespace NodeEditorFramework.Standard 5 | { 6 | [CustomEditor (typeof(RTNodeEditor))] 7 | public class RTNodeEditorInspector : Editor 8 | { 9 | public RTNodeEditor RTNE; 10 | private string[] sceneCanvasNames; 11 | 12 | public void OnEnable () 13 | { 14 | RTNE = (RTNodeEditor)target; 15 | sceneCanvasNames = NodeEditorSaveManager.GetSceneSaves(); 16 | } 17 | 18 | public override void OnInspectorGUI () 19 | { 20 | GUILayout.BeginHorizontal(); 21 | // Reference canvas 22 | RTNE.canvas = EditorGUILayout.ObjectField ("Canvas", RTNE.canvas, typeof(NodeCanvas), true, 23 | RTNE.canvas == null ? GUILayout.ExpandWidth(false) : GUILayout.ExpandWidth(true)) as NodeCanvas; 24 | if (RTNE.canvas != null) 25 | RTNE.loadSceneName = null; 26 | // Select canvas to load from scene 27 | int prevCanvasIndex = ArrayUtility.IndexOf(sceneCanvasNames, RTNE.loadSceneName); 28 | int newCanvasIndex = EditorGUILayout.Popup(prevCanvasIndex, sceneCanvasNames, 29 | string.IsNullOrEmpty(RTNE.loadSceneName) ? GUILayout.Width(30) : GUILayout.ExpandWidth (true)); 30 | if (prevCanvasIndex != newCanvasIndex && newCanvasIndex >= 0) 31 | { 32 | RTNE.loadSceneName = sceneCanvasNames[newCanvasIndex]; 33 | RTNE.canvas = null; 34 | } 35 | else if (newCanvasIndex < 0) 36 | RTNE.loadSceneName = null; 37 | GUILayout.EndHorizontal(); 38 | 39 | RTNE.screenSize = !EditorGUILayout.BeginToggleGroup (new GUIContent ("Specify Rect", "Specify Rects explicitly instead of adapting to the screen size"), !RTNE.screenSize); 40 | RTNE.specifiedRootRect = EditorGUILayout.RectField (new GUIContent ("Root Rect", "The root/group rect of the actual canvas rect. If left blank it is ignored."), RTNE.specifiedRootRect); 41 | RTNE.specifiedCanvasRect = EditorGUILayout.RectField (new GUIContent ("Canvas Rect", "The rect of the canvas."), RTNE.specifiedCanvasRect); 42 | EditorGUILayout.EndToggleGroup (); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Editor/Node_Editor/RTNodeEditorInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c9cdcf36237a684bad680baa79ede80 3 | timeCreated: 1482685504 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ccae5e6e6eac05f4d86cb82c261f5112 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e01192ab9d8f4c04a8e9d95ef1bc9673 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Core/ConnectionKnob.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3d338988a4691f43b8c0764bd85cf70 3 | timeCreated: 1498150662 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Core/ConnectionPort.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35456fbe6f3a0f3459ecfa7e219c273c 3 | timeCreated: 1498244777 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Core/ConnectionPortManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Collections; 6 | using System.Collections.Generic; 7 | 8 | using NodeEditorFramework.Utilities; 9 | 10 | namespace NodeEditorFramework 11 | { 12 | public static class ConnectionPortManager 13 | { 14 | private static Dictionary nodePortDeclarations; 15 | 16 | /// 17 | /// Fetches every node connection declaration for each node type for later use 18 | /// 19 | public static void FetchNodeConnectionDeclarations() 20 | { 21 | nodePortDeclarations = new Dictionary (); 22 | foreach (NodeTypeData nodeData in NodeTypes.getNodeDefinitions ()) 23 | { 24 | Type nodeType = nodeData.type; 25 | List declarations = new List (); 26 | // Get all declared port fields 27 | FieldInfo[] declaredPorts = ReflectionUtility.getFieldsOfType (nodeType, typeof(ConnectionPort)); 28 | foreach (FieldInfo portField in declaredPorts) 29 | { // Get info about that port declaration using the attribute 30 | object[] declAttrs = portField.GetCustomAttributes (typeof(ConnectionPortAttribute), true); 31 | if (declAttrs.Length < 1) 32 | continue; 33 | ConnectionPortAttribute declarationAttr = (ConnectionPortAttribute)declAttrs[0]; 34 | if (declarationAttr.MatchFieldType (portField.FieldType)) 35 | declarations.Add (new ConnectionPortDeclaration (portField, declarationAttr)); 36 | else 37 | Debug.LogError ("Mismatched " + declarationAttr.GetType ().Name + " for " + portField.FieldType.Name + " '" + declarationAttr.Name + "' on " + nodeData.type.Name + "!"); 38 | } 39 | nodePortDeclarations.Add (nodeData.typeID, declarations.ToArray ()); 40 | } 41 | } 42 | 43 | /// 44 | /// Updates all node connection ports in the given node and creates or adjusts them according to the declaration 45 | /// 46 | public static void UpdateConnectionPorts (Node node) 47 | { 48 | foreach (ConnectionPortDeclaration portDecl in GetPortDeclarationEnumerator (node, true)) 49 | { 50 | ConnectionPort port = (ConnectionPort)portDecl.portField.GetValue (node); 51 | if (port == null) 52 | { // Create new port from declaration 53 | port = portDecl.portInfo.CreateNew (node); 54 | portDecl.portField.SetValue (node, port); 55 | } 56 | else 57 | { // Check port values against port declaration 58 | portDecl.portInfo.UpdateProperties (port); 59 | } 60 | } 61 | } 62 | 63 | /// 64 | /// Updates the connectionPorts and connectionKnobs lists of the given node with all declared nodes 65 | /// 66 | public static void UpdatePortLists (Node node) 67 | { 68 | // Triggering is enough to update the list 69 | IEnumerator enumerator = GetPortDeclarationEnumerator(node, true).GetEnumerator(); 70 | while (enumerator.MoveNext()) { } 71 | } 72 | 73 | /// 74 | /// Returns the ConnectionPortDeclarations for the given node type 75 | /// 76 | public static ConnectionPortDeclaration[] GetPortDeclarations (string nodeTypeID) 77 | { 78 | ConnectionPortDeclaration[] portDecls; 79 | if (nodePortDeclarations.TryGetValue (nodeTypeID, out portDecls)) 80 | return portDecls; 81 | else 82 | throw new ArgumentException ("Could not find node port declarations for node type '" + nodeTypeID + "'!"); 83 | } 84 | 85 | /// 86 | /// Returns an enumerator of type ConnectionPortDeclaration over all port declarations of the given node 87 | /// 88 | public static IEnumerable GetPortDeclarationEnumerator (Node node, bool triggerUpdate = false) 89 | { 90 | List declaredConnectionPorts = new List (); 91 | ConnectionPortDeclaration[] portDecls; 92 | if (nodePortDeclarations.TryGetValue (node.GetID, out portDecls)) 93 | { 94 | for (int i = 0; i < portDecls.Length; i++) 95 | { // Iterate over each connection port and yield it's declaration 96 | ConnectionPortDeclaration portDecl = portDecls[i]; 97 | yield return portDecl; 98 | ConnectionPort port = (ConnectionPort)portDecl.portField.GetValue (node); 99 | if (port != null) 100 | declaredConnectionPorts.Add(port); 101 | } 102 | } 103 | if (triggerUpdate) 104 | { // Update lists as values might have changes when calling this function 105 | node.staticConnectionPorts = declaredConnectionPorts; 106 | UpdateRepresentativePortLists(node); 107 | } 108 | } 109 | 110 | /// 111 | /// Update the differenciated representative port lists in the given node to accommodate to all static and dynamic connection ports 112 | /// 113 | public static void UpdateRepresentativePortLists(Node node) 114 | { 115 | // Clean source static and dynamic port lists 116 | node.dynamicConnectionPorts = node.dynamicConnectionPorts.Where(o => o != null).ToList(); 117 | node.staticConnectionPorts = node.staticConnectionPorts.Where(o => o != null).ToList(); 118 | // Combine static and dynamic ports into one list 119 | node.connectionPorts = new List(); 120 | node.connectionPorts.AddRange(node.staticConnectionPorts); 121 | node.connectionPorts.AddRange(node.dynamicConnectionPorts); 122 | // Differenciate ports into types and direction 123 | node.inputPorts = node.connectionPorts.Where((ConnectionPort port) => port.direction == Direction.In).ToList(); 124 | node.outputPorts = node.connectionPorts.Where((ConnectionPort port) => port.direction == Direction.Out).ToList(); 125 | node.connectionKnobs = node.connectionPorts.OfType().ToList(); 126 | node.inputKnobs = node.connectionKnobs.Where((ConnectionKnob knob) => knob.direction == Direction.In).ToList(); 127 | node.outputKnobs = node.connectionKnobs.Where((ConnectionKnob knob) => knob.direction == Direction.Out).ToList(); 128 | } 129 | } 130 | 131 | public class ConnectionPortDeclaration 132 | { 133 | public FieldInfo portField; 134 | public ConnectionPortAttribute portInfo; 135 | 136 | public ConnectionPortDeclaration (FieldInfo field, ConnectionPortAttribute attr) 137 | { 138 | portField = field; 139 | portInfo = attr; 140 | } 141 | } 142 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Core/ConnectionPortManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c2b66f60866020c4ba95f07b98106379 3 | timeCreated: 1498244971 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Core/Node.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6b5fe394e83d344c990206132b84a28 3 | timeCreated: 1449162341 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Core/NodeCanvas.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | namespace NodeEditorFramework 7 | { 8 | /// 9 | /// Base class for all canvas types 10 | /// 11 | public abstract class NodeCanvas : ScriptableObject 12 | { 13 | public virtual string canvasName { get { return "DEFAULT"; } } 14 | 15 | public virtual bool allowSceneSaveOnly { get { return false; } } 16 | 17 | public NodeCanvasTraversal Traversal; 18 | 19 | public NodeEditorState[] editorStates = new NodeEditorState[0]; 20 | 21 | public string saveName; 22 | public string savePath; 23 | 24 | public bool livesInScene = false; 25 | 26 | public List nodes = new List (); 27 | public List groups = new List (); 28 | 29 | #region Constructors 30 | 31 | /// 32 | /// Creates a canvas of the specified generic type 33 | /// 34 | public static T CreateCanvas () where T : NodeCanvas 35 | { 36 | if (typeof(T) == typeof(NodeCanvas)) 37 | throw new Exception ("Cannot create canvas of type 'NodeCanvas' as that is only the base class. Please specify a valid subclass!"); 38 | T canvas = ScriptableObject.CreateInstance(); 39 | canvas.name = canvas.saveName = "New " + canvas.canvasName; 40 | 41 | NodeEditor.BeginEditingCanvas (canvas); 42 | canvas.OnCreate (); 43 | NodeEditor.EndEditingCanvas (); 44 | return canvas; 45 | } 46 | 47 | /// 48 | /// Creates a canvas of the specified canvasType as long as it is a subclass of NodeCanvas 49 | /// 50 | public static NodeCanvas CreateCanvas (Type canvasType) 51 | { 52 | NodeCanvas canvas; 53 | if (canvasType != null && canvasType.IsSubclassOf (typeof(NodeCanvas))) 54 | canvas = ScriptableObject.CreateInstance (canvasType) as NodeCanvas; 55 | else 56 | canvas = ScriptableObject.CreateInstance(); 57 | canvas.name = canvas.saveName = "New " + canvas.canvasName; 58 | 59 | NodeEditor.BeginEditingCanvas (canvas); 60 | canvas.OnCreate (); 61 | NodeEditor.EndEditingCanvas (); 62 | return canvas; 63 | } 64 | 65 | #endregion 66 | 67 | #region Extension Methods 68 | 69 | // GENERAL 70 | 71 | protected virtual void OnCreate () {} 72 | 73 | protected virtual void ValidateSelf () { } 74 | 75 | public virtual void OnBeforeSavingCanvas () { } 76 | 77 | public virtual bool CanAddNode (string nodeID) { return true; } 78 | 79 | // GUI 80 | 81 | public virtual void DrawCanvasPropertyEditor () { } 82 | 83 | // ADDITIONAL SERIALIZATION 84 | 85 | /// 86 | /// Should return all additional ScriptableObjects this Node references 87 | /// 88 | public virtual ScriptableObject[] GetScriptableObjects () { return new ScriptableObject[0]; } 89 | 90 | /// 91 | /// Replaces all references to any ScriptableObjects this Node holds with the cloned versions in the serialization process. 92 | /// 93 | protected internal virtual void CopyScriptableObjects (System.Func replaceSO) {} 94 | 95 | 96 | #endregion 97 | 98 | #region Methods 99 | 100 | /// 101 | /// Trigger traversal of the whole canvas 102 | /// 103 | public void TraverseAll () 104 | { 105 | if (Traversal != null) 106 | Traversal.TraverseAll (); 107 | } 108 | 109 | /// 110 | /// Specifies a node change, usually triggering traversal from that node 111 | /// 112 | public void OnNodeChange (Node node) 113 | { 114 | if (Traversal != null && node != null) 115 | Traversal.OnChange (node); 116 | } 117 | 118 | /// 119 | /// Validates this canvas, checking for any broken nodes or references and cleans them. 120 | /// 121 | public void Validate () 122 | { 123 | NodeEditor.checkInit(false); 124 | 125 | // Check Groups 126 | CheckNodeCanvasList(ref groups, "groups"); 127 | 128 | // Check Nodes and their connection ports 129 | CheckNodeCanvasList(ref nodes, "nodes"); 130 | foreach (Node node in nodes) 131 | { 132 | ConnectionPortManager.UpdateConnectionPorts(node); 133 | foreach (ConnectionPort port in node.connectionPorts) 134 | port.Validate(node); 135 | } 136 | 137 | // Check EditorStates 138 | if (editorStates == null) 139 | editorStates = new NodeEditorState[0]; 140 | editorStates = editorStates.Where ((NodeEditorState state) => state != null).ToArray (); 141 | foreach (NodeEditorState state in editorStates) 142 | { 143 | if (!nodes.Contains (state.selectedNode)) 144 | state.selectedNode = null; 145 | } 146 | 147 | // Validate CanvasType-specific stuff 148 | ValidateSelf (); 149 | } 150 | 151 | /// 152 | /// Checks the specified list and assures it is initialized, contains no null nodes and it it does, removes them and outputs an error. 153 | /// 154 | private void CheckNodeCanvasList (ref List list, string listName) 155 | { 156 | if (list == null) 157 | { 158 | Debug.LogWarning("NodeCanvas '" + name + "' " + listName + " were erased and set to null! Automatically fixed!"); 159 | list = new List(); 160 | } 161 | int originalCount = list.Count; 162 | list = list.Where((T o) => o != null).ToList(); 163 | if (originalCount != list.Count) 164 | Debug.LogWarning("NodeCanvas '" + name + "' contained " + (originalCount - list.Count) + " broken (null) " + listName + "! Automatically fixed!"); 165 | } 166 | 167 | /// 168 | /// Updates the source of this canvas to the specified path, updating saveName and savePath aswell as livesInScene when prefixed with "SCENE/" 169 | /// 170 | public void UpdateSource (string path) 171 | { 172 | if (path == savePath) 173 | return; 174 | string newName; 175 | if (path.StartsWith ("SCENE/")) 176 | { 177 | newName = path.Substring (6); 178 | } 179 | else 180 | { 181 | int nameStart = path.LastIndexOf ('/')+1; 182 | newName = path.Substring (nameStart, path.Length-nameStart-6); 183 | } 184 | if (!newName.ToLower ().Contains ("lastsession")) 185 | { 186 | savePath = path; 187 | saveName = newName; 188 | livesInScene = path.StartsWith ("SCENE/"); 189 | } 190 | return; 191 | } 192 | 193 | #endregion 194 | } 195 | } 196 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Core/NodeCanvas.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0e0c2324a9ab1224ebe3edad393e3544 3 | timeCreated: 1437395312 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Core/NodeCanvasTraversal.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NodeEditorFramework 4 | { 5 | [Serializable] 6 | public abstract class NodeCanvasTraversal 7 | { 8 | public NodeCanvas nodeCanvas; 9 | 10 | public NodeCanvasTraversal (NodeCanvas canvas) 11 | { 12 | nodeCanvas = canvas; 13 | } 14 | 15 | public virtual void OnLoadCanvas () { } 16 | public virtual void OnSaveCanvas () { } 17 | 18 | public abstract void TraverseAll (); 19 | public virtual void OnChange (Node node) {} 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Core/NodeCanvasTraversal.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fff8d766888b10d4cbd14d6d865a1e72 3 | timeCreated: 1481043527 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Core/NodeEditorState.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace NodeEditorFramework 6 | { 7 | public partial class NodeEditorState : ScriptableObject 8 | { // holds the state of a NodeCanvas inside a NodeEditor 9 | public NodeCanvas canvas; 10 | public NodeEditorState parentEditor; 11 | 12 | // Canvas options 13 | [NonSerialized] public bool drawing = true; // whether to draw the canvas 14 | 15 | // Selection State 16 | public Node selectedNode; // selected Node 17 | [NonSerialized] public Node focusedNode; // Node under mouse 18 | [NonSerialized] public ConnectionKnob focusedConnectionKnob; // ConnectionKnob under mouse 19 | [NonSerialized] public NodeGroup activeGroup; // NodeGroup that is currently interacted with 20 | 21 | // Navigation State 22 | public Vector2 panOffset = new Vector2 (); // pan offset 23 | public float zoom = 1; // zoom; Ranges in 0.2er-steps from 0.6-2.0; applied 1/zoom; 24 | 25 | // Current Action 26 | [NonSerialized] public ConnectionKnob connectKnob; // connection this output 27 | [NonSerialized] public bool dragNode; // node dragging 28 | [NonSerialized] public bool panWindow; // window panning 29 | [NonSerialized] public bool navigate; // navigation ('N') 30 | [NonSerialized] public bool resizeGroup; // whether the active group is being resized; if not, it is dragged 31 | 32 | // Temporary variables 33 | public Vector2 zoomPos { get { return canvasRect.size/2; } } // zoom center in canvas space 34 | public Rect canvasViewport { get { return new Rect(-panOffset - zoomPos * zoom, canvasRect.size * zoom); } } // canvas viewport in canvas space (same as nodes) 35 | [NonSerialized] public Rect canvasRect; // canvas rect in GUI space 36 | [NonSerialized] public Vector2 zoomPanAdjust; // calculated value to offset elements with when zooming 37 | [NonSerialized] public List ignoreInput = new List (); // Rects inside the canvas to ignore input in (nested canvases, fE) 38 | 39 | #region DragHelper 40 | 41 | [NonSerialized] public string dragUserID; // dragging source 42 | [NonSerialized] public Vector2 dragMouseStart; // drag start position (mouse) 43 | [NonSerialized] public Vector2 dragObjectStart; // start position of the dragged object 44 | [NonSerialized] public Vector2 dragOffset; // offset for both node dragging and window panning 45 | public Vector2 dragObjectPos { get { return dragObjectStart + dragOffset; } } // position of the dragged object 46 | 47 | /// 48 | /// Starts a drag operation with the given userID and initial mouse and object position 49 | /// Returns false when a different user already claims this drag operation 50 | /// 51 | public bool StartDrag (string userID, Vector2 mousePos, Vector2 objectPos) 52 | { 53 | if (!String.IsNullOrEmpty (dragUserID) && dragUserID != userID) 54 | return false; 55 | dragUserID = userID; 56 | dragMouseStart = mousePos; 57 | dragObjectStart = objectPos; 58 | dragOffset = Vector2.zero; 59 | return true; 60 | 61 | } 62 | 63 | /// 64 | /// Updates the current drag with the passed new mouse position and returns the drag offset change since the last update 65 | /// 66 | public Vector2 UpdateDrag (string userID, Vector2 newDragPos) 67 | { 68 | if (dragUserID != userID) 69 | throw new UnityException ("User ID " + userID + " tries to interrupt drag from " + dragUserID); 70 | Vector2 prevOffset = dragOffset; 71 | dragOffset = (newDragPos - dragMouseStart) * zoom; 72 | return dragOffset - prevOffset; 73 | } 74 | 75 | /// 76 | /// Ends the drag of the specified userID 77 | /// 78 | public Vector2 EndDrag (string userID) 79 | { 80 | if (dragUserID != userID) 81 | throw new UnityException ("User ID " + userID + " tries to end drag from " + dragUserID); 82 | Vector2 dragPos = dragObjectPos; 83 | dragUserID = ""; 84 | dragOffset = dragMouseStart = dragObjectStart = Vector2.zero; 85 | return dragPos; 86 | 87 | } 88 | 89 | #endregion 90 | } 91 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Core/NodeEditorState.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6ab6487237ff124ea4c2aa5de9ce3fb 3 | timeCreated: 1437395312 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Core/NodeGroup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a25adcb9d2c0e704a9b47bed372e4362 3 | timeCreated: 1482685563 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Core/ValueConnectionKnob.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 017e2c7fd038ecb46b317c1e003f31dc 3 | timeCreated: 1498244881 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/CoreExtensions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f27ab4d32042564cb1cccccefff77c9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/CoreExtensions/ConnectionPortStyles.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Linq; 4 | using System.Collections.Generic; 5 | 6 | using NodeEditorFramework.Utilities; 7 | 8 | namespace NodeEditorFramework 9 | { 10 | /// 11 | /// Handles fetching and storing of all ConnectionPortStyle declarations 12 | /// 13 | public static class ConnectionPortStyles 14 | { 15 | private static Dictionary connectionPortStyles; 16 | private static Dictionary connectionValueTypes; 17 | 18 | /// 19 | /// Fetches every ConnectionPortStyle, ConnectionKnobStyle or ValueConnectionType declaration in the script assemblies to provide the framework with custom connection port styles 20 | /// 21 | public static void FetchConnectionPortStyles () 22 | { 23 | connectionPortStyles = new Dictionary (); 24 | connectionValueTypes = new Dictionary (); 25 | foreach (Type type in ReflectionUtility.getSubTypes (typeof(ConnectionPortStyle))) 26 | { 27 | ConnectionPortStyle portStyle = (ConnectionPortStyle)Activator.CreateInstance (type); 28 | if (portStyle == null) 29 | throw new UnityException ("Error with Connection Port Style Declaration " + type.FullName); 30 | if (!portStyle.isValid ()) 31 | throw new Exception (type.BaseType.Name + " declaration " + portStyle.Identifier + " is invalid!"); 32 | if (connectionPortStyles.ContainsKey (portStyle.Identifier)) 33 | throw new Exception ("Duplicate ConnectionPortStyle declaration " + portStyle.Identifier + "!"); 34 | 35 | connectionPortStyles.Add (portStyle.Identifier, portStyle); 36 | if (type.IsSubclassOf (typeof(ValueConnectionType))) 37 | connectionValueTypes.Add (portStyle.Identifier, (ValueConnectionType)portStyle); 38 | if (!portStyle.isValid()) 39 | Debug.LogError("Style " + portStyle.Identifier + " is invalid!"); 40 | } 41 | } 42 | 43 | /// 44 | /// Gets the ValueConnectionType type the specified type name representates or creates it if not defined 45 | /// 46 | public static Type GetValueType (string typeName) 47 | { 48 | return ((ValueConnectionType)GetPortStyle (typeName, typeof(ValueConnectionType))).Type ?? typeof(void); 49 | } 50 | 51 | /// 52 | /// Gets the ConnectionPortStyle for the specified style name or creates it if not defined 53 | /// 54 | public static ConnectionPortStyle GetPortStyle (string styleName, Type baseStyleClass = null) 55 | { 56 | if (connectionPortStyles == null || connectionPortStyles.Count == 0) 57 | FetchConnectionPortStyles (); 58 | if (baseStyleClass == null || !typeof(ConnectionPortStyle).IsAssignableFrom (typeof(ConnectionPortStyle))) 59 | baseStyleClass = typeof(ConnectionPortStyle); 60 | ConnectionPortStyle portStyle; 61 | if (!connectionPortStyles.TryGetValue (styleName, out portStyle)) 62 | { // No port style with the exact name exists 63 | if (typeof(ValueConnectionType).IsAssignableFrom (baseStyleClass)) 64 | { // A ValueConnectionType is searched, try by type name 65 | Type type = Type.GetType (styleName); 66 | if (type == null) // No type matching the name found either 67 | { 68 | Debug.LogError ("No ValueConnectionType could be found or created with name '" + styleName + "'!"); 69 | return null; 70 | } 71 | else // Matching type found, search or create type data based on type 72 | portStyle = GetValueConnectionType(type); 73 | } 74 | else 75 | { 76 | portStyle = (ConnectionPortStyle)Activator.CreateInstance (baseStyleClass, styleName); 77 | connectionPortStyles.Add (styleName, portStyle); 78 | Debug.LogWarning("Created style from name " + styleName + "!"); 79 | } 80 | } 81 | if (!baseStyleClass.IsAssignableFrom (portStyle.GetType ())) 82 | throw new Exception ("Cannot use Connection Style: '" + styleName + "' is not of type " + baseStyleClass.Name + "!"); 83 | if (!portStyle.isValid()) 84 | Debug.LogError("Fetched style " + portStyle.Identifier + " is invalid!"); 85 | return portStyle; 86 | } 87 | 88 | /// 89 | /// Gets the ValueConnectionType for the specified type or creates it if not defined 90 | /// 91 | public static ValueConnectionType GetValueConnectionType (Type type) 92 | { 93 | if (connectionPortStyles == null || connectionPortStyles.Count == 0) 94 | FetchConnectionPortStyles (); 95 | ValueConnectionType valueType = connectionValueTypes.Values.FirstOrDefault ((ValueConnectionType data) => data.isValid () && data.Type == type); 96 | if (valueType == null) // ValueConnectionType with type does not exist, create it 97 | { 98 | valueType = new ValueConnectionType (type); 99 | connectionPortStyles.Add (type.FullName, valueType); 100 | connectionValueTypes.Add (type.FullName, valueType); 101 | } 102 | return valueType; 103 | } 104 | } 105 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/CoreExtensions/ConnectionPortStyles.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4be5c7fe89350d249b9fd20d52cfb700 3 | timeCreated: 1449162341 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/CoreExtensions/NodeCanvasTypes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEngine; 5 | 6 | using NodeEditorFramework.Utilities; 7 | 8 | namespace NodeEditorFramework 9 | { 10 | public class NodeCanvasManager 11 | { 12 | private static Dictionary CanvasTypes; 13 | 14 | private static Action _menuCallback; 15 | 16 | /// 17 | /// Fetches every CanvasType Declaration in the script assemblies to provide the framework with custom canvas types 18 | /// 19 | public static void FetchCanvasTypes () 20 | { 21 | CanvasTypes = new Dictionary(); 22 | foreach (Type type in ReflectionUtility.getSubTypes (typeof(NodeCanvas), typeof(NodeCanvasTypeAttribute))) 23 | { 24 | object[] nodeAttributes = type.GetCustomAttributes (typeof(NodeCanvasTypeAttribute), false); 25 | NodeCanvasTypeAttribute attr = nodeAttributes[0] as NodeCanvasTypeAttribute; 26 | CanvasTypes.Add(type, new NodeCanvasTypeData() { CanvasType = type, DisplayString = attr.Name }); 27 | } 28 | } 29 | 30 | /// 31 | /// Returns all recorded canvas definitions found by the system 32 | /// 33 | public static List getCanvasDefinitions () 34 | { 35 | return CanvasTypes.Values.ToList (); 36 | } 37 | 38 | /// 39 | /// Returns the NodeData for the given canvas 40 | /// 41 | public static NodeCanvasTypeData GetCanvasTypeData (NodeCanvas canvas) 42 | { 43 | return GetCanvasTypeData (canvas.GetType ()); 44 | } 45 | 46 | /// 47 | /// Returns the NodeData for the given canvas type 48 | /// 49 | public static NodeCanvasTypeData GetCanvasTypeData (Type canvasType) 50 | { 51 | NodeCanvasTypeData data; 52 | CanvasTypes.TryGetValue (canvasType, out data); 53 | return data; 54 | } 55 | 56 | /// 57 | /// Returns the NodeData for the given canvas name (type name, display string, etc.) 58 | /// 59 | public static NodeCanvasTypeData GetCanvasTypeData (string name) 60 | { 61 | return CanvasTypes.Values.FirstOrDefault ((NodeCanvasTypeData data) => data.CanvasType.FullName.Contains (name) || data.DisplayString.Contains (name) || name.Contains (data.DisplayString)); 62 | } 63 | 64 | /// 65 | /// Checks whether the süecified nodeID is compatible with the given canvas type 66 | /// 67 | public static bool CheckCanvasCompability (string nodeID, Type canvasType) 68 | { 69 | NodeTypeData data = NodeTypes.getNodeData (nodeID); 70 | return data.limitToCanvasTypes == null || data.limitToCanvasTypes.Length == 0 || data.limitToCanvasTypes.Contains (canvasType); 71 | } 72 | 73 | /// 74 | /// Converts the given canvas to the specified type 75 | /// 76 | public static NodeCanvas ConvertCanvasType (NodeCanvas canvas, Type newType) 77 | { 78 | NodeCanvas convertedCanvas = canvas; 79 | if (canvas.GetType () != newType && newType.IsSubclassOf (typeof(NodeCanvas))) 80 | { 81 | canvas.Validate(); 82 | canvas = NodeEditorSaveManager.CreateWorkingCopy (canvas); 83 | convertedCanvas = NodeCanvas.CreateCanvas(newType); 84 | convertedCanvas.nodes = canvas.nodes; 85 | convertedCanvas.groups = canvas.groups; 86 | convertedCanvas.editorStates = canvas.editorStates; 87 | for (int i = 0; i < convertedCanvas.nodes.Count; i++) 88 | { 89 | if (!CheckCanvasCompability (convertedCanvas.nodes[i].GetID, newType)) 90 | { // Check if nodes is even compatible with the canvas, if not delete it 91 | convertedCanvas.nodes[i].Delete (); 92 | i--; 93 | } 94 | } 95 | convertedCanvas.Validate (); 96 | } 97 | return convertedCanvas; 98 | } 99 | 100 | #region Canvas Type Menu 101 | 102 | public static void FillCanvasTypeMenu(ref GenericMenu menu, Action NodeCanvasSelection, string path = "") 103 | { 104 | _menuCallback = NodeCanvasSelection; 105 | foreach (NodeCanvasTypeData data in CanvasTypes.Values) 106 | menu.AddItem(new GUIContent(path + data.DisplayString), false, unwrapCanvasTypeCallback, (object)data); 107 | } 108 | 109 | #if UNITY_EDITOR 110 | public static void FillCanvasTypeMenu(ref UnityEditor.GenericMenu menu, Action NodeCanvasSelection, string path = "") 111 | { 112 | _menuCallback = NodeCanvasSelection; 113 | foreach (NodeCanvasTypeData data in CanvasTypes.Values) 114 | menu.AddItem(new GUIContent(path + data.DisplayString), false, unwrapCanvasTypeCallback, (object)data); 115 | } 116 | #endif 117 | 118 | private static void unwrapCanvasTypeCallback(object data) 119 | { 120 | NodeCanvasTypeData typeData = (NodeCanvasTypeData)data; 121 | _menuCallback(typeData.CanvasType); 122 | } 123 | 124 | #endregion 125 | } 126 | 127 | public struct NodeCanvasTypeData 128 | { 129 | public string DisplayString; 130 | public Type CanvasType; 131 | } 132 | 133 | public class NodeCanvasTypeAttribute : Attribute 134 | { 135 | public string Name; 136 | 137 | public NodeCanvasTypeAttribute(string displayName) 138 | { 139 | Name = displayName; 140 | } 141 | } 142 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/CoreExtensions/NodeCanvasTypes.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3ac1ecc7eb0a6a4bae51b6e18010b92 3 | timeCreated: 1469444159 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/CoreExtensions/NodeTypes.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Collections.Generic; 6 | 7 | using NodeEditorFramework.Utilities; 8 | 9 | namespace NodeEditorFramework 10 | { 11 | /// 12 | /// Handles fetching and storing of all Node declarations 13 | /// 14 | public static class NodeTypes 15 | { 16 | private static Dictionary nodes; 17 | 18 | /// 19 | /// Fetches every Node Declaration in the script assemblies to provide the framework with custom node types 20 | /// 21 | public static void FetchNodeTypes() 22 | { 23 | nodes = new Dictionary (); 24 | foreach (Type type in ReflectionUtility.getSubTypes (typeof(Node))) 25 | { 26 | object[] nodeAttributes = type.GetCustomAttributes(typeof(NodeAttribute), false); 27 | NodeAttribute attr = nodeAttributes[0] as NodeAttribute; 28 | if(attr == null || !attr.hide) 29 | { // Only regard if it is not marked as hidden 30 | // Fetch node information 31 | string ID, Title = "None"; 32 | FieldInfo IDField = type.GetField("ID"); 33 | if (IDField == null || attr == null) 34 | { // Cannot read ID from const field or need to read Title because of missing attribute -> Create sample to read from properties 35 | Node sample = (Node)ScriptableObject.CreateInstance(type); 36 | ID = sample.GetID; 37 | Title = sample.Title; 38 | UnityEngine.Object.DestroyImmediate(sample); 39 | } 40 | else // Can read ID directly from const field 41 | ID = (string)IDField.GetValue(null); 42 | // Create Data from information 43 | NodeTypeData data = attr == null? // Switch between explicit information by the attribute or node information 44 | new NodeTypeData(ID, Title, type, new Type[0]) : 45 | new NodeTypeData(ID, attr.contextText, type, attr.limitToCanvasTypes); 46 | nodes.Add (ID, data); 47 | } 48 | } 49 | } 50 | 51 | /// 52 | /// Returns all recorded node definitions found by the system 53 | /// 54 | public static List getNodeDefinitions () 55 | { 56 | return nodes.Values.ToList (); 57 | } 58 | 59 | /// 60 | /// Returns the NodeData for the given node type ID 61 | /// 62 | public static NodeTypeData getNodeData (string typeID) 63 | { 64 | NodeTypeData data; 65 | nodes.TryGetValue (typeID, out data); 66 | return data; 67 | } 68 | 69 | /// 70 | /// Returns all node IDs that can automatically connect to the specified port. 71 | /// If port is null, all node IDs are returned. 72 | /// 73 | public static List getCompatibleNodes (ConnectionPort port) 74 | { 75 | if (port == null) 76 | return NodeTypes.nodes.Keys.ToList (); 77 | List compatibleNodes = new List (); 78 | foreach (NodeTypeData nodeData in NodeTypes.nodes.Values) 79 | { // Iterate over all nodes to check compability of any of their connection ports 80 | if (ConnectionPortManager.GetPortDeclarations (nodeData.typeID).Any ( 81 | (ConnectionPortDeclaration portDecl) => portDecl.portInfo.IsCompatibleWith (port))) 82 | compatibleNodes.Add (nodeData.typeID); 83 | } 84 | return compatibleNodes; 85 | } 86 | } 87 | 88 | /// 89 | /// The NodeData contains the additional, editor specific data of a node type 90 | /// 91 | public struct NodeTypeData 92 | { 93 | public string typeID; 94 | public string adress; 95 | public Type type; 96 | public Type[] limitToCanvasTypes; 97 | 98 | public NodeTypeData(string ID, string name, Type nodeType, Type[] limitedCanvasTypes) 99 | { 100 | typeID = ID; 101 | adress = name; 102 | type = nodeType; 103 | limitToCanvasTypes = limitedCanvasTypes; 104 | } 105 | } 106 | 107 | /// 108 | /// The NodeAttribute is used to specify editor specific data for a node type, later stored using a NodeData 109 | /// 110 | public class NodeAttribute : Attribute 111 | { 112 | public bool hide { get; private set; } 113 | public string contextText { get; private set; } 114 | public Type[] limitToCanvasTypes { get; private set; } 115 | 116 | public NodeAttribute (bool HideNode, string ReplacedContextText, params Type[] limitedCanvasTypes) 117 | { 118 | hide = HideNode; 119 | contextText = ReplacedContextText; 120 | limitToCanvasTypes = limitedCanvasTypes; 121 | } 122 | } 123 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/CoreExtensions/NodeTypes.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1cdfbc99cfb2a2c4db2bb4cbbec242fc 3 | timeCreated: 1449162341 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Interface.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ca962c97c2620b48980dbd26c047c15 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Interface/NodeEditorCallbackReceiver.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace NodeEditorFramework 6 | { 7 | public abstract partial class NodeEditorCallbackReceiver : MonoBehaviour 8 | { 9 | // Editor 10 | public virtual void OnEditorStartUp () {} 11 | // Save and Load 12 | public virtual void OnLoadCanvas (NodeCanvas canvas) {} 13 | public virtual void OnLoadEditorState (NodeEditorState editorState) {} 14 | public virtual void OnSaveCanvas (NodeCanvas canvas) {} 15 | public virtual void OnSaveEditorState (NodeEditorState editorState) {} 16 | // Node 17 | public virtual void OnAddNode (Node node) {} 18 | public virtual void OnDeleteNode (Node node) {} 19 | public virtual void OnMoveNode (Node node) {} 20 | public virtual void OnAddConnectionPort (ConnectionPort knob) {} 21 | // Connection 22 | public virtual void OnAddConnection (ConnectionPort port1, ConnectionPort port2) {} 23 | public virtual void OnRemoveConnection (ConnectionPort port1, ConnectionPort port2) {} 24 | } 25 | 26 | public static partial class NodeEditorCallbacks 27 | { 28 | private static int receiverCount; 29 | private static List callbackReceiver; 30 | 31 | public static void SetupReceivers () 32 | { 33 | callbackReceiver = new List (MonoBehaviour.FindObjectsOfType ()); 34 | receiverCount = callbackReceiver.Count; 35 | } 36 | 37 | #region Editor (1) 38 | 39 | public static Action OnEditorStartUp = null; 40 | public static void IssueOnEditorStartUp () 41 | { 42 | if (OnEditorStartUp != null) 43 | OnEditorStartUp.Invoke (); 44 | for (int cnt = 0; cnt < receiverCount; cnt++) 45 | { 46 | if (callbackReceiver [cnt] == null) 47 | callbackReceiver.RemoveAt (cnt--); 48 | else 49 | callbackReceiver [cnt].OnEditorStartUp (); 50 | } 51 | } 52 | 53 | #endregion 54 | 55 | #region Save and Load (4) 56 | 57 | public static Action OnLoadCanvas; 58 | public static void IssueOnLoadCanvas (NodeCanvas canvas) 59 | { 60 | if (OnLoadCanvas != null) 61 | OnLoadCanvas.Invoke (canvas); 62 | for (int cnt = 0; cnt < receiverCount; cnt++) 63 | { 64 | if (callbackReceiver [cnt] == null) 65 | callbackReceiver.RemoveAt (cnt--); 66 | else 67 | callbackReceiver [cnt].OnLoadCanvas (canvas) ; 68 | } 69 | } 70 | 71 | public static Action OnLoadEditorState; 72 | public static void IssueOnLoadEditorState (NodeEditorState editorState) 73 | { 74 | if (OnLoadEditorState != null) 75 | OnLoadEditorState.Invoke (editorState); 76 | for (int cnt = 0; cnt < receiverCount; cnt++) 77 | { 78 | if (callbackReceiver [cnt] == null) 79 | callbackReceiver.RemoveAt (cnt--); 80 | else 81 | callbackReceiver [cnt].OnLoadEditorState (editorState) ; 82 | } 83 | } 84 | 85 | public static Action OnSaveCanvas; 86 | public static void IssueOnSaveCanvas (NodeCanvas canvas) 87 | { 88 | if (OnSaveCanvas != null) 89 | OnSaveCanvas.Invoke (canvas); 90 | for (int cnt = 0; cnt < receiverCount; cnt++) 91 | { 92 | if (callbackReceiver [cnt] == null) 93 | callbackReceiver.RemoveAt (cnt--); 94 | else 95 | callbackReceiver [cnt].OnSaveCanvas (canvas) ; 96 | } 97 | } 98 | 99 | public static Action OnSaveEditorState; 100 | public static void IssueOnSaveEditorState (NodeEditorState editorState) 101 | { 102 | if (OnSaveEditorState != null) 103 | OnSaveEditorState.Invoke (editorState); 104 | for (int cnt = 0; cnt < receiverCount; cnt++) 105 | { 106 | if (callbackReceiver [cnt] == null) 107 | callbackReceiver.RemoveAt (cnt--); 108 | else 109 | callbackReceiver [cnt].OnSaveEditorState (editorState) ; 110 | } 111 | } 112 | 113 | #endregion 114 | 115 | #region Node (4) 116 | 117 | public static Action OnAddNode; 118 | public static void IssueOnAddNode (Node node) 119 | { 120 | if (OnAddNode != null) 121 | OnAddNode.Invoke (node); 122 | for (int cnt = 0; cnt < receiverCount; cnt++) 123 | { 124 | if (callbackReceiver [cnt] == null) 125 | callbackReceiver.RemoveAt (cnt--); 126 | else 127 | callbackReceiver [cnt].OnAddNode (node); 128 | } 129 | } 130 | 131 | public static Action OnDeleteNode; 132 | public static void IssueOnDeleteNode (Node node) 133 | { 134 | if (OnDeleteNode != null) 135 | OnDeleteNode.Invoke (node); 136 | for (int cnt = 0; cnt < receiverCount; cnt++) 137 | { 138 | if (callbackReceiver [cnt] == null) 139 | callbackReceiver.RemoveAt (cnt--); 140 | else 141 | callbackReceiver [cnt].OnDeleteNode (node); 142 | } 143 | node.OnDelete (); 144 | } 145 | 146 | public static Action OnMoveNode; 147 | public static void IssueOnMoveNode (Node node) 148 | { 149 | if (OnMoveNode != null) 150 | OnMoveNode.Invoke (node); 151 | for (int cnt = 0; cnt < receiverCount; cnt++) 152 | { 153 | if (callbackReceiver [cnt] == null) 154 | callbackReceiver.RemoveAt (cnt--); 155 | else 156 | callbackReceiver [cnt].OnMoveNode (node); 157 | } 158 | } 159 | 160 | public static Action OnAddConnectionPort; 161 | public static void IssueOnAddConnectionPort (ConnectionPort connectionPort) 162 | { 163 | if (OnAddConnectionPort != null) 164 | OnAddConnectionPort.Invoke (connectionPort); 165 | for (int cnt = 0; cnt < receiverCount; cnt++) 166 | { 167 | if (callbackReceiver [cnt] == null) 168 | callbackReceiver.RemoveAt (cnt--); 169 | else 170 | callbackReceiver [cnt].OnAddConnectionPort (connectionPort); 171 | } 172 | } 173 | 174 | #endregion 175 | 176 | #region Connection (2) 177 | 178 | public static Action OnAddConnection; 179 | public static void IssueOnAddConnection (ConnectionPort port1, ConnectionPort port2) 180 | { 181 | if (OnAddConnection != null) 182 | OnAddConnection.Invoke (port1, port2); 183 | for (int cnt = 0; cnt < receiverCount; cnt++) 184 | { 185 | if (callbackReceiver [cnt] == null) 186 | callbackReceiver.RemoveAt (cnt--); 187 | else 188 | callbackReceiver [cnt].OnAddConnection (port1, port2); 189 | } 190 | } 191 | 192 | public static Action OnRemoveConnection; 193 | public static void IssueOnRemoveConnection (ConnectionPort port1, ConnectionPort port2) 194 | { 195 | if (OnRemoveConnection != null) 196 | OnRemoveConnection.Invoke (port1, port2); 197 | for (int cnt = 0; cnt < receiverCount; cnt++) 198 | { 199 | if (callbackReceiver [cnt] == null) 200 | callbackReceiver.RemoveAt (cnt--); 201 | else 202 | callbackReceiver [cnt].OnRemoveConnection (port1, port2); 203 | } 204 | } 205 | 206 | #endregion 207 | 208 | } 209 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Interface/NodeEditorCallbackReceiver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f72444d2da0ade14aba9ff3102d17243 3 | timeCreated: 1449162341 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Interface/NodeEditorGUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d45bec52de54d834e818ca0ccb994c1f 3 | timeCreated: 1449162341 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Interface/NodeEditorInputControls.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 76a77818258cdde43a807b810eb57074 3 | timeCreated: 1466001829 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Interface/NodeEditorInputSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b51ae3192829104296c1fc1bf4f4068 3 | timeCreated: 1466001829 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/Interface/NodeEditorInterface.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc2d5bd6fc3c2a042b33642dc057790d 3 | timeCreated: 1498909738 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/NodeEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b01efe70ff3f8d84da16ee5d254540a9 3 | timeCreated: 1449162341 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/SaveSystem.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4cc9acd7ae3ba0f479385c2d7e475109 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/SaveSystem/ImportExportFormat.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 961d85cbdc1829442907cdcfd40aaf01 3 | timeCreated: 1497884522 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/SaveSystem/ImportExportManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7761e7c3d61739f4bbb8b023e3e91adc 3 | timeCreated: 1497983354 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/SaveSystem/ImportExportStructure.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | using UnityEngine; 5 | 6 | namespace NodeEditorFramework.IO 7 | { 8 | public class CanvasData 9 | { 10 | public NodeCanvas canvas; 11 | 12 | public string name; 13 | public Type type; 14 | 15 | public EditorStateData[] editorStates; 16 | public List groups = new List(); 17 | 18 | public Dictionary nodes = new Dictionary(); 19 | public List connections = new List(); 20 | public Dictionary objects = new Dictionary(); 21 | 22 | public CanvasData(NodeCanvas nodeCanvas) 23 | { 24 | canvas = nodeCanvas; 25 | name = nodeCanvas.name; 26 | type = nodeCanvas.GetType(); 27 | } 28 | 29 | public CanvasData(Type canvasType, string canvasName) 30 | { 31 | type = canvasType; 32 | name = canvasName; 33 | } 34 | 35 | public ObjectData ReferenceObject(object obj) 36 | { 37 | if (obj == null) 38 | return null; 39 | foreach (ObjectData data in objects.Values) 40 | { 41 | if (data.data == obj) 42 | return data; 43 | } 44 | ObjectData objData = new ObjectData(obj); 45 | objects.Add(objData.refID, objData); 46 | return objData; 47 | } 48 | 49 | public ObjectData FindObject(int refID) 50 | { 51 | ObjectData data; 52 | objects.TryGetValue(refID, out data); 53 | return data; 54 | } 55 | 56 | public NodeData FindNode(Node node) 57 | { 58 | foreach (NodeData data in nodes.Values) 59 | { 60 | if (data.node == node) 61 | return data; 62 | } 63 | return null; 64 | } 65 | 66 | public NodeData FindNode(int nodeID) 67 | { 68 | NodeData data; 69 | nodes.TryGetValue(nodeID, out data); 70 | return data; 71 | } 72 | 73 | public bool RecordConnection(PortData portData1, PortData portData2) 74 | { 75 | if (!portData1.connections.Contains(portData2)) 76 | portData1.connections.Add(portData2); 77 | if (!portData2.connections.Contains(portData1)) 78 | portData2.connections.Add(portData1); 79 | if (!connections.Exists((ConnectionData conData) => conData.isPart(portData1) && conData.isPart(portData2))) 80 | { // Connection hasn't already been recorded 81 | ConnectionData conData = new ConnectionData(portData1, portData2); 82 | connections.Add(conData); 83 | return true; 84 | } 85 | return false; 86 | } 87 | } 88 | 89 | public class EditorStateData 90 | { 91 | public NodeData selectedNode; 92 | public Vector2 panOffset; 93 | public float zoom; 94 | 95 | public EditorStateData(NodeData SelectedNode, Vector2 PanOffset, float Zoom) 96 | { 97 | selectedNode = SelectedNode; 98 | panOffset = PanOffset; 99 | zoom = Zoom; 100 | } 101 | } 102 | 103 | public class GroupData 104 | { 105 | public string name; 106 | public Rect rect; 107 | public Color color; 108 | 109 | public GroupData(NodeGroup group) 110 | { 111 | name = group.title; 112 | rect = group.rect; 113 | color = group.color; 114 | } 115 | 116 | public GroupData(string Name, Rect Rect, Color Color) 117 | { 118 | name = Name; 119 | rect = Rect; 120 | color = Color; 121 | } 122 | } 123 | 124 | public class NodeData 125 | { 126 | public Node node; 127 | 128 | public string name; 129 | public int nodeID; 130 | public string typeID; 131 | public Vector2 nodePos; 132 | public Type type; 133 | 134 | public List connectionPorts = new List(); 135 | public List variables = new List(); 136 | 137 | public NodeData(Node n) 138 | { 139 | node = n; 140 | name = n.name; 141 | typeID = node.GetID; 142 | nodeID = node.GetHashCode(); 143 | nodePos = node.rect.position; 144 | type = n.GetType(); 145 | } 146 | 147 | public NodeData(string Name, string TypeID, int NodeID, Vector2 Pos) 148 | { 149 | name = Name; 150 | typeID = TypeID; 151 | nodeID = NodeID; 152 | nodePos = Pos; 153 | type = NodeTypes.getNodeData(typeID).type; 154 | } 155 | } 156 | 157 | public class PortData 158 | { 159 | public ConnectionPort port; 160 | 161 | public int portID; 162 | public NodeData body; 163 | public string name; 164 | 165 | public bool dynamic = false; 166 | public Type dynaType; 167 | 168 | public List connections = new List(); 169 | 170 | // STATIC 171 | 172 | public PortData(NodeData Body, ConnectionPort Port, string VarName) 173 | { 174 | port = Port; 175 | portID = port.GetHashCode(); 176 | body = Body; 177 | name = VarName; 178 | } 179 | 180 | public PortData(NodeData Body, string VarName, int PortID) 181 | { 182 | portID = PortID; 183 | body = Body; 184 | name = VarName; 185 | } 186 | 187 | // DYNAMIC 188 | 189 | public PortData(NodeData Body, ConnectionPort DynamicPort) 190 | { 191 | dynamic = true; 192 | port = DynamicPort; 193 | portID = port.GetHashCode(); 194 | body = Body; 195 | name = DynamicPort.name; 196 | dynaType = DynamicPort.GetType(); 197 | } 198 | 199 | public PortData(NodeData Body, ConnectionPort DynamicPort, int PortID) 200 | { 201 | dynamic = true; 202 | port = DynamicPort; 203 | portID = PortID; 204 | body = Body; 205 | name = DynamicPort.name; 206 | dynaType = DynamicPort.GetType(); 207 | } 208 | 209 | } 210 | 211 | public class ConnectionData 212 | { 213 | public PortData port1; 214 | public PortData port2; 215 | 216 | public ConnectionData(PortData Port1, PortData Port2) 217 | { 218 | port1 = Port1; 219 | port2 = Port2; 220 | } 221 | 222 | public bool isPart (PortData port) 223 | { 224 | return port1 == port || port2 == port; 225 | } 226 | } 227 | 228 | public class VariableData 229 | { 230 | public string name; 231 | public ObjectData refObject; 232 | public object value; 233 | 234 | public VariableData(FieldInfo field) 235 | { 236 | name = field.Name; 237 | } 238 | 239 | public VariableData(string fieldName) 240 | { 241 | name = fieldName; 242 | } 243 | } 244 | 245 | public class ObjectData 246 | { 247 | public int refID; 248 | public Type type; 249 | public object data; 250 | 251 | public ObjectData(object obj) 252 | { 253 | if (obj == null) 254 | throw new ArgumentNullException("obj"); 255 | refID = obj.GetHashCode(); 256 | // Some types like MonoScript implement no proper GetHashCode function 257 | if (Mathf.Abs (refID) < 10) 258 | refID = (int)UnityEngine.Random.value * int.MaxValue; 259 | type = obj.GetType(); 260 | data = obj; 261 | } 262 | 263 | public ObjectData(int objRefID, object obj) 264 | { 265 | refID = objRefID; 266 | type = obj.GetType(); 267 | data = obj; 268 | } 269 | } 270 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/SaveSystem/ImportExportStructure.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84af943011bc7e6448cd010e393c6c02 3 | timeCreated: 1498754587 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/SaveSystem/NodeCanvasSceneSave.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace NodeEditorFramework 4 | { 5 | public partial class NodeCanvasSceneSave : MonoBehaviour 6 | { 7 | public string saveName; 8 | public NodeCanvas savedNodeCanvas; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/SaveSystem/NodeCanvasSceneSave.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f1cd8579a6c9ec4b85d9d62cd5ba58b 3 | timeCreated: 1464014559 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/SaveSystem/NodeEditorSaveManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 536538853a8430243a2f38355c7d4bbd 3 | timeCreated: 1453840956 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Framework/SaveSystem/NodeEditorUserCache.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1bb1bb38f09a0534daf0b17a3e45693c 3 | timeCreated: 1466090292 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8332b4254efe6dd46b8fb241bf7590d0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/Example.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a7a9aba81c19584885b8f1e62197331 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/Example/AllAroundNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace NodeEditorFramework.Standard 4 | { 5 | [Node (false, "Example/AllAround Node")] 6 | public class AllAroundNode : Node 7 | { 8 | public const string ID = "allaroundNode"; 9 | public override string GetID { get { return ID; } } 10 | 11 | public override string Title { get { return "AllAround Node"; } } 12 | public override Vector2 DefaultSize { get { return new Vector2 (60, 60); } } 13 | 14 | public override bool AllowRecursion { get { return true; } } 15 | public override bool ContinueCalculation { get { return true; } } 16 | 17 | [ValueConnectionKnob("Input Top", Direction.In, "Float", NodeSide.Top, 20)] 18 | public ValueConnectionKnob inputTop; 19 | [ValueConnectionKnob("Input Bottom", Direction.In, "Float", NodeSide.Bottom, 20)] 20 | public ValueConnectionKnob inputBottom; 21 | [ValueConnectionKnob("Input Right", Direction.In, "Float", NodeSide.Right, 20)] 22 | public ValueConnectionKnob inputRight; 23 | [ValueConnectionKnob("Input Left", Direction.In, "Float", NodeSide.Left, 20)] 24 | public ValueConnectionKnob inputLeft; 25 | 26 | [ValueConnectionKnob("Output Top", Direction.Out, "Float", NodeSide.Top, 40)] 27 | public ValueConnectionKnob outputTop; 28 | [ValueConnectionKnob("Output Bottom", Direction.Out, "Float", NodeSide.Bottom, 40)] 29 | public ValueConnectionKnob outputBottom; 30 | [ValueConnectionKnob("Output Right", Direction.Out, "Float", NodeSide.Right, 40)] 31 | public ValueConnectionKnob outputRight; 32 | [ValueConnectionKnob("Output Left", Direction.Out, "Float", NodeSide.Left, 40)] 33 | public ValueConnectionKnob outputLeft; 34 | 35 | protected internal override void DrawNode () 36 | { 37 | Rect nodeRect = rect; 38 | nodeRect.position += NodeEditor.curEditorState.zoomPanAdjust + NodeEditor.curEditorState.panOffset; 39 | GUI.Box (nodeRect, GUIContent.none, GUI.skin.box); 40 | } 41 | 42 | public override bool Calculate () 43 | { 44 | outputTop.SetValue (inputTop.GetValue ()); 45 | outputBottom.SetValue (inputBottom.GetValue ()); 46 | outputRight.SetValue (inputRight.GetValue ()); 47 | outputLeft.SetValue (inputLeft.GetValue ()); 48 | 49 | return true; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/Example/AllAroundNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec20c217ebe61744d82a69ad83ff2447 3 | timeCreated: 1444930712 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/Example/ExampleNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace NodeEditorFramework.Standard 4 | { 5 | [Node (false, "Example/Example Node")] 6 | public class ExampleNode : Node 7 | { 8 | public const string ID = "exampleNode"; 9 | public override string GetID { get { return ID; } } 10 | 11 | public override string Title { get { return "Example Node"; } } 12 | public override Vector2 DefaultSize { get { return new Vector2 (150, 60); } } 13 | 14 | [ValueConnectionKnob("Input", Direction.In, "Float")] 15 | public ValueConnectionKnob inputKnob; 16 | [ValueConnectionKnob("Output", Direction.Out, "Float")] 17 | public ValueConnectionKnob outputKnob; 18 | 19 | public override void NodeGUI () 20 | { 21 | GUILayout.Label ("This is a custom Node!"); 22 | 23 | GUILayout.BeginHorizontal (); 24 | GUILayout.BeginVertical (); 25 | 26 | inputKnob.DisplayLayout (); 27 | 28 | GUILayout.EndVertical (); 29 | GUILayout.BeginVertical (); 30 | 31 | outputKnob.DisplayLayout (); 32 | 33 | GUILayout.EndVertical (); 34 | GUILayout.EndHorizontal (); 35 | 36 | } 37 | 38 | public override bool Calculate () 39 | { 40 | outputKnob.SetValue (inputKnob.GetValue () * 5); 41 | return true; 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/Example/ExampleNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 039d2c5c84d9bf0489aecb2b0b669362 3 | timeCreated: 1447019305 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/Example/FlowNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace NodeEditorFramework.Standard 6 | { 7 | [Node (false, "Example/Flow Node")] 8 | public class FlowNode : Node 9 | { 10 | public const string ID = "flowNode"; 11 | public override string GetID { get { return ID; } } 12 | 13 | public override string Title { get { return "Flow Node"; } } 14 | public override Vector2 DefaultSize { get { return new Vector2 (200, 180); } } 15 | 16 | [ConnectionKnob("Flow In", Direction.In, "Flow", NodeSide.Left, 10)] 17 | public ConnectionKnob flowIn; 18 | [ConnectionKnob("Flow Out", Direction.Out, "Flow", NodeSide.Right, 10)] 19 | public ConnectionKnob flowOut; 20 | 21 | [ValueConnectionKnob("Input", Direction.In, "Float")] 22 | public ValueConnectionKnob inputKnob; 23 | [ValueConnectionKnob("Output", Direction.Out, "Float")] 24 | public ValueConnectionKnob outputKnob; 25 | 26 | public override void NodeGUI () 27 | { 28 | // Display Float connections 29 | GUILayout.BeginHorizontal (); 30 | inputKnob.DisplayLayout (); 31 | outputKnob.DisplayLayout (); 32 | GUILayout.EndHorizontal (); 33 | 34 | // Get adjacent flow elements 35 | Node flowSource = flowIn.connected ()? flowIn.connections[0].body : null; 36 | List flowTargets = flowOut.connections.Select ((ConnectionKnob input) => input.body).ToList (); 37 | 38 | // Display adjacent flow elements 39 | GUILayout.Label ("Flow Source: " + (flowSource != null? flowSource.name : "null")); 40 | GUILayout.Label ("Flow Targets:"); 41 | foreach (Node flowTarget in flowTargets) 42 | GUILayout.Label ("-> " + flowTarget.name); 43 | } 44 | 45 | public override bool Calculate () 46 | { 47 | outputKnob.SetValue (inputKnob.GetValue () * 5); 48 | return true; 49 | } 50 | } 51 | 52 | // Flow connection visual style 53 | public class FlowConnection : ConnectionKnobStyle 54 | { 55 | public override string Identifier { get { return "Flow"; } } 56 | public override Color Color { get { return Color.red; } } 57 | } 58 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/Example/FlowNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de03bdfc59265fe45ac36abd01b51a31 3 | timeCreated: 1456945132 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/Example/ResizingNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | using NodeEditorFramework.Utilities; 4 | 5 | namespace NodeEditorFramework.Standard 6 | { 7 | [Node(false, "Example/Resizing Node")] 8 | public class ResizingNode : Node 9 | { 10 | public const string ID = "resizingNode"; 11 | public override string GetID { get { return ID; } } 12 | 13 | public override string Title { get { return "Resizing Node"; } } 14 | public override Vector2 MinSize { get { return new Vector2(200, 10); } } 15 | public override bool AutoLayout { get { return true; } } // IMPORTANT -> Automatically resize to fit list 16 | 17 | public List labels = new List(); 18 | private string newLabel = ""; 19 | 20 | private ValueConnectionKnobAttribute dynaCreationAttribute = new ValueConnectionKnobAttribute("Output", Direction.Out, "System.String"); 21 | 22 | public override void NodeGUI() 23 | { 24 | if (dynamicConnectionPorts.Count != labels.Count) 25 | { // Make sure labels and ports are synchronised 26 | while (dynamicConnectionPorts.Count > labels.Count) 27 | DeleteConnectionPort(dynamicConnectionPorts.Count - 1); 28 | while (dynamicConnectionPorts.Count < labels.Count) 29 | CreateValueConnectionKnob(dynaCreationAttribute); 30 | } 31 | 32 | GUILayout.Label("This node resizes to fit all inputs!"); 33 | 34 | // Display text field and add button 35 | GUILayout.BeginHorizontal(); 36 | newLabel = RTEditorGUI.TextField(GUIContent.none, newLabel); 37 | if (GUILayout.Button("Add", GUILayout.ExpandWidth(false))) 38 | { 39 | labels.Add(newLabel); 40 | CreateValueConnectionKnob(dynaCreationAttribute); 41 | } 42 | GUILayout.EndHorizontal(); 43 | 44 | for (int i = 0; i < labels.Count; i++) 45 | { // Display label and delete button 46 | GUILayout.BeginHorizontal(); 47 | GUILayout.Label(labels[i]); 48 | ((ValueConnectionKnob)dynamicConnectionPorts[i]).SetPosition(); 49 | if(GUILayout.Button("x", GUILayout.ExpandWidth(false))) 50 | { // Remove current label 51 | labels.RemoveAt (i); 52 | DeleteConnectionPort(i); 53 | i--; 54 | } 55 | GUILayout.EndHorizontal(); 56 | } 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/Example/ResizingNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b10f04280dcb14a40bbcd4ae5599e365 3 | timeCreated: 1485641363 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/Example/RootGraphNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using NodeEditorFramework.Utilities; 3 | 4 | namespace NodeEditorFramework.Standard 5 | { 6 | [Node (false, "Example/Graph Root")] 7 | public class RootGraphNode : Node 8 | { 9 | public const string ID = "rootGraphNode"; 10 | public override string GetID { get { return ID; } } 11 | 12 | public override string Title { get { return "Graph Root Node"; } } 13 | public override Vector2 DefaultSize { get { return new Vector2 (150, 100); } } 14 | 15 | [ConnectionKnob("Child 1", Direction.Out, "Flow")] 16 | public ConnectionKnob flowChild1; 17 | [ConnectionKnob("Child 2", Direction.Out, "Flow")] 18 | public ConnectionKnob flowChild2; 19 | [ConnectionKnob("Child 3", Direction.Out, "Flow")] 20 | public ConnectionKnob flowChild3; 21 | 22 | public override void NodeGUI () 23 | { 24 | name = RTEditorGUI.TextField (name); 25 | 26 | foreach (ConnectionKnob knob in connectionKnobs) 27 | knob.DisplayLayout (); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/Example/RootGraphNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be4620fa9db0beb41b2d5e2bff1656c9 3 | timeCreated: 1473448571 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/FloatCalc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6805508557167d64683e515791aa5d31 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/FloatCalc/CalcNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using NodeEditorFramework.Utilities; 3 | 4 | namespace NodeEditorFramework.Standard 5 | { 6 | [Node (false, "Float/Calculation")] 7 | public class CalcNode : Node 8 | { 9 | public const string ID = "calcNode"; 10 | public override string GetID { get { return ID; } } 11 | 12 | public override string Title { get { return "Calc Node"; } } 13 | public override Vector2 DefaultSize { get { return new Vector2 (200, 100); } } 14 | 15 | public enum CalcType { Add, Substract, Multiply, Divide } 16 | public CalcType type = CalcType.Add; 17 | 18 | [ValueConnectionKnob("Input 1", Direction.In, "Float")] 19 | public ValueConnectionKnob input1Knob; 20 | [ValueConnectionKnob("Input 2", Direction.In, "Float")] 21 | public ValueConnectionKnob input2Knob; 22 | 23 | [ValueConnectionKnob("Output", Direction.Out, "Float")] 24 | public ValueConnectionKnob outputKnob; 25 | 26 | public float Input1Val = 1f; 27 | public float Input2Val = 1f; 28 | 29 | public override void NodeGUI () 30 | { 31 | GUILayout.BeginHorizontal (); 32 | GUILayout.BeginVertical (); 33 | 34 | // First input 35 | if (input1Knob.connected ()) 36 | GUILayout.Label (input1Knob.name); 37 | else 38 | Input1Val = RTEditorGUI.FloatField (GUIContent.none, Input1Val); 39 | input1Knob.SetPosition (); 40 | 41 | // Second input 42 | if (input2Knob.connected ()) 43 | GUILayout.Label (input2Knob.name); 44 | else 45 | Input2Val = RTEditorGUI.FloatField (GUIContent.none, Input2Val); 46 | input2Knob.SetPosition (); 47 | 48 | GUILayout.EndVertical (); 49 | GUILayout.BeginVertical (); 50 | 51 | // Output 52 | outputKnob.DisplayLayout (); 53 | 54 | GUILayout.EndVertical (); 55 | GUILayout.EndHorizontal (); 56 | 57 | type = (CalcType)RTEditorGUI.EnumPopup (new GUIContent ("Calculation Type", "The type of calculation performed on Input 1 and Input 2"), type); 58 | 59 | if (GUI.changed) 60 | NodeEditor.curNodeCanvas.OnNodeChange (this); 61 | } 62 | 63 | public override bool Calculate () 64 | { 65 | if (input1Knob.connected ()) 66 | Input1Val = input1Knob.GetValue (); 67 | if (input2Knob.connected ()) 68 | Input2Val = input2Knob.GetValue (); 69 | 70 | switch (type) 71 | { 72 | case CalcType.Add: 73 | outputKnob.SetValue (Input1Val + Input2Val); 74 | break; 75 | case CalcType.Substract: 76 | outputKnob.SetValue (Input1Val - Input2Val); 77 | break; 78 | case CalcType.Multiply: 79 | outputKnob.SetValue (Input1Val * Input2Val); 80 | break; 81 | case CalcType.Divide: 82 | outputKnob.SetValue (Input1Val / Input2Val); 83 | break; 84 | } 85 | 86 | return true; 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/FloatCalc/CalcNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27a65ad2b155f0d40838ed81292e4df7 3 | timeCreated: 1447019305 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/FloatCalc/DisplayNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace NodeEditorFramework.Standard 4 | { 5 | [Node (false, "Float/Display")] 6 | public class DisplayNode : Node 7 | { 8 | public const string ID = "displayNode"; 9 | public override string GetID { get { return ID; } } 10 | 11 | public override string Title { get { return "Display Node"; } } 12 | public override Vector2 DefaultSize { get { return new Vector2 (150, 50); } } 13 | 14 | private float value = 0; 15 | 16 | [ValueConnectionKnob("Value", Direction.In, "Float")] 17 | public ValueConnectionKnob inputKnob; 18 | 19 | public override void NodeGUI () 20 | { 21 | inputKnob.DisplayLayout (new GUIContent ("Value : " + value.ToString (), "The input value to display")); 22 | } 23 | 24 | public override bool Calculate () 25 | { 26 | value = inputKnob.GetValue (); 27 | return true; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/FloatCalc/DisplayNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39f5df92d12f07d45a4fcfb96e1b36d8 3 | timeCreated: 1437395312 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/FloatCalc/InputNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using NodeEditorFramework.Utilities; 3 | 4 | namespace NodeEditorFramework.Standard 5 | { 6 | [System.Serializable] 7 | [Node(false, "Float/Input")] 8 | public class InputNode : Node 9 | { 10 | public const string ID = "inputNode"; 11 | public override string GetID { get { return ID; } } 12 | 13 | public override string Title { get { return "Input Node"; } } 14 | public override Vector2 DefaultSize { get { return new Vector2(200, 50); } } 15 | 16 | [ValueConnectionKnob("Value", Direction.Out, "Float")] 17 | public ValueConnectionKnob outputKnob; 18 | 19 | public float value = 1f; 20 | 21 | public override void NodeGUI() 22 | { 23 | value = RTEditorGUI.FloatField(new GUIContent("Value", "The input value of type float"), value); 24 | outputKnob.SetPosition(); 25 | 26 | if (GUI.changed) 27 | NodeEditor.curNodeCanvas.OnNodeChange(this); 28 | } 29 | 30 | public override bool Calculate() 31 | { 32 | outputKnob.SetValue(value); 33 | return true; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Nodes/FloatCalc/InputNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3dd50b389073b148b5ec10e419dc073 3 | timeCreated: 1437395312 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e54df360e4590845a6b451227030216 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Saves.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0e2140390e857c49930101c5771e941 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Saves/Calculation Canvas.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60480b2d075467a42b5d9e035f6d2a8f 3 | timeCreated: 1499013237 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Saves/Graph Canvas.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c2591c50ff1bb714d8398a7b80ec7cb4 3 | timeCreated: 1499013237 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48cee8ad9acff5a4cb8381da2f69496c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Shader/LineShader.shader: -------------------------------------------------------------------------------- 1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' 2 | 3 | Shader "Hidden/LineShader" 4 | { 5 | SubShader 6 | { 7 | Blend SrcAlpha OneMinusSrcAlpha 8 | ZWrite Off 9 | Cull Off 10 | Fog { Mode Off } 11 | 12 | Pass 13 | { 14 | CGPROGRAM 15 | #pragma vertex vert 16 | #pragma fragment frag 17 | 18 | uniform float4 _LineColor; 19 | uniform sampler2D _LineTexture; 20 | 21 | struct v2f 22 | { 23 | float2 texcoord : TEXCOORD0; 24 | float4 vertex : POSITION; 25 | }; 26 | 27 | v2f vert (float2 texcoord : TEXCOORD0, float4 vertex : POSITION) 28 | { 29 | v2f o; 30 | o.vertex = UnityObjectToClipPos(vertex); 31 | o.texcoord = texcoord; 32 | return o; 33 | } 34 | 35 | float4 frag (v2f i) : COLOR 36 | { 37 | return _LineColor * tex2D (_LineTexture, i.texcoord); 38 | } 39 | ENDCG 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Shader/LineShader.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0af19377f71840343ab4dffff74b8a00 3 | timeCreated: 1482685508 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a13d5c32322a24848a45b6882833d39b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/AALine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hdmmY/StateMachineNodeEditor/7b5b68846e7cc042e3fb34491ce5a8484cceddf9/Assets/Plugins/Node_Editor/Resources/Textures/AALine.png -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/AALine.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef3fefb6407298c42bbcbc73ad562830 3 | timeCreated: 1437572302 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -3 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 0 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 3, z: 0, w: 3} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 2 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/Icon_Dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hdmmY/StateMachineNodeEditor/7b5b68846e7cc042e3fb34491ce5a8484cceddf9/Assets/Plugins/Node_Editor/Resources/Textures/Icon_Dark.png -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/Icon_Dark.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7e0ecbca30f9b347bb68f235cd9cae4 3 | timeCreated: 1450128686 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -2 30 | maxTextureSize: 32 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 2 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/Icon_Light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hdmmY/StateMachineNodeEditor/7b5b68846e7cc042e3fb34491ce5a8484cceddf9/Assets/Plugins/Node_Editor/Resources/Textures/Icon_Light.png -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/Icon_Light.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bfe9901a943bc04ebeae2ba7f8f409e 3 | timeCreated: 1450128686 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -2 30 | maxTextureSize: 32 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 2 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/In_Knob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hdmmY/StateMachineNodeEditor/7b5b68846e7cc042e3fb34491ce5a8484cceddf9/Assets/Plugins/Node_Editor/Resources/Textures/In_Knob.png -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/In_Knob.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abb6137f2f8441f4caa48872db0b26e0 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 5 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 1 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 1 24 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 0 27 | seamlessCubemap: 0 28 | textureFormat: -3 29 | maxTextureSize: 32 30 | textureSettings: 31 | serializedVersion: 2 32 | filterMode: 1 33 | aniso: 1 34 | mipBias: -1 35 | wrapU: 1 36 | wrapV: 1 37 | wrapW: 1 38 | nPOTScale: 0 39 | lightmap: 0 40 | compressionQuality: 50 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spritePixelsToUnits: 100 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spriteGenerateFallbackPhysicsShape: 1 49 | alphaUsage: 1 50 | alphaIsTransparency: 1 51 | spriteTessellationDetail: -1 52 | textureType: 2 53 | textureShape: 1 54 | singleChannelComponent: 0 55 | maxTextureSizeSet: 0 56 | compressionQualitySet: 0 57 | textureFormatSet: 0 58 | platformSettings: 59 | - serializedVersion: 2 60 | buildTarget: DefaultTexturePlatform 61 | maxTextureSize: 32 62 | resizeAlgorithm: 0 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | androidETC2FallbackOverride: 0 70 | - serializedVersion: 2 71 | buildTarget: Standalone 72 | maxTextureSize: 32 73 | resizeAlgorithm: 0 74 | textureFormat: -1 75 | textureCompression: 0 76 | compressionQuality: 50 77 | crunchedCompression: 0 78 | allowsAlphaSplitting: 0 79 | overridden: 0 80 | androidETC2FallbackOverride: 0 81 | spriteSheet: 82 | serializedVersion: 2 83 | sprites: [] 84 | outline: [] 85 | physicsShape: [] 86 | bones: [] 87 | spriteID: 88 | vertices: [] 89 | indices: 90 | edges: [] 91 | weights: [] 92 | spritePackingTag: 93 | userData: 94 | assetBundleName: 95 | assetBundleVariant: 96 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/In_Knob_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hdmmY/StateMachineNodeEditor/7b5b68846e7cc042e3fb34491ce5a8484cceddf9/Assets/Plugins/Node_Editor/Resources/Textures/In_Knob_02.png -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/In_Knob_02.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7343feb0fd53c7488de12365640c18b 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 5 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 1 24 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 0 27 | seamlessCubemap: 0 28 | textureFormat: 1 29 | maxTextureSize: 2048 30 | textureSettings: 31 | serializedVersion: 2 32 | filterMode: -1 33 | aniso: 1 34 | mipBias: -1 35 | wrapU: 1 36 | wrapV: 1 37 | wrapW: 1 38 | nPOTScale: 0 39 | lightmap: 0 40 | compressionQuality: 50 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spritePixelsToUnits: 100 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spriteGenerateFallbackPhysicsShape: 1 49 | alphaUsage: 1 50 | alphaIsTransparency: 1 51 | spriteTessellationDetail: -1 52 | textureType: 2 53 | textureShape: 1 54 | singleChannelComponent: 0 55 | maxTextureSizeSet: 0 56 | compressionQualitySet: 0 57 | textureFormatSet: 0 58 | platformSettings: 59 | - serializedVersion: 2 60 | buildTarget: DefaultTexturePlatform 61 | maxTextureSize: 32 62 | resizeAlgorithm: 0 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | androidETC2FallbackOverride: 0 70 | - serializedVersion: 2 71 | buildTarget: Standalone 72 | maxTextureSize: 32 73 | resizeAlgorithm: 0 74 | textureFormat: -1 75 | textureCompression: 0 76 | compressionQuality: 50 77 | crunchedCompression: 0 78 | allowsAlphaSplitting: 0 79 | overridden: 0 80 | androidETC2FallbackOverride: 0 81 | spriteSheet: 82 | serializedVersion: 2 83 | sprites: [] 84 | outline: [] 85 | physicsShape: [] 86 | bones: [] 87 | spriteID: 88 | vertices: [] 89 | indices: 90 | edges: [] 91 | weights: [] 92 | spritePackingTag: 93 | userData: 94 | assetBundleName: 95 | assetBundleVariant: 96 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/Knobs.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hdmmY/StateMachineNodeEditor/7b5b68846e7cc042e3fb34491ce5a8484cceddf9/Assets/Plugins/Node_Editor/Resources/Textures/Knobs.xcf -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/Knobs.xcf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff7f91b939ae6d94db540d2ee38349fe 3 | timeCreated: 1450128681 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/NE_Box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hdmmY/StateMachineNodeEditor/7b5b68846e7cc042e3fb34491ce5a8484cceddf9/Assets/Plugins/Node_Editor/Resources/Textures/NE_Box.png -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/NE_Box.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3362057e6db2cea428eb8de4a4800db0 3 | timeCreated: 1453313403 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: 7 30 | maxTextureSize: 32 31 | textureSettings: 32 | filterMode: 0 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 2 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 3, y: 3, z: 3, w: 3} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 5 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/NE_Button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hdmmY/StateMachineNodeEditor/7b5b68846e7cc042e3fb34491ce5a8484cceddf9/Assets/Plugins/Node_Editor/Resources/Textures/NE_Button.png -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/NE_Button.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: acc3252d2ced34346a4fb935f95286e3 3 | timeCreated: 1441568627 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -3 30 | maxTextureSize: 32 31 | textureSettings: 32 | filterMode: 1 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 2 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 4, y: 7, z: 4, w: 4} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 5 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/NE_GUI.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hdmmY/StateMachineNodeEditor/7b5b68846e7cc042e3fb34491ce5a8484cceddf9/Assets/Plugins/Node_Editor/Resources/Textures/NE_GUI.xcf -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/NE_GUI.xcf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52c97a505457a9c4a9090a94d1701247 3 | timeCreated: 1450128681 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/NE_Toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hdmmY/StateMachineNodeEditor/7b5b68846e7cc042e3fb34491ce5a8484cceddf9/Assets/Plugins/Node_Editor/Resources/Textures/NE_Toolbar.png -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/NE_Toolbar.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 402e62fa352af714480f4f3e93e2296e 3 | timeCreated: 1499001690 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 0 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: 0 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 9, y: 3, z: 9, w: 3} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 0 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 8 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 32 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 32 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: WebGL 70 | maxTextureSize: 32 71 | textureFormat: -1 72 | textureCompression: 0 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | spriteSheet: 78 | serializedVersion: 2 79 | sprites: [] 80 | outline: [] 81 | spritePackingTag: 82 | userData: 83 | assetBundleName: 84 | assetBundleVariant: 85 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/NE_ToolbarButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hdmmY/StateMachineNodeEditor/7b5b68846e7cc042e3fb34491ce5a8484cceddf9/Assets/Plugins/Node_Editor/Resources/Textures/NE_ToolbarButton.png -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/NE_ToolbarButton.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7013279dd6b38b24fa8f17dcd98474f8 3 | timeCreated: 1499001707 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 0 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: 0 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 0 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 4, y: 0, z: 4, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 0 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 8 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 32 55 | textureFormat: -1 56 | textureCompression: 0 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 32 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: WebGL 70 | maxTextureSize: 32 71 | textureFormat: -1 72 | textureCompression: 0 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | spriteSheet: 78 | serializedVersion: 2 79 | sprites: [] 80 | outline: [] 81 | spritePackingTag: 82 | userData: 83 | assetBundleName: 84 | assetBundleVariant: 85 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/Out_Knob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hdmmY/StateMachineNodeEditor/7b5b68846e7cc042e3fb34491ce5a8484cceddf9/Assets/Plugins/Node_Editor/Resources/Textures/Out_Knob.png -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/Out_Knob.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d39755f0456c1284d8330cdf12c03faf 3 | timeCreated: 1437259204 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -3 30 | maxTextureSize: 32 31 | textureSettings: 32 | filterMode: 1 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 2 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/Out_Knob_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hdmmY/StateMachineNodeEditor/7b5b68846e7cc042e3fb34491ce5a8484cceddf9/Assets/Plugins/Node_Editor/Resources/Textures/Out_Knob_02.png -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/Out_Knob_02.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cfbefaf144e179c4d9ec68d75eb8a420 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 5 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 1 24 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 0 27 | seamlessCubemap: 0 28 | textureFormat: 1 29 | maxTextureSize: 2048 30 | textureSettings: 31 | serializedVersion: 2 32 | filterMode: -1 33 | aniso: 1 34 | mipBias: -1 35 | wrapU: 1 36 | wrapV: 1 37 | wrapW: -1 38 | nPOTScale: 0 39 | lightmap: 0 40 | compressionQuality: 50 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spritePixelsToUnits: 100 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spriteGenerateFallbackPhysicsShape: 1 49 | alphaUsage: 1 50 | alphaIsTransparency: 1 51 | spriteTessellationDetail: -1 52 | textureType: 2 53 | textureShape: 1 54 | singleChannelComponent: 0 55 | maxTextureSizeSet: 0 56 | compressionQualitySet: 0 57 | textureFormatSet: 0 58 | platformSettings: 59 | - serializedVersion: 2 60 | buildTarget: DefaultTexturePlatform 61 | maxTextureSize: 32 62 | resizeAlgorithm: 0 63 | textureFormat: -1 64 | textureCompression: 0 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | androidETC2FallbackOverride: 0 70 | - serializedVersion: 2 71 | buildTarget: Standalone 72 | maxTextureSize: 32 73 | resizeAlgorithm: 0 74 | textureFormat: -1 75 | textureCompression: 0 76 | compressionQuality: 50 77 | crunchedCompression: 0 78 | allowsAlphaSplitting: 0 79 | overridden: 0 80 | androidETC2FallbackOverride: 0 81 | spriteSheet: 82 | serializedVersion: 2 83 | sprites: [] 84 | outline: [] 85 | physicsShape: [] 86 | bones: [] 87 | spriteID: 88 | vertices: [] 89 | indices: 90 | edges: [] 91 | weights: [] 92 | spritePackingTag: 93 | userData: 94 | assetBundleName: 95 | assetBundleVariant: 96 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hdmmY/StateMachineNodeEditor/7b5b68846e7cc042e3fb34491ce5a8484cceddf9/Assets/Plugins/Node_Editor/Resources/Textures/background.png -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/background.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ab1df7fc134e8b4c86823e805911657 3 | timeCreated: 1437259204 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 1 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -2 30 | maxTextureSize: 512 31 | textureSettings: 32 | filterMode: 2 33 | aniso: 0 34 | mipBias: -1 35 | wrapMode: 0 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 5 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/expandRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hdmmY/StateMachineNodeEditor/7b5b68846e7cc042e3fb34491ce5a8484cceddf9/Assets/Plugins/Node_Editor/Resources/Textures/expandRight.png -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Resources/Textures/expandRight.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b09b3b201c310aa48aacdc1446dfc4bb 3 | timeCreated: 1441487997 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -2 30 | maxTextureSize: 32 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 2 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Utilities.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4e164d4d2ec59e46a6b0ba80ad793fb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Utilities/EditorLoadingControl.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | 3 | using UnityEngine; 4 | using UnityEditor; 5 | #if UNITY_5_3_OR_NEWER || UNITY_5_3 6 | using UnityEngine.SceneManagement; 7 | using UnityEditor.SceneManagement; 8 | #endif 9 | using System; 10 | 11 | namespace NodeEditorFramework.Utilities 12 | { 13 | [InitializeOnLoad] 14 | public static class EditorLoadingControl 15 | { 16 | #if UNITY_5_3_OR_NEWER || UNITY_5_3 17 | private static Scene loadedScene; 18 | #else 19 | private static string loadedScene; 20 | #endif 21 | 22 | private static bool serializationTest = false; 23 | private static bool playmodeSwitchToEdit = false; 24 | private static bool toggleLateEnteredPlaymode = false; 25 | 26 | public static Action beforeEnteringPlayMode; 27 | public static Action justEnteredPlayMode; 28 | public static Action lateEnteredPlayMode; 29 | public static Action beforeLeavingPlayMode; 30 | public static Action justLeftPlayMode; 31 | public static Action justOpenedNewScene; 32 | 33 | static EditorLoadingControl () 34 | { 35 | EditorApplication.playmodeStateChanged -= PlaymodeStateChanged; 36 | EditorApplication.playmodeStateChanged += PlaymodeStateChanged; 37 | EditorApplication.update -= Update; 38 | EditorApplication.update += Update; 39 | EditorApplication.hierarchyWindowChanged -= OnHierarchyChange; 40 | EditorApplication.hierarchyWindowChanged += OnHierarchyChange; 41 | } 42 | 43 | private static void OnHierarchyChange () 44 | { // TODO: OnGUI might be called before this function and migth cause problems. Find a better way to detect scene change! 45 | #if UNITY_5_3_OR_NEWER || UNITY_5_3 46 | Scene currentScene = EditorSceneManager.GetActiveScene (); 47 | #else 48 | string currentScene = Application.loadedLevelName; 49 | #endif 50 | if (loadedScene != currentScene) 51 | { 52 | if (justOpenedNewScene != null) 53 | justOpenedNewScene.Invoke (); 54 | loadedScene = currentScene; 55 | } 56 | } 57 | 58 | // Handles just after switch (non-serialized values lost) 59 | private static void Update () 60 | { 61 | if (toggleLateEnteredPlaymode) 62 | { 63 | toggleLateEnteredPlaymode = false; 64 | if (lateEnteredPlayMode != null) 65 | lateEnteredPlayMode.Invoke (); 66 | } 67 | serializationTest = true; 68 | } 69 | 70 | private static void PlaymodeStateChanged () 71 | { 72 | //Debug.Log ("Playmode State Change! isPlaying: " + Application.isPlaying + "; Serialized: " + serializationTest); 73 | if (!Application.isPlaying) 74 | { // Edit Mode 75 | if (playmodeSwitchToEdit) 76 | { // After Playmode 77 | //Debug.Log ("LOAD PLAY MODE Values in Edit Mode!!"); 78 | if (justLeftPlayMode != null) 79 | justLeftPlayMode.Invoke (); 80 | playmodeSwitchToEdit = false; 81 | } 82 | else 83 | { // Before Playmode 84 | //Debug.Log ("SAVE EDIT MODE Values before Play Mode!!"); 85 | if (beforeEnteringPlayMode != null) 86 | beforeEnteringPlayMode.Invoke (); 87 | } 88 | } 89 | else 90 | { // Play Mode 91 | if (serializationTest) 92 | { // Before Leaving Playmode 93 | //Debug.Log ("SAVE PLAY MODE Values before Edit Mode!!"); 94 | if (beforeLeavingPlayMode != null) 95 | beforeLeavingPlayMode.Invoke (); 96 | playmodeSwitchToEdit = true; 97 | } 98 | else 99 | { // After Entering Playmode 100 | //Debug.Log ("LOAD EDIT MODE Values in Play Mode!!"); 101 | if (justEnteredPlayMode != null) 102 | justEnteredPlayMode.Invoke (); 103 | toggleLateEnteredPlaymode = true; 104 | } 105 | 106 | } 107 | } 108 | } 109 | } 110 | #endif -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Utilities/EditorLoadingControl.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12c59819f3e821d48bca5ce4ad777682 3 | timeCreated: 1482685504 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Utilities/GUI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be09e85eddc76024fb4a3676a20b423f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Utilities/GUI/GUIScaleUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3f7361d79a0bf54fb9dbd7500d87c77 3 | timeCreated: 1482685504 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Utilities/GUI/OverlayGUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e983fb9135fb994489619385460bda0 3 | timeCreated: 1482685504 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Utilities/GUI/RTEditorGUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba0e8dc8348e88446aa2431285e7724c 3 | timeCreated: 1482685504 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Utilities/ReflectionUtility.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Reflection; 4 | using System.Linq; 5 | 6 | namespace NodeEditorFramework.Utilities 7 | { 8 | public static class ReflectionUtility 9 | { 10 | public class ReflectionSearchIgnoreAttribute : Attribute 11 | { 12 | public ReflectionSearchIgnoreAttribute () { } 13 | } 14 | 15 | /// 16 | /// Gets all non-abstract types extending the given base type 17 | /// 18 | public static Type[] getSubTypes (Type baseType) 19 | { 20 | return AppDomain.CurrentDomain.GetAssemblies () 21 | .Where ((Assembly assembly) => assembly.FullName.Contains ("Assembly")) 22 | .SelectMany ((Assembly assembly) => assembly.GetTypes () 23 | .Where ((Type T) => 24 | (T.IsClass && !T.IsAbstract) 25 | && T.IsSubclassOf (baseType) 26 | && !T.GetCustomAttributes (typeof(ReflectionSearchIgnoreAttribute), false).Any ()) 27 | ).ToArray (); 28 | } 29 | 30 | /// 31 | /// Gets all non-abstract types extending the given base type and with the given attribute 32 | /// 33 | public static Type[] getSubTypes (Type baseType, Type hasAttribute) 34 | { 35 | return AppDomain.CurrentDomain.GetAssemblies () 36 | .Where ((Assembly assembly) => assembly.FullName.Contains ("Assembly")) 37 | .SelectMany ((Assembly assembly) => assembly.GetTypes () 38 | .Where ((Type T) => 39 | (T.IsClass && !T.IsAbstract) 40 | && T.IsSubclassOf (baseType) 41 | && T.GetCustomAttributes (hasAttribute, false).Any () 42 | && !T.GetCustomAttributes (typeof(ReflectionSearchIgnoreAttribute), false).Any ()) 43 | ).ToArray (); 44 | } 45 | 46 | /// 47 | /// Returns all fields that should be serialized in the given type 48 | /// 49 | public static FieldInfo[] getSerializedFields (Type type) 50 | { 51 | return type.GetFields (BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) 52 | .Where ((FieldInfo field) => 53 | (field.IsPublic && !field.GetCustomAttributes (typeof(NonSerializedAttribute), true).Any ()) 54 | || field.GetCustomAttributes (typeof(SerializeField), true).Any () 55 | && !field.GetCustomAttributes (typeof(ReflectionSearchIgnoreAttribute), false).Any ()) 56 | .ToArray (); 57 | } 58 | 59 | /// 60 | /// Returns all fields that should be serialized in the given type, minus the fields declared in or above the given base type 61 | /// 62 | public static FieldInfo[] getSerializedFields (Type type, Type hiddenBaseType) 63 | { 64 | return type.GetFields (BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) 65 | .Where ((FieldInfo field) => 66 | (hiddenBaseType == null || !field.DeclaringType.IsAssignableFrom (hiddenBaseType)) 67 | && ((field.IsPublic && !field.GetCustomAttributes (typeof(NonSerializedAttribute), true).Any ()) 68 | || field.GetCustomAttributes (typeof(SerializeField), true).Any () 69 | && !field.GetCustomAttributes (typeof(ReflectionSearchIgnoreAttribute), false).Any ())) 70 | .ToArray (); 71 | } 72 | 73 | /// 74 | /// Gets all fields in the classType of the specified fieldType 75 | /// 76 | public static FieldInfo[] getFieldsOfType (Type classType, Type fieldType) 77 | { 78 | return classType.GetFields (BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) 79 | .Where ((FieldInfo field) => 80 | field.FieldType == fieldType || field.FieldType.IsSubclassOf (fieldType) 81 | && !field.GetCustomAttributes (typeof(ReflectionSearchIgnoreAttribute), false).Any ()) 82 | .ToArray (); 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Utilities/ReflectionUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb2f709eaa85b7e468b625b6304a6727 3 | timeCreated: 1498248777 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Utilities/ResourceManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d514a5dbe4a62c4c8bd5eb878e45eba 3 | timeCreated: 1482685504 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Utilities/link.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Assets/Plugins/Node_Editor/Utilities/link.xml.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1214e8ff723ff5649ad425fc75029717 3 | timeCreated: 1482685508 4 | licenseType: Free 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b21cee47d2293748a9daae64d34f7f5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d81f3084eb3a2246912471e65481cf6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Core/Canvas.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3df6536913b32524385fd9d8799e9e9e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Core/Canvas/StateMachineCanvas.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using NodeEditorFramework; 4 | using UnityEngine; 5 | 6 | [NodeCanvasType ("StateMachine Canvas")] 7 | public class StateMachineCanvas : NodeCanvas 8 | { 9 | public override string canvasName { get { return "StateMachine Canvas"; } } 10 | 11 | 12 | } -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Core/Canvas/StateMachineCanvas.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 393beab0634dfbf428863151156224ec 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Core/HMathf.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public static class HMathf 4 | { 5 | /// 6 | /// Segment intersect with segment. 7 | /// Line1 start with p0, end with p1. Line2 start with p2, end with p3. 8 | /// 9 | /// 10 | /// See https://github.com/jvanverth/essentialmath/blob/master/src/common/IvMath/IvLineSegment3.cpp method "DistanceSquared" 11 | /// 12 | /// True means have intersect, and the reVal give the intersect point. 13 | public static bool SegmentIntersect (Vector2 p0, Vector2 p1, Vector2 p2, Vector2 p3, ref Vector2 reVal) 14 | { 15 | Vector2 dir1 = p1 - p0; 16 | Vector2 dir2 = p3 - p2; 17 | 18 | Vector2 w0 = p0 - p2; 19 | float a = Vector2.Dot (dir1, dir1); 20 | float b = Vector2.Dot (dir1, dir2); 21 | float c = Vector2.Dot (dir2, dir2); 22 | float d = Vector2.Dot (dir1, w0); 23 | float e = Vector2.Dot (dir2, w0); 24 | 25 | float denom = a * c - b * b; 26 | 27 | // parameters to compute s_c, t_c 28 | float sn, sd, tn, td; 29 | float s_c, t_c; 30 | 31 | // if denom is zero, try finding closest point on segment1 to origin0 32 | if (Mathf.Abs (denom) < 1e-5) 33 | { 34 | // clamp s_c to 0 35 | sd = td = c; 36 | sn = 0.0f; 37 | tn = e; 38 | } 39 | else 40 | { 41 | // clamp s_c within [0,1] 42 | sd = td = denom; 43 | sn = b * e - c * d; 44 | tn = a * e - b * d; 45 | 46 | // clamp s_c to 0 47 | if (sn < 0.0f) 48 | { 49 | sn = 0.0f; 50 | tn = e; 51 | td = c; 52 | } 53 | // clamp s_c to 1 54 | else if (sn > sd) 55 | { 56 | sn = sd; 57 | tn = e + b; 58 | td = c; 59 | } 60 | } 61 | 62 | // clamp t_c within [0,1] 63 | // clamp t_c to 0 64 | if (tn < 0.0f) 65 | { 66 | t_c = 0.0f; 67 | // clamp s_c to 0 68 | if (-d < 0.0f) 69 | { 70 | s_c = 0.0f; 71 | } 72 | // clamp s_c to 1 73 | else if (-d > a) 74 | { 75 | s_c = 1.0f; 76 | } 77 | else 78 | { 79 | s_c = -d / a; 80 | } 81 | } 82 | // clamp t_c to 1 83 | else if (tn > td) 84 | { 85 | t_c = 1.0f; 86 | // clamp s_c to 0 87 | if ((-d + b) < 0.0f) 88 | { 89 | s_c = 0.0f; 90 | } 91 | // clamp s_c to 1 92 | else if ((-d + b) > a) 93 | { 94 | s_c = 1.0f; 95 | } 96 | else 97 | { 98 | s_c = (-d + b) / a; 99 | } 100 | } 101 | else 102 | { 103 | t_c = tn / td; 104 | s_c = sn / sd; 105 | } 106 | 107 | Vector2 wc = w0 + s_c * dir1 - t_c * dir2; 108 | 109 | if (Mathf.Abs (wc.sqrMagnitude) < 1e-3) 110 | { 111 | reVal = p0 + s_c * dir1; 112 | return true; 113 | } 114 | 115 | return false; 116 | } 117 | 118 | } -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Core/HMathf.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ccb841f9504e23946b678ae5ec1f5b66 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Core/Nodes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8ec97cee1f081e4db5d57c7aac4f86f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Core/Nodes/BaseStateNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NodeEditorFramework; 3 | using UnityEngine; 4 | 5 | [Node (true, "State/BaseStateNode", new Type[] { typeof (StateMachineCanvas) })] 6 | public abstract class BaseStateNode : Node 7 | { 8 | public override string Title => StateName; 9 | 10 | public override bool AutoLayout => false; 11 | 12 | public override bool AllowRecursion => true; 13 | 14 | public override Color TitleColor => Color.black; 15 | 16 | public string StateName; 17 | 18 | public string StateDescription; 19 | } 20 | 21 | #region Connection knob style 22 | 23 | public class StateTransOutType : ConnectionKnobStyle 24 | { 25 | public override string Identifier => "StateTransOut"; 26 | public override Color Color => Color.black; 27 | } 28 | 29 | public class StateTransInType : ConnectionKnobStyle 30 | { 31 | public override string Identifier => "StateTransIn"; 32 | public override Color Color => Color.cyan; 33 | } 34 | 35 | #endregion -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Core/Nodes/BaseStateNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d27bc3ba1ce457b4c9a96e12ae78f94d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Core/Nodes/ConditionNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb39bf664b3db654699fdb79a0ad8b87 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Core/Nodes/StateInfoNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NodeEditorFramework; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | [Node (false, "State/StateInfoNode", new Type[] { typeof (StateMachineCanvas) })] 7 | public class StateInfoNode : Node 8 | { 9 | private const string ID = "StateInfoNode"; 10 | 11 | public override string GetID => ID; 12 | 13 | public override string Title => "StateInfo"; 14 | 15 | public override Color TitleColor => Color.black; 16 | 17 | public override bool AutoLayout => true; 18 | 19 | public override Vector2 MinSize => new Vector2 (200, 90); 20 | 21 | public BaseStateInfo StateInfo; 22 | 23 | public BaseState StateScript; 24 | 25 | #region Node GUI 26 | 27 | public override void NodeGUI () 28 | { 29 | GUILayout.Space (8); 30 | 31 | StateInfo = EditorGUILayout.ObjectField (StateInfo, typeof (BaseStateInfo), 32 | false) as BaseStateInfo; 33 | 34 | StateScript = EditorGUILayout.ObjectField (StateScript, typeof (BaseState), 35 | false) as BaseState; 36 | } 37 | 38 | #endregion 39 | } -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Core/Nodes/StateInfoNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f995812c56849e4f9bcef62056035e5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Core/Nodes/StateNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f3650cc16a6d3046a691dc1bf670867 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f37edc50c189d140aa19fad49d1755c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Source.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e382a3604a6ab6a41aa58db00ae2adaf 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Source/BaseCondition.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class BaseCondition : MonoBehaviour 4 | { 5 | 6 | } -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Source/BaseCondition.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 579049993a726dd4bb42548eb8affda0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Source/BaseState.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | [RequireComponent (typeof (BaseStateInfo))] 4 | [System.Serializable] 5 | public class BaseState : MonoBehaviour { } -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Source/BaseState.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93cb7cde83ae87b4dbf4f1c857750d13 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Source/BaseStateInfo.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class BaseStateInfo : MonoBehaviour 4 | { 5 | 6 | } -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Source/BaseStateInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2745ba5a2185ce438317806ae0c651e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Source/ConditionMapping.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | [Serializable] 6 | public class ConditionMapping:  ISerializationCallbackReceiver 7 | { 8 | public Func ConditionInt; 9 | 10 | public Func ConditionFloat; 11 | 12 | public Func ConditionBool; 13 | 14 | #region Serialize 15 | 16 | [Serializable] 17 | private class ConditionIntSerializer : SerializableDelegate> { } 18 | 19 | [Serializable] 20 | private class ConditionFloatSerializer : SerializableDelegate> { } 21 | 22 | [Serializable] 23 | private class ConditionBoolSerializer : SerializableDelegate> { } 24 | 25 | private ConditionIntSerializer _conditionInt; 26 | 27 | private ConditionFloatSerializer _conditionFloat; 28 | 29 | private ConditionBoolSerializer _conditionBool; 30 | 31 | public void OnBeforeSerialize () 32 | { 33 | if (ConditionInt != null) 34 | _conditionInt.SetDelegate (ConditionInt); 35 | 36 | if (ConditionFloat != null) 37 | _conditionFloat.SetDelegate (ConditionFloat); 38 | 39 | if (ConditionBool != null) 40 | _conditionBool.SetDelegate (ConditionBool); 41 | } 42 | 43 | public void OnAfterDeserialize () 44 | { 45 | if (_conditionInt != null) 46 | ConditionInt = _conditionInt.CreateDelegate (); 47 | 48 | if (_conditionFloat != null) 49 | ConditionFloat = _conditionFloat.CreateDelegate (); 50 | 51 | if (_conditionBool != null) 52 | ConditionBool = _conditionBool.CreateDelegate (); 53 | } 54 | 55 | #endregion 56 | 57 | } -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Source/ConditionMapping.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be50bf4b625a27043acdec6690ead5e8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Source/SerializableDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Runtime.Serialization.Formatters.Binary; 4 | using UnityEngine; 5 | 6 | [Serializable] 7 | public class SerializableDelegate where T : class 8 | { 9 | [SerializeField] 10 | private UnityEngine.Object _target; 11 | [SerializeField] 12 | private string _methodName = ""; 13 | [SerializeField] 14 | private byte[] _serialData = { }; 15 | 16 | static SerializableDelegate () 17 | { 18 | if (!typeof (T).IsSubclassOf (typeof (Delegate))) 19 | { 20 | throw new InvalidOperationException (typeof (T).Name + " is not a delegate type."); 21 | } 22 | } 23 | 24 | public void SetDelegate (T action) 25 | { 26 | if (action == null) 27 | { 28 | _target = null; 29 | _methodName = ""; 30 | _serialData = new byte[] { }; 31 | return; 32 | } 33 | 34 | var delAction = action as Delegate; 35 | if (delAction == null) 36 | { 37 | throw new InvalidOperationException (typeof (T).Name + " is not a delegate type."); 38 | } 39 | 40 | _target = delAction.Target as UnityEngine.Object; 41 | 42 | if (_target != null) 43 | { 44 | _methodName = delAction.Method.Name; 45 | _serialData = null; 46 | } 47 | else 48 | { 49 | //Serialize the data to a binary stream 50 | using (var stream = new MemoryStream ()) 51 | { 52 | (new BinaryFormatter ()).Serialize (stream, action); 53 | stream.Flush (); 54 | _serialData = stream.ToArray (); 55 | } 56 | _methodName = null; 57 | } 58 | } 59 | 60 | public T CreateDelegate () 61 | { 62 | if (_serialData.Length == 0 && _methodName == "") 63 | { 64 | return null; 65 | } 66 | 67 | if (_target != null) 68 | { 69 | return Delegate.CreateDelegate (typeof (T), _target, _methodName) as T; 70 | } 71 | 72 | using (var stream = new MemoryStream (_serialData)) 73 | { 74 | return (new BinaryFormatter ()).Deserialize (stream) as T; 75 | } 76 | } 77 | } -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Source/SerializableDelegate.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0ae92c8e48db7b4cbeee62ac5eedb14 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Source/StateMachine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 232b7224f39371a4dbfc7db52e474f80 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Source/StateMachineRunner.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class StateMachineRunner : MonoBehaviour 6 | { 7 | #region Public methods 8 | 9 | public StateMachine Initialize (BaseState stateScript, string[] states) 10 | { 11 | var fsm = new StateMachine (this, stateScript, states); 12 | 13 | _stateMachineList.Add (fsm); 14 | 15 | return fsm; 16 | } 17 | 18 | public StateMachine Initialize (BaseState stateScript, string[] states, int startState) 19 | { 20 | var fsm = Initialize (stateScript, states); 21 | 22 | if (startState >= states.Length) return fsm; 23 | 24 | fsm.ChangeState (states[startState]); 25 | 26 | return fsm; 27 | } 28 | 29 | #endregion 30 | 31 | #region Monobehavior method 32 | 33 | private void FixedUpdate () 34 | { 35 | for (int i = 0; i < _stateMachineList.Count; i++) 36 | { 37 | var fsm = _stateMachineList[i]; 38 | 39 | if (!fsm.IsInTransition && fsm.StateScript.enabled) 40 | { 41 | fsm.CurrentStateMap.FixedUpdate (); 42 | } 43 | } 44 | } 45 | 46 | private void Update () 47 | { 48 | for (int i = 0; i < _stateMachineList.Count; i++) 49 | { 50 | var fsm = _stateMachineList[i]; 51 | 52 | if (!fsm.IsInTransition && fsm.StateScript.enabled) 53 | { 54 | fsm.CurrentStateMap.Update (); 55 | } 56 | } 57 | } 58 | 59 | private void LateUpdate () 60 | { 61 | for (int i = 0; i < _stateMachineList.Count; i++) 62 | { 63 | var fsm = _stateMachineList[i]; 64 | 65 | if (!fsm.IsInTransition && fsm.StateScript.enabled) 66 | { 67 | fsm.CurrentStateMap.LateUpdate (); 68 | } 69 | } 70 | } 71 | 72 | #endregion 73 | 74 | private List _stateMachineList = new List (); 75 | } -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Source/StateMachineRunner.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a8c4bb7c90ebd942aaed7501f7bc611 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Source/StateMapping.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | [Serializable] 6 | public class StateMapping:  ISerializationCallbackReceiver 7 | { 8 | public static void DoNothing () { } 9 | 10 | public static IEnumerator DoNothingCoroutine () { yield break; } 11 | 12 | public string State; 13 | 14 | public bool hasEnterRoutine; 15 | public Action EnterCall = DoNothing; 16 | public Func EnterRoutine = DoNothingCoroutine; 17 | 18 | public bool hasExitRoutine; 19 | public Action ExitCall = DoNothing; 20 | public Func ExitRoutine = DoNothingCoroutine; 21 | 22 | public Action Finally = DoNothing; 23 | 24 | public Action Update = DoNothing; 25 | 26 | public Action LateUpdate = DoNothing; 27 | 28 | public Action FixedUpdate = DoNothing; 29 | 30 | public StateMapping (string state) 31 | { 32 | State = state; 33 | } 34 | 35 | #region Serialize 36 | 37 | [Serializable] 38 | private class ActionSerializer : SerializableDelegate { } 39 | 40 | [Serializable] 41 | private class FuncIEnumeratorSerializer : SerializableDelegate> { } 42 | 43 | private ActionSerializer _enterCall = new ActionSerializer (); 44 | private ActionSerializer _exitCall = new ActionSerializer (); 45 | private ActionSerializer _finally = new ActionSerializer (); 46 | private ActionSerializer _update = new ActionSerializer (); 47 | private ActionSerializer _lateUpdate = new ActionSerializer (); 48 | private ActionSerializer _fixedUpdate = new ActionSerializer (); 49 | private FuncIEnumeratorSerializer _enterRoutine = new FuncIEnumeratorSerializer (); 50 | private FuncIEnumeratorSerializer _exitRoutine = new FuncIEnumeratorSerializer (); 51 | 52 | public void OnBeforeSerialize () 53 | { 54 | _enterCall.SetDelegate (EnterCall); 55 | _exitCall.SetDelegate (ExitCall); 56 | _finally.SetDelegate (Finally); 57 | _update.SetDelegate (Update); 58 | _lateUpdate.SetDelegate (LateUpdate); 59 | _fixedUpdate.SetDelegate (FixedUpdate); 60 | _enterRoutine.SetDelegate (EnterRoutine); 61 | _exitRoutine.SetDelegate (ExitRoutine); 62 | } 63 | 64 | public void OnAfterDeserialize () 65 | { 66 | EnterCall = _enterCall.CreateDelegate (); 67 | ExitCall = _exitCall.CreateDelegate (); 68 | Finally = _finally.CreateDelegate (); 69 | Update = _update.CreateDelegate (); 70 | LateUpdate = _lateUpdate.CreateDelegate (); 71 | FixedUpdate = _fixedUpdate.CreateDelegate (); 72 | EnterRoutine = _enterRoutine.CreateDelegate (); 73 | ExitRoutine = _exitRoutine.CreateDelegate (); 74 | } 75 | 76 | #endregion 77 | 78 | } -------------------------------------------------------------------------------- /Assets/Plugins/StateMachine/Source/StateMapping.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 838db2bfc05b76f489118c679989cf29 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f704ae4b4f98ae41a0bce26658850c1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99c9720ab356a0642a771bea13969a05 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Test.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8e4d55c90dbf6946bd4fc0a54102f09 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/NPC_001.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1516150707942332} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1516150707942332 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 4891837945444844} 22 | - component: {fileID: 114662341781921422} 23 | - component: {fileID: 114648333748679918} 24 | m_Layer: 0 25 | m_Name: NPC_001 26 | m_TagString: Untagged 27 | m_Icon: {fileID: 0} 28 | m_NavMeshLayer: 0 29 | m_StaticEditorFlags: 0 30 | m_IsActive: 1 31 | --- !u!4 &4891837945444844 32 | Transform: 33 | m_ObjectHideFlags: 1 34 | m_PrefabParentObject: {fileID: 0} 35 | m_PrefabInternal: {fileID: 100100000} 36 | m_GameObject: {fileID: 1516150707942332} 37 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 38 | m_LocalPosition: {x: 0, y: 0, z: 0} 39 | m_LocalScale: {x: 1, y: 1, z: 1} 40 | m_Children: [] 41 | m_Father: {fileID: 0} 42 | m_RootOrder: 0 43 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 44 | --- !u!114 &114648333748679918 45 | MonoBehaviour: 46 | m_ObjectHideFlags: 1 47 | m_PrefabParentObject: {fileID: 0} 48 | m_PrefabInternal: {fileID: 100100000} 49 | m_GameObject: {fileID: 1516150707942332} 50 | m_Enabled: 1 51 | m_EditorHideFlags: 0 52 | m_Script: {fileID: 11500000, guid: 02b9fd5bb64d9e44a88878044247dbf3, type: 3} 53 | m_Name: 54 | m_EditorClassIdentifier: 55 | --- !u!114 &114662341781921422 56 | MonoBehaviour: 57 | m_ObjectHideFlags: 1 58 | m_PrefabParentObject: {fileID: 0} 59 | m_PrefabInternal: {fileID: 100100000} 60 | m_GameObject: {fileID: 1516150707942332} 61 | m_Enabled: 1 62 | m_EditorHideFlags: 0 63 | m_Script: {fileID: 11500000, guid: 27577a686eeecb84b875e736ee15462c, type: 3} 64 | m_Name: 65 | m_EditorClassIdentifier: 66 | Timer: 0 67 | AttackTimes: 0 68 | Stage2End: 0 69 | -------------------------------------------------------------------------------- /Assets/Test/NPC_001.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 877953918490ddb48b5458bed5b1e7a8 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 100100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/SMI_NPC_001.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SMI_NPC_001 : BaseStateInfo 6 | { 7 | public float Timer; 8 | 9 | public int AttackTimes; 10 | 11 | public bool Stage2End; 12 | } -------------------------------------------------------------------------------- /Assets/Test/SMI_NPC_001.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27577a686eeecb84b875e736ee15462c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Test/SMS_NPC_001.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using UnityEngine; 3 | 4 | [System.Serializable] 5 | public class SMS_NPC_001 : BaseState 6 | { 7 | #region Attack State 8 | 9 | private void Attack_Enter () 10 | { 11 | Debug.Log ("Enter Attack State"); 12 | } 13 | 14 | public void Attack_Update () 15 | { 16 | Debug.Log ("Update Attack State"); 17 | } 18 | 19 | public IEnumerator Attack_Exit () 20 | { 21 | Debug.Log ("Exit Attack State"); 22 | yield break; 23 | } 24 | 25 | #endregion 26 | 27 | #region Move State 28 | 29 | private IEnumerator Move_Enter () 30 | { 31 | float timer = 0f; 32 | 33 | while (timer < 2f) 34 | { 35 | timer += Time.deltaTime; 36 | Debug.LogFormat ("Enter Move State. Timer : {0}", timer); 37 | yield return null; 38 | } 39 | } 40 | 41 | private void Move_Update () 42 | { 43 | Debug.Log ("Update Move State"); 44 | } 45 | 46 | private void Move_LateUpdate () 47 | { 48 | Debug.Log ("LateUpdate Move State"); 49 | } 50 | 51 | private void Move_Exit () 52 | { 53 | Debug.Log ("Exit Move State"); 54 | } 55 | 56 | private void Move_Finally () 57 | { 58 | Debug.Log ("Finally Move State"); 59 | } 60 | 61 | #endregion 62 | 63 | #region Speak State 64 | 65 | private void Speek_Update() 66 | { 67 | char[] word = new char[30]; 68 | 69 | for(int i = 0; i < 30; i++) 70 | { 71 | word[i] = (char)(Random.Range(0, 26) + 'a'); 72 | } 73 | 74 | Debug.Log(new string(word)); 75 | } 76 | 77 | 78 | #endregion 79 | 80 | 81 | 82 | 83 | } -------------------------------------------------------------------------------- /Assets/Test/SMS_NPC_001.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02b9fd5bb64d9e44a88878044247dbf3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Test/SM_NPC_001.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ee8484123b4ba242b6038044ffee99b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 HuDongming 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | } 4 | } 5 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 1024 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 1 23 | m_ClothInterCollisionSettingsToggle: 0 24 | m_ContactPairsMode: 0 25 | m_BroadphaseType: 0 26 | m_WorldBounds: 27 | m_Center: {x: 0, y: 0, z: 0} 28 | m_Extent: {x: 250, y: 250, z: 250} 29 | m_WorldSubdivisions: 8 30 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scenes/SampleScene.unity 10 | guid: 99c9720ab356a0642a771bea13969a05 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_SpritePackerMode: 0 12 | m_SpritePackerPaddingPower: 1 13 | m_EtcTextureCompressorBehavior: 1 14 | m_EtcTextureFastCompressor: 1 15 | m_EtcTextureNormalCompressor: 2 16 | m_EtcTextureBestCompressor: 4 17 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 18 | m_ProjectGenerationRootNamespace: 19 | m_UserGeneratedProjectSuffix: 20 | m_CollabEditorSettings: 21 | inProgressEnabled: 1 22 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: 7 | - type: 8 | m_NativeTypeID: 108 9 | m_ManagedTypePPtr: {fileID: 0} 10 | m_ManagedTypeFallback: 11 | defaultPresets: 12 | - m_Preset: {fileID: 2655988077585873504, guid: c1cf8506f04ef2c4a88b64b6c4202eea, 13 | type: 2} 14 | - type: 15 | m_NativeTypeID: 1020 16 | m_ManagedTypePPtr: {fileID: 0} 17 | m_ManagedTypeFallback: 18 | defaultPresets: 19 | - m_Preset: {fileID: 2655988077585873504, guid: 0cd792cc87e492d43b4e95b205fc5cc6, 20 | type: 2} 21 | - type: 22 | m_NativeTypeID: 1006 23 | m_ManagedTypePPtr: {fileID: 0} 24 | m_ManagedTypeFallback: 25 | defaultPresets: 26 | - m_Preset: {fileID: 2655988077585873504, guid: 7a99f8aa944efe94cb9bd74562b7d5f9, 27 | type: 2} 28 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2018.1.0b12 2 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 4 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 4 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 0 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 4 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 1 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 1 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 4 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 2 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 1 108 | antiAliasing: 2 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 1 112 | billboardsFaceCameraPosition: 1 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 4 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 2 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 40 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 1 136 | antiAliasing: 4 137 | softParticles: 1 138 | softVegetation: 1 139 | realtimeReflectionProbes: 1 140 | billboardsFaceCameraPosition: 1 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 4 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 1 164 | antiAliasing: 4 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 4 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: {} 178 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - PostProcessing 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.0167 7 | Maximum Allowed Timestep: 0.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate 14 | m_Enabled: 0 15 | m_CaptureEditorExceptions: 1 16 | UnityPurchasingSettings: 17 | m_Enabled: 0 18 | m_TestMode: 0 19 | UnityAnalyticsSettings: 20 | m_Enabled: 1 21 | m_InitializeOnStartup: 1 22 | m_TestMode: 0 23 | m_TestEventUrl: 24 | m_TestConfigUrl: 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # StateMachineNodeEditor 2 | A editorable node-base state machine for Unity. 3 | 4 | ## Overview 5 | 6 | ![Overview][1] 7 | 8 | node edit overview 9 | 10 | ![node edit overview][2] 11 | 12 | condition edit overview 13 | 14 | ![condition edit overview][3] 15 | 16 | ## Inspired 17 | 18 | I use the node editor framework from [Node_Editor_Framework](https://github.com/Seneral/Node_Editor_Framework) 19 | 20 | The state machine is inspired by [Unity3d-Finite-State-Machine](https://github.com/thefuntastic/Unity3d-Finite-State-Machine) 21 | 22 | 23 | [1]: http://static.zybuluo.com/HandY/yg4j75oytbs2ohn9exx4glui/%E6%97%A0%E6%A0%87%E9%A2%98.png 24 | [2]: http://static.zybuluo.com/HandY/msquphk441c6flepvbfqrijh/image_1ccifoqojc34cgg1s1foj49rq1s.png 25 | [3]: http://static.zybuluo.com/HandY/st3vdh1q00h74vfl07iqbrzd/image_1ccifrigd1o2k1mpmuap1dkd7vo29.png --------------------------------------------------------------------------------