├── ProjectSettings ├── ProjectVersion.txt ├── ClusterInputManager.asset ├── PresetManager.asset ├── EditorBuildSettings.asset ├── TimeManager.asset ├── VFXManager.asset ├── AudioManager.asset ├── TagManager.asset ├── EditorSettings.asset ├── UnityConnectSettings.asset ├── DynamicsManager.asset ├── NavMeshAreas.asset ├── Physics2DSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset └── QualitySettings.asset ├── Demo ├── 7_sin.png ├── 3_window.png ├── 8_connect.png ├── 2_soundasset.png ├── 6_create_sin.png ├── 4_select_output.png ├── 5_output_master.png ├── 9_SoundGraphPlayer.png └── 1_create_soundgraph.png ├── Assets ├── xNode │ ├── Scripts │ │ ├── Editor │ │ │ ├── Resources │ │ │ │ ├── xnode_dot.png │ │ │ │ ├── xnode_node.png │ │ │ │ ├── xnode_dot_outer.png │ │ │ │ ├── xnode_node_highlight.png │ │ │ │ ├── xnode_node_workfile.psd │ │ │ │ ├── ScriptTemplates │ │ │ │ │ ├── xNode_NodeGraphTemplate.cs.txt │ │ │ │ │ ├── xNode_NodeTemplate.cs.txt.meta │ │ │ │ │ ├── xNode_NodeGraphTemplate.cs.txt.meta │ │ │ │ │ └── xNode_NodeTemplate.cs.txt │ │ │ │ ├── ScriptTemplates.meta │ │ │ │ ├── xnode_node_highlight.png.meta │ │ │ │ ├── xnode_dot.png.meta │ │ │ │ ├── xnode_node.png.meta │ │ │ │ ├── xnode_dot_outer.png.meta │ │ │ │ └── xnode_node_workfile.psd.meta │ │ │ ├── Resources.meta │ │ │ ├── NodeEditorGUI.cs.meta │ │ │ ├── NodeEditor.cs.meta │ │ │ ├── NodeEditorAction.cs.meta │ │ │ ├── NodeEditorWindow.cs.meta │ │ │ ├── NodeGraphEditor.cs.meta │ │ │ ├── NodeEditorGUILayout.cs.meta │ │ │ ├── NodeEditorPreferences.cs.meta │ │ │ ├── NodeEditorReflection.cs.meta │ │ │ ├── NodeEditorResources.cs.meta │ │ │ ├── NodeEditorUtilities.cs.meta │ │ │ ├── NodeEditorAssetModProcessor.cs.meta │ │ │ ├── NodeEditorBase.cs.meta │ │ │ ├── NodeEditorBase.cs │ │ │ ├── NodeEditorAssetModProcessor.cs │ │ │ ├── NodeGraphEditor.cs │ │ │ ├── NodeEditorResources.cs │ │ │ ├── NodeEditor.cs │ │ │ ├── NodeEditorWindow.cs │ │ │ ├── NodeEditorUtilities.cs │ │ │ ├── NodeEditorReflection.cs │ │ │ └── NodeEditorPreferences.cs │ │ ├── Editor.meta │ │ ├── Node.cs.meta │ │ ├── NodeGraph.cs.meta │ │ ├── NodePort.cs.meta │ │ ├── NodeDataCache.cs.meta │ │ ├── NodeGraph.cs │ │ └── NodeDataCache.cs │ ├── LICENSE.md.meta │ ├── README.md.meta │ ├── CONTRIBUTING.md.meta │ ├── Scripts.meta │ ├── CONTRIBUTING.md │ ├── LICENSE.md │ └── README.md ├── xNode.meta ├── SoundGraph.meta └── SoundGraph │ ├── Sample.meta │ ├── Sample │ ├── SoundPlayScene.unity.meta │ ├── 1_Sine.asset.meta │ ├── 4_Noise.asset.meta │ ├── 5_YoiYoi.asset.meta │ ├── 2_Sine_Modulate_Sine.asset.meta │ ├── 3_Sine_Modulate_Random.asset.meta │ ├── 4_Noise.asset │ ├── 1_Sine.asset │ ├── 5_YoiYoi.asset │ ├── SoundPlayScene.unity │ ├── 3_Sine_Modulate_Random.asset │ └── 2_Sine_Modulate_Sine.asset │ ├── Scripts.meta │ └── Scripts │ ├── Node.meta │ ├── Node │ ├── Base.meta │ ├── ESoundWaveform.cs │ ├── Input.meta │ ├── Logic.meta │ ├── Math.meta │ ├── Output.meta │ ├── Generator.meta │ ├── Math │ │ ├── Add.cs.meta │ │ ├── Clamp.cs.meta │ │ ├── Remap.cs.meta │ │ ├── Multiply.cs.meta │ │ ├── Remap.cs │ │ ├── Clamp.cs │ │ ├── Add.cs │ │ └── Multiply.cs │ ├── ESoundWaveform.cs.meta │ ├── Input │ │ ├── Vector.cs.meta │ │ ├── CurveInput.cs.meta │ │ ├── Vector.cs │ │ └── CurveInput.cs │ ├── Base │ │ ├── BaseSoundNode.cs.meta │ │ └── BaseSoundNode.cs │ ├── Generator │ │ ├── NoiseOsc.cs.meta │ │ ├── SineOsc.cs.meta │ │ ├── NoiseOsc.cs │ │ └── SineOsc.cs │ ├── Logic │ │ ├── GreaterThan.cs.meta │ │ └── GreaterThan.cs │ └── Output │ │ ├── OutputMaster.cs.meta │ │ └── OutputMaster.cs │ ├── SoundGraph.cs.meta │ ├── SoundGraphPlayer.cs.meta │ ├── SoundGraph.cs │ └── SoundGraphPlayer.cs ├── .gitignore ├── .vscode └── settings.json ├── Logs └── Packages-Update.log ├── README.md └── Packages └── manifest.json /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2018.3.0f1 2 | -------------------------------------------------------------------------------- /Demo/7_sin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtm/Unity-NodeSynthesizer/HEAD/Demo/7_sin.png -------------------------------------------------------------------------------- /Demo/3_window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtm/Unity-NodeSynthesizer/HEAD/Demo/3_window.png -------------------------------------------------------------------------------- /Demo/8_connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtm/Unity-NodeSynthesizer/HEAD/Demo/8_connect.png -------------------------------------------------------------------------------- /Demo/2_soundasset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtm/Unity-NodeSynthesizer/HEAD/Demo/2_soundasset.png -------------------------------------------------------------------------------- /Demo/6_create_sin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtm/Unity-NodeSynthesizer/HEAD/Demo/6_create_sin.png -------------------------------------------------------------------------------- /Demo/4_select_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtm/Unity-NodeSynthesizer/HEAD/Demo/4_select_output.png -------------------------------------------------------------------------------- /Demo/5_output_master.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtm/Unity-NodeSynthesizer/HEAD/Demo/5_output_master.png -------------------------------------------------------------------------------- /Demo/9_SoundGraphPlayer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtm/Unity-NodeSynthesizer/HEAD/Demo/9_SoundGraphPlayer.png -------------------------------------------------------------------------------- /Demo/1_create_soundgraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtm/Unity-NodeSynthesizer/HEAD/Demo/1_create_soundgraph.png -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/Resources/xnode_dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtm/Unity-NodeSynthesizer/HEAD/Assets/xNode/Scripts/Editor/Resources/xnode_dot.png -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/Resources/xnode_node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtm/Unity-NodeSynthesizer/HEAD/Assets/xNode/Scripts/Editor/Resources/xnode_node.png -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/Resources/xnode_dot_outer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtm/Unity-NodeSynthesizer/HEAD/Assets/xNode/Scripts/Editor/Resources/xnode_dot_outer.png -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/Resources/xnode_node_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtm/Unity-NodeSynthesizer/HEAD/Assets/xNode/Scripts/Editor/Resources/xnode_node_highlight.png -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/Resources/xnode_node_workfile.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rngtm/Unity-NodeSynthesizer/HEAD/Assets/xNode/Scripts/Editor/Resources/xnode_node_workfile.psd -------------------------------------------------------------------------------- /Assets/xNode.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01bd27c4639784b428168ea1e5fa75a6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SoundGraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e945f01c1fe14d40a6f48ea2ea7baaa 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Sample.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25a350fc694c0b1428a4e7fcc0591d26 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Sample/SoundPlayScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9bf4882340b099748ba8df3475db14c6 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /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 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c2ce1db2839fb3409062925cf7804e7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/xNode/LICENSE.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1e66fae7e815eb42884571b2336ce08 3 | timeCreated: 1515241799 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/xNode/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32bbefb0d67624c4e85a1c6be8f01390 3 | timeCreated: 1515241799 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1166f8c738ed62546988ab05e58012e6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/xNode/CONTRIBUTING.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77f948bb5870dee4b8bcd5fdbd4b14d4 3 | timeCreated: 1526246612 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Base.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3044ff45cee1a848b5527d2952bea37 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/ESoundWaveform.cs: -------------------------------------------------------------------------------- 1 | namespace SoundNodeGraph 2 | { 3 | public enum ESoundWaveform 4 | { 5 | Noise, 6 | Sin, 7 | Saw, 8 | Pulse, 9 | Triangle, 10 | } 11 | } -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Input.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c5c5749a5857d54c9314f629e1cbf2c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Logic.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa5cd58193619a3448ebe3e8c2ec1e56 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Math.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c955aaa13bbe90429d5075a72a98776 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Output.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 494bf0f48bddc964eab41658e42c6adc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Generator.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 144d0f3e2505cf14f93bd2ef48fb3f76 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Sample/1_Sine.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f7c3f296ef2f2c14b8fd1e9fd9412dd0 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 657b15cb3ec32a24ca80faebf094d0f4 3 | folderAsset: yes 4 | timeCreated: 1505418321 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Sample/4_Noise.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a08a1efd90b5184aad3e1186af25a29 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Sample/5_YoiYoi.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa364153389d3e64486175a4285daaaa 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94d4fd78d9120634ebe0e8717610c412 3 | folderAsset: yes 4 | timeCreated: 1505418345 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Sample/2_Sine_Modulate_Sine.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4726a528c8cd2a74abb2433d1660cce1 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Sample/3_Sine_Modulate_Random.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e533c69d16748e4abf9621fb8e330f8 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 964fc201163fe884ca6a20094b6f3b49 3 | folderAsset: yes 4 | timeCreated: 1506110871 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/Resources/ScriptTemplates/xNode_NodeGraphTemplate.cs.txt: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using XNode; 5 | 6 | [CreateAssetMenu] 7 | public class #SCRIPTNAME# : NodeGraph { 8 | #NOTRIM# 9 | } -------------------------------------------------------------------------------- /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.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/Resources/ScriptTemplates.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86b677955452bb5449f9f4dd47b6ddfe 3 | folderAsset: yes 4 | timeCreated: 1519049391 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/Resources/ScriptTemplates/xNode_NodeTemplate.cs.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85f6f570600a1a44d8e734cb111a8b89 3 | timeCreated: 1519049802 4 | licenseType: Free 5 | TextScriptImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/Resources/ScriptTemplates/xNode_NodeGraphTemplate.cs.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8165767f64da7d94e925f61a38da668c 3 | timeCreated: 1519049802 4 | licenseType: Free 5 | TextScriptImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/SoundGraph.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a9f797d31a65b4c47b78ca83c1d57bfd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Math/Add.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 110e4f05bb7f78747be55c4e2a3d10fd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Math/Clamp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cee50182abdbcd949a3fe493bbc37786 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Math/Remap.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef81cad4a4c9f094eb942a22ea421ada 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/NodeEditorGUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 756276bfe9a0c2f4da3930ba1964f58d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/ESoundWaveform.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c2676d72eff16148a1f1ad476a5768a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Input/Vector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a99258135f759141b119c9cf35a0f09 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Math/Multiply.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a87f7b54fcf73ea4ea6f33038b8f379e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/SoundGraphPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ab4397a558500245876cd683692de11 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Base/BaseSoundNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f20f5fb2d39646d4791fe501739dd0f6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Generator/NoiseOsc.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bce5cfdf80040d24fbf71a68db022c9b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Generator/SineOsc.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37d9145fe859f3f43b70217bb7b74936 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Input/CurveInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 38bb0d5ada3d3a8428014bd254e0ed41 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Input/Vector.cs: -------------------------------------------------------------------------------- 1 | namespace SoundNodeGraph.Input 2 | { 3 | [System.Serializable] 4 | public class Vector : BaseSoundNode 5 | { 6 | public double Volume = -1; 7 | public override double GetSoundValue(double time) 8 | { 9 | return Volume; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Logic/GreaterThan.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ab773f054107bd46b5f8437404a0d89 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Output/OutputMaster.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2011e4b393323fb468af24f9b71f32e0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Node.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f26231e5ab9368746948d0ea49e8178a 3 | timeCreated: 1505419984 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/xNode/Scripts/NodeGraph.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 093f68ef2455d544fa2d14b80c811322 3 | timeCreated: 1505461376 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/xNode/Scripts/NodePort.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7dd2f76ac25c6f44c9426dff3e7491a3 3 | timeCreated: 1505734054 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/NodeDataCache.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 64ea6af1e195d024d8df0ead1921e517 3 | timeCreated: 1507566823 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/xNode/Scripts/Editor/NodeEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 712c3fc5d9eeb4c45b1e23918df6018f 3 | timeCreated: 1505462176 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/xNode/Scripts/Editor/NodeEditorAction.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa7d4286bf0ad2e4086252f2893d2cf5 3 | timeCreated: 1505426655 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/xNode/Scripts/Editor/NodeEditorWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ce2bf59ec7a25c4ba691cad7819bf38 3 | timeCreated: 1505418450 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/xNode/Scripts/Editor/NodeGraphEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ddcbb5432255d3247a0718b15a9c193c 3 | timeCreated: 1505462176 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/xNode/Scripts/Editor/NodeEditorGUILayout.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d6c2d118d1c77948a23f2f4a34d1f64 3 | timeCreated: 1507966608 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/xNode/Scripts/Editor/NodeEditorPreferences.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b1f47e387a6f714c9f2ff82a6888c85 3 | timeCreated: 1507920216 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/xNode/Scripts/Editor/NodeEditorReflection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c78a0fa4a13abcd408ebe73006b7b1bb 3 | timeCreated: 1505419458 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/xNode/Scripts/Editor/NodeEditorResources.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69f55d341299026489b29443c3dd13d1 3 | timeCreated: 1505418919 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/xNode/Scripts/Editor/NodeEditorUtilities.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 120960fe5b50aba418a8e8ad3c4c4bc8 3 | timeCreated: 1506073499 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/xNode/Scripts/Editor/NodeEditorAssetModProcessor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e515e86efe8160243a68b7c06d730c9c 3 | timeCreated: 1507982232 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/xNode/Scripts/Editor/NodeEditorBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e85122ded59aceb4eb4b1bd9d9202642 3 | timeCreated: 1511353946 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/Resources/ScriptTemplates/xNode_NodeTemplate.cs.txt: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using XNode; 5 | 6 | public class #SCRIPTNAME# : Node { 7 | 8 | // Use this for initialization 9 | protected override void Init() { 10 | base.Init(); 11 | #NOTRIM# 12 | } 13 | 14 | // Return the correct value of an output port when requested 15 | public override object GetValue(NodePort port) { 16 | return null; // Replace this 17 | } 18 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | 6 | # Autogenerated VS/MD solution and project files 7 | *.csproj 8 | *.unityproj 9 | *.sln 10 | *.suo 11 | *.tmp 12 | *.user 13 | *.userprefs 14 | *.pidb 15 | *.booproj 16 | 17 | # Unity3D generated meta files 18 | *.pidb.meta 19 | 20 | # Unity3D Generated File On Crash Reports 21 | sysinfo.txt 22 | BackupUnusedAssets 23 | Assets/AssetFiles 24 | Assets/AssetFiles.meta 25 | 26 | # movie data 27 | *.mp4 28 | 29 | Assets/Projects/Sound/_TEMP/ 30 | Assets/Projects/Sound/_TEMP.meta 31 | .vs/ 32 | 33 | ScreenShot 34 | -------------------------------------------------------------------------------- /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 | - 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 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Base/BaseSoundNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using XNode; 3 | 4 | namespace SoundNodeGraph 5 | { 6 | [System.Serializable] 7 | public abstract class BaseSoundNode : XNode.Node 8 | { 9 | [Output] public BaseSoundNode OutputNode; 10 | 11 | public virtual double GetSoundValue(double time) 12 | { 13 | return -1; 14 | } 15 | 16 | // GetValue should be overridden to return a value for any specified output port 17 | public override object GetValue(XNode.NodePort port) 18 | { 19 | return this; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Input/CurveInput.cs: -------------------------------------------------------------------------------- 1 | namespace SoundNodeGraph.Input 2 | { 3 | [System.Serializable] 4 | public class CurveInput : BaseSoundNode 5 | { 6 | public UnityEngine.AnimationCurve Curve = new UnityEngine.AnimationCurve( 7 | new UnityEngine.Keyframe(0f, 0f), 8 | new UnityEngine.Keyframe(1f, 1f) 9 | ); 10 | 11 | public override double GetSoundValue(double time) 12 | { 13 | float t1 = Curve[0].time; 14 | float t2 = Curve[Curve.length - 1].time; 15 | time -= t1; 16 | time %= t2 - t1; 17 | time += t1; 18 | return Curve.Evaluate((float)time); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Output/OutputMaster.cs: -------------------------------------------------------------------------------- 1 | namespace SoundNodeGraph.Output 2 | { 3 | [System.Serializable] 4 | public class OutputMaster : XNode.Node 5 | { 6 | [Input(connectionType = ConnectionType.Override, backingValue = ShowBackingValue.Never)] 7 | public BaseSoundNode OutputSound; 8 | 9 | protected override void Init() 10 | { 11 | } 12 | 13 | public double GetSoundValue(double time) 14 | { 15 | double result = 0; 16 | 17 | BaseSoundNode node = GetInputValue("OutputSound", null); 18 | if (node != null) 19 | { 20 | result = node.GetSoundValue(time); 21 | } 22 | 23 | return result; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /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: Hidden Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInPlayMode: 1 24 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Math/Remap.cs: -------------------------------------------------------------------------------- 1 | namespace SoundNodeGraph.Math 2 | { 3 | [System.Serializable] 4 | public class Remap : BaseSoundNode 5 | { 6 | [Input(connectionType = ConnectionType.Override, backingValue = ShowBackingValue.Never)] 7 | public BaseSoundNode In; 8 | 9 | public double InMin = -1f; 10 | public double InMax = 1f; 11 | public double OutMin = 0f; 12 | public double OutMax = 1f; 13 | public override double GetSoundValue(double time) 14 | { 15 | BaseSoundNode input = GetInputValue(nameof(In), null); 16 | if (input == null) 17 | { 18 | return 0.0; 19 | } 20 | return (double)((input.GetSoundValue(time) - InMin) * (OutMax - OutMin) / (InMax - InMin) + OutMin); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Generator/NoiseOsc.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SoundNodeGraph.Generator 4 | { 5 | [System.Serializable] 6 | public class NoiseOsc : BaseSoundNode 7 | { 8 | public double Interval = 0.1; 9 | Random _random; 10 | int _interval = 48000 / 4; 11 | int _counter = 0; 12 | double _soundValue = 0.0; 13 | protected override void Init() 14 | { 15 | _random = new Random(); 16 | _soundValue = NoiseValue(); 17 | } 18 | 19 | double NoiseValue() 20 | { 21 | return (double)_random.NextDouble() * 2 - 1; 22 | } 23 | 24 | public override double GetSoundValue(double time) 25 | { 26 | _counter++; 27 | if (_counter / SoundGraphPlayer.fs >= Interval * 2) 28 | { 29 | _soundValue = NoiseValue(); 30 | _counter = 0; 31 | } 32 | return _soundValue; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /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 | serializedVersion: 1 7 | m_Enabled: 1 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 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 | -------------------------------------------------------------------------------- /Assets/xNode/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing to xNode 2 | 💙Thank you for taking the time to contribute💙 3 | 4 | If you haven't already, join our [Discord channel](https://discord.gg/qgPrHv4)! 5 | 6 | ## Pull Requests 7 | Try to keep your pull requests relevant, neat, and manageable. If you are adding multiple features, try splitting them into separate commits. 8 | * Avoid including irellevant whitespace or formatting changes. 9 | * Comment your code. 10 | * Spell check your code / comments 11 | 12 | ## New features 13 | xNode aims to be simple and extendible, not trying to fix all of Unity's shortcomings. 14 | 15 | If your feature aims to cover something not related to editing nodes, it generally won't be accepted. If in doubt, ask on the Discord channel. 16 | 17 | ## Coding conventions 18 | Skim through the code and you'll get the hang of it quickly. 19 | * Methods, Types and properties PascalCase 20 | * Variables camelCase 21 | * Public methods XML commented 22 | * Open braces on same line as condition 23 | * 4 spaces for indentation. 24 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/SoundGraph.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using XNode; 5 | using SoundNodeGraph.Output; 6 | 7 | namespace SoundNodeGraph 8 | { 9 | [CreateAssetMenu] 10 | public class SoundGraph : NodeGraph 11 | { 12 | public double GetSoundValue(double time) 13 | { 14 | double value = 0; 15 | var outputNode = GetOutputNode(); 16 | if (outputNode != null) 17 | { 18 | value = outputNode.GetSoundValue(time); 19 | } 20 | return value; 21 | } 22 | 23 | private OutputMaster GetOutputNode() 24 | { 25 | OutputMaster result = null; 26 | foreach (var node in nodes) 27 | { 28 | result = node as OutputMaster; 29 | if (result != null) 30 | { 31 | break; 32 | } 33 | } 34 | return result; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Math/Clamp.cs: -------------------------------------------------------------------------------- 1 | namespace SoundNodeGraph.Math 2 | { 3 | [System.Serializable] 4 | public class Clamp : BaseSoundNode 5 | { 6 | [Input(connectionType = ConnectionType.Override, backingValue = ShowBackingValue.Never)] 7 | public BaseSoundNode In; 8 | public double InMin = -1f; 9 | public double InMax = 1f; 10 | 11 | public override double GetSoundValue(double time) 12 | { 13 | double inputValue = 0.0; 14 | BaseSoundNode input = GetInputValue(nameof(In), null); 15 | if (input != null) 16 | { 17 | inputValue = input.GetSoundValue(time); 18 | } 19 | if (inputValue < InMin) 20 | { 21 | return InMin; 22 | } 23 | else 24 | if (inputValue > InMax) 25 | { 26 | return InMax; 27 | } 28 | else 29 | { 30 | return inputValue; 31 | } 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Math/Add.cs: -------------------------------------------------------------------------------- 1 | namespace SoundNodeGraph.Math 2 | { 3 | [System.Serializable] 4 | public class Add : BaseSoundNode 5 | { 6 | public double DefaultA = 0.0; 7 | public double DefaultB = 0.0; 8 | [Input(connectionType = ConnectionType.Override, backingValue = ShowBackingValue.Never)] public BaseSoundNode A; 9 | [Input(connectionType = ConnectionType.Override, backingValue = ShowBackingValue.Never)] public BaseSoundNode B; 10 | 11 | public override double GetSoundValue(double time) 12 | { 13 | var inputA = GetInputValue(nameof(A), null); 14 | double a = DefaultA; 15 | if (inputA != null) 16 | { 17 | a = inputA.GetSoundValue(time); 18 | } 19 | 20 | var inputB = GetInputValue(nameof(B), null); 21 | double b = DefaultB; 22 | if (inputB != null) 23 | { 24 | b = inputB.GetSoundValue(time); 25 | } 26 | 27 | return a + b; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Math/Multiply.cs: -------------------------------------------------------------------------------- 1 | namespace SoundNodeGraph.Math 2 | { 3 | [System.Serializable] 4 | public class Multiply : BaseSoundNode 5 | { 6 | public double DefaultA = 1f; 7 | public double DefaultB = 1f; 8 | [Input(connectionType = ConnectionType.Override, backingValue = ShowBackingValue.Never)] public BaseSoundNode A; 9 | [Input(connectionType = ConnectionType.Override, backingValue = ShowBackingValue.Never)] public BaseSoundNode B; 10 | 11 | public override double GetSoundValue(double time) 12 | { 13 | var inputA = GetInputValue(nameof(A), null); 14 | double a = DefaultA; 15 | if (inputA != null) 16 | { 17 | a = inputA.GetSoundValue(time); 18 | } 19 | 20 | var inputB = GetInputValue(nameof(B), null); 21 | double b = DefaultB; 22 | if (inputB != null) 23 | { 24 | b = inputB.GetSoundValue(time); 25 | } 26 | 27 | return a * b; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Assets/xNode/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Thor Brigsted 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 13 | all 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 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Logic/GreaterThan.cs: -------------------------------------------------------------------------------- 1 | namespace SoundNodeGraph.Logic 2 | { 3 | [System.Serializable] 4 | public class GreaterThan : BaseSoundNode 5 | { 6 | public double DefaultA = 1f; 7 | public double DefaultB = 0f; 8 | [Input(connectionType = ConnectionType.Override, backingValue = ShowBackingValue.Never)] public BaseSoundNode A; 9 | [Input(connectionType = ConnectionType.Override, backingValue = ShowBackingValue.Never)] public BaseSoundNode B; 10 | 11 | public override double GetSoundValue(double time) 12 | { 13 | var inputA = GetInputValue(nameof(A), null); 14 | double a = DefaultA; 15 | if (inputA != null) 16 | { 17 | a = inputA.GetSoundValue(time); 18 | } 19 | 20 | var inputB = GetInputValue(nameof(B), null); 21 | double b = DefaultB; 22 | if (inputB != null) 23 | { 24 | b = inputB.GetSoundValue(time); 25 | } 26 | 27 | if (a > b) 28 | { 29 | return 1f; 30 | } 31 | else 32 | { 33 | return 0f; 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /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: 10 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: 0 23 | m_ReuseCollisionCallbacks: 0 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/SoundGraphPlayer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace SoundNodeGraph 6 | { 7 | [RequireComponent(typeof(AudioSource))] 8 | public class SoundGraphPlayer : MonoBehaviour 9 | { 10 | [SerializeField] SoundGraph _graph; 11 | const int maxAudioPos = 48000 * 120; 12 | int audioPos = 0; 13 | public const double fs = 48000; // sample frequency 14 | System.Random rand; 15 | [SerializeField] double previewValue; 16 | 17 | void Start() 18 | { 19 | rand = new System.Random(); 20 | } 21 | 22 | void OnAudioFilterRead(float[] data, int channels) 23 | { 24 | int dst = 0; 25 | while (dst < data.Length) 26 | { 27 | double audioTime = audioPos / fs; 28 | audioPos++; 29 | float sound = (float)_graph.GetSoundValue(audioTime); 30 | for (int i = 0; i < channels; i++) 31 | { 32 | data[dst++] = sound; 33 | } 34 | previewValue = sound; 35 | } 36 | 37 | if (audioPos >= maxAudioPos) 38 | { 39 | audioPos -= maxAudioPos; 40 | } 41 | } 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /.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 | } -------------------------------------------------------------------------------- /Logs/Packages-Update.log: -------------------------------------------------------------------------------- 1 | 2 | === Fri Jan 18 01:13:20 2019 3 | 4 | Packages were changed. 5 | Update Mode: resetToDefaultDependencies 6 | 7 | The following packages were added: 8 | com.unity.analytics@3.2.2 9 | com.unity.purchasing@2.0.3 10 | com.unity.ads@2.3.1 11 | com.unity.textmeshpro@1.3.0 12 | com.unity.package-manager-ui@2.0.3 13 | com.unity.collab-proxy@1.2.15 14 | com.unity.modules.ai@1.0.0 15 | com.unity.modules.animation@1.0.0 16 | com.unity.modules.assetbundle@1.0.0 17 | com.unity.modules.audio@1.0.0 18 | com.unity.modules.cloth@1.0.0 19 | com.unity.modules.director@1.0.0 20 | com.unity.modules.imageconversion@1.0.0 21 | com.unity.modules.imgui@1.0.0 22 | com.unity.modules.jsonserialize@1.0.0 23 | com.unity.modules.particlesystem@1.0.0 24 | com.unity.modules.physics@1.0.0 25 | com.unity.modules.physics2d@1.0.0 26 | com.unity.modules.screencapture@1.0.0 27 | com.unity.modules.terrain@1.0.0 28 | com.unity.modules.terrainphysics@1.0.0 29 | com.unity.modules.tilemap@1.0.0 30 | com.unity.modules.ui@1.0.0 31 | com.unity.modules.uielements@1.0.0 32 | com.unity.modules.umbra@1.0.0 33 | com.unity.modules.unityanalytics@1.0.0 34 | com.unity.modules.unitywebrequest@1.0.0 35 | com.unity.modules.unitywebrequestassetbundle@1.0.0 36 | com.unity.modules.unitywebrequestaudio@1.0.0 37 | com.unity.modules.unitywebrequesttexture@1.0.0 38 | com.unity.modules.unitywebrequestwww@1.0.0 39 | com.unity.modules.vehicles@1.0.0 40 | com.unity.modules.video@1.0.0 41 | com.unity.modules.vr@1.0.0 42 | com.unity.modules.wind@1.0.0 43 | com.unity.modules.xr@1.0.0 44 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Scripts/Node/Generator/SineOsc.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using XNode; 3 | 4 | namespace SoundNodeGraph.Generator 5 | { 6 | /// 7 | /// sine wave oscillator 8 | /// 9 | public class SineOsc : BaseSoundNode 10 | { 11 | public double DefaultAmp = 1; 12 | public double DefaultFreq = 440; 13 | public double DefaultPhase = 0; 14 | 15 | [Input(backingValue = ShowBackingValue.Never, connectionType = ConnectionType.Override)] 16 | public BaseSoundNode AmpNode; 17 | [Input(backingValue = ShowBackingValue.Never, connectionType = ConnectionType.Override)] 18 | public BaseSoundNode FreqNode; 19 | [Input(backingValue = ShowBackingValue.Never, connectionType = ConnectionType.Override)] 20 | public BaseSoundNode PhaseNode; 21 | 22 | public override double GetSoundValue(double time) 23 | { 24 | BaseSoundNode freqInput = GetInputValue(nameof(FreqNode), null); 25 | BaseSoundNode ampInput = GetInputValue(nameof(AmpNode), null); 26 | BaseSoundNode phaseInput = GetInputValue(nameof(PhaseNode), null); 27 | double freq = DefaultFreq; 28 | double amp = DefaultAmp; 29 | double phase = DefaultPhase; 30 | 31 | if (freqInput != null) 32 | freq = freqInput.GetSoundValue(time); 33 | if (ampInput != null) 34 | amp = ampInput.GetSoundValue(time); 35 | if (phaseInput != null) 36 | phase = phaseInput.GetSoundValue(time); 37 | 38 | return System.Math.Sin(2f * System.Math.PI * freq * time + phase) * amp; 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Unity-NodeSynthesizer 2 | Nose-Based Synthesizer on UnityEditor, based on xNode.
3 | 4 | GitHub - Siccity/xNode: Lets you view and edit node graphs inside Unity
5 | https://github.com/Siccity/xNode 6 | 7 | # Unity Version 8 | Unity 2018.3.0f1
9 | 10 | # Usage 11 | ## Create SoundGraph 12 | Right click on Project window,
13 | select **Create/SoundGraph**.
14 | 15 |
16 | 17 | The following is a **SoundGraph** asset.
18 |
19 | 20 | ## Open SoundGraph 21 | To open SoundGraph asset, double click SoundGraph asset.
22 | 23 | Double clicking SoundGraph asset will open xNode Window.
24 |
25 | 26 | ## Create Sound 27 | To create sound, you must create Oscillator and Output Node.
28 | 29 | ### Create OutputNode 30 | Output Master node output sound to speaker.
31 | 32 |
33 | 34 | Right click and *select* **Sound Node Graph > Output > Output Master**
35 | 36 | 37 | ### Create Oscillator Node 38 | **Sine Osc** node generates sine wave.
39 |
40 | 41 | Right click and *select* **Sound Node Graph > Generator > Sine Osc**
42 | 43 |
44 | 45 | ### Output Sound 46 | Connect Sine OSC node and Output Master node.
47 |
48 | 49 | ## PlaySound 50 | Add SoundGraphPlayer component to GameObject.
51 | Assign SoundGraph asset to SoundGraphPlayer.
52 |
53 |
54 | Sound will be played at run time.
55 | 56 | 57 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.3.1", 4 | "com.unity.analytics": "3.2.2", 5 | "com.unity.collab-proxy": "1.2.15", 6 | "com.unity.package-manager-ui": "2.0.3", 7 | "com.unity.purchasing": "2.0.3", 8 | "com.unity.textmeshpro": "1.3.0", 9 | "com.unity.modules.ai": "1.0.0", 10 | "com.unity.modules.animation": "1.0.0", 11 | "com.unity.modules.assetbundle": "1.0.0", 12 | "com.unity.modules.audio": "1.0.0", 13 | "com.unity.modules.cloth": "1.0.0", 14 | "com.unity.modules.director": "1.0.0", 15 | "com.unity.modules.imageconversion": "1.0.0", 16 | "com.unity.modules.imgui": "1.0.0", 17 | "com.unity.modules.jsonserialize": "1.0.0", 18 | "com.unity.modules.particlesystem": "1.0.0", 19 | "com.unity.modules.physics": "1.0.0", 20 | "com.unity.modules.physics2d": "1.0.0", 21 | "com.unity.modules.screencapture": "1.0.0", 22 | "com.unity.modules.terrain": "1.0.0", 23 | "com.unity.modules.terrainphysics": "1.0.0", 24 | "com.unity.modules.tilemap": "1.0.0", 25 | "com.unity.modules.ui": "1.0.0", 26 | "com.unity.modules.uielements": "1.0.0", 27 | "com.unity.modules.umbra": "1.0.0", 28 | "com.unity.modules.unityanalytics": "1.0.0", 29 | "com.unity.modules.unitywebrequest": "1.0.0", 30 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 31 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 32 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 33 | "com.unity.modules.unitywebrequestwww": "1.0.0", 34 | "com.unity.modules.vehicles": "1.0.0", 35 | "com.unity.modules.video": "1.0.0", 36 | "com.unity.modules.vr": "1.0.0", 37 | "com.unity.modules.wind": "1.0.0", 38 | "com.unity.modules.xr": "1.0.0" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /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: 4 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_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 0 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/Resources/xnode_node_highlight.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ab2b92d7e1771b47bba0a46a6f0f6d5 3 | timeCreated: 1516610730 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | externalObjects: {} 8 | serializedVersion: 4 9 | mipmaps: 10 | mipMapMode: 0 11 | enableMipMap: 0 12 | sRGBTexture: 0 13 | linearTexture: 0 14 | fadeOut: 0 15 | borderMipMap: 0 16 | mipMapsPreserveCoverage: 0 17 | alphaTestReferenceValue: 0.5 18 | mipMapFadeDistanceStart: 1 19 | mipMapFadeDistanceEnd: 3 20 | bumpmap: 21 | convertToNormalMap: 0 22 | externalNormalMap: 0 23 | heightScale: 0.25 24 | normalMapFilter: 0 25 | isReadable: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: 1 36 | mipBias: -1 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: -1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 49 | spritePixelsToUnits: 100 50 | alphaUsage: 1 51 | alphaIsTransparency: 1 52 | spriteTessellationDetail: -1 53 | textureType: 2 54 | textureShape: 1 55 | maxTextureSizeSet: 0 56 | compressionQualitySet: 0 57 | textureFormatSet: 0 58 | platformSettings: 59 | - buildTarget: DefaultTexturePlatform 60 | maxTextureSize: 2048 61 | resizeAlgorithm: 0 62 | textureFormat: -1 63 | textureCompression: 1 64 | compressionQuality: 50 65 | crunchedCompression: 0 66 | allowsAlphaSplitting: 0 67 | overridden: 0 68 | androidETC2FallbackOverride: 0 69 | - buildTarget: Standalone 70 | maxTextureSize: 2048 71 | resizeAlgorithm: 0 72 | textureFormat: -1 73 | textureCompression: 1 74 | compressionQuality: 50 75 | crunchedCompression: 0 76 | allowsAlphaSplitting: 0 77 | overridden: 0 78 | androidETC2FallbackOverride: 0 79 | spriteSheet: 80 | serializedVersion: 2 81 | sprites: [] 82 | outline: [] 83 | physicsShape: [] 84 | spritePackingTag: 85 | userData: 86 | assetBundleName: 87 | assetBundleVariant: 88 | -------------------------------------------------------------------------------- /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 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 39 | m_PreloadedShaders: [] 40 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 41 | type: 0} 42 | m_CustomRenderPipeline: {fileID: 0} 43 | m_TransparencySortMode: 0 44 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 45 | m_DefaultRenderingPath: 1 46 | m_DefaultMobileRenderingPath: 1 47 | m_TierSettings: [] 48 | m_LightmapStripping: 0 49 | m_FogStripping: 0 50 | m_InstancingStripping: 0 51 | m_LightmapKeepPlain: 1 52 | m_LightmapKeepDirCombined: 1 53 | m_LightmapKeepDynamicPlain: 1 54 | m_LightmapKeepDynamicDirCombined: 1 55 | m_LightmapKeepShadowMask: 1 56 | m_LightmapKeepSubtractive: 1 57 | m_FogKeepLinear: 1 58 | m_FogKeepExp: 1 59 | m_FogKeepExp2: 1 60 | m_AlbedoSwatchInfos: [] 61 | m_LightsUseLinearIntensity: 0 62 | m_LightsUseColorTemperature: 0 63 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/NodeEditorBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Reflection; 5 | using UnityEditor; 6 | using UnityEngine; 7 | 8 | namespace XNodeEditor.Internal { 9 | /// Handles caching of custom editor classes and their target types. Accessible with GetEditor(Type type) 10 | public class NodeEditorBase where A : Attribute, NodeEditorBase.INodeEditorAttrib where T : NodeEditorBase where K : ScriptableObject { 11 | /// Custom editors defined with [CustomNodeEditor] 12 | private static Dictionary editorTypes; 13 | private static Dictionary editors = new Dictionary(); 14 | public K target; 15 | public SerializedObject serializedObject; 16 | 17 | public static T GetEditor(K target) { 18 | if (target == null) return null; 19 | T editor; 20 | if (!editors.TryGetValue(target, out editor)) { 21 | Type type = target.GetType(); 22 | Type editorType = GetEditorType(type); 23 | editor = Activator.CreateInstance(editorType) as T; 24 | editor.target = target; 25 | editor.serializedObject = new SerializedObject(target); 26 | editors.Add(target, editor); 27 | } 28 | if (editor.target == null) editor.target = target; 29 | if (editor.serializedObject == null) editor.serializedObject = new SerializedObject(target); 30 | return editor; 31 | } 32 | 33 | private static Type GetEditorType(Type type) { 34 | if (type == null) return null; 35 | if (editorTypes == null) CacheCustomEditors(); 36 | Type result; 37 | if (editorTypes.TryGetValue(type, out result)) return result; 38 | //If type isn't found, try base type 39 | return GetEditorType(type.BaseType); 40 | } 41 | 42 | private static void CacheCustomEditors() { 43 | editorTypes = new Dictionary(); 44 | 45 | //Get all classes deriving from NodeEditor via reflection 46 | Type[] nodeEditors = XNodeEditor.NodeEditorWindow.GetDerivedTypes(typeof(T)); 47 | for (int i = 0; i < nodeEditors.Length; i++) { 48 | if (nodeEditors[i].IsAbstract) continue; 49 | var attribs = nodeEditors[i].GetCustomAttributes(typeof(A), false); 50 | if (attribs == null || attribs.Length == 0) continue; 51 | A attrib = attribs[0] as A; 52 | editorTypes.Add(attrib.GetInspectedType(), nodeEditors[i]); 53 | } 54 | } 55 | 56 | public interface INodeEditorAttrib { 57 | Type GetInspectedType(); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /Assets/SoundGraph/Sample/4_Noise.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: a9f797d31a65b4c47b78ca83c1d57bfd, type: 3} 13 | m_Name: 4_Noise 14 | m_EditorClassIdentifier: 15 | nodes: 16 | - {fileID: 114099731895078562} 17 | - {fileID: 114194253743225382} 18 | --- !u!114 &114099731895078562 19 | MonoBehaviour: 20 | m_ObjectHideFlags: 0 21 | m_CorrespondingSourceObject: {fileID: 0} 22 | m_PrefabInstance: {fileID: 0} 23 | m_PrefabAsset: {fileID: 0} 24 | m_GameObject: {fileID: 0} 25 | m_Enabled: 1 26 | m_EditorHideFlags: 0 27 | m_Script: {fileID: 11500000, guid: 2011e4b393323fb468af24f9b71f32e0, type: 3} 28 | m_Name: Output Master 29 | m_EditorClassIdentifier: 30 | graph: {fileID: 11400000} 31 | position: {x: -136, y: -72} 32 | ports: 33 | keys: 34 | - OutputSound 35 | values: 36 | - _fieldName: OutputSound 37 | _node: {fileID: 114099731895078562} 38 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 39 | Culture=neutral, PublicKeyToken=null 40 | connections: 41 | - fieldName: OutputNode 42 | node: {fileID: 114194253743225382} 43 | reroutePoints: [] 44 | _direction: 0 45 | _connectionType: 1 46 | _dynamic: 0 47 | OutputSound: {fileID: 0} 48 | --- !u!114 &114194253743225382 49 | MonoBehaviour: 50 | m_ObjectHideFlags: 0 51 | m_CorrespondingSourceObject: {fileID: 0} 52 | m_PrefabInstance: {fileID: 0} 53 | m_PrefabAsset: {fileID: 0} 54 | m_GameObject: {fileID: 0} 55 | m_Enabled: 1 56 | m_EditorHideFlags: 0 57 | m_Script: {fileID: 11500000, guid: bce5cfdf80040d24fbf71a68db022c9b, type: 3} 58 | m_Name: Noise Osc 59 | m_EditorClassIdentifier: 60 | graph: {fileID: 11400000} 61 | position: {x: -392, y: -40} 62 | ports: 63 | keys: 64 | - OutputNode 65 | values: 66 | - _fieldName: OutputNode 67 | _node: {fileID: 114194253743225382} 68 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 69 | Culture=neutral, PublicKeyToken=null 70 | connections: 71 | - fieldName: OutputSound 72 | node: {fileID: 114099731895078562} 73 | reroutePoints: [] 74 | _direction: 1 75 | _connectionType: 0 76 | _dynamic: 0 77 | OutputNode: {fileID: 0} 78 | Interval: 0.03 79 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/Resources/xnode_dot.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75a1fe0b102226a418486ed823c9a7fb 3 | timeCreated: 1506110357 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 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: 1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | serializedVersion: 2 33 | filterMode: -1 34 | aniso: 1 35 | mipBias: -1 36 | wrapU: 1 37 | wrapV: -1 38 | wrapW: -1 39 | nPOTScale: 0 40 | lightmap: 0 41 | compressionQuality: 50 42 | spriteMode: 0 43 | spriteExtrude: 1 44 | spriteMeshType: 1 45 | alignment: 0 46 | spritePivot: {x: 0.5, y: 0.5} 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spritePixelsToUnits: 100 49 | alphaUsage: 1 50 | alphaIsTransparency: 1 51 | spriteTessellationDetail: -1 52 | textureType: 2 53 | textureShape: 1 54 | maxTextureSizeSet: 0 55 | compressionQualitySet: 0 56 | textureFormatSet: 0 57 | platformSettings: 58 | - buildTarget: DefaultTexturePlatform 59 | maxTextureSize: 2048 60 | textureFormat: -1 61 | textureCompression: 1 62 | compressionQuality: 50 63 | crunchedCompression: 0 64 | allowsAlphaSplitting: 0 65 | overridden: 0 66 | - buildTarget: Standalone 67 | maxTextureSize: 2048 68 | textureFormat: -1 69 | textureCompression: 1 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | - buildTarget: Android 75 | maxTextureSize: 2048 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | - buildTarget: WebGL 83 | maxTextureSize: 2048 84 | textureFormat: -1 85 | textureCompression: 1 86 | compressionQuality: 50 87 | crunchedCompression: 0 88 | allowsAlphaSplitting: 0 89 | overridden: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | spritePackingTag: 96 | userData: 97 | assetBundleName: 98 | assetBundleVariant: 99 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/Resources/xnode_node.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2fea1dcb24935ef4ca514d534eb6aa3d 3 | timeCreated: 1507454532 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 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: 1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | serializedVersion: 2 33 | filterMode: -1 34 | aniso: 1 35 | mipBias: -1 36 | wrapU: 1 37 | wrapV: 1 38 | wrapW: 1 39 | nPOTScale: 0 40 | lightmap: 0 41 | compressionQuality: 50 42 | spriteMode: 0 43 | spriteExtrude: 1 44 | spriteMeshType: 1 45 | alignment: 0 46 | spritePivot: {x: 0.5, y: 0.5} 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spritePixelsToUnits: 100 49 | alphaUsage: 1 50 | alphaIsTransparency: 1 51 | spriteTessellationDetail: -1 52 | textureType: 2 53 | textureShape: 1 54 | maxTextureSizeSet: 0 55 | compressionQualitySet: 0 56 | textureFormatSet: 0 57 | platformSettings: 58 | - buildTarget: DefaultTexturePlatform 59 | maxTextureSize: 2048 60 | textureFormat: -1 61 | textureCompression: 1 62 | compressionQuality: 50 63 | crunchedCompression: 0 64 | allowsAlphaSplitting: 0 65 | overridden: 0 66 | - buildTarget: Standalone 67 | maxTextureSize: 2048 68 | textureFormat: -1 69 | textureCompression: 1 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | - buildTarget: Android 75 | maxTextureSize: 2048 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | - buildTarget: WebGL 83 | maxTextureSize: 2048 84 | textureFormat: -1 85 | textureCompression: 1 86 | compressionQuality: 50 87 | crunchedCompression: 0 88 | allowsAlphaSplitting: 0 89 | overridden: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | spritePackingTag: 96 | userData: 97 | assetBundleName: 98 | assetBundleVariant: 99 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/Resources/xnode_dot_outer.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 434ca8b4bdfa5574abb0002bbc9b65ad 3 | timeCreated: 1506110357 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 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: 1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | serializedVersion: 2 33 | filterMode: -1 34 | aniso: 1 35 | mipBias: -1 36 | wrapU: 1 37 | wrapV: -1 38 | wrapW: -1 39 | nPOTScale: 0 40 | lightmap: 0 41 | compressionQuality: 50 42 | spriteMode: 0 43 | spriteExtrude: 1 44 | spriteMeshType: 1 45 | alignment: 0 46 | spritePivot: {x: 0.5, y: 0.5} 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spritePixelsToUnits: 100 49 | alphaUsage: 1 50 | alphaIsTransparency: 1 51 | spriteTessellationDetail: -1 52 | textureType: 2 53 | textureShape: 1 54 | maxTextureSizeSet: 0 55 | compressionQualitySet: 0 56 | textureFormatSet: 0 57 | platformSettings: 58 | - buildTarget: DefaultTexturePlatform 59 | maxTextureSize: 2048 60 | textureFormat: -1 61 | textureCompression: 1 62 | compressionQuality: 50 63 | crunchedCompression: 0 64 | allowsAlphaSplitting: 0 65 | overridden: 0 66 | - buildTarget: Standalone 67 | maxTextureSize: 2048 68 | textureFormat: -1 69 | textureCompression: 1 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | - buildTarget: Android 75 | maxTextureSize: 2048 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | - buildTarget: WebGL 83 | maxTextureSize: 2048 84 | textureFormat: -1 85 | textureCompression: 1 86 | compressionQuality: 50 87 | crunchedCompression: 0 88 | allowsAlphaSplitting: 0 89 | overridden: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | spritePackingTag: 96 | userData: 97 | assetBundleName: 98 | assetBundleVariant: 99 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/Resources/xnode_node_workfile.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2267efa6e1e349348ae0b28fb659a6e2 3 | timeCreated: 1507454532 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 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: 1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | serializedVersion: 2 33 | filterMode: -1 34 | aniso: 1 35 | mipBias: -1 36 | wrapU: 1 37 | wrapV: -1 38 | wrapW: -1 39 | nPOTScale: 0 40 | lightmap: 0 41 | compressionQuality: 50 42 | spriteMode: 0 43 | spriteExtrude: 1 44 | spriteMeshType: 1 45 | alignment: 0 46 | spritePivot: {x: 0.5, y: 0.5} 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spritePixelsToUnits: 100 49 | alphaUsage: 1 50 | alphaIsTransparency: 1 51 | spriteTessellationDetail: -1 52 | textureType: 2 53 | textureShape: 1 54 | maxTextureSizeSet: 0 55 | compressionQualitySet: 0 56 | textureFormatSet: 0 57 | platformSettings: 58 | - buildTarget: DefaultTexturePlatform 59 | maxTextureSize: 2048 60 | textureFormat: -1 61 | textureCompression: 1 62 | compressionQuality: 50 63 | crunchedCompression: 0 64 | allowsAlphaSplitting: 0 65 | overridden: 0 66 | - buildTarget: Standalone 67 | maxTextureSize: 2048 68 | textureFormat: -1 69 | textureCompression: 1 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | - buildTarget: Android 75 | maxTextureSize: 2048 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | - buildTarget: WebGL 83 | maxTextureSize: 2048 84 | textureFormat: -1 85 | textureCompression: 1 86 | compressionQuality: 50 87 | crunchedCompression: 0 88 | allowsAlphaSplitting: 0 89 | overridden: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | spritePackingTag: 96 | userData: 97 | assetBundleName: 98 | assetBundleVariant: 99 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/NodeGraph.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace XNode { 6 | /// Base class for all node graphs 7 | [Serializable] 8 | public abstract class NodeGraph : ScriptableObject { 9 | 10 | /// All nodes in the graph. 11 | /// See: 12 | [SerializeField] public List nodes = new List(); 13 | 14 | /// Add a node to the graph by type 15 | public T AddNode() where T : Node { 16 | return AddNode(typeof(T)) as T; 17 | } 18 | 19 | /// Add a node to the graph by type 20 | public virtual Node AddNode(Type type) { 21 | Node node = ScriptableObject.CreateInstance(type) as Node; 22 | nodes.Add(node); 23 | node.graph = this; 24 | return node; 25 | } 26 | 27 | /// Creates a copy of the original node in the graph 28 | public virtual Node CopyNode(Node original) { 29 | Node node = ScriptableObject.Instantiate(original); 30 | node.ClearConnections(); 31 | nodes.Add(node); 32 | node.graph = this; 33 | return node; 34 | } 35 | 36 | /// Safely remove a node and all its connections 37 | /// The node to remove 38 | public void RemoveNode(Node node) { 39 | node.ClearConnections(); 40 | nodes.Remove(node); 41 | if (Application.isPlaying) Destroy(node); 42 | } 43 | 44 | /// Remove all nodes and connections from the graph 45 | public void Clear() { 46 | if (Application.isPlaying) { 47 | for (int i = 0; i < nodes.Count; i++) { 48 | Destroy(nodes[i]); 49 | } 50 | } 51 | nodes.Clear(); 52 | } 53 | 54 | /// Create a new deep copy of this graph 55 | public XNode.NodeGraph Copy() { 56 | // Instantiate a new nodegraph instance 57 | NodeGraph graph = Instantiate(this); 58 | // Instantiate all nodes inside the graph 59 | for (int i = 0; i < nodes.Count; i++) { 60 | if (nodes[i] == null) continue; 61 | Node node = Instantiate(nodes[i]) as Node; 62 | node.graph = graph; 63 | graph.nodes[i] = node; 64 | } 65 | 66 | // Redirect all connections 67 | for (int i = 0; i < graph.nodes.Count; i++) { 68 | if (graph.nodes[i] == null) continue; 69 | foreach (NodePort port in graph.nodes[i].Ports) { 70 | port.Redirect(nodes, graph.nodes); 71 | } 72 | } 73 | 74 | return graph; 75 | } 76 | 77 | private void OnDestroy() { 78 | // Remove all nodes prior to graph destruction 79 | Clear(); 80 | } 81 | } 82 | } -------------------------------------------------------------------------------- /Assets/SoundGraph/Sample/1_Sine.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: a9f797d31a65b4c47b78ca83c1d57bfd, type: 3} 13 | m_Name: 1_Sine 14 | m_EditorClassIdentifier: 15 | nodes: 16 | - {fileID: 114099731895078562} 17 | - {fileID: 114453496444914630} 18 | --- !u!114 &114099731895078562 19 | MonoBehaviour: 20 | m_ObjectHideFlags: 0 21 | m_CorrespondingSourceObject: {fileID: 0} 22 | m_PrefabInstance: {fileID: 0} 23 | m_PrefabAsset: {fileID: 0} 24 | m_GameObject: {fileID: 0} 25 | m_Enabled: 1 26 | m_EditorHideFlags: 0 27 | m_Script: {fileID: 11500000, guid: 2011e4b393323fb468af24f9b71f32e0, type: 3} 28 | m_Name: Output Master 29 | m_EditorClassIdentifier: 30 | graph: {fileID: 11400000} 31 | position: {x: -136, y: -72} 32 | ports: 33 | keys: 34 | - OutputSound 35 | values: 36 | - _fieldName: OutputSound 37 | _node: {fileID: 114099731895078562} 38 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 39 | Culture=neutral, PublicKeyToken=null 40 | connections: 41 | - fieldName: OutputNode 42 | node: {fileID: 114453496444914630} 43 | reroutePoints: [] 44 | _direction: 0 45 | _connectionType: 1 46 | _dynamic: 0 47 | OutputSound: {fileID: 0} 48 | --- !u!114 &114453496444914630 49 | MonoBehaviour: 50 | m_ObjectHideFlags: 0 51 | m_CorrespondingSourceObject: {fileID: 0} 52 | m_PrefabInstance: {fileID: 0} 53 | m_PrefabAsset: {fileID: 0} 54 | m_GameObject: {fileID: 0} 55 | m_Enabled: 1 56 | m_EditorHideFlags: 0 57 | m_Script: {fileID: 11500000, guid: 37d9145fe859f3f43b70217bb7b74936, type: 3} 58 | m_Name: Sine Osc 59 | m_EditorClassIdentifier: 60 | graph: {fileID: 11400000} 61 | position: {x: -392, y: -56} 62 | ports: 63 | keys: 64 | - AmpNode 65 | - FreqNode 66 | - OutputNode 67 | values: 68 | - _fieldName: AmpNode 69 | _node: {fileID: 114453496444914630} 70 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 71 | Culture=neutral, PublicKeyToken=null 72 | connections: [] 73 | _direction: 0 74 | _connectionType: 1 75 | _dynamic: 0 76 | - _fieldName: FreqNode 77 | _node: {fileID: 114453496444914630} 78 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 79 | Culture=neutral, PublicKeyToken=null 80 | connections: [] 81 | _direction: 0 82 | _connectionType: 1 83 | _dynamic: 0 84 | - _fieldName: OutputNode 85 | _node: {fileID: 114453496444914630} 86 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 87 | Culture=neutral, PublicKeyToken=null 88 | connections: 89 | - fieldName: OutputSound 90 | node: {fileID: 114099731895078562} 91 | reroutePoints: [] 92 | _direction: 1 93 | _connectionType: 0 94 | _dynamic: 0 95 | OutputNode: {fileID: 0} 96 | DefaultAmp: 1 97 | DefaultFreq: 440 98 | AmpNode: {fileID: 0} 99 | FreqNode: {fileID: 0} 100 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/NodeEditorAssetModProcessor.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace XNodeEditor { 5 | /// Deals with modified assets 6 | class NodeEditorAssetModProcessor : UnityEditor.AssetModificationProcessor { 7 | 8 | /// Automatically delete Node sub-assets before deleting their script. 9 | /// This is important to do, because you can't delete null sub assets. 10 | private static AssetDeleteResult OnWillDeleteAsset (string path, RemoveAssetOptions options) { 11 | // Get the object that is requested for deletion 12 | UnityEngine.Object obj = AssetDatabase.LoadAssetAtPath (path); 13 | 14 | // If we aren't deleting a script, return 15 | if (!(obj is UnityEditor.MonoScript)) return AssetDeleteResult.DidNotDelete; 16 | 17 | // Check script type. Return if deleting a non-node script 18 | UnityEditor.MonoScript script = obj as UnityEditor.MonoScript; 19 | System.Type scriptType = script.GetClass (); 20 | if (scriptType == null || (scriptType != typeof (XNode.Node) && !scriptType.IsSubclassOf (typeof (XNode.Node)))) return AssetDeleteResult.DidNotDelete; 21 | 22 | // Find all ScriptableObjects using this script 23 | string[] guids = AssetDatabase.FindAssets ("t:" + scriptType); 24 | for (int i = 0; i < guids.Length; i++) { 25 | string assetpath = AssetDatabase.GUIDToAssetPath (guids[i]); 26 | Object[] objs = AssetDatabase.LoadAllAssetRepresentationsAtPath (assetpath); 27 | for (int k = 0; k < objs.Length; k++) { 28 | XNode.Node node = objs[k] as XNode.Node; 29 | if (node.GetType () == scriptType) { 30 | if (node != null && node.graph != null) { 31 | // Delete the node and notify the user 32 | Debug.LogWarning (node.name + " of " + node.graph + " depended on deleted script and has been removed automatically.", node.graph); 33 | node.graph.RemoveNode (node); 34 | } 35 | } 36 | } 37 | } 38 | // We didn't actually delete the script. Tell the internal system to carry on with normal deletion procedure 39 | return AssetDeleteResult.DidNotDelete; 40 | } 41 | 42 | /// Automatically re-add loose node assets to the Graph node list 43 | [InitializeOnLoadMethod] 44 | private static void OnReloadEditor () { 45 | // Find all NodeGraph assets 46 | string[] guids = AssetDatabase.FindAssets ("t:" + typeof (XNode.NodeGraph)); 47 | for (int i = 0; i < guids.Length; i++) { 48 | string assetpath = AssetDatabase.GUIDToAssetPath (guids[i]); 49 | XNode.NodeGraph graph = AssetDatabase.LoadAssetAtPath (assetpath, typeof (XNode.NodeGraph)) as XNode.NodeGraph; 50 | graph.nodes.RemoveAll(x => x == null); //Remove null items 51 | Object[] objs = AssetDatabase.LoadAllAssetRepresentationsAtPath (assetpath); 52 | // Ensure that all sub node assets are present in the graph node list 53 | for (int u = 0; u < objs.Length; u++) { 54 | if (!graph.nodes.Contains (objs[u] as XNode.Node)) graph.nodes.Add(objs[u] as XNode.Node); 55 | } 56 | } 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/NodeGraphEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEditor; 5 | using UnityEngine; 6 | 7 | namespace XNodeEditor { 8 | /// Base class to derive custom Node Graph editors from. Use this to override how graphs are drawn in the editor. 9 | [CustomNodeGraphEditor(typeof(XNode.NodeGraph))] 10 | public class NodeGraphEditor : XNodeEditor.Internal.NodeEditorBase { 11 | /// The position of the window in screen space. 12 | public Rect position; 13 | /// Are we currently renaming a node? 14 | protected bool isRenaming; 15 | 16 | public virtual void OnGUI() { } 17 | 18 | public virtual Texture2D GetGridTexture() { 19 | return NodeEditorPreferences.GetSettings().gridTexture; 20 | } 21 | 22 | public virtual Texture2D GetSecondaryGridTexture() { 23 | return NodeEditorPreferences.GetSettings().crossTexture; 24 | } 25 | 26 | /// Return default settings for this graph type. This is the settings the user will load if no previous settings have been saved. 27 | public virtual NodeEditorPreferences.Settings GetDefaultPreferences() { 28 | return new NodeEditorPreferences.Settings(); 29 | } 30 | 31 | /// Returns context node menu path. Null or empty strings for hidden nodes. 32 | public virtual string GetNodeMenuName(Type type) { 33 | //Check if type has the CreateNodeMenuAttribute 34 | XNode.Node.CreateNodeMenuAttribute attrib; 35 | if (NodeEditorUtilities.GetAttrib(type, out attrib)) // Return custom path 36 | return attrib.menuName; 37 | else // Return generated path 38 | return ObjectNames.NicifyVariableName(type.ToString().Replace('.', '/')); 39 | } 40 | 41 | public virtual Color GetTypeColor(Type type) { 42 | return NodeEditorPreferences.GetTypeColor(type); 43 | } 44 | 45 | /// Creates a copy of the original node in the graph 46 | public XNode.Node CopyNode(XNode.Node original) { 47 | XNode.Node node = target.CopyNode(original); 48 | node.name = original.name; 49 | AssetDatabase.AddObjectToAsset(node, target); 50 | if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets(); 51 | return node; 52 | } 53 | 54 | /// Safely remove a node and all its connections. 55 | public void RemoveNode(XNode.Node node) { 56 | UnityEngine.Object.DestroyImmediate(node, true); 57 | target.RemoveNode(node); 58 | if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets(); 59 | } 60 | 61 | [AttributeUsage(AttributeTargets.Class)] 62 | public class CustomNodeGraphEditorAttribute : Attribute, 63 | XNodeEditor.Internal.NodeEditorBase.INodeEditorAttrib { 64 | private Type inspectedType; 65 | public string editorPrefsKey; 66 | /// Tells a NodeGraphEditor which Graph type it is an editor for 67 | /// Type that this editor can edit 68 | /// Define unique key for unique layout settings instance 69 | public CustomNodeGraphEditorAttribute(Type inspectedType, string editorPrefsKey = "xNode.Settings") { 70 | this.inspectedType = inspectedType; 71 | this.editorPrefsKey = editorPrefsKey; 72 | } 73 | 74 | public Type GetInspectedType() { 75 | return inspectedType; 76 | } 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /Assets/xNode/README.md: -------------------------------------------------------------------------------- 1 | ![alt text](https://user-images.githubusercontent.com/37786733/41541140-71602302-731a-11e8-9434-79b3a57292b6.png) 2 | 3 | [![Discord](https://img.shields.io/discord/361769369404964864.svg)](https://discord.gg/qgPrHv4) 4 | [![GitHub issues](https://img.shields.io/github/issues/Siccity/xNode.svg)](https://github.com/Siccity/xNode/issues) 5 | [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/Siccity/xNode/master/LICENSE.md) 6 | [![GitHub Wiki](https://img.shields.io/badge/wiki-available-brightgreen.svg)](https://github.com/Siccity/xNode/wiki) 7 | 8 | [Downloads](https://github.com/Siccity/xNode/releases) / [Asset Store](http://u3d.as/108S) / [Documentation](https://github.com/Siccity/xNode/wiki) 9 | 10 | [Support Me on Ko-fi](https://ko-fi.com/Z8Z5DYWA) 11 | 12 | ### xNode 13 | Thinking of developing a node-based plugin? Then this is for you. You can download it as an archive and unpack to a new unity project, or connect it as git submodule. 14 | 15 | xNode is super userfriendly, intuitive and will help you reap the benefits of node graphs in no time. 16 | With a minimal footprint, it is ideal as a base for custom state machines, dialogue systems, decision makers etc. 17 | 18 | ![editor](https://user-images.githubusercontent.com/6402525/33150712-01d60602-cfd5-11e7-83b4-eb008fd9d711.png) 19 | 20 | ### Key features 21 | * Lightweight in runtime 22 | * Very little boilerplate code 23 | * Strong separation of editor and runtime code 24 | * No runtime reflection (unless you need to edit/build node graphs at runtime. In this case, all reflection is cached.) 25 | * Does not rely on any 3rd party plugins 26 | * Custom node inspector code is very similar to regular custom inspector code 27 | 28 | ### Wiki 29 | * [Getting started](https://github.com/Siccity/xNode/wiki/Getting%20Started) - create your very first node node and graph 30 | * [Examples branch](https://github.com/Siccity/xNode/tree/examples) - look at other small projects 31 | 32 | ### Node example: 33 | ```csharp 34 | // public classes deriving from Node are registered as nodes for use within a graph 35 | public class MathNode : Node { 36 | // Adding [Input] or [Output] is all you need to do to register a field as a valid port on your node 37 | [Input] public float a; 38 | [Input] public float b; 39 | // The value of an output node field is not used for anything, but could be used for caching output results 40 | [Output] public float result; 41 | [Output] public float sum; 42 | 43 | // The value of 'mathType' will be displayed on the node in an editable format, similar to the inspector 44 | public MathType mathType = MathType.Add; 45 | public enum MathType { Add, Subtract, Multiply, Divide} 46 | 47 | // GetValue should be overridden to return a value for any specified output port 48 | public override object GetValue(NodePort port) { 49 | 50 | // Get new a and b values from input connections. Fallback to field values if input is not connected 51 | float a = GetInputValue("a", this.a); 52 | float b = GetInputValue("b", this.b); 53 | 54 | // After you've gotten your input values, you can perform your calculations and return a value 55 | if (port.fieldName == "result") 56 | switch(mathType) { 57 | case MathType.Add: default: return a + b; 58 | case MathType.Subtract: return a - b; 59 | case MathType.Multiply: return a * b; 60 | case MathType.Divide: return a / b; 61 | } 62 | else if (port.fieldName == "sum") return a + b; 63 | else return 0f; 64 | } 65 | } 66 | ``` 67 | 68 | Join the [Discord](https://discord.gg/qgPrHv4 "Join Discord server") server to leave feedback or get support. 69 | Feel free to also leave suggestions/requests in the [issues](https://github.com/Siccity/xNode/issues "Go to Issues") page. 70 | 71 | Projects using xNode: 72 | * [Graphmesh](https://github.com/Siccity/Graphmesh "Go to github page") 73 | * [Dialogue](https://github.com/Siccity/Dialogue "Go to github page") 74 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/NodeEditorResources.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace XNodeEditor { 5 | public static class NodeEditorResources { 6 | // Textures 7 | public static Texture2D dot { get { return _dot != null ? _dot : _dot = Resources.Load("xnode_dot"); } } 8 | private static Texture2D _dot; 9 | public static Texture2D dotOuter { get { return _dotOuter != null ? _dotOuter : _dotOuter = Resources.Load("xnode_dot_outer"); } } 10 | private static Texture2D _dotOuter; 11 | public static Texture2D nodeBody { get { return _nodeBody != null ? _nodeBody : _nodeBody = Resources.Load("xnode_node"); } } 12 | private static Texture2D _nodeBody; 13 | public static Texture2D nodeHighlight { get { return _nodeHighlight != null ? _nodeHighlight : _nodeHighlight = Resources.Load("xnode_node_highlight"); } } 14 | private static Texture2D _nodeHighlight; 15 | 16 | // Styles 17 | public static Styles styles { get { return _styles != null ? _styles : _styles = new Styles(); } } 18 | public static Styles _styles = null; 19 | public static GUIStyle OutputPort { get { return new GUIStyle(EditorStyles.label) { alignment = TextAnchor.UpperRight }; } } 20 | public class Styles { 21 | public GUIStyle inputPort, nodeHeader, nodeBody, tooltip, nodeHighlight; 22 | 23 | public Styles() { 24 | GUIStyle baseStyle = new GUIStyle("Label"); 25 | baseStyle.fixedHeight = 18; 26 | 27 | inputPort = new GUIStyle(baseStyle); 28 | inputPort.alignment = TextAnchor.UpperLeft; 29 | inputPort.padding.left = 10; 30 | 31 | nodeHeader = new GUIStyle(); 32 | nodeHeader.alignment = TextAnchor.MiddleCenter; 33 | nodeHeader.fontStyle = FontStyle.Bold; 34 | nodeHeader.normal.textColor = Color.white; 35 | 36 | nodeBody = new GUIStyle(); 37 | nodeBody.normal.background = NodeEditorResources.nodeBody; 38 | nodeBody.border = new RectOffset(32, 32, 32, 32); 39 | nodeBody.padding = new RectOffset(16, 16, 4, 16); 40 | 41 | nodeHighlight = new GUIStyle(); 42 | nodeHighlight.normal.background = NodeEditorResources.nodeHighlight; 43 | nodeHighlight.border = new RectOffset(32, 32, 32, 32); 44 | 45 | tooltip = new GUIStyle("helpBox"); 46 | tooltip.alignment = TextAnchor.MiddleCenter; 47 | } 48 | } 49 | 50 | public static Texture2D GenerateGridTexture(Color line, Color bg) { 51 | Texture2D tex = new Texture2D(64, 64); 52 | Color[] cols = new Color[64 * 64]; 53 | for (int y = 0; y < 64; y++) { 54 | for (int x = 0; x < 64; x++) { 55 | Color col = bg; 56 | if (y % 16 == 0 || x % 16 == 0) col = Color.Lerp(line, bg, 0.65f); 57 | if (y == 63 || x == 63) col = Color.Lerp(line, bg, 0.35f); 58 | cols[(y * 64) + x] = col; 59 | } 60 | } 61 | tex.SetPixels(cols); 62 | tex.wrapMode = TextureWrapMode.Repeat; 63 | tex.filterMode = FilterMode.Bilinear; 64 | tex.name = "Grid"; 65 | tex.Apply(); 66 | return tex; 67 | } 68 | 69 | public static Texture2D GenerateCrossTexture(Color line) { 70 | Texture2D tex = new Texture2D(64, 64); 71 | Color[] cols = new Color[64 * 64]; 72 | for (int y = 0; y < 64; y++) { 73 | for (int x = 0; x < 64; x++) { 74 | Color col = line; 75 | if (y != 31 && x != 31) col.a = 0; 76 | cols[(y * 64) + x] = col; 77 | } 78 | } 79 | tex.SetPixels(cols); 80 | tex.wrapMode = TextureWrapMode.Clamp; 81 | tex.filterMode = FilterMode.Bilinear; 82 | tex.name = "Grid"; 83 | tex.Apply(); 84 | return tex; 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/NodeEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEditor; 5 | using UnityEngine; 6 | 7 | namespace XNodeEditor { 8 | /// Base class to derive custom Node editors from. Use this to create your own custom inspectors and editors for your nodes. 9 | 10 | [CustomNodeEditor(typeof(XNode.Node))] 11 | public class NodeEditor : XNodeEditor.Internal.NodeEditorBase { 12 | 13 | /// Fires every whenever a node was modified through the editor 14 | public static Action onUpdateNode; 15 | public static Dictionary portPositions; 16 | public static int renaming; 17 | 18 | public virtual void OnHeaderGUI() { 19 | string title = target.name; 20 | if (renaming != 0 && Selection.Contains(target)) { 21 | int controlID = EditorGUIUtility.GetControlID(FocusType.Keyboard) + 1; 22 | if (renaming == 1) { 23 | EditorGUIUtility.keyboardControl = controlID; 24 | EditorGUIUtility.editingTextField = true; 25 | renaming = 2; 26 | } 27 | target.name = EditorGUILayout.TextField(target.name, NodeEditorResources.styles.nodeHeader, GUILayout.Height(30)); 28 | if (!EditorGUIUtility.editingTextField) { 29 | Rename(target.name); 30 | renaming = 0; 31 | } 32 | } else { 33 | GUILayout.Label(title, NodeEditorResources.styles.nodeHeader, GUILayout.Height(30)); 34 | } 35 | } 36 | 37 | /// Draws standard field editors for all public fields 38 | public virtual void OnBodyGUI() { 39 | // Unity specifically requires this to save/update any serial object. 40 | // serializedObject.Update(); must go at the start of an inspector gui, and 41 | // serializedObject.ApplyModifiedProperties(); goes at the end. 42 | serializedObject.Update(); 43 | string[] excludes = { "m_Script", "graph", "position", "ports" }; 44 | portPositions = new Dictionary(); 45 | 46 | SerializedProperty iterator = serializedObject.GetIterator(); 47 | bool enterChildren = true; 48 | EditorGUIUtility.labelWidth = 84; 49 | while (iterator.NextVisible(enterChildren)) { 50 | enterChildren = false; 51 | if (excludes.Contains(iterator.name)) continue; 52 | NodeEditorGUILayout.PropertyField(iterator, true); 53 | } 54 | serializedObject.ApplyModifiedProperties(); 55 | } 56 | 57 | public virtual int GetWidth() { 58 | Type type = target.GetType(); 59 | int width; 60 | if (NodeEditorWindow.nodeWidth.TryGetValue(type, out width)) return width; 61 | else return 208; 62 | } 63 | 64 | public virtual Color GetTint() { 65 | Type type = target.GetType(); 66 | Color color; 67 | if (NodeEditorWindow.nodeTint.TryGetValue(type, out color)) return color; 68 | else return Color.white; 69 | } 70 | 71 | public virtual GUIStyle GetBodyStyle() { 72 | return NodeEditorResources.styles.nodeBody; 73 | } 74 | 75 | public void InitiateRename() { 76 | renaming = 1; 77 | } 78 | 79 | public void Rename(string newName) { 80 | target.name = newName; 81 | AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(target)); 82 | } 83 | 84 | [AttributeUsage(AttributeTargets.Class)] 85 | public class CustomNodeEditorAttribute : Attribute, 86 | XNodeEditor.Internal.NodeEditorBase.INodeEditorAttrib { 87 | private Type inspectedType; 88 | /// Tells a NodeEditor which Node type it is an editor for 89 | /// Type that this editor can edit 90 | /// Path to the node 91 | public CustomNodeEditorAttribute(Type inspectedType) { 92 | this.inspectedType = inspectedType; 93 | } 94 | 95 | public Type GetInspectedType() { 96 | return inspectedType; 97 | } 98 | } 99 | } 100 | } -------------------------------------------------------------------------------- /Assets/xNode/Scripts/NodeDataCache.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Reflection; 4 | using UnityEngine; 5 | 6 | namespace XNode { 7 | /// Precaches reflection data in editor so we won't have to do it runtime 8 | public static class NodeDataCache { 9 | private static PortDataCache portDataCache; 10 | private static bool Initialized { get { return portDataCache != null; } } 11 | 12 | /// Update static ports to reflect class fields. 13 | public static void UpdatePorts(Node node, Dictionary ports) { 14 | if (!Initialized) BuildCache(); 15 | 16 | Dictionary staticPorts = new Dictionary(); 17 | System.Type nodeType = node.GetType(); 18 | 19 | List typePortCache; 20 | if (portDataCache.TryGetValue(nodeType, out typePortCache)) { 21 | for (int i = 0; i < typePortCache.Count; i++) { 22 | staticPorts.Add(typePortCache[i].fieldName, portDataCache[nodeType][i]); 23 | } 24 | } 25 | 26 | // Cleanup port dict - Remove nonexisting static ports - update static port types 27 | // Loop through current node ports 28 | foreach (NodePort port in ports.Values.ToList()) { 29 | // If port still exists, check it it has been changed 30 | NodePort staticPort; 31 | if (staticPorts.TryGetValue(port.fieldName, out staticPort)) { 32 | // If port exists but with wrong settings, remove it. Re-add it later. 33 | if (port.connectionType != staticPort.connectionType || port.IsDynamic || port.direction != staticPort.direction) ports.Remove(port.fieldName); 34 | else port.ValueType = staticPort.ValueType; 35 | } 36 | // If port doesn't exist anymore, remove it 37 | else if (port.IsStatic) ports.Remove(port.fieldName); 38 | } 39 | // Add missing ports 40 | foreach (NodePort staticPort in staticPorts.Values) { 41 | if (!ports.ContainsKey(staticPort.fieldName)) { 42 | ports.Add(staticPort.fieldName, new NodePort(staticPort, node)); 43 | } 44 | } 45 | } 46 | 47 | private static void BuildCache() { 48 | portDataCache = new PortDataCache(); 49 | System.Type baseType = typeof(Node); 50 | List nodeTypes = new List(); 51 | System.Reflection.Assembly[] assemblies = System.AppDomain.CurrentDomain.GetAssemblies(); 52 | Assembly selfAssembly = Assembly.GetAssembly(baseType); 53 | if (selfAssembly.FullName.StartsWith("Assembly-CSharp") && !selfAssembly.FullName.Contains("-firstpass")) { 54 | // If xNode is not used as a DLL, check only CSharp (fast) 55 | nodeTypes.AddRange(selfAssembly.GetTypes().Where(t => !t.IsAbstract && baseType.IsAssignableFrom(t))); 56 | } else { 57 | // Else, check all relevant DDLs (slower) 58 | // ignore all unity related assemblies 59 | foreach (Assembly assembly in assemblies) { 60 | if (assembly.FullName.StartsWith("Unity")) continue; 61 | // unity created assemblies always have version 0.0.0 62 | if (!assembly.FullName.Contains("Version=0.0.0")) continue; 63 | nodeTypes.AddRange(assembly.GetTypes().Where(t => !t.IsAbstract && baseType.IsAssignableFrom(t)).ToArray()); 64 | } 65 | } 66 | for (int i = 0; i < nodeTypes.Count; i++) { 67 | CachePorts(nodeTypes[i]); 68 | } 69 | } 70 | 71 | private static void CachePorts(System.Type nodeType) { 72 | System.Reflection.FieldInfo[] fieldInfo = nodeType.GetFields(); 73 | for (int i = 0; i < fieldInfo.Length; i++) { 74 | 75 | //Get InputAttribute and OutputAttribute 76 | object[] attribs = fieldInfo[i].GetCustomAttributes(false); 77 | Node.InputAttribute inputAttrib = attribs.FirstOrDefault(x => x is Node.InputAttribute) as Node.InputAttribute; 78 | Node.OutputAttribute outputAttrib = attribs.FirstOrDefault(x => x is Node.OutputAttribute) as Node.OutputAttribute; 79 | 80 | if (inputAttrib == null && outputAttrib == null) continue; 81 | 82 | if (inputAttrib != null && outputAttrib != null) Debug.LogError("Field " + fieldInfo[i].Name + " of type " + nodeType.FullName + " cannot be both input and output."); 83 | else { 84 | if (!portDataCache.ContainsKey(nodeType)) portDataCache.Add(nodeType, new List()); 85 | portDataCache[nodeType].Add(new NodePort(fieldInfo[i])); 86 | } 87 | } 88 | } 89 | 90 | [System.Serializable] 91 | private class PortDataCache : Dictionary>, ISerializationCallbackReceiver { 92 | [SerializeField] private List keys = new List(); 93 | [SerializeField] private List> values = new List>(); 94 | 95 | // save the dictionary to lists 96 | public void OnBeforeSerialize() { 97 | keys.Clear(); 98 | values.Clear(); 99 | foreach (var pair in this) { 100 | keys.Add(pair.Key); 101 | values.Add(pair.Value); 102 | } 103 | } 104 | 105 | // load dictionary from lists 106 | public void OnAfterDeserialize() { 107 | this.Clear(); 108 | 109 | if (keys.Count != values.Count) 110 | throw new System.Exception(string.Format("there are {0} keys and {1} values after deserialization. Make sure that both key and value types are serializable.")); 111 | 112 | for (int i = 0; i < keys.Count; i++) 113 | this.Add(keys[i], values[i]); 114 | } 115 | } 116 | } 117 | } -------------------------------------------------------------------------------- /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/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: 5 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 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 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: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: {} 220 | -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/NodeEditorWindow.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEditor; 3 | using UnityEditor.Callbacks; 4 | using UnityEngine; 5 | 6 | namespace XNodeEditor { 7 | [InitializeOnLoad] 8 | public partial class NodeEditorWindow : EditorWindow { 9 | public static NodeEditorWindow current; 10 | 11 | /// Stores node positions for all nodePorts. 12 | public Dictionary portConnectionPoints { get { return _portConnectionPoints; } } 13 | private Dictionary _portConnectionPoints = new Dictionary(); 14 | [SerializeField] private NodePortReference[] _references = new NodePortReference[0]; 15 | [SerializeField] private Rect[] _rects = new Rect[0]; 16 | 17 | [System.Serializable] private class NodePortReference { 18 | [SerializeField] private XNode.Node _node; 19 | [SerializeField] private string _name; 20 | 21 | public NodePortReference(XNode.NodePort nodePort) { 22 | _node = nodePort.node; 23 | _name = nodePort.fieldName; 24 | } 25 | 26 | public XNode.NodePort GetNodePort() { 27 | if (_node == null) { 28 | return null; 29 | } 30 | return _node.GetPort(_name); 31 | } 32 | } 33 | 34 | private void OnDisable() { 35 | // Cache portConnectionPoints before serialization starts 36 | int count = portConnectionPoints.Count; 37 | _references = new NodePortReference[count]; 38 | _rects = new Rect[count]; 39 | int index = 0; 40 | foreach (var portConnectionPoint in portConnectionPoints) { 41 | _references[index] = new NodePortReference(portConnectionPoint.Key); 42 | _rects[index] = portConnectionPoint.Value; 43 | index++; 44 | } 45 | } 46 | 47 | private void OnEnable() { 48 | // Reload portConnectionPoints if there are any 49 | int length = _references.Length; 50 | if (length == _rects.Length) { 51 | for (int i = 0; i < length; i++) { 52 | XNode.NodePort nodePort = _references[i].GetNodePort(); 53 | if (nodePort != null) 54 | _portConnectionPoints.Add(nodePort, _rects[i]); 55 | } 56 | } 57 | } 58 | 59 | public Dictionary nodeSizes { get { return _nodeSizes; } } 60 | private Dictionary _nodeSizes = new Dictionary(); 61 | public XNode.NodeGraph graph; 62 | public Vector2 panOffset { get { return _panOffset; } set { _panOffset = value; Repaint(); } } 63 | private Vector2 _panOffset; 64 | public float zoom { get { return _zoom; } set { _zoom = Mathf.Clamp(value, 1f, 5f); Repaint(); } } 65 | private float _zoom = 1; 66 | 67 | void OnFocus() { 68 | current = this; 69 | graphEditor = NodeGraphEditor.GetEditor(graph); 70 | if (graphEditor != null && NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets(); 71 | } 72 | 73 | /// Create editor window 74 | public static NodeEditorWindow Init() { 75 | NodeEditorWindow w = CreateInstance(); 76 | w.titleContent = new GUIContent("xNode"); 77 | w.wantsMouseMove = true; 78 | w.Show(); 79 | return w; 80 | } 81 | 82 | public void Save() { 83 | if (AssetDatabase.Contains(graph)) { 84 | EditorUtility.SetDirty(graph); 85 | if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets(); 86 | } else SaveAs(); 87 | } 88 | 89 | public void SaveAs() { 90 | string path = EditorUtility.SaveFilePanelInProject("Save NodeGraph", "NewNodeGraph", "asset", ""); 91 | if (string.IsNullOrEmpty(path)) return; 92 | else { 93 | XNode.NodeGraph existingGraph = AssetDatabase.LoadAssetAtPath(path); 94 | if (existingGraph != null) AssetDatabase.DeleteAsset(path); 95 | AssetDatabase.CreateAsset(graph, path); 96 | EditorUtility.SetDirty(graph); 97 | if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets(); 98 | } 99 | } 100 | 101 | private void DraggableWindow(int windowID) { 102 | GUI.DragWindow(); 103 | } 104 | 105 | public Vector2 WindowToGridPosition(Vector2 windowPosition) { 106 | return (windowPosition - (position.size * 0.5f) - (panOffset / zoom)) * zoom; 107 | } 108 | 109 | public Vector2 GridToWindowPosition(Vector2 gridPosition) { 110 | return (position.size * 0.5f) + (panOffset / zoom) + (gridPosition / zoom); 111 | } 112 | 113 | public Rect GridToWindowRectNoClipped(Rect gridRect) { 114 | gridRect.position = GridToWindowPositionNoClipped(gridRect.position); 115 | return gridRect; 116 | } 117 | 118 | public Rect GridToWindowRect(Rect gridRect) { 119 | gridRect.position = GridToWindowPosition(gridRect.position); 120 | gridRect.size /= zoom; 121 | return gridRect; 122 | } 123 | 124 | public Vector2 GridToWindowPositionNoClipped(Vector2 gridPosition) { 125 | Vector2 center = position.size * 0.5f; 126 | float xOffset = (center.x * zoom + (panOffset.x + gridPosition.x)); 127 | float yOffset = (center.y * zoom + (panOffset.y + gridPosition.y)); 128 | return new Vector2(xOffset, yOffset); 129 | } 130 | 131 | public void SelectNode(XNode.Node node, bool add) { 132 | if (add) { 133 | List selection = new List(Selection.objects); 134 | selection.Add(node); 135 | Selection.objects = selection.ToArray(); 136 | } else Selection.objects = new Object[] { node }; 137 | } 138 | 139 | public void DeselectNode(XNode.Node node) { 140 | List selection = new List(Selection.objects); 141 | selection.Remove(node); 142 | Selection.objects = selection.ToArray(); 143 | } 144 | 145 | [OnOpenAsset(0)] 146 | public static bool OnOpen(int instanceID, int line) { 147 | XNode.NodeGraph nodeGraph = EditorUtility.InstanceIDToObject(instanceID) as XNode.NodeGraph; 148 | if (nodeGraph != null) { 149 | NodeEditorWindow w = GetWindow(typeof(NodeEditorWindow), false, "xNode", true) as NodeEditorWindow; 150 | w.wantsMouseMove = true; 151 | w.graph = nodeGraph; 152 | return true; 153 | } 154 | return false; 155 | } 156 | 157 | /// Repaint all open NodeEditorWindows. 158 | public static void RepaintAll() { 159 | NodeEditorWindow[] windows = Resources.FindObjectsOfTypeAll(); 160 | for (int i = 0; i < windows.Length; i++) { 161 | windows[i].Repaint(); 162 | } 163 | } 164 | } 165 | } -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/NodeEditorUtilities.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Text; 7 | using UnityEditor; 8 | using UnityEngine; 9 | using Object = UnityEngine.Object; 10 | 11 | namespace XNodeEditor { 12 | /// A set of editor-only utilities and extensions for UnityNodeEditorBase 13 | public static class NodeEditorUtilities { 14 | 15 | /// C#'s Script Icon [The one MonoBhevaiour Scripts have]. 16 | private static Texture2D scriptIcon = (EditorGUIUtility.IconContent("cs Script Icon").image as Texture2D); 17 | 18 | public static bool GetAttrib(Type classType, out T attribOut) where T : Attribute { 19 | object[] attribs = classType.GetCustomAttributes(typeof(T), false); 20 | return GetAttrib(attribs, out attribOut); 21 | } 22 | 23 | public static bool GetAttrib(object[] attribs, out T attribOut) where T : Attribute { 24 | for (int i = 0; i < attribs.Length; i++) { 25 | if (attribs[i].GetType() == typeof(T)) { 26 | attribOut = attribs[i] as T; 27 | return true; 28 | } 29 | } 30 | attribOut = null; 31 | return false; 32 | } 33 | 34 | public static bool GetAttrib(Type classType, string fieldName, out T attribOut) where T : Attribute { 35 | object[] attribs = classType.GetField(fieldName).GetCustomAttributes(typeof(T), false); 36 | return GetAttrib(attribs, out attribOut); 37 | } 38 | 39 | public static bool HasAttrib(object[] attribs) where T : Attribute { 40 | for (int i = 0; i < attribs.Length; i++) { 41 | if (attribs[i].GetType() == typeof(T)) { 42 | return true; 43 | } 44 | } 45 | return false; 46 | } 47 | 48 | /// Returns true if this can be casted to 49 | public static bool IsCastableTo(this Type from, Type to) { 50 | if (to.IsAssignableFrom(from)) return true; 51 | var methods = from.GetMethods(BindingFlags.Public | BindingFlags.Static) 52 | .Where( 53 | m => m.ReturnType == to && 54 | (m.Name == "op_Implicit" || 55 | m.Name == "op_Explicit") 56 | ); 57 | return methods.Count() > 0; 58 | } 59 | 60 | /// Return a prettiefied type name. 61 | public static string PrettyName(this Type type) { 62 | if (type == null) return "null"; 63 | if (type == typeof(System.Object)) return "object"; 64 | if (type == typeof(float)) return "float"; 65 | else if (type == typeof(int)) return "int"; 66 | else if (type == typeof(long)) return "long"; 67 | else if (type == typeof(double)) return "double"; 68 | else if (type == typeof(string)) return "string"; 69 | else if (type == typeof(bool)) return "bool"; 70 | else if (type.IsGenericType) { 71 | string s = ""; 72 | Type genericType = type.GetGenericTypeDefinition(); 73 | if (genericType == typeof(List<>)) s = "List"; 74 | else s = type.GetGenericTypeDefinition().ToString(); 75 | 76 | Type[] types = type.GetGenericArguments(); 77 | string[] stypes = new string[types.Length]; 78 | for (int i = 0; i < types.Length; i++) { 79 | stypes[i] = types[i].PrettyName(); 80 | } 81 | return s + "<" + string.Join(", ", stypes) + ">"; 82 | } else if (type.IsArray) { 83 | string rank = ""; 84 | for (int i = 1; i < type.GetArrayRank(); i++) { 85 | rank += ","; 86 | } 87 | Type elementType = type.GetElementType(); 88 | if (!elementType.IsArray) return elementType.PrettyName() + "[" + rank + "]"; 89 | else { 90 | string s = elementType.PrettyName(); 91 | int i = s.IndexOf('['); 92 | return s.Substring(0, i) + "[" + rank + "]" + s.Substring(i); 93 | } 94 | } else return type.ToString(); 95 | } 96 | 97 | /// Creates a new C# Class. 98 | [MenuItem("Assets/Create/xNode/Node C# Script", false, 89)] 99 | private static void CreateNode() { 100 | string[] guids = AssetDatabase.FindAssets("xNode_NodeTemplate.cs"); 101 | if (guids.Length == 0) { 102 | Debug.LogWarning("xNode_NodeTemplate.cs.txt not found in asset database"); 103 | return; 104 | } 105 | string path = AssetDatabase.GUIDToAssetPath(guids[0]); 106 | CreateFromTemplate( 107 | "NewNode.cs", 108 | path 109 | ); 110 | } 111 | 112 | /// Creates a new C# Class. 113 | [MenuItem("Assets/Create/xNode/NodeGraph C# Script", false, 89)] 114 | private static void CreateGraph() { 115 | string[] guids = AssetDatabase.FindAssets("xNode_NodeGraphTemplate.cs"); 116 | if (guids.Length == 0) { 117 | Debug.LogWarning("xNode_NodeGraphTemplate.cs.txt not found in asset database"); 118 | return; 119 | } 120 | string path = AssetDatabase.GUIDToAssetPath(guids[0]); 121 | CreateFromTemplate( 122 | "NewNodeGraph.cs", 123 | path 124 | ); 125 | } 126 | 127 | public static void CreateFromTemplate(string initialName, string templatePath) { 128 | ProjectWindowUtil.StartNameEditingIfProjectWindowExists( 129 | 0, 130 | ScriptableObject.CreateInstance(), 131 | initialName, 132 | scriptIcon, 133 | templatePath 134 | ); 135 | } 136 | 137 | /// Inherits from EndNameAction, must override EndNameAction.Action 138 | public class DoCreateCodeFile : UnityEditor.ProjectWindowCallback.EndNameEditAction { 139 | public override void Action(int instanceId, string pathName, string resourceFile) { 140 | Object o = CreateScript(pathName, resourceFile); 141 | ProjectWindowUtil.ShowCreatedAsset(o); 142 | } 143 | } 144 | 145 | /// Creates Script from Template's path. 146 | internal static UnityEngine.Object CreateScript(string pathName, string templatePath) { 147 | string className = Path.GetFileNameWithoutExtension(pathName).Replace(" ", string.Empty); 148 | string templateText = string.Empty; 149 | 150 | UTF8Encoding encoding = new UTF8Encoding(true, false); 151 | 152 | if (File.Exists(templatePath)) { 153 | /// Read procedures. 154 | StreamReader reader = new StreamReader(templatePath); 155 | templateText = reader.ReadToEnd(); 156 | reader.Close(); 157 | 158 | templateText = templateText.Replace("#SCRIPTNAME#", className); 159 | templateText = templateText.Replace("#NOTRIM#", string.Empty); 160 | /// You can replace as many tags you make on your templates, just repeat Replace function 161 | /// e.g.: 162 | /// templateText = templateText.Replace("#NEWTAG#", "MyText"); 163 | 164 | /// Write procedures. 165 | 166 | StreamWriter writer = new StreamWriter(Path.GetFullPath(pathName), false, encoding); 167 | writer.Write(templateText); 168 | writer.Close(); 169 | 170 | AssetDatabase.ImportAsset(pathName); 171 | return AssetDatabase.LoadAssetAtPath(pathName, typeof(Object)); 172 | } else { 173 | Debug.LogError(string.Format("The template file was not found: {0}", templatePath)); 174 | return null; 175 | } 176 | } 177 | } 178 | } -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/NodeEditorReflection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Reflection; 6 | using UnityEditor; 7 | using UnityEngine; 8 | 9 | namespace XNodeEditor { 10 | /// Contains reflection-related info 11 | public partial class NodeEditorWindow { 12 | /// Custom node tint colors defined with [NodeColor(r, g, b)] 13 | public static Dictionary nodeTint { get { return _nodeTint != null ? _nodeTint : _nodeTint = GetNodeTint(); } } 14 | 15 | [NonSerialized] private static Dictionary _nodeTint; 16 | /// Custom node widths defined with [NodeWidth(width)] 17 | public static Dictionary nodeWidth { get { return _nodeWidth != null ? _nodeWidth : _nodeWidth = GetNodeWidth(); } } 18 | 19 | [NonSerialized] private static Dictionary _nodeWidth; 20 | /// All available node types 21 | public static Type[] nodeTypes { get { return _nodeTypes != null ? _nodeTypes : _nodeTypes = GetNodeTypes(); } } 22 | 23 | [NonSerialized] private static Type[] _nodeTypes = null; 24 | 25 | private Func isDocked { 26 | get { 27 | if (_isDocked == null) { 28 | BindingFlags fullBinding = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static; 29 | MethodInfo isDockedMethod = typeof(NodeEditorWindow).GetProperty("docked", fullBinding).GetGetMethod(true); 30 | _isDocked = (Func) Delegate.CreateDelegate(typeof(Func), this, isDockedMethod); 31 | } 32 | return _isDocked; 33 | } 34 | } 35 | private Func _isDocked; 36 | 37 | public static Type[] GetNodeTypes() { 38 | //Get all classes deriving from Node via reflection 39 | return GetDerivedTypes(typeof(XNode.Node)); 40 | } 41 | 42 | public static Dictionary GetNodeTint() { 43 | Dictionary tints = new Dictionary(); 44 | for (int i = 0; i < nodeTypes.Length; i++) { 45 | var attribs = nodeTypes[i].GetCustomAttributes(typeof(XNode.Node.NodeTint), true); 46 | if (attribs == null || attribs.Length == 0) continue; 47 | XNode.Node.NodeTint attrib = attribs[0] as XNode.Node.NodeTint; 48 | tints.Add(nodeTypes[i], attrib.color); 49 | } 50 | return tints; 51 | } 52 | 53 | public static Dictionary GetNodeWidth() { 54 | Dictionary widths = new Dictionary(); 55 | for (int i = 0; i < nodeTypes.Length; i++) { 56 | var attribs = nodeTypes[i].GetCustomAttributes(typeof(XNode.Node.NodeWidth), true); 57 | if (attribs == null || attribs.Length == 0) continue; 58 | XNode.Node.NodeWidth attrib = attribs[0] as XNode.Node.NodeWidth; 59 | widths.Add(nodeTypes[i], attrib.width); 60 | } 61 | return widths; 62 | } 63 | 64 | /// Get all classes deriving from baseType via reflection 65 | public static Type[] GetDerivedTypes(Type baseType) { 66 | List types = new List(); 67 | System.Reflection.Assembly[] assemblies = System.AppDomain.CurrentDomain.GetAssemblies(); 68 | foreach (Assembly assembly in assemblies) { 69 | types.AddRange(assembly.GetTypes().Where(t => !t.IsAbstract && baseType.IsAssignableFrom(t)).ToArray()); 70 | } 71 | return types.ToArray(); 72 | } 73 | 74 | public static object ObjectFromType(Type type) { 75 | return Activator.CreateInstance(type); 76 | } 77 | 78 | public static object ObjectFromFieldName(object obj, string fieldName) { 79 | Type type = obj.GetType(); 80 | FieldInfo fieldInfo = type.GetField(fieldName); 81 | return fieldInfo.GetValue(obj); 82 | } 83 | 84 | public static KeyValuePair[] GetContextMenuMethods(object obj) { 85 | Type type = obj.GetType(); 86 | MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); 87 | List> kvp = new List>(); 88 | for (int i = 0; i < methods.Length; i++) { 89 | ContextMenu[] attribs = methods[i].GetCustomAttributes(typeof(ContextMenu), true).Select(x => x as ContextMenu).ToArray(); 90 | if (attribs == null || attribs.Length == 0) continue; 91 | if (methods[i].GetParameters().Length != 0) { 92 | Debug.LogWarning("Method " + methods[i].DeclaringType.Name + "." + methods[i].Name + " has parameters and cannot be used for context menu commands."); 93 | continue; 94 | } 95 | if (methods[i].IsStatic) { 96 | Debug.LogWarning("Method " + methods[i].DeclaringType.Name + "." + methods[i].Name + " is static and cannot be used for context menu commands."); 97 | continue; 98 | } 99 | 100 | for (int k = 0; k < attribs.Length; k++) { 101 | kvp.Add(new KeyValuePair(attribs[k], methods[i])); 102 | } 103 | } 104 | #if UNITY_5_5_OR_NEWER 105 | //Sort menu items 106 | kvp.Sort((x, y) => x.Key.priority.CompareTo(y.Key.priority)); 107 | #endif 108 | return kvp.ToArray(); 109 | } 110 | 111 | /// Very crude. Uses a lot of reflection. 112 | public static void OpenPreferences() { 113 | try { 114 | //Open preferences window 115 | Assembly assembly = Assembly.GetAssembly(typeof(UnityEditor.EditorWindow)); 116 | Type type = assembly.GetType("UnityEditor.PreferencesWindow"); 117 | type.GetMethod("ShowPreferencesWindow", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, null); 118 | 119 | //Get the window 120 | EditorWindow window = EditorWindow.GetWindow(type); 121 | 122 | //Make sure custom sections are added (because waiting for it to happen automatically is too slow) 123 | FieldInfo refreshField = type.GetField("m_RefreshCustomPreferences", BindingFlags.NonPublic | BindingFlags.Instance); 124 | if ((bool) refreshField.GetValue(window)) { 125 | type.GetMethod("AddCustomSections", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(window, null); 126 | refreshField.SetValue(window, false); 127 | } 128 | 129 | //Get sections 130 | FieldInfo sectionsField = type.GetField("m_Sections", BindingFlags.Instance | BindingFlags.NonPublic); 131 | IList sections = sectionsField.GetValue(window) as IList; 132 | 133 | //Iterate through sections and check contents 134 | Type sectionType = sectionsField.FieldType.GetGenericArguments() [0]; 135 | FieldInfo sectionContentField = sectionType.GetField("content", BindingFlags.Instance | BindingFlags.Public); 136 | for (int i = 0; i < sections.Count; i++) { 137 | GUIContent sectionContent = sectionContentField.GetValue(sections[i]) as GUIContent; 138 | if (sectionContent.text == "Node Editor") { 139 | //Found contents - Set index 140 | FieldInfo sectionIndexField = type.GetField("m_SelectedSectionIndex", BindingFlags.Instance | BindingFlags.NonPublic); 141 | sectionIndexField.SetValue(window, i); 142 | return; 143 | } 144 | } 145 | } catch (Exception e) { 146 | Debug.LogError(e); 147 | Debug.LogWarning("Unity has changed around internally. Can't open properties through reflection. Please contact xNode developer and supply unity version number."); 148 | } 149 | } 150 | } 151 | } -------------------------------------------------------------------------------- /Assets/xNode/Scripts/Editor/NodeEditorPreferences.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace XNodeEditor { 7 | public static class NodeEditorPreferences { 8 | public enum NoodleType { Curve, Line, Angled } 9 | 10 | /// The last editor we checked. This should be the one we modify 11 | private static XNodeEditor.NodeGraphEditor lastEditor; 12 | /// The last key we checked. This should be the one we modify 13 | private static string lastKey = "xNode.Settings"; 14 | 15 | private static Dictionary typeColors = new Dictionary(); 16 | private static Dictionary settings = new Dictionary(); 17 | 18 | [System.Serializable] 19 | public class Settings : ISerializationCallbackReceiver { 20 | [SerializeField] private Color32 _gridLineColor = new Color(0.45f, 0.45f, 0.45f); 21 | public Color32 gridLineColor { get { return _gridLineColor; } set { _gridLineColor = value; _gridTexture = null; _crossTexture = null; } } 22 | 23 | [SerializeField] private Color32 _gridBgColor = new Color(0.18f, 0.18f, 0.18f); 24 | public Color32 gridBgColor { get { return _gridBgColor; } set { _gridBgColor = value; _gridTexture = null; } } 25 | 26 | public Color32 highlightColor = new Color32(255, 255, 255, 255); 27 | public bool gridSnap = true; 28 | public bool autoSave = true; 29 | [SerializeField] private string typeColorsData = ""; 30 | [NonSerialized] public Dictionary typeColors = new Dictionary(); 31 | public NoodleType noodleType = NoodleType.Curve; 32 | 33 | private Texture2D _gridTexture; 34 | public Texture2D gridTexture { 35 | get { 36 | if (_gridTexture == null) _gridTexture = NodeEditorResources.GenerateGridTexture(gridLineColor, gridBgColor); 37 | return _gridTexture; 38 | } 39 | } 40 | private Texture2D _crossTexture; 41 | public Texture2D crossTexture { 42 | get { 43 | if (_crossTexture == null) _crossTexture = NodeEditorResources.GenerateCrossTexture(gridLineColor); 44 | return _crossTexture; 45 | } 46 | } 47 | 48 | public void OnAfterDeserialize() { 49 | // Deserialize typeColorsData 50 | typeColors = new Dictionary(); 51 | string[] data = typeColorsData.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); 52 | for (int i = 0; i < data.Length; i += 2) { 53 | Color col; 54 | if (ColorUtility.TryParseHtmlString("#" + data[i + 1], out col)) { 55 | typeColors.Add(data[i], col); 56 | } 57 | } 58 | } 59 | 60 | public void OnBeforeSerialize() { 61 | // Serialize typeColors 62 | typeColorsData = ""; 63 | foreach (var item in typeColors) { 64 | typeColorsData += item.Key + "," + ColorUtility.ToHtmlStringRGB(item.Value) + ","; 65 | } 66 | } 67 | } 68 | 69 | /// Get settings of current active editor 70 | public static Settings GetSettings() { 71 | if (lastEditor != XNodeEditor.NodeEditorWindow.current.graphEditor) { 72 | object[] attribs = XNodeEditor.NodeEditorWindow.current.graphEditor.GetType().GetCustomAttributes(typeof(XNodeEditor.NodeGraphEditor.CustomNodeGraphEditorAttribute), true); 73 | if (attribs.Length == 1) { 74 | XNodeEditor.NodeGraphEditor.CustomNodeGraphEditorAttribute attrib = attribs[0] as XNodeEditor.NodeGraphEditor.CustomNodeGraphEditorAttribute; 75 | lastEditor = XNodeEditor.NodeEditorWindow.current.graphEditor; 76 | lastKey = attrib.editorPrefsKey; 77 | } else return null; 78 | } 79 | if (!settings.ContainsKey(lastKey)) VerifyLoaded(); 80 | return settings[lastKey]; 81 | } 82 | 83 | [PreferenceItem("Node Editor")] 84 | private static void PreferencesGUI() { 85 | VerifyLoaded(); 86 | Settings settings = NodeEditorPreferences.settings[lastKey]; 87 | 88 | NodeSettingsGUI(lastKey, settings); 89 | GridSettingsGUI(lastKey, settings); 90 | SystemSettingsGUI(lastKey, settings); 91 | TypeColorsGUI(lastKey, settings); 92 | if (GUILayout.Button(new GUIContent("Set Default", "Reset all values to default"), GUILayout.Width(120))) { 93 | ResetPrefs(); 94 | } 95 | } 96 | 97 | private static void GridSettingsGUI(string key, Settings settings) { 98 | //Label 99 | EditorGUILayout.LabelField("Grid", EditorStyles.boldLabel); 100 | settings.gridSnap = EditorGUILayout.Toggle(new GUIContent("Snap", "Hold CTRL in editor to invert"), settings.gridSnap); 101 | 102 | settings.gridLineColor = EditorGUILayout.ColorField("Color", settings.gridLineColor); 103 | settings.gridBgColor = EditorGUILayout.ColorField(" ", settings.gridBgColor); 104 | if (GUI.changed) { 105 | SavePrefs(key, settings); 106 | 107 | NodeEditorWindow.RepaintAll(); 108 | } 109 | EditorGUILayout.Space(); 110 | } 111 | 112 | private static void SystemSettingsGUI(string key, Settings settings) { 113 | //Label 114 | EditorGUILayout.LabelField("System", EditorStyles.boldLabel); 115 | settings.autoSave = EditorGUILayout.Toggle(new GUIContent("Autosave", "Disable for better editor performance"), settings.autoSave); 116 | if (GUI.changed) SavePrefs(key, settings); 117 | EditorGUILayout.Space(); 118 | } 119 | 120 | private static void NodeSettingsGUI(string key, Settings settings) { 121 | //Label 122 | EditorGUILayout.LabelField("Node", EditorStyles.boldLabel); 123 | settings.highlightColor = EditorGUILayout.ColorField("Selection", settings.highlightColor); 124 | settings.noodleType = (NoodleType) EditorGUILayout.EnumPopup("Noodle type", (Enum) settings.noodleType); 125 | if (GUI.changed) { 126 | SavePrefs(key, settings); 127 | NodeEditorWindow.RepaintAll(); 128 | } 129 | EditorGUILayout.Space(); 130 | } 131 | 132 | private static void TypeColorsGUI(string key, Settings settings) { 133 | //Label 134 | EditorGUILayout.LabelField("Types", EditorStyles.boldLabel); 135 | 136 | //Display type colors. Save them if they are edited by the user 137 | List typeColorKeys = new List(typeColors.Keys); 138 | foreach (string typeColorKey in typeColorKeys) { 139 | Color col = typeColors[typeColorKey]; 140 | EditorGUI.BeginChangeCheck(); 141 | EditorGUILayout.BeginHorizontal(); 142 | col = EditorGUILayout.ColorField(typeColorKey, col); 143 | EditorGUILayout.EndHorizontal(); 144 | if (EditorGUI.EndChangeCheck()) { 145 | typeColors[typeColorKey] = col; 146 | if (settings.typeColors.ContainsKey(typeColorKey)) settings.typeColors[typeColorKey] = col; 147 | else settings.typeColors.Add(typeColorKey, col); 148 | SavePrefs(typeColorKey, settings); 149 | NodeEditorWindow.RepaintAll(); 150 | } 151 | } 152 | } 153 | 154 | /// Load prefs if they exist. Create if they don't 155 | private static Settings LoadPrefs() { 156 | // Create settings if it doesn't exist 157 | if (!EditorPrefs.HasKey(lastKey)) { 158 | if (lastEditor != null) EditorPrefs.SetString(lastKey, JsonUtility.ToJson(lastEditor.GetDefaultPreferences())); 159 | else EditorPrefs.SetString(lastKey, JsonUtility.ToJson(new Settings())); 160 | } 161 | return JsonUtility.FromJson(EditorPrefs.GetString(lastKey)); 162 | } 163 | 164 | /// Delete all prefs 165 | public static void ResetPrefs() { 166 | if (EditorPrefs.HasKey(lastKey)) EditorPrefs.DeleteKey(lastKey); 167 | if (settings.ContainsKey(lastKey)) settings.Remove(lastKey); 168 | typeColors = new Dictionary(); 169 | VerifyLoaded(); 170 | NodeEditorWindow.RepaintAll(); 171 | } 172 | 173 | /// Save preferences in EditorPrefs 174 | private static void SavePrefs(string key, Settings settings) { 175 | EditorPrefs.SetString(key, JsonUtility.ToJson(settings)); 176 | } 177 | 178 | /// Check if we have loaded settings for given key. If not, load them 179 | private static void VerifyLoaded() { 180 | if (!settings.ContainsKey(lastKey)) settings.Add(lastKey, LoadPrefs()); 181 | } 182 | 183 | /// Return color based on type 184 | public static Color GetTypeColor(System.Type type) { 185 | VerifyLoaded(); 186 | if (type == null) return Color.gray; 187 | string typeName = type.PrettyName(); 188 | if (!typeColors.ContainsKey(typeName)) { 189 | if (settings[lastKey].typeColors.ContainsKey(typeName)) typeColors.Add(typeName, settings[lastKey].typeColors[typeName]); 190 | else { 191 | #if UNITY_5_4_OR_NEWER 192 | UnityEngine.Random.InitState(typeName.GetHashCode()); 193 | #else 194 | UnityEngine.Random.seed = typeName.GetHashCode(); 195 | #endif 196 | typeColors.Add(typeName, new Color(UnityEngine.Random.value, UnityEngine.Random.value, UnityEngine.Random.value)); 197 | } 198 | } 199 | return typeColors[typeName]; 200 | } 201 | } 202 | } -------------------------------------------------------------------------------- /Assets/SoundGraph/Sample/5_YoiYoi.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: a9f797d31a65b4c47b78ca83c1d57bfd, type: 3} 13 | m_Name: 5_YoiYoi 14 | m_EditorClassIdentifier: 15 | nodes: 16 | - {fileID: 114296011642660246} 17 | - {fileID: 114343795097281644} 18 | - {fileID: 114874188937579692} 19 | - {fileID: 114525674253870422} 20 | - {fileID: 114179582277208574} 21 | - {fileID: 0} 22 | --- !u!114 &114179582277208574 23 | MonoBehaviour: 24 | m_ObjectHideFlags: 0 25 | m_CorrespondingSourceObject: {fileID: 0} 26 | m_PrefabInstance: {fileID: 0} 27 | m_PrefabAsset: {fileID: 0} 28 | m_GameObject: {fileID: 0} 29 | m_Enabled: 1 30 | m_EditorHideFlags: 0 31 | m_Script: {fileID: 11500000, guid: 37d9145fe859f3f43b70217bb7b74936, type: 3} 32 | m_Name: Sine Osc 33 | m_EditorClassIdentifier: 34 | graph: {fileID: 11400000} 35 | position: {x: -1000, y: -376} 36 | ports: 37 | keys: 38 | - AmpNode 39 | - FreqNode 40 | - OutputNode 41 | - PhaseNode 42 | values: 43 | - _fieldName: AmpNode 44 | _node: {fileID: 114179582277208574} 45 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 46 | Culture=neutral, PublicKeyToken=null 47 | connections: [] 48 | _direction: 0 49 | _connectionType: 1 50 | _dynamic: 0 51 | - _fieldName: FreqNode 52 | _node: {fileID: 114179582277208574} 53 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 54 | Culture=neutral, PublicKeyToken=null 55 | connections: [] 56 | _direction: 0 57 | _connectionType: 1 58 | _dynamic: 0 59 | - _fieldName: OutputNode 60 | _node: {fileID: 114179582277208574} 61 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 62 | Culture=neutral, PublicKeyToken=null 63 | connections: 64 | - fieldName: In 65 | node: {fileID: 114525674253870422} 66 | reroutePoints: [] 67 | _direction: 1 68 | _connectionType: 0 69 | _dynamic: 0 70 | - _fieldName: PhaseNode 71 | _node: {fileID: 114179582277208574} 72 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 73 | Culture=neutral, PublicKeyToken=null 74 | connections: [] 75 | _direction: 0 76 | _connectionType: 1 77 | _dynamic: 0 78 | OutputNode: {fileID: 0} 79 | DefaultAmp: 1 80 | DefaultFreq: 0.7 81 | DefaultPhase: 0 82 | AmpNode: {fileID: 0} 83 | FreqNode: {fileID: 0} 84 | PhaseNode: {fileID: 0} 85 | --- !u!114 &114296011642660246 86 | MonoBehaviour: 87 | m_ObjectHideFlags: 0 88 | m_CorrespondingSourceObject: {fileID: 0} 89 | m_PrefabInstance: {fileID: 0} 90 | m_PrefabAsset: {fileID: 0} 91 | m_GameObject: {fileID: 0} 92 | m_Enabled: 1 93 | m_EditorHideFlags: 0 94 | m_Script: {fileID: 11500000, guid: 2011e4b393323fb468af24f9b71f32e0, type: 3} 95 | m_Name: Output Master 96 | m_EditorClassIdentifier: 97 | graph: {fileID: 11400000} 98 | position: {x: -216, y: -392} 99 | ports: 100 | keys: 101 | - OutputSound 102 | values: 103 | - _fieldName: OutputSound 104 | _node: {fileID: 114296011642660246} 105 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 106 | Culture=neutral, PublicKeyToken=null 107 | connections: 108 | - fieldName: OutputNode 109 | node: {fileID: 114343795097281644} 110 | reroutePoints: [] 111 | _direction: 0 112 | _connectionType: 1 113 | _dynamic: 0 114 | OutputSound: {fileID: 0} 115 | --- !u!114 &114343795097281644 116 | MonoBehaviour: 117 | m_ObjectHideFlags: 0 118 | m_CorrespondingSourceObject: {fileID: 0} 119 | m_PrefabInstance: {fileID: 0} 120 | m_PrefabAsset: {fileID: 0} 121 | m_GameObject: {fileID: 0} 122 | m_Enabled: 1 123 | m_EditorHideFlags: 0 124 | m_Script: {fileID: 11500000, guid: 37d9145fe859f3f43b70217bb7b74936, type: 3} 125 | m_Name: Sine Osc 126 | m_EditorClassIdentifier: 127 | graph: {fileID: 11400000} 128 | position: {x: -456, y: -392} 129 | ports: 130 | keys: 131 | - AmpNode 132 | - FreqNode 133 | - OutputNode 134 | - PhaseNode 135 | values: 136 | - _fieldName: AmpNode 137 | _node: {fileID: 114343795097281644} 138 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 139 | Culture=neutral, PublicKeyToken=null 140 | connections: [] 141 | _direction: 0 142 | _connectionType: 1 143 | _dynamic: 0 144 | - _fieldName: FreqNode 145 | _node: {fileID: 114343795097281644} 146 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 147 | Culture=neutral, PublicKeyToken=null 148 | connections: 149 | - fieldName: OutputNode 150 | node: {fileID: 114525674253870422} 151 | reroutePoints: [] 152 | _direction: 0 153 | _connectionType: 1 154 | _dynamic: 0 155 | - _fieldName: OutputNode 156 | _node: {fileID: 114343795097281644} 157 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 158 | Culture=neutral, PublicKeyToken=null 159 | connections: 160 | - fieldName: OutputSound 161 | node: {fileID: 114296011642660246} 162 | reroutePoints: [] 163 | _direction: 1 164 | _connectionType: 0 165 | _dynamic: 0 166 | - _fieldName: PhaseNode 167 | _node: {fileID: 114343795097281644} 168 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 169 | Culture=neutral, PublicKeyToken=null 170 | connections: 171 | - fieldName: OutputNode 172 | node: {fileID: 114874188937579692} 173 | reroutePoints: [] 174 | _direction: 0 175 | _connectionType: 1 176 | _dynamic: 0 177 | OutputNode: {fileID: 0} 178 | DefaultAmp: 1 179 | DefaultFreq: 440 180 | DefaultPhase: 0 181 | AmpNode: {fileID: 0} 182 | FreqNode: {fileID: 0} 183 | PhaseNode: {fileID: 0} 184 | --- !u!114 &114525674253870422 185 | MonoBehaviour: 186 | m_ObjectHideFlags: 0 187 | m_CorrespondingSourceObject: {fileID: 0} 188 | m_PrefabInstance: {fileID: 0} 189 | m_PrefabAsset: {fileID: 0} 190 | m_GameObject: {fileID: 0} 191 | m_Enabled: 1 192 | m_EditorHideFlags: 0 193 | m_Script: {fileID: 11500000, guid: ef81cad4a4c9f094eb942a22ea421ada, type: 3} 194 | m_Name: Remap 195 | m_EditorClassIdentifier: 196 | graph: {fileID: 11400000} 197 | position: {x: -728, y: -392} 198 | ports: 199 | keys: 200 | - In 201 | - OutputNode 202 | values: 203 | - _fieldName: In 204 | _node: {fileID: 114525674253870422} 205 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 206 | Culture=neutral, PublicKeyToken=null 207 | connections: 208 | - fieldName: OutputNode 209 | node: {fileID: 114179582277208574} 210 | reroutePoints: [] 211 | _direction: 0 212 | _connectionType: 1 213 | _dynamic: 0 214 | - _fieldName: OutputNode 215 | _node: {fileID: 114525674253870422} 216 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 217 | Culture=neutral, PublicKeyToken=null 218 | connections: 219 | - fieldName: FreqNode 220 | node: {fileID: 114343795097281644} 221 | reroutePoints: [] 222 | _direction: 1 223 | _connectionType: 0 224 | _dynamic: 0 225 | OutputNode: {fileID: 0} 226 | In: {fileID: 0} 227 | InMin: -1 228 | InMax: 1 229 | OutMin: 100 230 | OutMax: 210 231 | --- !u!114 &114874188937579692 232 | MonoBehaviour: 233 | m_ObjectHideFlags: 0 234 | m_CorrespondingSourceObject: {fileID: 0} 235 | m_PrefabInstance: {fileID: 0} 236 | m_PrefabAsset: {fileID: 0} 237 | m_GameObject: {fileID: 0} 238 | m_Enabled: 1 239 | m_EditorHideFlags: 0 240 | m_Script: {fileID: 11500000, guid: 37d9145fe859f3f43b70217bb7b74936, type: 3} 241 | m_Name: Sine Osc 242 | m_EditorClassIdentifier: 243 | graph: {fileID: 11400000} 244 | position: {x: -728, y: -232} 245 | ports: 246 | keys: 247 | - AmpNode 248 | - FreqNode 249 | - PhaseNode 250 | - OutputNode 251 | values: 252 | - _fieldName: AmpNode 253 | _node: {fileID: 114874188937579692} 254 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 255 | Culture=neutral, PublicKeyToken=null 256 | connections: [] 257 | _direction: 0 258 | _connectionType: 1 259 | _dynamic: 0 260 | - _fieldName: FreqNode 261 | _node: {fileID: 114874188937579692} 262 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 263 | Culture=neutral, PublicKeyToken=null 264 | connections: [] 265 | _direction: 0 266 | _connectionType: 1 267 | _dynamic: 0 268 | - _fieldName: PhaseNode 269 | _node: {fileID: 114874188937579692} 270 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 271 | Culture=neutral, PublicKeyToken=null 272 | connections: [] 273 | _direction: 0 274 | _connectionType: 1 275 | _dynamic: 0 276 | - _fieldName: OutputNode 277 | _node: {fileID: 114874188937579692} 278 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 279 | Culture=neutral, PublicKeyToken=null 280 | connections: 281 | - fieldName: PhaseNode 282 | node: {fileID: 114343795097281644} 283 | reroutePoints: [] 284 | _direction: 1 285 | _connectionType: 0 286 | _dynamic: 0 287 | OutputNode: {fileID: 0} 288 | DefaultAmp: 1 289 | DefaultFreq: 1800 290 | DefaultPhase: 0 291 | AmpNode: {fileID: 0} 292 | FreqNode: {fileID: 0} 293 | PhaseNode: {fileID: 0} 294 | --- !u!114 &114903792417912858 295 | MonoBehaviour: 296 | m_ObjectHideFlags: 0 297 | m_CorrespondingSourceObject: {fileID: 0} 298 | m_PrefabInstance: {fileID: 0} 299 | m_PrefabAsset: {fileID: 0} 300 | m_GameObject: {fileID: 0} 301 | m_Enabled: 1 302 | m_EditorHideFlags: 0 303 | m_Script: {fileID: 11500000, guid: be86366df013726459bca226fcc116eb, type: 3} 304 | m_Name: Curve 305 | m_EditorClassIdentifier: 306 | graph: {fileID: 11400000} 307 | position: {x: -1160, y: -616} 308 | ports: 309 | keys: 310 | - OutputNode 311 | values: 312 | - _fieldName: OutputNode 313 | _node: {fileID: 114903792417912858} 314 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 315 | Culture=neutral, PublicKeyToken=null 316 | connections: [] 317 | _direction: 1 318 | _connectionType: 0 319 | _dynamic: 0 320 | OutputNode: {fileID: 0} 321 | _curve: 322 | m_Curve: [] 323 | m_PreInfinity: 2 324 | m_PostInfinity: 2 325 | m_RotationOrder: 4 326 | Volume: -1 327 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Sample/SoundPlayScene.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0.4465782, g: 0.49641252, b: 0.5748167, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 0 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 10 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_Padding: 2 66 | m_LightmapParameters: {fileID: 0} 67 | m_LightmapsBakeMode: 1 68 | m_TextureCompression: 1 69 | m_FinalGather: 0 70 | m_FinalGatherFiltering: 1 71 | m_FinalGatherRayCount: 256 72 | m_ReflectionCompression: 2 73 | m_MixedBakeMode: 2 74 | m_BakeBackend: 1 75 | m_PVRSampling: 1 76 | m_PVRDirectSampleCount: 32 77 | m_PVRSampleCount: 500 78 | m_PVRBounces: 2 79 | m_PVRFilterTypeDirect: 0 80 | m_PVRFilterTypeIndirect: 0 81 | m_PVRFilterTypeAO: 0 82 | m_PVRFilteringMode: 1 83 | m_PVRCulling: 1 84 | m_PVRFilteringGaussRadiusDirect: 1 85 | m_PVRFilteringGaussRadiusIndirect: 5 86 | m_PVRFilteringGaussRadiusAO: 2 87 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 88 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 89 | m_PVRFilteringAtrousPositionSigmaAO: 1 90 | m_ShowResolutionOverlay: 1 91 | m_LightingDataAsset: {fileID: 0} 92 | m_UseShadowmask: 1 93 | --- !u!196 &4 94 | NavMeshSettings: 95 | serializedVersion: 2 96 | m_ObjectHideFlags: 0 97 | m_BuildSettings: 98 | serializedVersion: 2 99 | agentTypeID: 0 100 | agentRadius: 0.5 101 | agentHeight: 2 102 | agentSlope: 45 103 | agentClimb: 0.4 104 | ledgeDropHeight: 0 105 | maxJumpAcrossDistance: 0 106 | minRegionArea: 2 107 | manualCellSize: 0 108 | cellSize: 0.16666667 109 | manualTileSize: 0 110 | tileSize: 256 111 | accuratePlacement: 0 112 | debug: 113 | m_Flags: 0 114 | m_NavMeshData: {fileID: 0} 115 | --- !u!1 &289179828 116 | GameObject: 117 | m_ObjectHideFlags: 0 118 | m_CorrespondingSourceObject: {fileID: 0} 119 | m_PrefabInstance: {fileID: 0} 120 | m_PrefabAsset: {fileID: 0} 121 | serializedVersion: 6 122 | m_Component: 123 | - component: {fileID: 289179830} 124 | - component: {fileID: 289179829} 125 | - component: {fileID: 289179831} 126 | m_Layer: 0 127 | m_Name: SoundPlayer 128 | m_TagString: Untagged 129 | m_Icon: {fileID: 0} 130 | m_NavMeshLayer: 0 131 | m_StaticEditorFlags: 0 132 | m_IsActive: 1 133 | --- !u!114 &289179829 134 | MonoBehaviour: 135 | m_ObjectHideFlags: 0 136 | m_CorrespondingSourceObject: {fileID: 0} 137 | m_PrefabInstance: {fileID: 0} 138 | m_PrefabAsset: {fileID: 0} 139 | m_GameObject: {fileID: 289179828} 140 | m_Enabled: 1 141 | m_EditorHideFlags: 0 142 | m_Script: {fileID: 11500000, guid: 4ab4397a558500245876cd683692de11, type: 3} 143 | m_Name: 144 | m_EditorClassIdentifier: 145 | _graph: {fileID: 11400000, guid: f7c3f296ef2f2c14b8fd1e9fd9412dd0, type: 2} 146 | previewValue: 0 147 | --- !u!4 &289179830 148 | Transform: 149 | m_ObjectHideFlags: 0 150 | m_CorrespondingSourceObject: {fileID: 0} 151 | m_PrefabInstance: {fileID: 0} 152 | m_PrefabAsset: {fileID: 0} 153 | m_GameObject: {fileID: 289179828} 154 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 155 | m_LocalPosition: {x: 0, y: 0, z: 0} 156 | m_LocalScale: {x: 1, y: 1, z: 1} 157 | m_Children: [] 158 | m_Father: {fileID: 0} 159 | m_RootOrder: 2 160 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 161 | --- !u!82 &289179831 162 | AudioSource: 163 | m_ObjectHideFlags: 0 164 | m_CorrespondingSourceObject: {fileID: 0} 165 | m_PrefabInstance: {fileID: 0} 166 | m_PrefabAsset: {fileID: 0} 167 | m_GameObject: {fileID: 289179828} 168 | m_Enabled: 1 169 | serializedVersion: 4 170 | OutputAudioMixerGroup: {fileID: 0} 171 | m_audioClip: {fileID: 0} 172 | m_PlayOnAwake: 1 173 | m_Volume: 0.069 174 | m_Pitch: 1 175 | Loop: 0 176 | Mute: 0 177 | Spatialize: 0 178 | SpatializePostEffects: 0 179 | Priority: 128 180 | DopplerLevel: 1 181 | MinDistance: 1 182 | MaxDistance: 500 183 | Pan2D: 0 184 | rolloffMode: 0 185 | BypassEffects: 0 186 | BypassListenerEffects: 0 187 | BypassReverbZones: 0 188 | rolloffCustomCurve: 189 | serializedVersion: 2 190 | m_Curve: 191 | - serializedVersion: 3 192 | time: 0 193 | value: 1 194 | inSlope: 0 195 | outSlope: 0 196 | tangentMode: 0 197 | weightedMode: 0 198 | inWeight: 0.33333334 199 | outWeight: 0.33333334 200 | - serializedVersion: 3 201 | time: 1 202 | value: 0 203 | inSlope: 0 204 | outSlope: 0 205 | tangentMode: 0 206 | weightedMode: 0 207 | inWeight: 0.33333334 208 | outWeight: 0.33333334 209 | m_PreInfinity: 2 210 | m_PostInfinity: 2 211 | m_RotationOrder: 4 212 | panLevelCustomCurve: 213 | serializedVersion: 2 214 | m_Curve: 215 | - serializedVersion: 3 216 | time: 0 217 | value: 0 218 | inSlope: 0 219 | outSlope: 0 220 | tangentMode: 0 221 | weightedMode: 0 222 | inWeight: 0.33333334 223 | outWeight: 0.33333334 224 | m_PreInfinity: 2 225 | m_PostInfinity: 2 226 | m_RotationOrder: 4 227 | spreadCustomCurve: 228 | serializedVersion: 2 229 | m_Curve: 230 | - serializedVersion: 3 231 | time: 0 232 | value: 0 233 | inSlope: 0 234 | outSlope: 0 235 | tangentMode: 0 236 | weightedMode: 0 237 | inWeight: 0.33333334 238 | outWeight: 0.33333334 239 | m_PreInfinity: 2 240 | m_PostInfinity: 2 241 | m_RotationOrder: 4 242 | reverbZoneMixCustomCurve: 243 | serializedVersion: 2 244 | m_Curve: 245 | - serializedVersion: 3 246 | time: 0 247 | value: 1 248 | inSlope: 0 249 | outSlope: 0 250 | tangentMode: 0 251 | weightedMode: 0 252 | inWeight: 0.33333334 253 | outWeight: 0.33333334 254 | m_PreInfinity: 2 255 | m_PostInfinity: 2 256 | m_RotationOrder: 4 257 | --- !u!1 &1105794777 258 | GameObject: 259 | m_ObjectHideFlags: 0 260 | m_CorrespondingSourceObject: {fileID: 0} 261 | m_PrefabInstance: {fileID: 0} 262 | m_PrefabAsset: {fileID: 0} 263 | serializedVersion: 6 264 | m_Component: 265 | - component: {fileID: 1105794780} 266 | - component: {fileID: 1105794779} 267 | - component: {fileID: 1105794778} 268 | m_Layer: 0 269 | m_Name: Main Camera 270 | m_TagString: MainCamera 271 | m_Icon: {fileID: 0} 272 | m_NavMeshLayer: 0 273 | m_StaticEditorFlags: 0 274 | m_IsActive: 1 275 | --- !u!81 &1105794778 276 | AudioListener: 277 | m_ObjectHideFlags: 0 278 | m_CorrespondingSourceObject: {fileID: 0} 279 | m_PrefabInstance: {fileID: 0} 280 | m_PrefabAsset: {fileID: 0} 281 | m_GameObject: {fileID: 1105794777} 282 | m_Enabled: 1 283 | --- !u!20 &1105794779 284 | Camera: 285 | m_ObjectHideFlags: 0 286 | m_CorrespondingSourceObject: {fileID: 0} 287 | m_PrefabInstance: {fileID: 0} 288 | m_PrefabAsset: {fileID: 0} 289 | m_GameObject: {fileID: 1105794777} 290 | m_Enabled: 1 291 | serializedVersion: 2 292 | m_ClearFlags: 1 293 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 294 | m_projectionMatrixMode: 1 295 | m_SensorSize: {x: 36, y: 24} 296 | m_LensShift: {x: 0, y: 0} 297 | m_GateFitMode: 2 298 | m_FocalLength: 50 299 | m_NormalizedViewPortRect: 300 | serializedVersion: 2 301 | x: 0 302 | y: 0 303 | width: 1 304 | height: 1 305 | near clip plane: 0.3 306 | far clip plane: 1000 307 | field of view: 60 308 | orthographic: 0 309 | orthographic size: 5 310 | m_Depth: -1 311 | m_CullingMask: 312 | serializedVersion: 2 313 | m_Bits: 4294967295 314 | m_RenderingPath: -1 315 | m_TargetTexture: {fileID: 0} 316 | m_TargetDisplay: 0 317 | m_TargetEye: 3 318 | m_HDR: 1 319 | m_AllowMSAA: 1 320 | m_AllowDynamicResolution: 0 321 | m_ForceIntoRT: 0 322 | m_OcclusionCulling: 1 323 | m_StereoConvergence: 10 324 | m_StereoSeparation: 0.022 325 | --- !u!4 &1105794780 326 | Transform: 327 | m_ObjectHideFlags: 0 328 | m_CorrespondingSourceObject: {fileID: 0} 329 | m_PrefabInstance: {fileID: 0} 330 | m_PrefabAsset: {fileID: 0} 331 | m_GameObject: {fileID: 1105794777} 332 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 333 | m_LocalPosition: {x: 0, y: 0, z: 0} 334 | m_LocalScale: {x: 1, y: 1, z: 1} 335 | m_Children: [] 336 | m_Father: {fileID: 0} 337 | m_RootOrder: 0 338 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 339 | --- !u!1 &1854529306 340 | GameObject: 341 | m_ObjectHideFlags: 0 342 | m_CorrespondingSourceObject: {fileID: 0} 343 | m_PrefabInstance: {fileID: 0} 344 | m_PrefabAsset: {fileID: 0} 345 | serializedVersion: 6 346 | m_Component: 347 | - component: {fileID: 1854529308} 348 | - component: {fileID: 1854529307} 349 | m_Layer: 0 350 | m_Name: Directional Light 351 | m_TagString: Untagged 352 | m_Icon: {fileID: 0} 353 | m_NavMeshLayer: 0 354 | m_StaticEditorFlags: 0 355 | m_IsActive: 1 356 | --- !u!108 &1854529307 357 | Light: 358 | m_ObjectHideFlags: 0 359 | m_CorrespondingSourceObject: {fileID: 0} 360 | m_PrefabInstance: {fileID: 0} 361 | m_PrefabAsset: {fileID: 0} 362 | m_GameObject: {fileID: 1854529306} 363 | m_Enabled: 1 364 | serializedVersion: 8 365 | m_Type: 1 366 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 367 | m_Intensity: 1 368 | m_Range: 10 369 | m_SpotAngle: 30 370 | m_CookieSize: 10 371 | m_Shadows: 372 | m_Type: 2 373 | m_Resolution: -1 374 | m_CustomResolution: -1 375 | m_Strength: 1 376 | m_Bias: 0.05 377 | m_NormalBias: 0.4 378 | m_NearPlane: 0.2 379 | m_Cookie: {fileID: 0} 380 | m_DrawHalo: 0 381 | m_Flare: {fileID: 0} 382 | m_RenderMode: 0 383 | m_CullingMask: 384 | serializedVersion: 2 385 | m_Bits: 4294967295 386 | m_Lightmapping: 4 387 | m_LightShadowCasterMode: 0 388 | m_AreaSize: {x: 1, y: 1} 389 | m_BounceIntensity: 1 390 | m_ColorTemperature: 6570 391 | m_UseColorTemperature: 0 392 | m_ShadowRadius: 0 393 | m_ShadowAngle: 0 394 | --- !u!4 &1854529308 395 | Transform: 396 | m_ObjectHideFlags: 0 397 | m_CorrespondingSourceObject: {fileID: 0} 398 | m_PrefabInstance: {fileID: 0} 399 | m_PrefabAsset: {fileID: 0} 400 | m_GameObject: {fileID: 1854529306} 401 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 402 | m_LocalPosition: {x: 0, y: 3, z: 0} 403 | m_LocalScale: {x: 1, y: 1, z: 1} 404 | m_Children: [] 405 | m_Father: {fileID: 0} 406 | m_RootOrder: 1 407 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 408 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Sample/3_Sine_Modulate_Random.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: a9f797d31a65b4c47b78ca83c1d57bfd, type: 3} 13 | m_Name: 3_Sine_Modulate_Random 14 | m_EditorClassIdentifier: 15 | nodes: 16 | - {fileID: 114119520956522026} 17 | - {fileID: 114547645064501658} 18 | - {fileID: 114280852938357178} 19 | - {fileID: 0} 20 | --- !u!114 &114071559049339972 21 | MonoBehaviour: 22 | m_ObjectHideFlags: 0 23 | m_CorrespondingSourceObject: {fileID: 0} 24 | m_PrefabInstance: {fileID: 0} 25 | m_PrefabAsset: {fileID: 0} 26 | m_GameObject: {fileID: 0} 27 | m_Enabled: 1 28 | m_EditorHideFlags: 0 29 | m_Script: {fileID: 11500000, guid: d3bacc80cf7e9ba4092c7c051f4de5c7, type: 3} 30 | m_Name: Vector Node 31 | m_EditorClassIdentifier: 32 | graph: {fileID: 11400000} 33 | position: {x: -664, y: 536} 34 | ports: 35 | keys: 36 | - OutputNode 37 | values: 38 | - _fieldName: OutputNode 39 | _node: {fileID: 114071559049339972} 40 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 41 | Culture=neutral, PublicKeyToken=null 42 | connections: 43 | - fieldName: Amp 44 | node: {fileID: 0} 45 | reroutePoints: [] 46 | - fieldName: Amp 47 | node: {fileID: 0} 48 | reroutePoints: [] 49 | _direction: 1 50 | _connectionType: 0 51 | _dynamic: 0 52 | OutputNode: {fileID: 0} 53 | Volume: 1 54 | --- !u!114 &114119520956522026 55 | MonoBehaviour: 56 | m_ObjectHideFlags: 0 57 | m_CorrespondingSourceObject: {fileID: 0} 58 | m_PrefabInstance: {fileID: 0} 59 | m_PrefabAsset: {fileID: 0} 60 | m_GameObject: {fileID: 0} 61 | m_Enabled: 1 62 | m_EditorHideFlags: 0 63 | m_Script: {fileID: 11500000, guid: bce5cfdf80040d24fbf71a68db022c9b, type: 3} 64 | m_Name: Noise Osc 65 | m_EditorClassIdentifier: 66 | graph: {fileID: 11400000} 67 | position: {x: -184, y: -680} 68 | ports: 69 | keys: 70 | - OutputNode 71 | values: 72 | - _fieldName: OutputNode 73 | _node: {fileID: 114119520956522026} 74 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 75 | Culture=neutral, PublicKeyToken=null 76 | connections: 77 | - fieldName: In 78 | node: {fileID: 114280852938357178} 79 | reroutePoints: [] 80 | _direction: 1 81 | _connectionType: 0 82 | _dynamic: 0 83 | OutputNode: {fileID: 0} 84 | Interval: 0.01 85 | --- !u!114 &114280852938357178 86 | MonoBehaviour: 87 | m_ObjectHideFlags: 0 88 | m_CorrespondingSourceObject: {fileID: 0} 89 | m_PrefabInstance: {fileID: 0} 90 | m_PrefabAsset: {fileID: 0} 91 | m_GameObject: {fileID: 0} 92 | m_Enabled: 1 93 | m_EditorHideFlags: 0 94 | m_Script: {fileID: 11500000, guid: ef81cad4a4c9f094eb942a22ea421ada, type: 3} 95 | m_Name: Remap 96 | m_EditorClassIdentifier: 97 | graph: {fileID: 11400000} 98 | position: {x: 56, y: -680} 99 | ports: 100 | keys: 101 | - In 102 | - OutputNode 103 | values: 104 | - _fieldName: In 105 | _node: {fileID: 114280852938357178} 106 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 107 | Culture=neutral, PublicKeyToken=null 108 | connections: 109 | - fieldName: OutputNode 110 | node: {fileID: 114119520956522026} 111 | reroutePoints: [] 112 | _direction: 0 113 | _connectionType: 1 114 | _dynamic: 0 115 | - _fieldName: OutputNode 116 | _node: {fileID: 114280852938357178} 117 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 118 | Culture=neutral, PublicKeyToken=null 119 | connections: 120 | - fieldName: FreqNode 121 | node: {fileID: 114547645064501658} 122 | reroutePoints: [] 123 | _direction: 1 124 | _connectionType: 0 125 | _dynamic: 0 126 | OutputNode: {fileID: 0} 127 | In: {fileID: 0} 128 | InMin: -1 129 | InMax: 1 130 | OutMin: 440 131 | OutMax: 4000 132 | --- !u!114 &114292211875289996 133 | MonoBehaviour: 134 | m_ObjectHideFlags: 0 135 | m_CorrespondingSourceObject: {fileID: 0} 136 | m_PrefabInstance: {fileID: 0} 137 | m_PrefabAsset: {fileID: 0} 138 | m_GameObject: {fileID: 0} 139 | m_Enabled: 1 140 | m_EditorHideFlags: 0 141 | m_Script: {fileID: 11500000, guid: bea105aa486173a4aa4cc9d8c13eeb7b, type: 3} 142 | m_Name: Remap Node 143 | m_EditorClassIdentifier: 144 | graph: {fileID: 11400000} 145 | position: {x: -56, y: 600} 146 | ports: 147 | keys: 148 | - In 149 | - OutputNode 150 | values: 151 | - _fieldName: In 152 | _node: {fileID: 114292211875289996} 153 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 154 | Culture=neutral, PublicKeyToken=null 155 | connections: 156 | - fieldName: OutputNode 157 | node: {fileID: 0} 158 | reroutePoints: [] 159 | _direction: 0 160 | _connectionType: 1 161 | _dynamic: 0 162 | - _fieldName: OutputNode 163 | _node: {fileID: 114292211875289996} 164 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 165 | Culture=neutral, PublicKeyToken=null 166 | connections: 167 | - fieldName: FreqNode 168 | node: {fileID: 0} 169 | reroutePoints: [] 170 | _direction: 1 171 | _connectionType: 0 172 | _dynamic: 0 173 | OutputNode: {fileID: 0} 174 | In: {fileID: 0} 175 | InMin: -1 176 | InMax: 1 177 | OutMin: 440 178 | OutMax: 440.03 179 | --- !u!114 &114324303804486368 180 | MonoBehaviour: 181 | m_ObjectHideFlags: 0 182 | m_CorrespondingSourceObject: {fileID: 0} 183 | m_PrefabInstance: {fileID: 0} 184 | m_PrefabAsset: {fileID: 0} 185 | m_GameObject: {fileID: 0} 186 | m_Enabled: 1 187 | m_EditorHideFlags: 0 188 | m_Script: {fileID: 11500000, guid: d3bacc80cf7e9ba4092c7c051f4de5c7, type: 3} 189 | m_Name: Vector Node 190 | m_EditorClassIdentifier: 191 | graph: {fileID: 11400000} 192 | position: {x: -664, y: 696} 193 | ports: 194 | keys: 195 | - OutputNode 196 | values: 197 | - _fieldName: OutputNode 198 | _node: {fileID: 114324303804486368} 199 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 200 | Culture=neutral, PublicKeyToken=null 201 | connections: 202 | - fieldName: Freq 203 | node: {fileID: 0} 204 | reroutePoints: [] 205 | _direction: 1 206 | _connectionType: 0 207 | _dynamic: 0 208 | OutputNode: {fileID: 0} 209 | Volume: 2 210 | --- !u!114 &114545127027540424 211 | MonoBehaviour: 212 | m_ObjectHideFlags: 0 213 | m_CorrespondingSourceObject: {fileID: 0} 214 | m_PrefabInstance: {fileID: 0} 215 | m_PrefabAsset: {fileID: 0} 216 | m_GameObject: {fileID: 0} 217 | m_Enabled: 1 218 | m_EditorHideFlags: 0 219 | m_Script: {fileID: 0} 220 | m_Name: Pulse Osc 221 | m_EditorClassIdentifier: Assembly-CSharp:SoundNodeGraph:PulseOsc 222 | graph: {fileID: 11400000} 223 | position: {x: 24, y: 88} 224 | ports: 225 | keys: 226 | - PulseFreq 227 | - PulseAmp 228 | - OutputNode 229 | values: 230 | - _fieldName: PulseFreq 231 | _node: {fileID: 114545127027540424} 232 | _typeQualifiedName: SoundNodeGraph.VectorNode, Assembly-CSharp, Version=0.0.0.0, 233 | Culture=neutral, PublicKeyToken=null 234 | connections: 235 | - fieldName: OutputNode 236 | node: {fileID: 0} 237 | reroutePoints: [] 238 | _direction: 0 239 | _connectionType: 1 240 | _dynamic: 0 241 | - _fieldName: PulseAmp 242 | _node: {fileID: 114545127027540424} 243 | _typeQualifiedName: SoundNodeGraph.VectorNode, Assembly-CSharp, Version=0.0.0.0, 244 | Culture=neutral, PublicKeyToken=null 245 | connections: 246 | - fieldName: OutputNode 247 | node: {fileID: 0} 248 | reroutePoints: [] 249 | _direction: 0 250 | _connectionType: 1 251 | _dynamic: 0 252 | - _fieldName: OutputNode 253 | _node: {fileID: 114545127027540424} 254 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 255 | Culture=neutral, PublicKeyToken=null 256 | connections: 257 | - fieldName: InputNode 258 | node: {fileID: 0} 259 | reroutePoints: [] 260 | _direction: 1 261 | _connectionType: 0 262 | _dynamic: 0 263 | OutputNode: {fileID: 0} 264 | PulseAmp: {fileID: 0} 265 | PulseFreq: {fileID: 0} 266 | --- !u!114 &114547645064501658 267 | MonoBehaviour: 268 | m_ObjectHideFlags: 0 269 | m_CorrespondingSourceObject: {fileID: 0} 270 | m_PrefabInstance: {fileID: 0} 271 | m_PrefabAsset: {fileID: 0} 272 | m_GameObject: {fileID: 0} 273 | m_Enabled: 1 274 | m_EditorHideFlags: 0 275 | m_Script: {fileID: 11500000, guid: 37d9145fe859f3f43b70217bb7b74936, type: 3} 276 | m_Name: Sine Osc 277 | m_EditorClassIdentifier: 278 | graph: {fileID: 11400000} 279 | position: {x: 296, y: -744} 280 | ports: 281 | keys: 282 | - AmpNode 283 | - FreqNode 284 | - OutputNode 285 | values: 286 | - _fieldName: AmpNode 287 | _node: {fileID: 114547645064501658} 288 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 289 | Culture=neutral, PublicKeyToken=null 290 | connections: [] 291 | _direction: 0 292 | _connectionType: 1 293 | _dynamic: 0 294 | - _fieldName: FreqNode 295 | _node: {fileID: 114547645064501658} 296 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 297 | Culture=neutral, PublicKeyToken=null 298 | connections: 299 | - fieldName: OutputNode 300 | node: {fileID: 114280852938357178} 301 | reroutePoints: [] 302 | _direction: 0 303 | _connectionType: 1 304 | _dynamic: 0 305 | - _fieldName: OutputNode 306 | _node: {fileID: 114547645064501658} 307 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 308 | Culture=neutral, PublicKeyToken=null 309 | connections: [] 310 | _direction: 1 311 | _connectionType: 0 312 | _dynamic: 0 313 | OutputNode: {fileID: 0} 314 | DefaultAmp: 1 315 | DefaultFreq: 440 316 | AmpNode: {fileID: 0} 317 | FreqNode: {fileID: 0} 318 | --- !u!114 &114605303529000674 319 | MonoBehaviour: 320 | m_ObjectHideFlags: 0 321 | m_CorrespondingSourceObject: {fileID: 0} 322 | m_PrefabInstance: {fileID: 0} 323 | m_PrefabAsset: {fileID: 0} 324 | m_GameObject: {fileID: 0} 325 | m_Enabled: 1 326 | m_EditorHideFlags: 0 327 | m_Script: {fileID: 0} 328 | m_Name: Output Master 329 | m_EditorClassIdentifier: Assembly-CSharp:SoundNodeGraph.Output:OutputMaster 330 | graph: {fileID: 11400000} 331 | position: {x: 536, y: -712} 332 | ports: 333 | keys: 334 | - OutputSound 335 | values: 336 | - _fieldName: OutputSound 337 | _node: {fileID: 114605303529000674} 338 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 339 | Culture=neutral, PublicKeyToken=null 340 | connections: 341 | - fieldName: OutputNode 342 | node: {fileID: 114547645064501658} 343 | reroutePoints: [] 344 | _direction: 0 345 | _connectionType: 1 346 | _dynamic: 0 347 | OutputSound: {fileID: 0} 348 | --- !u!114 &114627456590377564 349 | MonoBehaviour: 350 | m_ObjectHideFlags: 0 351 | m_CorrespondingSourceObject: {fileID: 0} 352 | m_PrefabInstance: {fileID: 0} 353 | m_PrefabAsset: {fileID: 0} 354 | m_GameObject: {fileID: 0} 355 | m_Enabled: 1 356 | m_EditorHideFlags: 0 357 | m_Script: {fileID: 11500000, guid: ef75303d55e0c6d478108b4080953a97, type: 3} 358 | m_Name: Output Node 359 | m_EditorClassIdentifier: 360 | graph: {fileID: 11400000} 361 | position: {x: -104, y: -24} 362 | ports: 363 | keys: [] 364 | values: [] 365 | --- !u!114 &114664526583732144 366 | MonoBehaviour: 367 | m_ObjectHideFlags: 0 368 | m_CorrespondingSourceObject: {fileID: 0} 369 | m_PrefabInstance: {fileID: 0} 370 | m_PrefabAsset: {fileID: 0} 371 | m_GameObject: {fileID: 0} 372 | m_Enabled: 1 373 | m_EditorHideFlags: 0 374 | m_Script: {fileID: 11500000, guid: 2271e620fe2ebb3478a649ee589de8e7, type: 3} 375 | m_Name: Output Node 376 | m_EditorClassIdentifier: 377 | graph: {fileID: 11400000} 378 | position: {x: 456, y: 600} 379 | ports: 380 | keys: 381 | - OutputSound 382 | values: 383 | - _fieldName: OutputSound 384 | _node: {fileID: 114664526583732144} 385 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 386 | Culture=neutral, PublicKeyToken=null 387 | connections: 388 | - fieldName: OutputNode 389 | node: {fileID: 0} 390 | reroutePoints: [] 391 | _direction: 0 392 | _connectionType: 1 393 | _dynamic: 0 394 | OutputSound: {fileID: 0} 395 | --- !u!114 &114962881736905208 396 | MonoBehaviour: 397 | m_ObjectHideFlags: 0 398 | m_CorrespondingSourceObject: {fileID: 0} 399 | m_PrefabInstance: {fileID: 0} 400 | m_PrefabAsset: {fileID: 0} 401 | m_GameObject: {fileID: 0} 402 | m_Enabled: 1 403 | m_EditorHideFlags: 0 404 | m_Script: {fileID: 11500000, guid: f736aebe5ec362d4493d0427ba776db0, type: 3} 405 | m_Name: Branch 406 | m_EditorClassIdentifier: 407 | graph: {fileID: 11400000} 408 | position: {x: -184, y: -280} 409 | ports: 410 | keys: 411 | - A 412 | - B 413 | - A_Greater_B 414 | - A_Less_B 415 | - A_Equal_B 416 | - OutputNode 417 | values: 418 | - _fieldName: A 419 | _node: {fileID: 114962881736905208} 420 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 421 | Culture=neutral, PublicKeyToken=null 422 | connections: 423 | - fieldName: OutputNode 424 | node: {fileID: 0} 425 | reroutePoints: [] 426 | _direction: 0 427 | _connectionType: 1 428 | _dynamic: 0 429 | - _fieldName: B 430 | _node: {fileID: 114962881736905208} 431 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 432 | Culture=neutral, PublicKeyToken=null 433 | connections: [] 434 | _direction: 0 435 | _connectionType: 1 436 | _dynamic: 0 437 | - _fieldName: A_Greater_B 438 | _node: {fileID: 114962881736905208} 439 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 440 | Culture=neutral, PublicKeyToken=null 441 | connections: 442 | - fieldName: A 443 | node: {fileID: 0} 444 | reroutePoints: [] 445 | _direction: 1 446 | _connectionType: 0 447 | _dynamic: 0 448 | - _fieldName: A_Less_B 449 | _node: {fileID: 114962881736905208} 450 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 451 | Culture=neutral, PublicKeyToken=null 452 | connections: [] 453 | _direction: 1 454 | _connectionType: 0 455 | _dynamic: 0 456 | - _fieldName: A_Equal_B 457 | _node: {fileID: 114962881736905208} 458 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 459 | Culture=neutral, PublicKeyToken=null 460 | connections: [] 461 | _direction: 1 462 | _connectionType: 0 463 | _dynamic: 0 464 | - _fieldName: OutputNode 465 | _node: {fileID: 114962881736905208} 466 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 467 | Culture=neutral, PublicKeyToken=null 468 | connections: [] 469 | _direction: 1 470 | _connectionType: 0 471 | _dynamic: 0 472 | OutputNode: {fileID: 0} 473 | DefaultA: 0.52 474 | DefaultB: 0.25 475 | A: {fileID: 0} 476 | B: {fileID: 0} 477 | A_Greater_B: {fileID: 0} 478 | A_Less_B: {fileID: 0} 479 | A_Equal_B: {fileID: 0} 480 | -------------------------------------------------------------------------------- /Assets/SoundGraph/Sample/2_Sine_Modulate_Sine.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: a9f797d31a65b4c47b78ca83c1d57bfd, type: 3} 13 | m_Name: 2_Sine_Modulate_Sine 14 | m_EditorClassIdentifier: 15 | nodes: 16 | - {fileID: 114547645064501658} 17 | - {fileID: 114620301349381194} 18 | - {fileID: 114605303529000674} 19 | - {fileID: 0} 20 | --- !u!114 &114071559049339972 21 | MonoBehaviour: 22 | m_ObjectHideFlags: 0 23 | m_CorrespondingSourceObject: {fileID: 0} 24 | m_PrefabInstance: {fileID: 0} 25 | m_PrefabAsset: {fileID: 0} 26 | m_GameObject: {fileID: 0} 27 | m_Enabled: 1 28 | m_EditorHideFlags: 0 29 | m_Script: {fileID: 11500000, guid: d3bacc80cf7e9ba4092c7c051f4de5c7, type: 3} 30 | m_Name: Vector Node 31 | m_EditorClassIdentifier: 32 | graph: {fileID: 11400000} 33 | position: {x: -664, y: 536} 34 | ports: 35 | keys: 36 | - OutputNode 37 | values: 38 | - _fieldName: OutputNode 39 | _node: {fileID: 114071559049339972} 40 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 41 | Culture=neutral, PublicKeyToken=null 42 | connections: 43 | - fieldName: Amp 44 | node: {fileID: 0} 45 | reroutePoints: [] 46 | - fieldName: Amp 47 | node: {fileID: 0} 48 | reroutePoints: [] 49 | _direction: 1 50 | _connectionType: 0 51 | _dynamic: 0 52 | OutputNode: {fileID: 0} 53 | Volume: 1 54 | --- !u!114 &114292211875289996 55 | MonoBehaviour: 56 | m_ObjectHideFlags: 0 57 | m_CorrespondingSourceObject: {fileID: 0} 58 | m_PrefabInstance: {fileID: 0} 59 | m_PrefabAsset: {fileID: 0} 60 | m_GameObject: {fileID: 0} 61 | m_Enabled: 1 62 | m_EditorHideFlags: 0 63 | m_Script: {fileID: 11500000, guid: bea105aa486173a4aa4cc9d8c13eeb7b, type: 3} 64 | m_Name: Remap Node 65 | m_EditorClassIdentifier: 66 | graph: {fileID: 11400000} 67 | position: {x: -56, y: 600} 68 | ports: 69 | keys: 70 | - In 71 | - OutputNode 72 | values: 73 | - _fieldName: In 74 | _node: {fileID: 114292211875289996} 75 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 76 | Culture=neutral, PublicKeyToken=null 77 | connections: 78 | - fieldName: OutputNode 79 | node: {fileID: 0} 80 | reroutePoints: [] 81 | _direction: 0 82 | _connectionType: 1 83 | _dynamic: 0 84 | - _fieldName: OutputNode 85 | _node: {fileID: 114292211875289996} 86 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 87 | Culture=neutral, PublicKeyToken=null 88 | connections: 89 | - fieldName: FreqNode 90 | node: {fileID: 0} 91 | reroutePoints: [] 92 | _direction: 1 93 | _connectionType: 0 94 | _dynamic: 0 95 | OutputNode: {fileID: 0} 96 | In: {fileID: 0} 97 | InMin: -1 98 | InMax: 1 99 | OutMin: 440 100 | OutMax: 440.03 101 | --- !u!114 &114324303804486368 102 | MonoBehaviour: 103 | m_ObjectHideFlags: 0 104 | m_CorrespondingSourceObject: {fileID: 0} 105 | m_PrefabInstance: {fileID: 0} 106 | m_PrefabAsset: {fileID: 0} 107 | m_GameObject: {fileID: 0} 108 | m_Enabled: 1 109 | m_EditorHideFlags: 0 110 | m_Script: {fileID: 11500000, guid: d3bacc80cf7e9ba4092c7c051f4de5c7, type: 3} 111 | m_Name: Vector Node 112 | m_EditorClassIdentifier: 113 | graph: {fileID: 11400000} 114 | position: {x: -664, y: 696} 115 | ports: 116 | keys: 117 | - OutputNode 118 | values: 119 | - _fieldName: OutputNode 120 | _node: {fileID: 114324303804486368} 121 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 122 | Culture=neutral, PublicKeyToken=null 123 | connections: 124 | - fieldName: Freq 125 | node: {fileID: 0} 126 | reroutePoints: [] 127 | _direction: 1 128 | _connectionType: 0 129 | _dynamic: 0 130 | OutputNode: {fileID: 0} 131 | Volume: 2 132 | --- !u!114 &114545127027540424 133 | MonoBehaviour: 134 | m_ObjectHideFlags: 0 135 | m_CorrespondingSourceObject: {fileID: 0} 136 | m_PrefabInstance: {fileID: 0} 137 | m_PrefabAsset: {fileID: 0} 138 | m_GameObject: {fileID: 0} 139 | m_Enabled: 1 140 | m_EditorHideFlags: 0 141 | m_Script: {fileID: 0} 142 | m_Name: Pulse Osc 143 | m_EditorClassIdentifier: Assembly-CSharp:SoundNodeGraph:PulseOsc 144 | graph: {fileID: 11400000} 145 | position: {x: 24, y: 88} 146 | ports: 147 | keys: 148 | - PulseFreq 149 | - PulseAmp 150 | - OutputNode 151 | values: 152 | - _fieldName: PulseFreq 153 | _node: {fileID: 114545127027540424} 154 | _typeQualifiedName: SoundNodeGraph.VectorNode, Assembly-CSharp, Version=0.0.0.0, 155 | Culture=neutral, PublicKeyToken=null 156 | connections: 157 | - fieldName: OutputNode 158 | node: {fileID: 0} 159 | reroutePoints: [] 160 | _direction: 0 161 | _connectionType: 1 162 | _dynamic: 0 163 | - _fieldName: PulseAmp 164 | _node: {fileID: 114545127027540424} 165 | _typeQualifiedName: SoundNodeGraph.VectorNode, Assembly-CSharp, Version=0.0.0.0, 166 | Culture=neutral, PublicKeyToken=null 167 | connections: 168 | - fieldName: OutputNode 169 | node: {fileID: 0} 170 | reroutePoints: [] 171 | _direction: 0 172 | _connectionType: 1 173 | _dynamic: 0 174 | - _fieldName: OutputNode 175 | _node: {fileID: 114545127027540424} 176 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 177 | Culture=neutral, PublicKeyToken=null 178 | connections: 179 | - fieldName: InputNode 180 | node: {fileID: 0} 181 | reroutePoints: [] 182 | _direction: 1 183 | _connectionType: 0 184 | _dynamic: 0 185 | OutputNode: {fileID: 0} 186 | PulseAmp: {fileID: 0} 187 | PulseFreq: {fileID: 0} 188 | --- !u!114 &114547645064501658 189 | MonoBehaviour: 190 | m_ObjectHideFlags: 0 191 | m_CorrespondingSourceObject: {fileID: 0} 192 | m_PrefabInstance: {fileID: 0} 193 | m_PrefabAsset: {fileID: 0} 194 | m_GameObject: {fileID: 0} 195 | m_Enabled: 1 196 | m_EditorHideFlags: 0 197 | m_Script: {fileID: 11500000, guid: 37d9145fe859f3f43b70217bb7b74936, type: 3} 198 | m_Name: Sine Osc 199 | m_EditorClassIdentifier: 200 | graph: {fileID: 11400000} 201 | position: {x: 88, y: -728} 202 | ports: 203 | keys: 204 | - AmpNode 205 | - FreqNode 206 | - OutputNode 207 | - PhaseNode 208 | values: 209 | - _fieldName: AmpNode 210 | _node: {fileID: 114547645064501658} 211 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 212 | Culture=neutral, PublicKeyToken=null 213 | connections: [] 214 | _direction: 0 215 | _connectionType: 1 216 | _dynamic: 0 217 | - _fieldName: FreqNode 218 | _node: {fileID: 114547645064501658} 219 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 220 | Culture=neutral, PublicKeyToken=null 221 | connections: [] 222 | _direction: 0 223 | _connectionType: 1 224 | _dynamic: 0 225 | - _fieldName: OutputNode 226 | _node: {fileID: 114547645064501658} 227 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 228 | Culture=neutral, PublicKeyToken=null 229 | connections: 230 | - fieldName: OutputSound 231 | node: {fileID: 114605303529000674} 232 | reroutePoints: [] 233 | _direction: 1 234 | _connectionType: 0 235 | _dynamic: 0 236 | - _fieldName: PhaseNode 237 | _node: {fileID: 114547645064501658} 238 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 239 | Culture=neutral, PublicKeyToken=null 240 | connections: 241 | - fieldName: OutputNode 242 | node: {fileID: 114620301349381194} 243 | reroutePoints: [] 244 | _direction: 0 245 | _connectionType: 1 246 | _dynamic: 0 247 | OutputNode: {fileID: 0} 248 | DefaultAmp: 0.5 249 | DefaultFreq: 440 250 | DefaultPhase: 0 251 | AmpNode: {fileID: 0} 252 | FreqNode: {fileID: 0} 253 | PhaseNode: {fileID: 0} 254 | --- !u!114 &114605303529000674 255 | MonoBehaviour: 256 | m_ObjectHideFlags: 0 257 | m_CorrespondingSourceObject: {fileID: 0} 258 | m_PrefabInstance: {fileID: 0} 259 | m_PrefabAsset: {fileID: 0} 260 | m_GameObject: {fileID: 0} 261 | m_Enabled: 1 262 | m_EditorHideFlags: 0 263 | m_Script: {fileID: 0} 264 | m_Name: Output Master 265 | m_EditorClassIdentifier: Assembly-CSharp:SoundNodeGraph.Output:OutputMaster 266 | graph: {fileID: 11400000} 267 | position: {x: 408, y: -728} 268 | ports: 269 | keys: 270 | - OutputSound 271 | values: 272 | - _fieldName: OutputSound 273 | _node: {fileID: 114605303529000674} 274 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 275 | Culture=neutral, PublicKeyToken=null 276 | connections: 277 | - fieldName: OutputNode 278 | node: {fileID: 114547645064501658} 279 | reroutePoints: [] 280 | _direction: 0 281 | _connectionType: 1 282 | _dynamic: 0 283 | OutputSound: {fileID: 0} 284 | --- !u!114 &114620301349381194 285 | MonoBehaviour: 286 | m_ObjectHideFlags: 0 287 | m_CorrespondingSourceObject: {fileID: 0} 288 | m_PrefabInstance: {fileID: 0} 289 | m_PrefabAsset: {fileID: 0} 290 | m_GameObject: {fileID: 0} 291 | m_Enabled: 1 292 | m_EditorHideFlags: 0 293 | m_Script: {fileID: 11500000, guid: 37d9145fe859f3f43b70217bb7b74936, type: 3} 294 | m_Name: Sine Osc 295 | m_EditorClassIdentifier: 296 | graph: {fileID: 11400000} 297 | position: {x: -152, y: -600} 298 | ports: 299 | keys: 300 | - AmpNode 301 | - FreqNode 302 | - OutputNode 303 | - PhaseNode 304 | values: 305 | - _fieldName: AmpNode 306 | _node: {fileID: 114620301349381194} 307 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 308 | Culture=neutral, PublicKeyToken=null 309 | connections: [] 310 | _direction: 0 311 | _connectionType: 1 312 | _dynamic: 0 313 | - _fieldName: FreqNode 314 | _node: {fileID: 114620301349381194} 315 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 316 | Culture=neutral, PublicKeyToken=null 317 | connections: [] 318 | _direction: 0 319 | _connectionType: 1 320 | _dynamic: 0 321 | - _fieldName: OutputNode 322 | _node: {fileID: 114620301349381194} 323 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 324 | Culture=neutral, PublicKeyToken=null 325 | connections: 326 | - fieldName: PhaseNode 327 | node: {fileID: 114547645064501658} 328 | reroutePoints: [] 329 | _direction: 1 330 | _connectionType: 0 331 | _dynamic: 0 332 | - _fieldName: PhaseNode 333 | _node: {fileID: 114620301349381194} 334 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 335 | Culture=neutral, PublicKeyToken=null 336 | connections: [] 337 | _direction: 0 338 | _connectionType: 1 339 | _dynamic: 0 340 | OutputNode: {fileID: 0} 341 | DefaultAmp: 8 342 | DefaultFreq: 512 343 | DefaultPhase: 0 344 | AmpNode: {fileID: 0} 345 | FreqNode: {fileID: 0} 346 | PhaseNode: {fileID: 0} 347 | --- !u!114 &114627456590377564 348 | MonoBehaviour: 349 | m_ObjectHideFlags: 0 350 | m_CorrespondingSourceObject: {fileID: 0} 351 | m_PrefabInstance: {fileID: 0} 352 | m_PrefabAsset: {fileID: 0} 353 | m_GameObject: {fileID: 0} 354 | m_Enabled: 1 355 | m_EditorHideFlags: 0 356 | m_Script: {fileID: 11500000, guid: ef75303d55e0c6d478108b4080953a97, type: 3} 357 | m_Name: Output Node 358 | m_EditorClassIdentifier: 359 | graph: {fileID: 11400000} 360 | position: {x: -104, y: -24} 361 | ports: 362 | keys: [] 363 | values: [] 364 | --- !u!114 &114664526583732144 365 | MonoBehaviour: 366 | m_ObjectHideFlags: 0 367 | m_CorrespondingSourceObject: {fileID: 0} 368 | m_PrefabInstance: {fileID: 0} 369 | m_PrefabAsset: {fileID: 0} 370 | m_GameObject: {fileID: 0} 371 | m_Enabled: 1 372 | m_EditorHideFlags: 0 373 | m_Script: {fileID: 11500000, guid: 2271e620fe2ebb3478a649ee589de8e7, type: 3} 374 | m_Name: Output Node 375 | m_EditorClassIdentifier: 376 | graph: {fileID: 11400000} 377 | position: {x: 456, y: 600} 378 | ports: 379 | keys: 380 | - OutputSound 381 | values: 382 | - _fieldName: OutputSound 383 | _node: {fileID: 114664526583732144} 384 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 385 | Culture=neutral, PublicKeyToken=null 386 | connections: 387 | - fieldName: OutputNode 388 | node: {fileID: 0} 389 | reroutePoints: [] 390 | _direction: 0 391 | _connectionType: 1 392 | _dynamic: 0 393 | OutputSound: {fileID: 0} 394 | --- !u!114 &114962881736905208 395 | MonoBehaviour: 396 | m_ObjectHideFlags: 0 397 | m_CorrespondingSourceObject: {fileID: 0} 398 | m_PrefabInstance: {fileID: 0} 399 | m_PrefabAsset: {fileID: 0} 400 | m_GameObject: {fileID: 0} 401 | m_Enabled: 1 402 | m_EditorHideFlags: 0 403 | m_Script: {fileID: 11500000, guid: f736aebe5ec362d4493d0427ba776db0, type: 3} 404 | m_Name: Branch 405 | m_EditorClassIdentifier: 406 | graph: {fileID: 11400000} 407 | position: {x: -184, y: -280} 408 | ports: 409 | keys: 410 | - A 411 | - B 412 | - A_Greater_B 413 | - A_Less_B 414 | - A_Equal_B 415 | - OutputNode 416 | values: 417 | - _fieldName: A 418 | _node: {fileID: 114962881736905208} 419 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 420 | Culture=neutral, PublicKeyToken=null 421 | connections: 422 | - fieldName: OutputNode 423 | node: {fileID: 0} 424 | reroutePoints: [] 425 | _direction: 0 426 | _connectionType: 1 427 | _dynamic: 0 428 | - _fieldName: B 429 | _node: {fileID: 114962881736905208} 430 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 431 | Culture=neutral, PublicKeyToken=null 432 | connections: [] 433 | _direction: 0 434 | _connectionType: 1 435 | _dynamic: 0 436 | - _fieldName: A_Greater_B 437 | _node: {fileID: 114962881736905208} 438 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 439 | Culture=neutral, PublicKeyToken=null 440 | connections: 441 | - fieldName: A 442 | node: {fileID: 0} 443 | reroutePoints: [] 444 | _direction: 1 445 | _connectionType: 0 446 | _dynamic: 0 447 | - _fieldName: A_Less_B 448 | _node: {fileID: 114962881736905208} 449 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 450 | Culture=neutral, PublicKeyToken=null 451 | connections: [] 452 | _direction: 1 453 | _connectionType: 0 454 | _dynamic: 0 455 | - _fieldName: A_Equal_B 456 | _node: {fileID: 114962881736905208} 457 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 458 | Culture=neutral, PublicKeyToken=null 459 | connections: [] 460 | _direction: 1 461 | _connectionType: 0 462 | _dynamic: 0 463 | - _fieldName: OutputNode 464 | _node: {fileID: 114962881736905208} 465 | _typeQualifiedName: SoundNodeGraph.BaseSoundNode, Assembly-CSharp, Version=0.0.0.0, 466 | Culture=neutral, PublicKeyToken=null 467 | connections: [] 468 | _direction: 1 469 | _connectionType: 0 470 | _dynamic: 0 471 | OutputNode: {fileID: 0} 472 | DefaultA: 0.52 473 | DefaultB: 0.25 474 | A: {fileID: 0} 475 | B: {fileID: 0} 476 | A_Greater_B: {fileID: 0} 477 | A_Less_B: {fileID: 0} 478 | A_Equal_B: {fileID: 0} 479 | --------------------------------------------------------------------------------