├── .gitignore ├── QuickStartGuide.txt ├── QuickStartGuide.txt.meta ├── README.md ├── README.md.meta ├── ThirdParty.meta ├── ThirdParty ├── ProceduralNoise.meta ├── ProceduralNoise │ ├── Noise.meta │ └── Noise │ │ ├── FractalNoise.cs │ │ ├── FractalNoise.cs.meta │ │ ├── INoise.cs │ │ ├── INoise.cs.meta │ │ ├── Noise.cs │ │ ├── Noise.cs.meta │ │ ├── NoiseType.cs │ │ ├── NoiseType.cs.meta │ │ ├── PerlinNoise.cs │ │ ├── PerlinNoise.cs.meta │ │ ├── PermutationTable.cs │ │ ├── PermutationTable.cs.meta │ │ ├── SimplexNoise.cs │ │ ├── SimplexNoise.cs.meta │ │ ├── ValueNoise.cs │ │ ├── ValueNoise.cs.meta │ │ ├── VoronoiNoise.cs │ │ ├── VoronoiNoise.cs.meta │ │ ├── WorleyNoise.cs │ │ └── WorleyNoise.cs.meta ├── xNode-master.meta └── xNode-master │ ├── Examples.meta │ ├── Examples │ ├── LogicToy.meta │ ├── LogicToy │ │ ├── Editor.meta │ │ ├── Editor │ │ │ ├── LogicGraphEditor.cs │ │ │ ├── LogicGraphEditor.cs.meta │ │ │ ├── LogicNodeEditor.cs │ │ │ └── LogicNodeEditor.cs.meta │ │ ├── Example.asset │ │ ├── Example.asset.meta │ │ ├── ITimerTick.cs │ │ ├── ITimerTick.cs.meta │ │ ├── LogicGraph.cs │ │ ├── LogicGraph.cs.meta │ │ ├── Nodes.meta │ │ └── Nodes │ │ │ ├── AndNode.cs │ │ │ ├── AndNode.cs.meta │ │ │ ├── LogicNode.cs │ │ │ ├── LogicNode.cs.meta │ │ │ ├── NotNode.cs │ │ │ ├── NotNode.cs.meta │ │ │ ├── PulseNode.cs │ │ │ ├── PulseNode.cs.meta │ │ │ ├── ToggleNode.cs │ │ │ └── ToggleNode.cs.meta │ ├── MathGraph.meta │ ├── MathGraph │ │ ├── Editor.meta │ │ ├── Editor │ │ │ ├── MathGraphEditor.cs │ │ │ └── MathGraphEditor.cs.meta │ │ ├── MathGraph.cs │ │ ├── MathGraph.cs.meta │ │ ├── New Math Graph.asset │ │ ├── New Math Graph.asset.meta │ │ ├── Nodes.meta │ │ └── Nodes │ │ │ ├── DisplayValue.cs │ │ │ ├── DisplayValue.cs.meta │ │ │ ├── Editor.meta │ │ │ ├── Editor │ │ │ ├── DisplayValueEditor.cs │ │ │ └── DisplayValueEditor.cs.meta │ │ │ ├── MathNode.cs │ │ │ ├── MathNode.cs.meta │ │ │ ├── Vector.cs │ │ │ └── Vector.cs.meta │ ├── RuntimeMathGraph.meta │ ├── RuntimeMathGraph │ │ ├── Graphics.meta │ │ ├── Graphics │ │ │ ├── half.png │ │ │ ├── half.png.meta │ │ │ ├── xnode_dot.png │ │ │ ├── xnode_dot.png.meta │ │ │ ├── xnode_dot_outer.png │ │ │ ├── xnode_dot_outer.png.meta │ │ │ ├── xnode_node.png │ │ │ ├── xnode_node.png.meta │ │ │ ├── xnode_node_highlight.png │ │ │ └── xnode_node_highlight.png.meta │ │ ├── Prefabs.meta │ │ ├── Prefabs │ │ │ ├── Connection.prefab │ │ │ ├── Connection.prefab.meta │ │ │ ├── NodeGraph.prefab │ │ │ ├── NodeGraph.prefab.meta │ │ │ ├── Nodes.meta │ │ │ └── Nodes │ │ │ │ ├── DisplayValue.prefab │ │ │ │ ├── DisplayValue.prefab.meta │ │ │ │ ├── MathNode.prefab │ │ │ │ ├── MathNode.prefab.meta │ │ │ │ ├── Vector.prefab │ │ │ │ └── Vector.prefab.meta │ │ ├── Scenes.meta │ │ ├── Scenes │ │ │ ├── RuntimeGraph.unity │ │ │ ├── RuntimeGraph.unity.meta │ │ │ ├── RuntimeGraphSettings.lighting │ │ │ └── RuntimeGraphSettings.lighting.meta │ │ ├── Scripts.meta │ │ └── Scripts │ │ │ ├── Connection.cs │ │ │ ├── Connection.cs.meta │ │ │ ├── NodeDrag.cs │ │ │ ├── NodeDrag.cs.meta │ │ │ ├── RuntimeMathGraph.cs │ │ │ ├── RuntimeMathGraph.cs.meta │ │ │ ├── RuntimeNodes.meta │ │ │ ├── RuntimeNodes │ │ │ ├── UGUIDisplayValue.cs │ │ │ ├── UGUIDisplayValue.cs.meta │ │ │ ├── UGUIMathBaseNode.cs │ │ │ ├── UGUIMathBaseNode.cs.meta │ │ │ ├── UGUIMathNode.cs │ │ │ ├── UGUIMathNode.cs.meta │ │ │ ├── UGUIVector.cs │ │ │ └── UGUIVector.cs.meta │ │ │ ├── UGUIContextMenu.cs │ │ │ ├── UGUIContextMenu.cs.meta │ │ │ ├── UGUIPort.cs │ │ │ ├── UGUIPort.cs.meta │ │ │ ├── UGUITooltip.cs │ │ │ └── UGUITooltip.cs.meta │ ├── StateMachine.meta │ └── StateMachine │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── StateGraphEditor.cs │ │ └── StateGraphEditor.cs.meta │ │ ├── New State Graph.asset │ │ ├── New State Graph.asset.meta │ │ ├── Nodes.meta │ │ ├── Nodes │ │ ├── Editor.meta │ │ ├── Editor │ │ │ ├── StateNodeEditor.cs │ │ │ └── StateNodeEditor.cs.meta │ │ ├── StateNode.cs │ │ └── StateNode.cs.meta │ │ ├── README.md │ │ ├── README.md.meta │ │ ├── StateGraph.cs │ │ ├── StateGraph.cs.meta │ │ ├── test.asset │ │ └── test.asset.meta │ ├── Scripts.meta │ └── Scripts │ ├── Attributes.meta │ ├── Attributes │ ├── NodeEnum.cs │ └── NodeEnum.cs.meta │ ├── Editor.meta │ ├── Editor │ ├── Drawers.meta │ ├── Drawers │ │ ├── NodeEnumDrawer.cs │ │ ├── NodeEnumDrawer.cs.meta │ │ ├── Odin.meta │ │ └── Odin │ │ │ ├── InNodeEditorAttributeProcessor.cs │ │ │ ├── InNodeEditorAttributeProcessor.cs.meta │ │ │ ├── InputAttributeDrawer.cs │ │ │ ├── InputAttributeDrawer.cs.meta │ │ │ ├── OutputAttributeDrawer.cs │ │ │ └── OutputAttributeDrawer.cs.meta │ ├── GraphAndNodeEditor.cs │ ├── GraphAndNodeEditor.cs.meta │ ├── GraphRenameFixAssetProcessor.cs │ ├── GraphRenameFixAssetProcessor.cs.meta │ ├── Internal.meta │ ├── Internal │ │ ├── RerouteReference.cs │ │ └── RerouteReference.cs.meta │ ├── NodeEditor.cs │ ├── NodeEditor.cs.meta │ ├── NodeEditorAction.cs │ ├── NodeEditorAction.cs.meta │ ├── NodeEditorAssetModProcessor.cs │ ├── NodeEditorAssetModProcessor.cs.meta │ ├── NodeEditorBase.cs │ ├── NodeEditorBase.cs.meta │ ├── NodeEditorGUI.cs │ ├── NodeEditorGUI.cs.meta │ ├── NodeEditorGUILayout.cs │ ├── NodeEditorGUILayout.cs.meta │ ├── NodeEditorPreferences.cs │ ├── NodeEditorPreferences.cs.meta │ ├── NodeEditorReflection.cs │ ├── NodeEditorReflection.cs.meta │ ├── NodeEditorResources.cs │ ├── NodeEditorResources.cs.meta │ ├── NodeEditorUtilities.cs │ ├── NodeEditorUtilities.cs.meta │ ├── NodeEditorWindow.cs │ ├── NodeEditorWindow.cs.meta │ ├── NodeGraphEditor.cs │ ├── NodeGraphEditor.cs.meta │ ├── NodeGraphImporter.cs │ ├── NodeGraphImporter.cs.meta │ ├── RenamePopup.cs │ ├── RenamePopup.cs.meta │ ├── Resources.meta │ ├── Resources │ │ ├── ScriptTemplates.meta │ │ ├── ScriptTemplates │ │ │ ├── xNode_NodeGraphTemplate.cs.txt │ │ │ ├── xNode_NodeGraphTemplate.cs.txt.meta │ │ │ ├── xNode_NodeTemplate.cs.txt │ │ │ └── xNode_NodeTemplate.cs.txt.meta │ │ ├── xnode_dot.png │ │ ├── xnode_dot.png.meta │ │ ├── xnode_dot_outer.png │ │ ├── xnode_dot_outer.png.meta │ │ ├── xnode_node.png │ │ ├── xnode_node.png.meta │ │ ├── xnode_node_highlight.png │ │ ├── xnode_node_highlight.png.meta │ │ ├── xnode_node_workfile.psd │ │ └── xnode_node_workfile.psd.meta │ ├── SceneGraphEditor.cs │ ├── SceneGraphEditor.cs.meta │ ├── XNodeEditor.asmdef │ └── XNodeEditor.asmdef.meta │ ├── Node.cs │ ├── Node.cs.meta │ ├── NodeDataCache.cs │ ├── NodeDataCache.cs.meta │ ├── NodeGraph.cs │ ├── NodeGraph.cs.meta │ ├── NodePort.cs │ ├── NodePort.cs.meta │ ├── SceneGraph.cs │ ├── SceneGraph.cs.meta │ ├── XNode.asmdef │ └── XNode.asmdef.meta ├── UltraNoise5000.meta └── UltraNoise5000 ├── Async.meta ├── Async ├── BaseSampleStep.cs ├── BaseSampleStep.cs.meta ├── BaseSampleStep2DAsync.cs ├── BaseSampleStep2DAsync.cs.meta ├── BaseSampleStep3DAsync.cs ├── BaseSampleStep3DAsync.cs.meta ├── BaseSampleStepAsync.cs ├── BaseSampleStepAsync.cs.meta ├── PaintToolSampleStep.cs ├── PaintToolSampleStep.cs.meta ├── SampleStepColor.cs ├── SampleStepColor.cs.meta ├── SampleStepFloat.cs ├── SampleStepFloat.cs.meta ├── SampleStepFloat2.cs ├── SampleStepFloat2.cs.meta ├── SampleStepFloat3.cs └── SampleStepFloat3.cs.meta ├── Exports.meta ├── Exports ├── ExportNode.cs ├── ExportNode.cs.meta ├── PaintLayer.cs ├── PaintLayer.cs.meta ├── PaintLayerExportGroup.cs ├── PaintLayerExportGroup.cs.meta ├── TextureExportNode.cs └── TextureExportNode.cs.meta ├── Generators.meta ├── Generators ├── Attributes.cs ├── Attributes.cs.meta ├── NodeGeneratorHelper.cs ├── NodeGeneratorHelper.cs.meta ├── NoiseGenerator.cs ├── NoiseGenerator.cs.meta ├── Static.meta └── Static │ ├── Black.cs │ ├── Black.cs.meta │ ├── Circle.cs │ ├── Circle.cs.meta │ ├── ExternalNode.cs │ ├── ExternalNode.cs.meta │ ├── Gradient.cs │ ├── Gradient.cs.meta │ ├── Texture.cs │ ├── Texture.cs.meta │ ├── Triangle.cs │ ├── Triangle.cs.meta │ ├── White.cs │ └── White.cs.meta ├── Graph.meta ├── Graph ├── NoiseNodeGraph.cs └── NoiseNodeGraph.cs.meta ├── Modifiers.meta ├── Modifiers ├── AbsCordinates.cs ├── AbsCordinates.cs.meta ├── BaseNodeModifier.cs ├── BaseNodeModifier.cs.meta ├── Clamp.cs ├── Clamp.cs.meta ├── Cos.cs ├── Cos.cs.meta ├── Curve.cs ├── Curve.cs.meta ├── OneMinus.cs ├── OneMinus.cs.meta ├── Sin.cs ├── Sin.cs.meta ├── Step.cs ├── Step.cs.meta ├── Tan.cs └── Tan.cs.meta ├── Nodes.meta ├── Nodes ├── Bound.cs ├── Bound.cs.meta ├── NodeBase.cs ├── NodeBase.cs.meta ├── NodeDoubleInputOutput.cs ├── NodeDoubleInputOutput.cs.meta ├── NodeInputOutput.cs ├── NodeInputOutput.cs.meta ├── NodeOutput.cs ├── NodeOutput.cs.meta ├── NodeProprieties.cs ├── NodeProprieties.cs.meta ├── NodeTripleInputOutput.cs ├── NodeTripleInputOutput.cs.meta ├── PreviewImage.cs └── PreviewImage.cs.meta ├── Operations.meta ├── Operations ├── Add.cs ├── Add.cs.meta ├── Div.cs ├── Div.cs.meta ├── Lerp.cs ├── Lerp.cs.meta ├── LerpNoise.cs ├── LerpNoise.cs.meta ├── Mult.cs ├── Mult.cs.meta ├── Sub.cs └── Sub.cs.meta ├── UseTools.meta ├── UseTools ├── Mesh.meta ├── Mesh │ ├── UltraMeshDeformationTool.cs │ └── UltraMeshDeformationTool.cs.meta ├── Movement.meta ├── Movement │ ├── UltraNoiseMovement.cs │ ├── UltraNoiseMovement.cs.meta │ ├── UltraNoiseMovementSettings.cs │ └── UltraNoiseMovementSettings.cs.meta ├── Placement.meta ├── Placement │ ├── Base.meta │ ├── Base │ │ ├── PlacementItem.cs │ │ ├── PlacementItem.cs.meta │ │ ├── PlacementSettings.cs │ │ ├── PlacementSettings.cs.meta │ │ ├── PlacementVectorRange.cs │ │ ├── PlacementVectorRange.cs.meta │ │ ├── PlacementVectorRangeRandom.cs │ │ ├── PlacementVectorRangeRandom.cs.meta │ │ ├── PlacementVectorRangeValue.cs │ │ ├── PlacementVectorRangeValue.cs.meta │ │ ├── enum.meta │ │ └── enum │ │ │ ├── AxisType.cs │ │ │ ├── AxisType.cs.meta │ │ │ ├── RangeType.cs │ │ │ └── RangeType.cs.meta │ ├── HeightPositioning.meta │ ├── HeightPositioning │ │ ├── GridHeightPos.cs │ │ ├── GridHeightPos.cs.meta │ │ ├── HeightBase.cs │ │ ├── HeightBase.cs.meta │ │ ├── HeightPosType.cs │ │ ├── HeightPosType.cs.meta │ │ ├── IHeightBase.cs │ │ ├── IHeightBase.cs.meta │ │ ├── NoiseHeightPos.cs │ │ ├── NoiseHeightPos.cs.meta │ │ ├── RayCastHeightPos.cs │ │ └── RayCastHeightPos.cs.meta │ ├── PlacementItemGameObject.cs │ ├── PlacementItemGameObject.cs.meta │ ├── Settings.meta │ ├── Settings │ │ ├── BasePlacementSetting.cs │ │ ├── BasePlacementSetting.cs.meta │ │ ├── PositionSettings.cs │ │ ├── PositionSettings.cs.meta │ │ ├── RotationSettings.cs │ │ ├── RotationSettings.cs.meta │ │ ├── ScaleSettings.cs │ │ └── ScaleSettings.cs.meta │ ├── UltraPlacementTool.cs │ └── UltraPlacementTool.cs.meta ├── Terrain.meta ├── Terrain │ ├── BaseTool.cs │ ├── BaseTool.cs.meta │ ├── TerrainTool.cs │ ├── TerrainTool.cs.meta │ ├── UltraTerrainPainter.cs │ ├── UltraTerrainPainter.cs.meta │ ├── UltraTerrainShaper.cs │ └── UltraTerrainShaper.cs.meta ├── Transform.meta ├── Transform │ ├── Position.cs │ ├── Position.cs.meta │ ├── Rotation.cs │ ├── Rotation.cs.meta │ ├── Scale.cs │ └── Scale.cs.meta ├── Utils.meta └── Utils │ ├── CoroutineWrapper.cs │ ├── CoroutineWrapper.cs.meta │ ├── MathUtils.cs │ ├── MathUtils.cs.meta │ ├── PlacementBounds.cs │ ├── PlacementBounds.cs.meta │ ├── Profiler.cs │ ├── Profiler.cs.meta │ ├── ProgressBar.cs │ ├── ProgressBar.cs.meta │ ├── TaskGroup.cs │ ├── TaskGroup.cs.meta │ ├── Wait.cs │ └── Wait.cs.meta ├── Utilities.meta └── Utilities ├── CommentBox.cs ├── CommentBox.cs.meta ├── Coupler.cs └── Coupler.cs.meta /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | 13 | # Asset meta data should only be ignored when the corresponding asset is also ignored 14 | !/[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # Autogenerated Jetbrains Rider plugin 20 | [Aa]ssets/Plugins/Editor/JetBrains* 21 | 22 | # Visual Studio cache directory 23 | .vs/ 24 | 25 | # Gradle cache directory 26 | .gradle/ 27 | 28 | # Autogenerated VS/MD/Consulo solution and project files 29 | ExportedObj/ 30 | .consulo/ 31 | *.csproj 32 | *.unityproj 33 | *.sln 34 | *.suo 35 | *.tmp 36 | *.user 37 | *.userprefs 38 | *.pidb 39 | *.booproj 40 | *.svd 41 | *.pdb 42 | *.mdb 43 | *.opendb 44 | *.VC.db 45 | 46 | # Unity3D generated meta files 47 | *.pidb.meta 48 | *.pdb.meta 49 | *.mdb.meta 50 | 51 | # Unity3D generated file on crash reports 52 | sysinfo.txt 53 | 54 | # Builds 55 | *.apk 56 | *.unitypackage 57 | 58 | # Crashlytics generated file 59 | crashlytics-build.properties 60 | 61 | -------------------------------------------------------------------------------- /QuickStartGuide.txt: -------------------------------------------------------------------------------- 1 | Quick start guide for UltraNoise 2 | 3 | 4 | 1. Add Editor Coroutines from package manager 5 | 1. Open the package manager from “Window/package manager” 6 | 2. From the Unity registry select the package “Editor Coroutines” and install 7 | 2. Add Odin inspector 8 | 1. If you don't own Odin inspector get it here: https://assetstore.unity.com/packages/tools/utilities/odin-inspector-and-serializer-89041 9 | 2. Open the package manager from “Window/package manager” 10 | 3. From your personal asset Select odin inspector and install the package. 11 | 12 | 13 | And you should be ready to go! 14 | 15 | 16 | To create your first noise from the create menu select: 17 | “Create/KillMobil/UltraNoise/Noise Graph” 18 | 19 | 20 | From the project preferences you can adjust xNode settings like the node connection line etc. 21 | 22 | 23 | Examples and learning resources can be found here: 24 | https://github.com/KillMobil-SA/UltraNoiseExamples 25 | 26 | 27 | All the best from 28 | https://twitter.com/kllmbl 29 | & 30 | https://twitter.com/ycarowr -------------------------------------------------------------------------------- /QuickStartGuide.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4119275f76a887d4ab27dddc969083a0 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 530abc9b51f5c9a4aaadbd12d585e3a3 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ThirdParty.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85bf632217258704bb34d986208a633e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ThirdParty/ProceduralNoise.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f78120c4afb604547a29a39560ba1670 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ThirdParty/ProceduralNoise/Noise.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42f8918d06894d647a4563abfd4fa69e 3 | folderAsset: yes 4 | timeCreated: 1489482446 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ThirdParty/ProceduralNoise/Noise/FractalNoise.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a9ba035e8204888478841b1d715daecd 3 | timeCreated: 1489482448 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/ProceduralNoise/Noise/INoise.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace ProceduralNoiseProject 6 | { 7 | /// 8 | /// Interface for generating noise. 9 | /// 10 | public interface INoise 11 | { 12 | 13 | /// 14 | /// The frequency of the fractal. 15 | /// 16 | float Frequency { get; set; } 17 | 18 | /// 19 | /// The amplitude of the fractal. 20 | /// 21 | float Amplitude { get; set; } 22 | 23 | /// 24 | /// The offset applied to each dimension. 25 | /// 26 | Vector3 Offset { get; set; } 27 | 28 | /// 29 | /// Sample the noise in 1 dimension. 30 | /// 31 | float Sample1D(float x); 32 | 33 | /// 34 | /// Sample the noise in 2 dimensions. 35 | /// 36 | float Sample2D(float x, float y); 37 | 38 | /// 39 | /// Sample the noise in 3 dimensions. 40 | /// 41 | float Sample3D(float x, float y, float z); 42 | 43 | /// 44 | /// Update the seed. 45 | /// 46 | void UpdateSeed(int seed); 47 | 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /ThirdParty/ProceduralNoise/Noise/INoise.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 383fcd9f09f34594cb4ed66f8dc3ac47 3 | timeCreated: 1489482448 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/ProceduralNoise/Noise/Noise.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace ProceduralNoiseProject 6 | { 7 | /// 8 | /// Abstract class for generating noise. 9 | /// 10 | public abstract class Noise : INoise 11 | { 12 | 13 | /// 14 | /// The frequency of the fractal. 15 | /// 16 | public float Frequency { get; set; } 17 | 18 | /// 19 | /// The amplitude of the fractal. 20 | /// 21 | public float Amplitude { get; set; } 22 | 23 | /// 24 | /// The offset applied to each dimension. 25 | /// 26 | public Vector3 Offset { get; set; } 27 | 28 | /// 29 | /// Create a noise object. 30 | /// 31 | public Noise() 32 | { 33 | 34 | } 35 | 36 | /// 37 | /// Sample the noise in 1 dimension. 38 | /// 39 | public abstract float Sample1D(float x); 40 | 41 | /// 42 | /// Sample the noise in 2 dimensions. 43 | /// 44 | public abstract float Sample2D(float x, float y); 45 | 46 | /// 47 | /// Sample the noise in 3 dimensions. 48 | /// 49 | public abstract float Sample3D(float x, float y, float z); 50 | 51 | /// 52 | /// Update the seed. 53 | /// 54 | public abstract void UpdateSeed(int seed); 55 | 56 | } 57 | 58 | } 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /ThirdParty/ProceduralNoise/Noise/Noise.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0cf7fa87868b5134d9fe207ab82df5ff 3 | timeCreated: 1489482448 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/ProceduralNoise/Noise/NoiseType.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public enum NOISE_TYPE { PERLIN, VALUE, SIMPLEX, VORONOI, WORLEY } 6 | -------------------------------------------------------------------------------- /ThirdParty/ProceduralNoise/Noise/NoiseType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 691ebd90f89fcb04d83a55721880316d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/ProceduralNoise/Noise/PerlinNoise.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d1b91dcd0ddc7341b38c0b99cb435bc 3 | timeCreated: 1489482448 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/ProceduralNoise/Noise/PermutationTable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace ProceduralNoiseProject 5 | { 6 | internal class PermutationTable 7 | { 8 | 9 | public int Size { get; private set; } 10 | 11 | public int Seed { get; private set; } 12 | 13 | public int Max { get; private set; } 14 | 15 | public float Inverse { get; private set; } 16 | 17 | private int Wrap; 18 | 19 | private int[] Table; 20 | 21 | internal PermutationTable(int size, int max, int seed) 22 | { 23 | Size = size; 24 | Wrap = Size - 1; 25 | Max = Math.Max(1, max); 26 | Inverse = 1.0f / Max; 27 | Build(seed); 28 | } 29 | 30 | internal void Build(int seed) 31 | { 32 | if (Seed == seed && Table != null) return; 33 | 34 | Seed = seed; 35 | Table = new int[Size]; 36 | 37 | System.Random rnd = new System.Random(Seed); 38 | 39 | for(int i = 0; i < Size; i++) 40 | { 41 | Table[i] = rnd.Next(); 42 | } 43 | } 44 | 45 | internal int this[int i] 46 | { 47 | get 48 | { 49 | return Table[i & Wrap] & Max; 50 | } 51 | } 52 | 53 | internal int this[int i, int j] 54 | { 55 | get 56 | { 57 | return Table[(j + Table[i & Wrap]) & Wrap] & Max; 58 | } 59 | } 60 | 61 | internal int this[int i, int j, int k] 62 | { 63 | get 64 | { 65 | return Table[(k + Table[(j + Table[i & Wrap]) & Wrap]) & Wrap] & Max; 66 | } 67 | } 68 | 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /ThirdParty/ProceduralNoise/Noise/PermutationTable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a672f909348b1d4aa28049d606caa95 3 | timeCreated: 1489482448 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/ProceduralNoise/Noise/SimplexNoise.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 131584a410cef254c8f9dc7438eb4156 3 | timeCreated: 1489482448 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/ProceduralNoise/Noise/ValueNoise.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d9a8f0dc2f85404f8bcdbced78152b2 3 | timeCreated: 1489482448 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/ProceduralNoise/Noise/VoronoiNoise.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ff120f87de31174396fcb53e3a9e642 3 | timeCreated: 1489482448 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/ProceduralNoise/Noise/WorleyNoise.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ded05784a6f59dd4cbcc8a6a69886d3b 3 | timeCreated: 1489482448 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3ae388475114da468043e3cd691e648 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7302249d0ecbb5c44a92b49accca82fa 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ac562a0423fff74ea984a2d355e4df9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e5de235328e16fc4dbc4dcdd3794863e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/Editor/LogicGraphEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c9bb5ae9dee9af43a89fa0db3ed8de0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/Editor/LogicNodeEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | using XNode; 4 | using XNode.Examples.LogicToy; 5 | 6 | namespace XNodeEditor.Examples.LogicToy { 7 | [CustomNodeEditor(typeof(LogicNode))] 8 | public class LogicNodeEditor : NodeEditor { 9 | private LogicNode node; 10 | private LogicGraphEditor graphEditor; 11 | 12 | public override void OnHeaderGUI() { 13 | // Initialization 14 | if (node == null) { 15 | node = target as LogicNode; 16 | graphEditor = NodeGraphEditor.GetEditor(target.graph, window) as LogicGraphEditor; 17 | } 18 | 19 | base.OnHeaderGUI(); 20 | Rect dotRect = GUILayoutUtility.GetLastRect(); 21 | dotRect.size = new Vector2(16, 16); 22 | dotRect.y += 6; 23 | 24 | GUI.color = graphEditor.GetLerpColor(Color.red, Color.green, node, node.led); 25 | GUI.DrawTexture(dotRect, NodeEditorResources.dot); 26 | GUI.color = Color.white; 27 | } 28 | 29 | public override void OnBodyGUI() { 30 | if (target == null) { 31 | Debug.LogWarning("Null target node for node editor!"); 32 | return; 33 | } 34 | NodePort input = target.GetPort("input"); 35 | NodePort output = target.GetPort("output"); 36 | 37 | GUILayout.BeginHorizontal(); 38 | if (input != null) NodeEditorGUILayout.PortField(GUIContent.none, input, GUILayout.MinWidth(0)); 39 | if (output != null) NodeEditorGUILayout.PortField(GUIContent.none, output, GUILayout.MinWidth(0)); 40 | GUILayout.EndHorizontal(); 41 | EditorGUIUtility.labelWidth = 60; 42 | base.OnBodyGUI(); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/Editor/LogicNodeEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1280a9d3431638429b64ea41000b794 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/Example.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df29bbd59126610439c3391f59eac02a 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/ITimerTick.cs: -------------------------------------------------------------------------------- 1 | namespace XNode.Examples.LogicToy { 2 | public interface ITimerTick { 3 | void Tick(float timeDelta); 4 | } 5 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/ITimerTick.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46533d584cdbed04db785406b8361397 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/LogicGraph.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace XNode.Examples.LogicToy { 4 | [CreateAssetMenu(fileName = "New LogicToy Graph", menuName = "xNode Examples/LogicToy Graph")] 5 | public class LogicGraph : NodeGraph { } 6 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/LogicGraph.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1577ad53614c9e0498c962eaa9ba304f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/Nodes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8852475771ad63a45a0854e9419d4e19 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/Nodes/AndNode.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using UnityEngine; 3 | 4 | namespace XNode.Examples.LogicToy { 5 | [NodeWidth(140), NodeTint(100, 70, 70)] 6 | public class AndNode : LogicNode { 7 | [Input, HideInInspector] public bool input; 8 | [Output, HideInInspector] public bool output; 9 | public override bool led { get { return output; } } 10 | 11 | protected override void OnInputChanged() { 12 | bool newInput = GetPort("input").GetInputValues().All(x => x); 13 | 14 | if (input != newInput) { 15 | input = newInput; 16 | output = newInput; 17 | SendSignal(GetPort("output")); 18 | } 19 | } 20 | 21 | public override object GetValue(NodePort port) { 22 | return output; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/Nodes/AndNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c88b3b7abe7eb324baec5d03dfa998ab 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/Nodes/LogicNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace XNode.Examples.LogicToy { 5 | /// Base node for the LogicToy system 6 | public abstract class LogicNode : Node { 7 | public Action onStateChange; 8 | public abstract bool led { get; } 9 | 10 | public void SendSignal(NodePort output) { 11 | // Loop through port connections 12 | int connectionCount = output.ConnectionCount; 13 | for (int i = 0; i < connectionCount; i++) { 14 | NodePort connectedPort = output.GetConnection(i); 15 | 16 | // Get connected ports logic node 17 | LogicNode connectedNode = connectedPort.node as LogicNode; 18 | 19 | // Trigger it 20 | if (connectedNode != null) connectedNode.OnInputChanged(); 21 | } 22 | if (onStateChange != null) onStateChange(); 23 | } 24 | 25 | protected abstract void OnInputChanged(); 26 | 27 | 28 | } 29 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/Nodes/LogicNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1731c3983afdaa4e824178fcd76d66e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/Nodes/NotNode.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using UnityEngine; 3 | 4 | namespace XNode.Examples.LogicToy { 5 | [NodeWidth(140), NodeTint(100, 100, 50)] 6 | public class NotNode : LogicNode { 7 | [Input, HideInInspector] public bool input; 8 | [Output, HideInInspector] public bool output = true; 9 | public override bool led { get { return output; } } 10 | 11 | protected override void OnInputChanged() { 12 | bool newInput = GetPort("input").GetInputValues().Any(x => x); 13 | 14 | if (input != newInput) { 15 | input = newInput; 16 | output = !newInput; 17 | SendSignal(GetPort("output")); 18 | } 19 | } 20 | 21 | public override object GetValue(NodePort port) { 22 | return output; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/Nodes/NotNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4bb0f0e96df60a4690ca03082a93b44 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/Nodes/PulseNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace XNode.Examples.LogicToy { 4 | [NodeWidth(140), NodeTint(70,100,70)] 5 | public class PulseNode : LogicNode, ITimerTick { 6 | [Space(-18)] 7 | public float interval = 1f; 8 | [Output, HideInInspector] public bool output; 9 | public override bool led { get { return output; } } 10 | 11 | private float timer; 12 | 13 | public void Tick(float deltaTime) { 14 | timer += deltaTime; 15 | if (!output && timer > interval) { 16 | timer -= interval; 17 | output = true; 18 | SendSignal(GetPort("output")); 19 | } else if (output) { 20 | output = false; 21 | SendSignal(GetPort("output")); 22 | } 23 | } 24 | 25 | /// This node can not receive signals, so this is not used 26 | protected override void OnInputChanged() { } 27 | 28 | public override object GetValue(NodePort port) { 29 | return output; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/Nodes/PulseNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54822dcd4ea0525409ad71a5fa416755 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/Nodes/ToggleNode.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using UnityEngine; 3 | 4 | namespace XNode.Examples.LogicToy { 5 | [NodeWidth(140), NodeTint(70,70,100)] 6 | public class ToggleNode : LogicNode { 7 | [Input, HideInInspector] public bool input; 8 | [Output, HideInInspector] public bool output; 9 | public override bool led { get { return output; } } 10 | 11 | protected override void OnInputChanged() { 12 | bool newInput = GetPort("input").GetInputValues().Any(x => x); 13 | 14 | if (!input && newInput) { 15 | input = newInput; 16 | output = !output; 17 | SendSignal(GetPort("output")); 18 | } else if (input && !newInput) { 19 | input = newInput; 20 | } 21 | } 22 | 23 | public override object GetValue(NodePort port) { 24 | return output; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/LogicToy/Nodes/ToggleNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7d4066122e5859498bbf1f1db2593cf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 852631db1e0f047478da88918f49e4a3 3 | folderAsset: yes 4 | timeCreated: 1516177447 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 642e362943557314392fc62290a8e242 3 | folderAsset: yes 4 | timeCreated: 1516180279 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph/Editor/MathGraphEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using XNode.Examples; 5 | 6 | namespace XNodeEditor.Examples { 7 | [CustomNodeGraphEditor(typeof(MathGraph))] 8 | public class MathGraphEditor : NodeGraphEditor { 9 | 10 | /// 11 | /// Overriding GetNodeMenuName lets you control if and how nodes are categorized. 12 | /// In this example we are sorting out all node types that are not in the XNode.Examples namespace. 13 | /// 14 | public override string GetNodeMenuName(System.Type type) { 15 | if (type.Namespace == "XNode.Examples.MathNodes") { 16 | return base.GetNodeMenuName(type).Replace("X Node/Examples/Math Nodes/", ""); 17 | } else return null; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph/Editor/MathGraphEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f6ed0407f1f4ad45bf697d7798ddf0d 3 | timeCreated: 1516180270 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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph/MathGraph.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace XNode.Examples { 5 | /// Defines an example nodegraph that can be created as an asset in the Project window. 6 | [Serializable, CreateAssetMenu(fileName = "New Math Graph", menuName = "xNode Examples/Math Graph")] 7 | public class MathGraph : XNode.NodeGraph { } 8 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph/MathGraph.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6399826e2c44b447b32a3ed06646162 3 | timeCreated: 1506460823 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph/New Math Graph.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 97b11561dfa2a2646a1217518e90411b 3 | timeCreated: 1516179614 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 11400000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph/Nodes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 31c1681f5df4f764ab4ca7f09cd3be7d 3 | folderAsset: yes 4 | timeCreated: 1505462700 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph/Nodes/DisplayValue.cs: -------------------------------------------------------------------------------- 1 | namespace XNode.Examples.MathNodes { 2 | 3 | public class DisplayValue : XNode.Node { 4 | 5 | /// 6 | /// Create an input port that only allows a single connection. 7 | /// The backing value is not important, as we are only interested in the input value. 8 | /// We are also acceptable of all input types, so any type will do, as long as it is serializable. 9 | /// 10 | [Input(ShowBackingValue.Never, ConnectionType.Override)] public Anything input; 11 | 12 | /// Get the value currently plugged in to this node 13 | public object GetValue() { 14 | return GetInputValue("input"); 15 | } 16 | 17 | /// This class is defined for the sole purpose of being serializable 18 | [System.Serializable] public class Anything {} 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph/Nodes/DisplayValue.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98f6f901f0da53142b79277ea3f42518 3 | timeCreated: 1507499149 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph/Nodes/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d2300267781fed46a6d964565309cbf 3 | folderAsset: yes 4 | timeCreated: 1509307735 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph/Nodes/Editor/DisplayValueEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using XNode.Examples.MathNodes; 3 | 4 | namespace XNodeEditor.Examples { 5 | 6 | /// 7 | /// NodeEditor functions similarly to the Editor class, only it is xNode specific. 8 | /// Custom node editors should have the CustomNodeEditor attribute that defines which node type it is an editor for. 9 | /// 10 | [CustomNodeEditor(typeof(DisplayValue))] 11 | public class DisplayValueEditor : NodeEditor { 12 | 13 | /// Called whenever the xNode editor window is updated 14 | public override void OnBodyGUI() { 15 | 16 | // Draw the default GUI first, so we don't have to do all of that manually. 17 | base.OnBodyGUI(); 18 | 19 | // `target` points to the node, but it is of type `Node`, so cast it. 20 | DisplayValue displayValueNode = target as DisplayValue; 21 | 22 | // Get the value from the node, and display it 23 | object obj = displayValueNode.GetValue(); 24 | if (obj != null) EditorGUILayout.LabelField(obj.ToString()); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph/Nodes/Editor/DisplayValueEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d7298690665789498dc42a285eb2c28 3 | timeCreated: 1509305659 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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph/Nodes/MathNode.cs: -------------------------------------------------------------------------------- 1 | namespace XNode.Examples.MathNodes { 2 | [System.Serializable] 3 | public class MathNode : XNode.Node { 4 | // Adding [Input] or [Output] is all you need to do to register a field as a valid port on your node 5 | [Input] public float a; 6 | [Input] public float b; 7 | // The value of an output node field is not used for anything, but could be used for caching output results 8 | [Output] public float result; 9 | 10 | // Will be displayed as an editable field - just like the normal inspector 11 | public MathType mathType = MathType.Add; 12 | public enum MathType { Add, Subtract, Multiply, Divide } 13 | 14 | // GetValue should be overridden to return a value for any specified output port 15 | public override object GetValue(XNode.NodePort port) { 16 | 17 | // Get new a and b values from input connections. Fallback to field values if input is not connected 18 | float a = GetInputValue("a", this.a); 19 | float b = GetInputValue("b", this.b); 20 | 21 | // After you've gotten your input values, you can perform your calculations and return a value 22 | result = 0f; 23 | if (port.fieldName == "result") 24 | switch (mathType) { 25 | case MathType.Add: default: result = a+b; break; 26 | case MathType.Subtract: result = a - b; break; 27 | case MathType.Multiply: result = a * b; break; 28 | case MathType.Divide: result = a / b; break; 29 | } 30 | return result; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph/Nodes/MathNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 19e541bba2a188f4a84c6f3718ee6d55 3 | timeCreated: 1509307779 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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph/Nodes/Vector.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace XNode.Examples.MathNodes { 4 | public class Vector : XNode.Node { 5 | [Input] public float x, y, z; 6 | [Output] public Vector3 vector; 7 | 8 | public override object GetValue(XNode.NodePort port) { 9 | vector.x = GetInputValue("x", this.x); 10 | vector.y = GetInputValue("y", this.y); 11 | vector.z = GetInputValue("z", this.z); 12 | return vector; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/MathGraph/Nodes/Vector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05559f4106850df4ab41776666216480 3 | timeCreated: 1509303406 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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 303cd8b799b4aac4ab113e25ceb788c2 3 | folderAsset: yes 4 | timeCreated: 1525910619 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Graphics.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ece0a00127d585c40a5c32fc4ce996c8 3 | folderAsset: yes 4 | timeCreated: 1525603698 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Graphics/half.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KillMobil-SA/UltraNoiseNodeGraph/9eac22b04f11e31a4de71da5f4eedaebb2ac26af/ThirdParty/xNode-master/Examples/RuntimeMathGraph/Graphics/half.png -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Graphics/xnode_dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KillMobil-SA/UltraNoiseNodeGraph/9eac22b04f11e31a4de71da5f4eedaebb2ac26af/ThirdParty/xNode-master/Examples/RuntimeMathGraph/Graphics/xnode_dot.png -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Graphics/xnode_dot_outer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KillMobil-SA/UltraNoiseNodeGraph/9eac22b04f11e31a4de71da5f4eedaebb2ac26af/ThirdParty/xNode-master/Examples/RuntimeMathGraph/Graphics/xnode_dot_outer.png -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Graphics/xnode_node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KillMobil-SA/UltraNoiseNodeGraph/9eac22b04f11e31a4de71da5f4eedaebb2ac26af/ThirdParty/xNode-master/Examples/RuntimeMathGraph/Graphics/xnode_node.png -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Graphics/xnode_node_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KillMobil-SA/UltraNoiseNodeGraph/9eac22b04f11e31a4de71da5f4eedaebb2ac26af/ThirdParty/xNode-master/Examples/RuntimeMathGraph/Graphics/xnode_node_highlight.png -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3adf4ad59a1c98743bf53bd605f481b1 3 | folderAsset: yes 4 | timeCreated: 1525604249 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Prefabs/Connection.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c02acb8ebd6bcd42805aea1dfa350f5 3 | timeCreated: 1525820302 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 100100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Prefabs/NodeGraph.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93cd8c9c9c49d5a48a1b48ae3415b91b 3 | timeCreated: 1525818382 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 100100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Prefabs/Nodes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4df6a8137a1ed174495e29df73cd795f 3 | folderAsset: yes 4 | timeCreated: 1525818390 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Prefabs/Nodes/DisplayValue.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e82b168e67f1384d82799733341d6f8 3 | timeCreated: 1525815979 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 100100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Prefabs/Nodes/MathNode.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4feddbc48021f37449adc6b750f91afa 3 | timeCreated: 1525813474 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 100100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Prefabs/Nodes/Vector.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85f77ac8ea4840c4a982e2197715bf6f 3 | timeCreated: 1525816131 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 100100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51aca6355d0176d4a9de10207f170a0f 3 | folderAsset: yes 4 | timeCreated: 1525605250 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scenes/RuntimeGraph.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58c9f16d3dd0a2349b49ab4a6e83a2d1 3 | timeCreated: 1525605251 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scenes/RuntimeGraphSettings.lighting: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!850595691 &4890085278179872738 4 | LightingSettings: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: RuntimeGraphSettings 10 | serializedVersion: 2 11 | m_GIWorkflowMode: 0 12 | m_EnableBakedLightmaps: 1 13 | m_EnableRealtimeLightmaps: 1 14 | m_RealtimeEnvironmentLighting: 1 15 | m_BounceScale: 1 16 | m_AlbedoBoost: 1 17 | m_IndirectOutputScale: 1 18 | m_UsingShadowmask: 1 19 | m_BakeBackend: 0 20 | m_LightmapMaxSize: 1024 21 | m_BakeResolution: 40 22 | m_Padding: 2 23 | m_TextureCompression: 1 24 | m_AO: 0 25 | m_AOMaxDistance: 1 26 | m_CompAOExponent: 1 27 | m_CompAOExponentDirect: 0 28 | m_ExtractAO: 0 29 | m_MixedBakeMode: 2 30 | m_LightmapsBakeMode: 1 31 | m_FilterMode: 1 32 | m_LightmapParameters: {fileID: 0} 33 | m_ExportTrainingData: 0 34 | m_TrainingDataDestination: TrainingData 35 | m_RealtimeResolution: 2 36 | m_ForceWhiteAlbedo: 0 37 | m_ForceUpdates: 0 38 | m_FinalGather: 0 39 | m_FinalGatherRayCount: 256 40 | m_FinalGatherFiltering: 1 41 | m_PVRCulling: 1 42 | m_PVRSampling: 1 43 | m_PVRDirectSampleCount: 32 44 | m_PVRSampleCount: 500 45 | m_PVREnvironmentSampleCount: 500 46 | m_PVREnvironmentReferencePointCount: 2048 47 | m_LightProbeSampleCountMultiplier: 4 48 | m_PVRBounces: 2 49 | m_PVRRussianRouletteStartBounce: 2 50 | m_PVREnvironmentMIS: 0 51 | m_PVRFilteringMode: 2 52 | m_PVRDenoiserTypeDirect: 0 53 | m_PVRDenoiserTypeIndirect: 0 54 | m_PVRDenoiserTypeAO: 0 55 | m_PVRFilterTypeDirect: 0 56 | m_PVRFilterTypeIndirect: 0 57 | m_PVRFilterTypeAO: 0 58 | m_PVRFilteringGaussRadiusDirect: 1 59 | m_PVRFilteringGaussRadiusIndirect: 5 60 | m_PVRFilteringGaussRadiusAO: 2 61 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 62 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 63 | m_PVRFilteringAtrousPositionSigmaAO: 1 64 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scenes/RuntimeGraphSettings.lighting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d45565588204aab4bb6e52cbcd545c43 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5015730ed7e9ddb43b21c2d35f15b1cb 3 | folderAsset: yes 4 | timeCreated: 1525604672 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/Connection.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using XNode; 5 | 6 | namespace XNode.Examples.RuntimeMathNodes { 7 | public class Connection : MonoBehaviour { 8 | private RectTransform rectTransform; 9 | public void SetPosition(Vector2 start, Vector2 end) { 10 | if (!rectTransform) rectTransform = (RectTransform) transform; 11 | transform.position = (start + end) * 0.5f; 12 | 13 | float r = Mathf.Atan2(start.y - end.y, start.x - end.x) * Mathf.Rad2Deg; 14 | transform.rotation = Quaternion.Euler(0, 0, r); 15 | rectTransform.sizeDelta = new Vector2(Vector2.Distance(start, end), rectTransform.sizeDelta.y); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/Connection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 656e34b375c2eb64991ee74b5f01bd13 3 | timeCreated: 1525819160 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/NodeDrag.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.EventSystems; 5 | 6 | namespace XNode.Examples.RuntimeMathNodes { 7 | public class NodeDrag : MonoBehaviour, IPointerClickHandler, IBeginDragHandler, IDragHandler, IEndDragHandler { 8 | private Vector3 offset; 9 | private UGUIMathBaseNode node; 10 | 11 | private void Awake() { 12 | node = GetComponentInParent(); 13 | } 14 | 15 | public void OnDrag(PointerEventData eventData) { 16 | node.transform.localPosition = node.graph.scrollRect.content.InverseTransformPoint(eventData.position) - offset; 17 | } 18 | 19 | public void OnBeginDrag(PointerEventData eventData) { 20 | Vector2 pointer = node.graph.scrollRect.content.InverseTransformPoint(eventData.position); 21 | Vector2 pos = node.transform.localPosition; 22 | offset = pointer - pos; 23 | } 24 | 25 | public void OnEndDrag(PointerEventData eventData) { 26 | node.transform.localPosition = node.graph.scrollRect.content.InverseTransformPoint(eventData.position) - offset; 27 | Vector2 pos = node.transform.localPosition; 28 | pos.y = -pos.y; 29 | node.node.position = pos; 30 | } 31 | 32 | public void OnPointerClick(PointerEventData eventData) { 33 | if (eventData.button != PointerEventData.InputButton.Right) 34 | return; 35 | 36 | node.graph.nodeContextMenu.selectedNode = node.node; 37 | node.graph.nodeContextMenu.OpenAt(eventData.position); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/NodeDrag.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3f4b82da0d484640839efdaf81118b8 3 | timeCreated: 1525909194 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/RuntimeMathGraph.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f58f5c7a27d48e34fb5180e77697e866 3 | timeCreated: 1525811971 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/RuntimeNodes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e934323f65742a4ebcabeebb8da2f92 3 | folderAsset: yes 4 | timeCreated: 1525818451 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/RuntimeNodes/UGUIDisplayValue.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | using XNode.Examples.MathNodes; 6 | 7 | namespace XNode.Examples.RuntimeMathNodes { 8 | public class UGUIDisplayValue : UGUIMathBaseNode { 9 | public Text label; 10 | 11 | void Update() { 12 | DisplayValue displayValue = node as DisplayValue; 13 | object obj = displayValue.GetInputValue("input"); 14 | if (obj != null) label.text = obj.ToString(); 15 | else label.text = "n/a"; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/RuntimeNodes/UGUIDisplayValue.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 151bec3209e717646b65a9214bc08295 3 | timeCreated: 1525812043 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/RuntimeNodes/UGUIMathBaseNode.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.EventSystems; 5 | using UnityEngine.UI; 6 | using XNode.Examples.MathNodes; 7 | 8 | namespace XNode.Examples.RuntimeMathNodes { 9 | public class UGUIMathBaseNode : MonoBehaviour, IDragHandler { 10 | [HideInInspector] public Node node; 11 | [HideInInspector] public RuntimeMathGraph graph; 12 | public Text header; 13 | 14 | private UGUIPort[] ports; 15 | 16 | public virtual void Start() { 17 | ports = GetComponentsInChildren(); 18 | foreach (UGUIPort port in ports) port.node = node; 19 | header.text = node.name; 20 | SetPosition(node.position); 21 | } 22 | 23 | public virtual void UpdateGUI() { } 24 | 25 | private void LateUpdate() { 26 | foreach (UGUIPort port in ports) port.UpdateConnectionTransforms(); 27 | } 28 | 29 | public UGUIPort GetPort(string name) { 30 | for (int i = 0; i < ports.Length; i++) { 31 | if (ports[i].name == name) return ports[i]; 32 | } 33 | return null; 34 | } 35 | 36 | public void SetPosition(Vector2 pos) { 37 | pos.y = -pos.y; 38 | transform.localPosition = pos; 39 | } 40 | 41 | public void SetName(string name) { 42 | header.text = name; 43 | } 44 | 45 | public void OnDrag(PointerEventData eventData) { 46 | 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/RuntimeNodes/UGUIMathBaseNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f09009dde769a3845a66ded688a8f8dd 3 | timeCreated: 1525812043 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/RuntimeNodes/UGUIMathNode.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | using XNode.Examples.MathNodes; 6 | 7 | namespace XNode.Examples.RuntimeMathNodes { 8 | public class UGUIMathNode : UGUIMathBaseNode { 9 | public InputField valA; 10 | public InputField valB; 11 | public Dropdown dropDown; 12 | 13 | private MathNode mathNode; 14 | 15 | public override void Start() { 16 | base.Start(); 17 | mathNode = node as MathNode; 18 | 19 | valA.onValueChanged.AddListener(OnChangeValA); 20 | valB.onValueChanged.AddListener(OnChangeValB); 21 | dropDown.onValueChanged.AddListener(OnChangeDropdown); 22 | UpdateGUI(); 23 | } 24 | 25 | public override void UpdateGUI() { 26 | NodePort portA = node.GetInputPort("a"); 27 | NodePort portB = node.GetInputPort("b"); 28 | valA.gameObject.SetActive(!portA.IsConnected); 29 | valB.gameObject.SetActive(!portB.IsConnected); 30 | 31 | valA.text = mathNode.a.ToString(); 32 | valB.text = mathNode.b.ToString(); 33 | dropDown.value = (int) mathNode.mathType; 34 | } 35 | 36 | private void OnChangeValA(string val) { 37 | mathNode.a = float.Parse(valA.text); 38 | } 39 | 40 | private void OnChangeValB(string val) { 41 | mathNode.b = float.Parse(valB.text); 42 | } 43 | 44 | private void OnChangeDropdown(int val) { 45 | mathNode.mathType = (MathNode.MathType) val; 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/RuntimeNodes/UGUIMathNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9595458c0d990a458724e20b81b5637 3 | timeCreated: 1525812043 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/RuntimeNodes/UGUIVector.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | using XNode.Examples.MathNodes; 6 | 7 | namespace XNode.Examples.RuntimeMathNodes { 8 | public class UGUIVector : UGUIMathBaseNode { 9 | public InputField valX; 10 | public InputField valY; 11 | public InputField valZ; 12 | 13 | private Vector vectorNode; 14 | 15 | public override void Start() { 16 | base.Start(); 17 | vectorNode = node as Vector; 18 | 19 | valX.onValueChanged.AddListener(OnChangeValX); 20 | valY.onValueChanged.AddListener(OnChangeValY); 21 | valZ.onValueChanged.AddListener(OnChangeValZ); 22 | UpdateGUI(); 23 | } 24 | 25 | public override void UpdateGUI() { 26 | NodePort portX = node.GetInputPort("x"); 27 | NodePort portY = node.GetInputPort("y"); 28 | NodePort portZ = node.GetInputPort("z"); 29 | valX.gameObject.SetActive(!portX.IsConnected); 30 | valY.gameObject.SetActive(!portY.IsConnected); 31 | valZ.gameObject.SetActive(!portZ.IsConnected); 32 | 33 | Vector vectorNode = node as Vector; 34 | valX.text = vectorNode.x.ToString(); 35 | valY.text = vectorNode.y.ToString(); 36 | valZ.text = vectorNode.z.ToString(); 37 | } 38 | 39 | private void OnChangeValX(string val) { 40 | vectorNode.x = float.Parse(valX.text); 41 | } 42 | 43 | private void OnChangeValY(string val) { 44 | vectorNode.y = float.Parse(valY.text); 45 | } 46 | 47 | private void OnChangeValZ(string val) { 48 | vectorNode.z = float.Parse(valZ.text); 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/RuntimeNodes/UGUIVector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f91529775ea04f4681f3f03df79e870 3 | timeCreated: 1525812043 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/UGUIContextMenu.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.EventSystems; 6 | 7 | namespace XNode.Examples.RuntimeMathNodes { 8 | public class UGUIContextMenu : MonoBehaviour, IPointerExitHandler { 9 | 10 | public Action onClickSpawn; 11 | public CanvasGroup group; 12 | [HideInInspector] public Node selectedNode; 13 | private Vector2 pos; 14 | 15 | private void Start() { 16 | Close(); 17 | } 18 | 19 | public void OpenAt(Vector2 pos) { 20 | transform.position = pos; 21 | group.alpha = 1; 22 | group.interactable = true; 23 | group.blocksRaycasts = true; 24 | transform.SetAsLastSibling(); 25 | } 26 | 27 | public void Close() { 28 | group.alpha = 0; 29 | group.interactable = false; 30 | group.blocksRaycasts = false; 31 | } 32 | 33 | public void SpawnMathNode() { 34 | SpawnNode(typeof(XNode.Examples.MathNodes.MathNode)); 35 | } 36 | 37 | public void SpawnDisplayNode() { 38 | SpawnNode(typeof(XNode.Examples.MathNodes.DisplayValue)); 39 | } 40 | 41 | public void SpawnVectorNode() { 42 | SpawnNode(typeof(XNode.Examples.MathNodes.Vector)); 43 | } 44 | 45 | private void SpawnNode(Type nodeType) { 46 | Vector2 pos = new Vector2(transform.localPosition.x, -transform.localPosition.y); 47 | onClickSpawn(nodeType, pos); 48 | } 49 | 50 | public void RemoveNode() { 51 | RuntimeMathGraph runtimeMathGraph = GetComponentInParent(); 52 | runtimeMathGraph.graph.RemoveNode(selectedNode); 53 | runtimeMathGraph.Refresh(); 54 | Close(); 55 | } 56 | 57 | public void OnPointerExit(PointerEventData eventData) { 58 | Close(); 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/UGUIContextMenu.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 402b5de5d75c05445994c83bba07d273 3 | timeCreated: 1526035634 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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/UGUIPort.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 76c005fc401e40f42b1e76d5ffc80292 3 | timeCreated: 1526084889 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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/UGUITooltip.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | namespace XNode.Examples.RuntimeMathNodes { 7 | public class UGUITooltip : MonoBehaviour { 8 | public CanvasGroup group; 9 | public Text label; 10 | private bool show; 11 | private RuntimeMathGraph graph; 12 | 13 | private void Awake() { 14 | graph = GetComponentInParent(); 15 | } 16 | 17 | private void Start() { 18 | Hide(); 19 | } 20 | 21 | private void Update() { 22 | if (show) UpdatePosition(); 23 | } 24 | 25 | public void Show() { 26 | show = true; 27 | group.alpha = 1; 28 | UpdatePosition(); 29 | transform.SetAsLastSibling(); 30 | } 31 | 32 | public void Hide() { 33 | show = false; 34 | group.alpha = 0; 35 | } 36 | 37 | private void UpdatePosition() { 38 | Vector2 pos; 39 | RectTransform rect = graph.scrollRect.content.transform as RectTransform; 40 | Camera cam = graph.gameObject.GetComponentInParent().worldCamera; 41 | RectTransformUtility.ScreenPointToLocalPointInRectangle(rect, Input.mousePosition, cam, out pos); 42 | transform.localPosition = pos; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/RuntimeMathGraph/Scripts/UGUITooltip.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ea6060c58096cd4d8c959a427a9b059 3 | timeCreated: 1526123957 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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8aa31d972c52204dbdcf109681928c8 3 | folderAsset: yes 4 | timeCreated: 1516177052 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9abb31871fcc4b840baedb640fb6815e 3 | folderAsset: yes 4 | timeCreated: 1516181202 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine/Editor/StateGraphEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using XNode.Examples.StateGraph; 5 | using XNodeEditor; 6 | 7 | namespace XNodeEditor.Examples { 8 | [CustomNodeGraphEditor(typeof(StateGraph))] 9 | public class StateGraphEditor : NodeGraphEditor { 10 | 11 | /// 12 | /// Overriding GetNodeMenuName lets you control if and how nodes are categorized. 13 | /// In this example we are sorting out all node types that are not in the XNode.Examples namespace. 14 | /// 15 | public override string GetNodeMenuName(System.Type type) { 16 | 17 | 18 | 19 | if (type.Namespace == "XNode.Examples.StateGraph") { 20 | return base.GetNodeMenuName(type).Replace("X Node/Examples/State Graph/", ""); 21 | } else return null; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine/Editor/StateGraphEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c46ac2790aeee7341998d217311ba8d3 3 | timeCreated: 1516181207 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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine/New State Graph.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18b73d7e492ac594886d6afd816395ec 3 | timeCreated: 1516181166 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 11400000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine/Nodes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e4f25b00cb54f84c82e84af31c8e056 3 | folderAsset: yes 4 | timeCreated: 1514505844 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine/Nodes/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61176f710e9af264db5db0a81711f423 3 | folderAsset: yes 4 | timeCreated: 1514506327 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine/Nodes/Editor/StateNodeEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | using UnityEngine; 5 | using XNode.Examples.StateGraph; 6 | 7 | namespace XNodeEditor.Examples { 8 | [CustomNodeEditor(typeof(StateNode))] 9 | public class StateNodeEditor : NodeEditor { 10 | 11 | public override void OnHeaderGUI() { 12 | GUI.color = Color.white; 13 | StateNode node = target as StateNode; 14 | StateGraph graph = node.graph as StateGraph; 15 | if (graph.current == node) GUI.color = Color.blue; 16 | string title = target.name; 17 | GUILayout.Label(title, NodeEditorResources.styles.nodeHeader, GUILayout.Height(30)); 18 | GUI.color = Color.white; 19 | } 20 | 21 | public override void OnBodyGUI() { 22 | base.OnBodyGUI(); 23 | StateNode node = target as StateNode; 24 | StateGraph graph = node.graph as StateGraph; 25 | if (GUILayout.Button("MoveNext Node")) node.MoveNext(); 26 | if (GUILayout.Button("Continue Graph")) graph.Continue(); 27 | if (GUILayout.Button("Set as current")) graph.current = node; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine/Nodes/Editor/StateNodeEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f59d4dfd6e73e6b4d9d14256bc7a20f3 3 | timeCreated: 1514506333 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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine/Nodes/StateNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace XNode.Examples.StateGraph { 7 | public class StateNode : Node { 8 | 9 | [Input] public Empty enter; 10 | [Output] public Empty exit; 11 | 12 | public void MoveNext() { 13 | StateGraph fmGraph = graph as StateGraph; 14 | 15 | if (fmGraph.current != this) { 16 | Debug.LogWarning("Node isn't active"); 17 | return; 18 | } 19 | 20 | NodePort exitPort = GetOutputPort("exit"); 21 | 22 | if (!exitPort.IsConnected) { 23 | Debug.LogWarning("Node isn't connected"); 24 | return; 25 | } 26 | 27 | StateNode node = exitPort.Connection.node as StateNode; 28 | node.OnEnter(); 29 | } 30 | 31 | public void OnEnter() { 32 | StateGraph fmGraph = graph as StateGraph; 33 | fmGraph.current = this; 34 | } 35 | 36 | [Serializable] 37 | public class Empty { } 38 | } 39 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine/Nodes/StateNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32ef86e1b73c7d642acaa1b75f66bbbb 3 | timeCreated: 1514505861 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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine/README.md: -------------------------------------------------------------------------------- 1 | [![Discord](https://img.shields.io/discord/361769369404964864.svg)](https://discord.gg/qgPrHv4) 2 | [![GitHub issues](https://img.shields.io/github/issues/Siccity/xNode.svg)](https://github.com/Siccity/xNode/issues) 3 | [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/Siccity/xNode/master/LICENSE.md) 4 | [![GitHub Wiki](https://img.shields.io/badge/wiki-available-brightgreen.svg)](https://github.com/Siccity/xNode/wiki) 5 | 6 | [Go to Downloads](https://github.com/Siccity/xNode/releases) 7 | 8 | ### xNode State Machine (Example) 9 | This example project should give you an understanding of how to handle traversing through nodes, one by one. 10 | The same principle can be applied to dialogue graphs, and other simple decision makers. 11 | 12 | 13 | Join the [Discord](https://discord.gg/qgPrHv4 "Join Discord server") server to leave feedback or get support. 14 | Feel free to also leave suggestions/requests in the [issues](https://github.com/Siccity/xNode/issues "Go to Issues") page. 15 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ac4cc8efb8449f4d93c88f21785bb3a 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine/StateGraph.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace XNode.Examples.StateGraph { 6 | [CreateAssetMenu(fileName = "New State Graph", menuName = "xNode Examples/State Graph")] 7 | public class StateGraph : NodeGraph { 8 | 9 | // The current "active" node 10 | public StateNode current; 11 | 12 | public void Continue() { 13 | current.MoveNext(); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine/StateGraph.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dad9e75908d47ae419dba5bc800df549 3 | timeCreated: 1514505839 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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine/test.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: dad9e75908d47ae419dba5bc800df549, type: 3} 13 | m_Name: test 14 | m_EditorClassIdentifier: 15 | nodes: [] 16 | current: {fileID: 0} 17 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Examples/StateMachine/test.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49d0fe4e823e8e5489caea40ac9ccf4d 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee64ea13a8ca5214287ede65dddb1aff 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Attributes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5644dfc7eed151045af664a9d4fd1906 3 | folderAsset: yes 4 | timeCreated: 1541633926 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Attributes/NodeEnum.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | /// Draw enums correctly within nodes. Without it, enums show up at the wrong positions. 4 | /// Enums with this attribute are not detected by EditorGui.ChangeCheck due to waiting before executing 5 | public class NodeEnumAttribute : PropertyAttribute { } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Attributes/NodeEnum.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10a8338f6c985854697b35459181af0a 3 | timeCreated: 1541633942 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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Drawers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7adf21edfb51f514fa991d7556ecd0ef 3 | folderAsset: yes 4 | timeCreated: 1541971984 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Drawers/NodeEnumDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83db81f92abadca439507e25d517cabe 3 | timeCreated: 1541633798 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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Drawers/Odin.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 327994a52f523b641898a39ff7500a02 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Drawers/Odin/InNodeEditorAttributeProcessor.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR && ODIN_INSPECTOR 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Reflection; 5 | using Sirenix.OdinInspector.Editor; 6 | using UnityEngine; 7 | using XNode; 8 | 9 | namespace XNodeEditor { 10 | internal class OdinNodeInGraphAttributeProcessor : OdinAttributeProcessor where T : Node { 11 | public override bool CanProcessSelfAttributes(InspectorProperty property) { 12 | return false; 13 | } 14 | 15 | public override bool CanProcessChildMemberAttributes(InspectorProperty parentProperty, MemberInfo member) { 16 | if (!NodeEditor.inNodeEditor) 17 | return false; 18 | 19 | if (member.MemberType == MemberTypes.Field) { 20 | switch (member.Name) { 21 | case "graph": 22 | case "position": 23 | case "ports": 24 | return true; 25 | 26 | default: 27 | break; 28 | } 29 | } 30 | 31 | return false; 32 | } 33 | 34 | public override void ProcessChildMemberAttributes(InspectorProperty parentProperty, MemberInfo member, List attributes) { 35 | switch (member.Name) { 36 | case "graph": 37 | case "position": 38 | case "ports": 39 | attributes.Add(new HideInInspector()); 40 | break; 41 | 42 | default: 43 | break; 44 | } 45 | } 46 | } 47 | } 48 | #endif -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Drawers/Odin/InNodeEditorAttributeProcessor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3cf2561fbfea9a041ac81efbbb5b3e0d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Drawers/Odin/InputAttributeDrawer.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR && ODIN_INSPECTOR 2 | using Sirenix.OdinInspector; 3 | using Sirenix.OdinInspector.Editor; 4 | using Sirenix.Utilities.Editor; 5 | using UnityEngine; 6 | using XNode; 7 | 8 | namespace XNodeEditor { 9 | public class InputAttributeDrawer : OdinAttributeDrawer { 10 | protected override bool CanDrawAttributeProperty(InspectorProperty property) { 11 | Node node = property.Tree.WeakTargets[0] as Node; 12 | return node != null; 13 | } 14 | 15 | protected override void DrawPropertyLayout(GUIContent label) { 16 | Node node = Property.Tree.WeakTargets[0] as Node; 17 | NodePort port = node.GetInputPort(Property.Name); 18 | 19 | if (!NodeEditor.inNodeEditor) { 20 | if (Attribute.backingValue == XNode.Node.ShowBackingValue.Always || Attribute.backingValue == XNode.Node.ShowBackingValue.Unconnected && !port.IsConnected) 21 | CallNextDrawer(label); 22 | return; 23 | } 24 | 25 | if (Property.Tree.WeakTargets.Count > 1) { 26 | SirenixEditorGUI.WarningMessageBox("Cannot draw ports with multiple nodes selected"); 27 | return; 28 | } 29 | 30 | if (port != null) { 31 | var portPropoerty = Property.Tree.GetUnityPropertyForPath(Property.UnityPropertyPath); 32 | if (portPropoerty == null) { 33 | SirenixEditorGUI.ErrorMessageBox("Port property missing at: " + Property.UnityPropertyPath); 34 | return; 35 | } else { 36 | var labelWidth = Property.GetAttribute(); 37 | if (labelWidth != null) 38 | GUIHelper.PushLabelWidth(labelWidth.Width); 39 | 40 | NodeEditorGUILayout.PropertyField(portPropoerty, label == null ? GUIContent.none : label, true, GUILayout.MinWidth(30)); 41 | 42 | if (labelWidth != null) 43 | GUIHelper.PopLabelWidth(); 44 | } 45 | } 46 | } 47 | } 48 | } 49 | #endif -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Drawers/Odin/InputAttributeDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2fd590b2e9ea0bd49b6986a2ca9010ab 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Drawers/Odin/OutputAttributeDrawer.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR && ODIN_INSPECTOR 2 | using Sirenix.OdinInspector; 3 | using Sirenix.OdinInspector.Editor; 4 | using Sirenix.Utilities.Editor; 5 | using UnityEngine; 6 | using XNode; 7 | 8 | namespace XNodeEditor { 9 | public class OutputAttributeDrawer : OdinAttributeDrawer { 10 | protected override bool CanDrawAttributeProperty(InspectorProperty property) { 11 | Node node = property.Tree.WeakTargets[0] as Node; 12 | return node != null; 13 | } 14 | 15 | protected override void DrawPropertyLayout(GUIContent label) { 16 | Node node = Property.Tree.WeakTargets[0] as Node; 17 | NodePort port = node.GetOutputPort(Property.Name); 18 | 19 | if (!NodeEditor.inNodeEditor) { 20 | if (Attribute.backingValue == XNode.Node.ShowBackingValue.Always || Attribute.backingValue == XNode.Node.ShowBackingValue.Unconnected && !port.IsConnected) 21 | CallNextDrawer(label); 22 | return; 23 | } 24 | 25 | if (Property.Tree.WeakTargets.Count > 1) { 26 | SirenixEditorGUI.WarningMessageBox("Cannot draw ports with multiple nodes selected"); 27 | return; 28 | } 29 | 30 | if (port != null) { 31 | var portPropoerty = Property.Tree.GetUnityPropertyForPath(Property.UnityPropertyPath); 32 | if (portPropoerty == null) { 33 | SirenixEditorGUI.ErrorMessageBox("Port property missing at: " + Property.UnityPropertyPath); 34 | return; 35 | } else { 36 | var labelWidth = Property.GetAttribute(); 37 | if (labelWidth != null) 38 | GUIHelper.PushLabelWidth(labelWidth.Width); 39 | 40 | NodeEditorGUILayout.PropertyField(portPropoerty, label == null ? GUIContent.none : label, true, GUILayout.MinWidth(30)); 41 | 42 | if (labelWidth != null) 43 | GUIHelper.PopLabelWidth(); 44 | } 45 | } 46 | } 47 | } 48 | } 49 | #endif -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Drawers/Odin/OutputAttributeDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7ebd8f2b42e2384aa109551dc46af88 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/GraphAndNodeEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bdd6e443125ccac4dad0665515759637 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/GraphRenameFixAssetProcessor.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using XNode; 3 | 4 | namespace XNodeEditor { 5 | /// 6 | /// This asset processor resolves an issue with the new v2 AssetDatabase system present on 2019.3 and later. When 7 | /// renaming a asset, it appears that sometimes the v2 AssetDatabase will swap which asset 8 | /// is the main asset (present at top level) between the and one of its 9 | /// sub-assets. As a workaround until Unity fixes this, this asset processor checks all renamed assets and if it 10 | /// finds a case where a has been made the main asset it will swap it back to being a sub-asset 11 | /// and rename the node to the default name for that node type. 12 | /// 13 | internal sealed class GraphRenameFixAssetProcessor : AssetPostprocessor { 14 | private static void OnPostprocessAllAssets( 15 | string[] importedAssets, 16 | string[] deletedAssets, 17 | string[] movedAssets, 18 | string[] movedFromAssetPaths) { 19 | for (int i = 0; i < movedAssets.Length; i++) { 20 | Node nodeAsset = AssetDatabase.LoadMainAssetAtPath(movedAssets[i]) as Node; 21 | 22 | // If the renamed asset is a node graph, but the v2 AssetDatabase has swapped a sub-asset node to be its 23 | // main asset, reset the node graph to be the main asset and rename the node asset back to its default 24 | // name. 25 | if (nodeAsset != null && AssetDatabase.IsMainAsset(nodeAsset)) { 26 | AssetDatabase.SetMainObject(nodeAsset.graph, movedAssets[i]); 27 | AssetDatabase.ImportAsset(movedAssets[i]); 28 | 29 | nodeAsset.name = NodeEditorUtilities.NodeDefaultName(nodeAsset.GetType()); 30 | EditorUtility.SetDirty(nodeAsset); 31 | } 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/GraphRenameFixAssetProcessor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65da1ff1c50a9984a9c95fd18799e8dd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Internal.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6a1bbc054e282346a02e7bbddde3206 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Internal/RerouteReference.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace XNodeEditor.Internal { 4 | public struct RerouteReference { 5 | public XNode.NodePort port; 6 | public int connectionIndex; 7 | public int pointIndex; 8 | 9 | public RerouteReference(XNode.NodePort port, int connectionIndex, int pointIndex) { 10 | this.port = port; 11 | this.connectionIndex = connectionIndex; 12 | this.pointIndex = pointIndex; 13 | } 14 | 15 | public void InsertPoint(Vector2 pos) { port.GetReroutePoints(connectionIndex).Insert(pointIndex, pos); } 16 | public void SetPoint(Vector2 pos) { port.GetReroutePoints(connectionIndex) [pointIndex] = pos; } 17 | public void RemovePoint() { port.GetReroutePoints(connectionIndex).RemoveAt(pointIndex); } 18 | public Vector2 GetPoint() { return port.GetReroutePoints(connectionIndex) [pointIndex]; } 19 | } 20 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Internal/RerouteReference.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 399f3c5fb717b2c458c3e9746f8959a3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/NodeGraphImporter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a816f2790bf3da48a2d6d0035ebc9a0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/RenamePopup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ef3ddc25518318469bce838980c64be 3 | timeCreated: 1552067957 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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Resources/xnode_dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KillMobil-SA/UltraNoiseNodeGraph/9eac22b04f11e31a4de71da5f4eedaebb2ac26af/ThirdParty/xNode-master/Scripts/Editor/Resources/xnode_dot.png -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Resources/xnode_dot_outer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KillMobil-SA/UltraNoiseNodeGraph/9eac22b04f11e31a4de71da5f4eedaebb2ac26af/ThirdParty/xNode-master/Scripts/Editor/Resources/xnode_dot_outer.png -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Resources/xnode_node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KillMobil-SA/UltraNoiseNodeGraph/9eac22b04f11e31a4de71da5f4eedaebb2ac26af/ThirdParty/xNode-master/Scripts/Editor/Resources/xnode_node.png -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Resources/xnode_node_highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KillMobil-SA/UltraNoiseNodeGraph/9eac22b04f11e31a4de71da5f4eedaebb2ac26af/ThirdParty/xNode-master/Scripts/Editor/Resources/xnode_node_highlight.png -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/Resources/xnode_node_workfile.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KillMobil-SA/UltraNoiseNodeGraph/9eac22b04f11e31a4de71da5f4eedaebb2ac26af/ThirdParty/xNode-master/Scripts/Editor/Resources/xnode_node_workfile.psd -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/SceneGraphEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aea725adabc311f44b5ea8161360a915 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/XNodeEditor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "XNodeEditor", 3 | "references": [ 4 | "XNode" 5 | ], 6 | "optionalUnityReferences": [], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [], 16 | "versionDefines": [] 17 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/Editor/XNodeEditor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 002c1bbed08fa44d282ef34fd5edb138 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/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 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/SceneGraph.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using XNode; 5 | 6 | namespace XNode { 7 | /// Lets you instantiate a node graph in the scene. This allows you to reference in-scene objects. 8 | public class SceneGraph : MonoBehaviour { 9 | public NodeGraph graph; 10 | } 11 | 12 | /// Derive from this class to create a SceneGraph with a specific graph type. 13 | /// 14 | /// 15 | /// public class MySceneGraph : SceneGraph { 16 | /// 17 | /// } 18 | /// 19 | /// 20 | public class SceneGraph : SceneGraph where T : NodeGraph { 21 | public new T graph { get { return base.graph as T; } set { base.graph = value; } } 22 | } 23 | } -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/SceneGraph.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7915171fc13472a40a0162003052d2db 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/XNode.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "XNode", 3 | "references": [], 4 | "optionalUnityReferences": [], 5 | "includePlatforms": [], 6 | "excludePlatforms": [], 7 | "allowUnsafeCode": false, 8 | "overrideReferences": false, 9 | "precompiledReferences": [], 10 | "autoReferenced": true, 11 | "defineConstraints": [], 12 | "versionDefines": [] 13 | } 14 | -------------------------------------------------------------------------------- /ThirdParty/xNode-master/Scripts/XNode.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8e24fd1eb19b4226afebb2810e3c19b 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UltraNoise5000.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 97f8b75c08652c549a20ae830655322e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UltraNoise5000/Async.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3afb91c1adcf49499c41dc92d65f6f9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UltraNoise5000/Async/BaseSampleStep.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NoiseUltra.Nodes 4 | { 5 | /// 6 | /// A simple step in the async sample generation. 7 | /// 8 | public abstract class BaseSampleStep 9 | { 10 | public abstract void Execute(Func sampleFunction); 11 | } 12 | } -------------------------------------------------------------------------------- /UltraNoise5000/Async/BaseSampleStep.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1eb14d08b4a04121bfde4203ecb977bd 3 | timeCreated: 1635090640 -------------------------------------------------------------------------------- /UltraNoise5000/Async/BaseSampleStep2DAsync.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NoiseUltra.Nodes 4 | { 5 | public abstract class BaseSampleStep2DAsync : BaseSampleStep 6 | { 7 | private readonly int m_PxIndex; 8 | private readonly int m_PyIndex; 9 | private readonly float m_X; 10 | private readonly float m_Y; 11 | private readonly T[,] m_Values; 12 | 13 | protected BaseSampleStep2DAsync(float x, float y, int pxIndex, int pyIndex, ref T[,] values) 14 | { 15 | m_X = x; 16 | m_Y = y; 17 | m_PxIndex = pxIndex; 18 | m_PyIndex = pyIndex; 19 | m_Values = values; 20 | } 21 | 22 | public override void Execute(Func sampleFunction) 23 | { 24 | float sample = sampleFunction(m_X, m_Y); 25 | m_Values[m_PxIndex, m_PyIndex] = Create(sample); 26 | } 27 | 28 | protected abstract T Create(float sample); 29 | 30 | public override string ToString() 31 | { 32 | return $"x: {m_X}|" + 33 | $"y: {m_Y}|" + 34 | $"pxIndex: {m_PxIndex}|" + 35 | $"pyIndex: {m_PyIndex}|" + 36 | $"values: {m_Values}|"; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /UltraNoise5000/Async/BaseSampleStep2DAsync.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 522ffa052ce3431586780e2204cbc527 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Async/BaseSampleStep3DAsync.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NoiseUltra.Nodes 4 | { 5 | public abstract class BaseSampleStep3DAsync : BaseSampleStep 6 | { 7 | private readonly int m_PxIndex; 8 | private readonly int m_PyIndex; 9 | private readonly int m_PzIndex; 10 | private readonly float m_X; 11 | private readonly float m_Y; 12 | private readonly T[,,] m_Values; 13 | 14 | protected BaseSampleStep3DAsync(float x, float y, int pxIndex, int pyIndex, int pzIndex, ref T[,,] values) 15 | { 16 | m_X = x; 17 | m_Y = y; 18 | m_PxIndex = pxIndex; 19 | m_PyIndex = pyIndex; 20 | m_PzIndex = pzIndex; 21 | m_Values = values; 22 | } 23 | 24 | public override void Execute(Func sampleFunction) 25 | { 26 | float sample = sampleFunction(m_X, m_Y); 27 | m_Values[m_PxIndex, m_PyIndex, m_PzIndex] = Create(sample); 28 | } 29 | 30 | protected abstract T Create(float sample); 31 | 32 | public override string ToString() 33 | { 34 | return $"x: {m_X}|" + 35 | $"y: {m_Y}|" + 36 | $"pxIndex: {m_PxIndex}|" + 37 | $"pyIndex: {m_PyIndex}|" + 38 | $"pzIndex: {m_PzIndex}|" + 39 | $"values: {m_Values}|"; 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /UltraNoise5000/Async/BaseSampleStep3DAsync.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ba0acddf48642e3b9d16c78e6c76ee0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Async/BaseSampleStepAsync.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NoiseUltra.Nodes 4 | { 5 | public abstract class BaseSampleStepAsync : BaseSampleStep 6 | { 7 | private readonly int m_Index; 8 | private readonly float m_X; 9 | private readonly float m_Y; 10 | private readonly T[] m_Values; 11 | 12 | protected BaseSampleStepAsync(float x, float y, int index, ref T[] values) 13 | { 14 | m_X = x; 15 | m_Y = y; 16 | m_Index = index; 17 | m_Values = values; 18 | } 19 | 20 | public override void Execute(Func sampleFunction) 21 | { 22 | float sample = sampleFunction(m_X, m_Y); 23 | m_Values[m_Index] = Create(sample); 24 | } 25 | 26 | protected abstract T Create(float sample); 27 | 28 | public override string ToString() 29 | { 30 | return $"x: {m_X}|" + 31 | $"y: {m_Y}|" + 32 | $"index: {m_Index}|" + 33 | $"values: {m_Values}|"; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /UltraNoise5000/Async/BaseSampleStepAsync.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: febbda4441a667143b75f4ef0dd771bf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Async/PaintToolSampleStep.cs: -------------------------------------------------------------------------------- 1 | namespace NoiseUltra.Nodes 2 | { 3 | public sealed class PaintToolSampleStep : SampleStepFloat3 4 | { 5 | private readonly float m_AngleV; 6 | 7 | public PaintToolSampleStep(float x, float y, int pxIndex, int pyIndex, int pzIndex, ref float[,,] values, float angleV) : 8 | base(x, y, pxIndex, pyIndex, pzIndex, ref values) 9 | { 10 | m_AngleV = angleV; 11 | } 12 | 13 | protected override float Create(float sample) 14 | { 15 | return m_AngleV * sample; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /UltraNoise5000/Async/PaintToolSampleStep.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b34dd9a5c42a4df3935d557289290118 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Async/SampleStepColor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace NoiseUltra.Nodes 5 | { 6 | public sealed class SampleStepColor : BaseSampleStepAsync 7 | { 8 | public SampleStepColor(float x, float y, int index, ref Color[] values) : base(x, y, index, ref values) 9 | { 10 | } 11 | 12 | protected override Color Create(float sample) 13 | { 14 | return new Color(sample, sample, sample); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /UltraNoise5000/Async/SampleStepColor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0679b184c2584d56bba7b58899fe731c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Async/SampleStepFloat.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NoiseUltra.Nodes 4 | { 5 | public sealed class SampleStepFloat : BaseSampleStepAsync 6 | { 7 | public SampleStepFloat(float x, float y, int index, ref float[] values) : base(x, y, index, ref values) 8 | { 9 | } 10 | 11 | protected override float Create(float sample) 12 | { 13 | return sample; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /UltraNoise5000/Async/SampleStepFloat.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 90a8438401b34328a1fcb891a292490f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Async/SampleStepFloat2.cs: -------------------------------------------------------------------------------- 1 | namespace NoiseUltra.Nodes 2 | { 3 | public class SampleStepFloat2 : BaseSampleStep2DAsync 4 | { 5 | public SampleStepFloat2(float x, float y, int pxIndex, int pyIndex, ref float[,] values) : 6 | base(x, y, pxIndex, pyIndex, ref values) 7 | { 8 | } 9 | 10 | protected override float Create(float sample) 11 | { 12 | return sample; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /UltraNoise5000/Async/SampleStepFloat2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b079ae1ae4a946f2a82d6afb479d6b7e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Async/SampleStepFloat3.cs: -------------------------------------------------------------------------------- 1 | namespace NoiseUltra.Nodes 2 | { 3 | public class SampleStepFloat3 : BaseSampleStep3DAsync 4 | { 5 | public SampleStepFloat3(float x, float y, int pxIndex, int pyIndex, int pzIndex, ref float[,,] values) : 6 | base(x, y, pxIndex, pyIndex, pzIndex, ref values) 7 | { 8 | } 9 | 10 | protected override float Create(float sample) 11 | { 12 | return sample; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /UltraNoise5000/Async/SampleStepFloat3.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30c646bea01c64b4db803ca2b1d56bdd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Exports.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 91f0f268bcb287d46a45f076d3b1aa8f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UltraNoise5000/Exports/ExportNode.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | using Sirenix.OdinInspector; 3 | using UnityEngine; 4 | 5 | namespace NoiseUltra.Output 6 | { 7 | [NodeTint(NodeColor.EXPORT_NODE)] 8 | public class ExportNode : NodeInputOutput 9 | { 10 | [SerializeField] [OnValueChanged(nameof(UpdateNoiseName))] 11 | private string nodeTitle; 12 | 13 | protected override void Init() 14 | { 15 | base.Init(); 16 | nodeTitle = name; 17 | } 18 | 19 | private void UpdateNoiseName() 20 | { 21 | name = nodeTitle; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /UltraNoise5000/Exports/ExportNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10860912d812daf4ba9a34501edbf366 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Exports/PaintLayer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NoiseUltra.Nodes; 3 | using Sirenix.OdinInspector; 4 | using UnityEngine; 5 | 6 | namespace NoiseUltra.Output 7 | { 8 | [Serializable,NodeTint(NodeColor.PAINTLAYER)] 9 | public class PaintLayer : NodeInputOutput 10 | { 11 | [SerializeField] 12 | [OnValueChanged(nameof(UpdateNoiseName))] 13 | private TerrainLayer terrainLayer; 14 | 15 | [SerializeField] 16 | private bool isAnglePaint; 17 | public bool IsAnglePaint => isAnglePaint; 18 | 19 | [SerializeField] 20 | [ShowIf(nameof(isAnglePaint))] 21 | private float angleDivide = .1f; 22 | 23 | [SerializeField] 24 | [ShowIf(nameof(isAnglePaint))] 25 | private AnimationCurve clifCurve = AnimationCurve.Linear(0, 0, 1, 1); 26 | 27 | public TerrainLayer TerrainLayer => terrainLayer; 28 | 29 | public float EvaluateCliff(float steepness, float resolution) 30 | { 31 | float value = steepness * steepness / (resolution / angleDivide); 32 | return clifCurve.Evaluate(Mathf.Clamp01(value)); 33 | } 34 | 35 | public float GetSample(float x, float y , float xAlpha , float yAlpha, TerrainData terrainData, bool useWorldPos) 36 | { 37 | float sample = GetSample(x, y); 38 | 39 | if (isAnglePaint) 40 | { 41 | int heightMapResolution = terrainData.heightmapResolution; 42 | float x01 = xAlpha / terrainData.alphamapWidth; 43 | float y01 = yAlpha / terrainData.alphamapHeight; 44 | float steepness = terrainData.GetSteepness(x01, y01); 45 | float value = steepness * steepness / (heightMapResolution / angleDivide); 46 | float clampValue = Mathf.Clamp01(value); 47 | float angleV = clifCurve.Evaluate(clampValue); 48 | sample *= angleV; 49 | } 50 | 51 | return sample; 52 | } 53 | 54 | private void UpdateNoiseName() 55 | { 56 | name = terrainLayer.name; 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /UltraNoise5000/Exports/PaintLayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0bce4a70b785853489f7da031988ec4d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Exports/PaintLayerExportGroup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 032b9084395d4bd19d51659a127c5dbd 3 | timeCreated: 1620555512 -------------------------------------------------------------------------------- /UltraNoise5000/Exports/TextureExportNode.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | using Sirenix.OdinInspector; 3 | using UnityEngine; 4 | #if UNITY_EDITOR 5 | using UnityEditor; 6 | #endif 7 | 8 | namespace NoiseUltra.Output 9 | { 10 | [NodeTint(NodeColor.EXPORT_TEXTURE)] 11 | public class TextureExportNode : NodeInputOutput 12 | { 13 | private const string SAVE_FOLDER_PATH = "NoiseTextures"; 14 | private const string FILES_EXTENSION = ".png"; 15 | private const string FILE_ASSET_EXTENSION = ".asset"; 16 | 17 | [SerializeField] 18 | [OnValueChanged(nameof(UpdateNoiseName))] 19 | private string nodeTitle; 20 | 21 | [SerializeField] 22 | private int textureResolution = 1024; 23 | 24 | protected override void Init() 25 | { 26 | base.Init(); 27 | nodeTitle = name; 28 | } 29 | 30 | private void UpdateNoiseName() 31 | { 32 | name = nodeTitle; 33 | } 34 | 35 | [Button] 36 | private void ExportTexture() 37 | { 38 | #if UNITY_EDITOR 39 | previewImage.SetImageSize(textureResolution); 40 | string currentPath = AssetDatabase.GetAssetPath(graph); 41 | string folderPath = currentPath.Replace(graph.name + FILE_ASSET_EXTENSION, string.Empty) + SAVE_FOLDER_PATH; 42 | 43 | DrawSync(); 44 | 45 | byte[] bytes = previewImage.GetTexture().EncodeToPNG(); 46 | 47 | string filename = string.Format("{0}/{1}{2}", folderPath, name, FILES_EXTENSION); 48 | 49 | if (!System.IO.Directory.Exists(folderPath)) 50 | { 51 | System.IO.Directory.CreateDirectory(folderPath); 52 | } 53 | 54 | System.IO.File.WriteAllBytes(filename, bytes); 55 | AssetDatabase.Refresh(); 56 | previewImage.ResetImageSize(); 57 | #endif 58 | } 59 | } 60 | } 61 | 62 | -------------------------------------------------------------------------------- /UltraNoise5000/Exports/TextureExportNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6489f332632ff2a4a9fad842a8da2370 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Generators.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b43e51c08dd43ef8fca9270accb0d84 3 | timeCreated: 1612654572 -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Attributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Sirenix.OdinInspector; 3 | using UnityEngine; 4 | using Random = UnityEngine.Random; 5 | 6 | namespace NoiseUltra.Generators 7 | { 8 | [Serializable] 9 | public sealed class Attributes 10 | { 11 | #region Member 12 | [SerializeField] 13 | [OnValueChanged(nameof(DrawPreview))] 14 | private int seed; 15 | 16 | [SerializeField] 17 | [OnValueChanged(nameof(DrawPreview))] 18 | private NOISE_TYPE noiseType = NOISE_TYPE.PERLIN; 19 | 20 | [SerializeField] 21 | [OnValueChanged(nameof(DrawPreview))] 22 | private float frequency = 20f; 23 | 24 | [SerializeField] 25 | [OnValueChanged(nameof(DrawPreview))] 26 | private float amplitude = 1f; 27 | 28 | [SerializeField] 29 | [OnValueChanged(nameof(DrawPreview))] 30 | private float lacunarity = 2.0f; 31 | 32 | [SerializeField] 33 | [OnValueChanged(nameof(DrawPreview))] 34 | [Range(1, 16)] 35 | private int octaves = 4; 36 | 37 | [SerializeField] 38 | [OnValueChanged(nameof(DrawPreview))] 39 | private Vector3 offset; 40 | #endregion 41 | 42 | #region Public 43 | public float FrequencyOver100 => frequency / 100f; 44 | 45 | private NoiseGenerator NoiseGenerator { get; set; } 46 | 47 | public int Seed => seed; 48 | public NOISE_TYPE NoiseType => noiseType; 49 | 50 | public float Amplitude => amplitude; 51 | 52 | public float Lacunarity => lacunarity; 53 | 54 | public int Octaves => octaves; 55 | 56 | public Vector3 Offset => offset; 57 | 58 | public void RandomizeSeed() 59 | { 60 | seed = Random.Range(0, 999999); 61 | } 62 | 63 | public void SetGenerator(NoiseGenerator noiseGenerator) 64 | { 65 | this.NoiseGenerator = noiseGenerator; 66 | } 67 | #endregion 68 | 69 | #region Private 70 | private void DrawPreview() 71 | { 72 | if (NoiseGenerator != null) 73 | { 74 | NoiseGenerator.SetFractalDirty(); 75 | NoiseGenerator.DrawAsync(); 76 | } 77 | } 78 | #endregion 79 | } 80 | } -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Attributes.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bbf064ff70024cfeba4d807321fdbf6a 3 | timeCreated: 1619126830 -------------------------------------------------------------------------------- /UltraNoise5000/Generators/NodeGeneratorHelper.cs: -------------------------------------------------------------------------------- 1 | using ProceduralNoiseProject; 2 | using UnityEngine; 3 | 4 | namespace NoiseUltra.Generators 5 | { 6 | public static class NodeGeneratorHelper 7 | { 8 | public static FractalNoise CreateFractal(Attributes attributes) 9 | { 10 | INoise noise = CreateBaseNoise(attributes); 11 | int octaves = attributes.Octaves; 12 | float frequency = attributes.FrequencyOver100; 13 | FractalNoise fractal = new FractalNoise(noise, octaves, frequency); 14 | Vector3 offset = attributes.Offset; 15 | fractal.Offset = offset; 16 | return fractal; 17 | } 18 | 19 | private static INoise CreateBaseNoise(Attributes attributes) 20 | { 21 | int seed = attributes.Seed; 22 | NOISE_TYPE noiseType = attributes.NoiseType; 23 | float frequency = attributes.FrequencyOver100; 24 | float amplitude = attributes.Amplitude; 25 | return CreateBaseNoise(seed, frequency, noiseType, amplitude); 26 | } 27 | 28 | private static INoise CreateBaseNoise(int seed, float frequency, NOISE_TYPE type, float amplitude) 29 | { 30 | INoise noise = type switch 31 | { 32 | NOISE_TYPE.PERLIN => new PerlinNoise(seed, frequency), 33 | NOISE_TYPE.VALUE => new ValueNoise(seed, frequency), 34 | NOISE_TYPE.SIMPLEX => new SimplexNoise(seed, frequency), 35 | NOISE_TYPE.VORONOI => new VoronoiNoise(seed, frequency), 36 | NOISE_TYPE.WORLEY => new WorleyNoise(seed, frequency, jitter: 1.0f), 37 | _ => new PerlinNoise(seed, frequency) 38 | }; 39 | 40 | noise.Amplitude = amplitude; 41 | return noise; 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /UltraNoise5000/Generators/NodeGeneratorHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45a747c19487472b996684c5c8e33433 3 | timeCreated: 1619123857 -------------------------------------------------------------------------------- /UltraNoise5000/Generators/NoiseGenerator.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | using ProceduralNoiseProject; 3 | using Sirenix.OdinInspector; 4 | using UnityEngine; 5 | 6 | namespace NoiseUltra.Generators 7 | { 8 | [NodeTint(NodeColor.GENERATOR_NOISE)] 9 | public class NoiseGenerator : NodeOutput 10 | { 11 | #region Members 12 | [BoxGroup("Noise Settings"),SerializeField , InlineProperty() , HideLabel] 13 | private Attributes attributes = new Attributes(); 14 | private FractalNoise m_Fractal; 15 | 16 | private bool IsDirty => m_Fractal == null; 17 | #endregion 18 | 19 | #region Public 20 | public void SetFractalDirty() 21 | { 22 | m_Fractal = null; 23 | } 24 | 25 | public override float GetSample(float x) 26 | { 27 | float sample = GetFractalLazy().Sample1D(x); 28 | return sample; 29 | } 30 | 31 | public override float GetSample(float x, float y) 32 | { 33 | float sample = GetFractalLazy().Sample3D(x, 0 , y); 34 | return sample; 35 | } 36 | 37 | public override float GetSample(float x, float y, float z) 38 | { 39 | float sample = GetFractalLazy().Sample3D(x, y, z); 40 | return sample; 41 | } 42 | #endregion 43 | 44 | #region Private 45 | [Button] 46 | private void New() 47 | { 48 | attributes.RandomizeSeed(); 49 | SetFractalDirty(); 50 | DrawAsync(); 51 | } 52 | 53 | private FractalNoise GetFractalLazy() 54 | { 55 | return IsDirty ? CreateFractal() : m_Fractal; 56 | } 57 | 58 | private FractalNoise CreateFractal() 59 | { 60 | attributes.SetGenerator(this); 61 | return NodeGeneratorHelper.CreateFractal(attributes); 62 | } 63 | 64 | #endregion 65 | } 66 | } -------------------------------------------------------------------------------- /UltraNoise5000/Generators/NoiseGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e0efac3304690548881b019e836aa62 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Static.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa6c016d7bbf42adb0820adc7234dd45 3 | timeCreated: 1619273411 -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Static/Black.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NoiseUltra.Nodes; 3 | using UnityEngine; 4 | 5 | namespace NoiseUltra.Generators.Static 6 | { 7 | [NodeTint(NodeColor.GENERATOR_OTHER)] 8 | public class Black : NodeOutput 9 | { 10 | public override float GetSample(float x) 11 | { 12 | return 0; 13 | } 14 | 15 | public override float GetSample(float x, float y) 16 | { 17 | return 0; 18 | } 19 | 20 | public override float GetSample(float x, float y, float z) 21 | { 22 | return 0; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Static/Black.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 013b0c34c18a69145850da4efd7ad540 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Static/Circle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NoiseUltra.Nodes; 3 | using Sirenix.OdinInspector; 4 | using UnityEngine; 5 | 6 | namespace NoiseUltra.Generators.Static 7 | { 8 | [NodeTint(NodeColor.GENERATOR_OTHER)] 9 | public class Circle : NodeOutput 10 | { 11 | private const float Default = 0; 12 | [SerializeField] 13 | private Vector3 center = new Vector2(Default, Default); 14 | 15 | [SerializeField] 16 | private float radius = Default; 17 | 18 | [SerializeField] 19 | private bool hardEdges; 20 | 21 | 22 | public override float GetSample(float x) 23 | { 24 | return 1; 25 | } 26 | 27 | public override float GetSample(float x, float y) 28 | { 29 | var distance = Vector2.Distance(center, new Vector2(x, y)); 30 | var isInRange = distance < radius; 31 | 32 | if (hardEdges) 33 | return isInRange ? 1 : 0; 34 | 35 | return 1 - Mathf.InverseLerp(0 , radius , distance); 36 | } 37 | 38 | public override float GetSample(float x, float y, float z) 39 | { 40 | var distance = Vector3.Distance(center, new Vector3(x, y, z)); 41 | var isInRange = distance < radius; 42 | 43 | if (hardEdges) 44 | return isInRange ? 1 : 0; 45 | 46 | return 1- Mathf.InverseLerp(0 , radius , distance); 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Static/Circle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 608518c0442c80c4ba50a69bbdf02c55 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Static/ExternalNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NoiseUltra.Nodes; 3 | using NoiseUltra.Output; 4 | using UnityEngine; 5 | 6 | namespace NoiseUltra.Generators.Static 7 | { 8 | [NodeTint(NodeColor.YELLOW)] 9 | public class ExternalNode : NodeOutput 10 | { 11 | [SerializeField] private ExportNode node; 12 | 13 | private bool IsValid => node != null; 14 | 15 | public override float GetSample(float x) 16 | { 17 | if (!IsValid) return 0; 18 | return node.GetSample(x); 19 | } 20 | 21 | public override float GetSample(float x, float y) 22 | { 23 | if (!IsValid) return 0; 24 | return node.GetSample(x, y); 25 | } 26 | 27 | public override float GetSample(float x, float y, float z) 28 | { 29 | if (!IsValid) return 0; 30 | return node.GetSample(x, y, z); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Static/ExternalNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a1ff3f47fc813049b5f2d3bf8544535 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Static/Gradient.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NoiseUltra.Nodes; 3 | using UnityEngine; 4 | 5 | namespace NoiseUltra.Generators.Static 6 | { 7 | [NodeTint(NodeColor.GENERATOR_OTHER)] 8 | public class Gradient : NodeOutput 9 | { 10 | [SerializeField] private GrandientLineType lineType; 11 | [SerializeField] private float start; 12 | [SerializeField] private float end = 256; 13 | 14 | public override float GetSample(float x) 15 | { 16 | return Mathf.Lerp(start, end, x); 17 | } 18 | 19 | public override float GetSample(float x, float y) 20 | { 21 | return Mathf.InverseLerp(start, end, lineType == GrandientLineType.Horizontal ? x : y); 22 | } 23 | 24 | public override float GetSample(float x, float y, float z) 25 | { 26 | return Mathf.InverseLerp(start, end, lineType == GrandientLineType.Horizontal ? x : y); 27 | } 28 | 29 | private enum GrandientLineType 30 | { 31 | Horizontal, 32 | Vertical 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Static/Gradient.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a3b340d214492a49a92568738d06f10 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Static/Texture.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | using Sirenix.OdinInspector; 3 | using UnityEngine; 4 | 5 | namespace NoiseUltra.Generators.Static 6 | { 7 | [NodeTint(NodeColor.GENERATOR_OTHER)] 8 | public class Texture : NodeOutput 9 | { 10 | [SerializeField] 11 | private Texture2D texture2d; 12 | 13 | [SerializeField] 14 | private float scale = 1; 15 | 16 | [SerializeField] 17 | private Vector2 offSet = new Vector2(0, 0); 18 | 19 | [SerializeField] 20 | private Rect textureRect; 21 | 22 | private bool IsValid => texture2d != null; 23 | 24 | [Button] 25 | public void UpdateTexture() 26 | { 27 | textureRect = new Rect(0, 0, texture2d.width, texture2d.height); 28 | DrawAsync(); 29 | } 30 | 31 | public override float GetSample(float x) 32 | { 33 | return 0; 34 | } 35 | 36 | public override float GetSample(float x, float y) 37 | { 38 | var scaledPosition = GetScaledPosition(x, y); 39 | 40 | if (!IsValid || !IsValidPosition(scaledPosition)) 41 | return 0; 42 | 43 | var px = Mathf.RoundToInt(scaledPosition.x); 44 | var py = Mathf.RoundToInt(scaledPosition.y); 45 | return texture2d.GetPixel(px, py).r; 46 | } 47 | 48 | public override float GetSample(float x, float y, float z) 49 | { 50 | var scaledPosition = GetScaledPosition(x, z); 51 | 52 | if (!IsValid || !IsValidPosition(scaledPosition)) 53 | return 0; 54 | 55 | var px = Mathf.RoundToInt(scaledPosition.x); 56 | var py = Mathf.RoundToInt(scaledPosition.y); 57 | return texture2d.GetPixel(px, py).r; 58 | } 59 | 60 | private bool IsValidPosition(Vector2 scaledPosition) 61 | { 62 | return textureRect.Contains(scaledPosition); 63 | } 64 | 65 | 66 | private Vector2 GetScaledPosition(float x, float y) 67 | { 68 | var posCord = new Vector2(x, y); 69 | return (posCord + offSet) * scale; 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Static/Texture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d975450be4b74b4e83a03637a75316b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Static/Triangle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NoiseUltra.Nodes; 3 | using UnityEngine; 4 | 5 | namespace NoiseUltra.Generators.Static 6 | { 7 | [NodeTint(NodeColor.GENERATOR_OTHER)] 8 | public class Triangle : NodeOutput 9 | { 10 | [SerializeField] private Vector2 p1; 11 | 12 | [SerializeField] private Vector2 p2; 13 | 14 | [SerializeField] private Vector2 p3; 15 | 16 | public override float GetSample(float x) 17 | { 18 | return 1; 19 | } 20 | 21 | public override float GetSample(float x, float y) 22 | { 23 | return IsInTriangle(new Vector2(x, y)) ? 1 : 0; 24 | } 25 | 26 | public override float GetSample(float x, float y, float z) 27 | { 28 | return 1; 29 | } 30 | 31 | private float Sign(Vector2 p1, Vector2 p2, Vector2 p3) 32 | { 33 | return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y); 34 | } 35 | 36 | private bool IsInTriangle(Vector2 point) 37 | { 38 | var d1 = Sign(point, p1, p2); 39 | var d2 = Sign(point, p2, p3); 40 | var d3 = Sign(point, p3, p1); 41 | var hasNeg = d1 < 0 || d2 < 0 || d3 < 0; 42 | var hasPos = d1 > 0 || d2 > 0 || d3 > 0; 43 | return !(hasNeg && hasPos); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Static/Triangle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae57daa299cc458ea72bbabd7ca68cb7 3 | timeCreated: 1619283584 -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Static/White.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | 3 | namespace NoiseUltra.Generators.Static 4 | { 5 | [NodeTint(NodeColor.GENERATOR_OTHER)] 6 | public class White : NodeOutput 7 | { 8 | public override float GetSample(float x) 9 | { 10 | return 1; 11 | } 12 | 13 | public override float GetSample(float x, float y) 14 | { 15 | return 1; 16 | } 17 | 18 | public override float GetSample(float x, float y, float z) 19 | { 20 | return 1; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /UltraNoise5000/Generators/Static/White.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d248cb3f39d5454d960d953a915e8e5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Graph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e978cddd26a4a39909b3f82adfe90d6 3 | timeCreated: 1619268943 -------------------------------------------------------------------------------- /UltraNoise5000/Graph/NoiseNodeGraph.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | using Sirenix.OdinInspector; 3 | using UnityEngine; 4 | using XNode; 5 | 6 | namespace NoiseUltra 7 | { 8 | /// 9 | /// Class packs all nodes of a graph and serializes them into a single file. 10 | /// 11 | [CreateAssetMenu(fileName = "Ultra Noise Graph", menuName = "KillMobil/UltraNoise/Noise Graph")] 12 | public class NoiseNodeGraph : NodeGraph 13 | { 14 | private const string UPDATE_ALL_NODES_NAME = "Update All Nodes"; 15 | private const string UPDATE_ALL_ZOOMS_NAME = "Update All Zooms"; 16 | 17 | [SerializeField] 18 | private int globalZoom = 1024; 19 | public int GlobalZoom => globalZoom; 20 | 21 | public override void OnOpen() 22 | { 23 | UpdateAllNodes(); 24 | } 25 | 26 | [Button] 27 | [ContextMenu(UPDATE_ALL_NODES_NAME)] 28 | public void UpdateAllNodes() 29 | { 30 | int count = nodes.Count; 31 | for (int index = 0; index < count; index++) 32 | { 33 | Node node = nodes[index]; 34 | if (node is NodeBase item) 35 | { 36 | item.DrawAsync(); 37 | } 38 | } 39 | } 40 | 41 | [Button] 42 | [ContextMenu(UPDATE_ALL_ZOOMS_NAME)] 43 | public void UpdateAllZooms() 44 | { 45 | int count = nodes.Count; 46 | for (int index = 0; index < count; index++) 47 | { 48 | var node = nodes[index]; 49 | if (node is NodeBase item) 50 | { 51 | item.SetZoom(globalZoom); 52 | } 53 | } 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /UltraNoise5000/Graph/NoiseNodeGraph.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac0e6c3739716634bbbce7e890c35354 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5fcc6bb25fdc5244398f604c395f2031 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/AbsCordinates.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using NoiseUltra.Nodes; 3 | using Sirenix.OdinInspector; 4 | 5 | 6 | namespace NoiseUltra.Modifiers 7 | { 8 | [NodeTint(NodeColor.MODIFIER)] 9 | public class AbsCordinates :NodeInputOutput 10 | { 11 | 12 | public override float GetSample(float x) 13 | { 14 | 15 | return base.GetSample(Mathf.Abs(x)); 16 | } 17 | 18 | public override float GetSample(float x, float y) 19 | { 20 | 21 | return base.GetSample(Mathf.Abs(x), Mathf.Abs(y)); 22 | } 23 | 24 | public override float GetSample(float x, float y, float z) 25 | { 26 | 27 | return base.GetSample(Mathf.Abs(x), Mathf.Abs(y), Mathf.Abs(z) ); 28 | } 29 | 30 | } 31 | } -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/AbsCordinates.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f491ebfeb4e64454bcce1319e5c79680 3 | timeCreated: 1641830527 -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/BaseNodeModifier.cs: -------------------------------------------------------------------------------- 1 | namespace NoiseUltra.Nodes 2 | { 3 | /// 4 | /// Class samples a value and applies a modifier. 5 | /// 6 | public abstract class BaseNodeModifier : NodeInputOutput 7 | { 8 | protected abstract float ApplyModifier(float sample); 9 | 10 | public override float GetSample(float x) 11 | { 12 | float sample = base.GetSample(x); 13 | return ApplyModifier(sample); 14 | } 15 | 16 | public override float GetSample(float x, float y) 17 | { 18 | float sample = base.GetSample(x, y); 19 | return ApplyModifier(sample); 20 | } 21 | 22 | public override float GetSample(float x, float y, float z) 23 | { 24 | float sample = base.GetSample(x, y, z); 25 | return ApplyModifier(sample); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/BaseNodeModifier.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ebe245f0a8d43184190f50c4929d8a46 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/Clamp.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | using Sirenix.OdinInspector; 3 | using UnityEngine; 4 | 5 | namespace NoiseUltra.Modifiers 6 | { 7 | [NodeTint(NodeColor.MODIFIER)] 8 | public class Clamp : BaseNodeModifier 9 | { 10 | [SerializeField] 11 | [OnValueChanged(nameof(DrawAsync))] 12 | private Vector2 limit = new Vector2(0, 1); 13 | 14 | [SerializeField] 15 | [OnValueChanged(nameof(DrawAsync))] 16 | private bool smoothClampValue; 17 | 18 | protected override float ApplyModifier(float sample) 19 | { 20 | float clamp = Mathf.Clamp(sample, limit.x, limit.y); 21 | if (smoothClampValue) 22 | { 23 | clamp = Mathf.InverseLerp(limit.x, limit.y, clamp); 24 | } 25 | 26 | return clamp; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/Clamp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b9ecd2ce9cc5574c9541d312dbed3aa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/Cos.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | using NoiseUltra.Operations; 3 | using UnityEngine; 4 | using Sirenix.OdinInspector; 5 | 6 | namespace NoiseUltra.Modifiers 7 | { 8 | [NodeTint(NodeColor.MODIFIER)] 9 | public class Cos : BaseNodeModifier 10 | { 11 | [SerializeField , OnValueChanged(nameof(DrawAsync))] 12 | private float strenght; 13 | protected override float ApplyModifier(float sample) 14 | { 15 | return CosCalculation(sample * strenght); 16 | } 17 | 18 | private float CosCalculation(float sample) 19 | { 20 | float f = sample * MathUtils.PI_TIMES_2; 21 | float resultValue = 0.5f * (1f - Mathf.Cos(f)); 22 | return resultValue; 23 | } 24 | 25 | } 26 | } -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/Cos.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58465e6a50ec4d678206046b4bc23cad 3 | timeCreated: 1619275049 -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/Curve.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | using Sirenix.OdinInspector; 3 | using UnityEngine; 4 | 5 | namespace NoiseUltra.Modifiers 6 | { 7 | [NodeTint(NodeColor.MODIFIER)] 8 | public class Curve : BaseNodeModifier 9 | { 10 | [SerializeField] 11 | [OnValueChanged(nameof(DrawAsync))] 12 | private AnimationCurve resultCurve = AnimationCurve.Linear(0, 0, 1, 1); 13 | 14 | protected override float ApplyModifier(float sample) 15 | { 16 | return resultCurve.Evaluate(sample); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/Curve.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ea95bccf1ca23c4cb206992d0b37f52 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/OneMinus.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | 3 | namespace NoiseUltra.Modifiers 4 | { 5 | [NodeTint(NodeColor.MODIFIER)] 6 | public class OneMinus : BaseNodeModifier 7 | { 8 | protected override float ApplyModifier(float sample) 9 | { 10 | return 1 - sample; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/OneMinus.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fcbb6fd6a48b4074fbfee8e56d02f201 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/Sin.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | using NoiseUltra.Operations; 3 | using Sirenix.OdinInspector; 4 | using UnityEngine; 5 | 6 | namespace NoiseUltra.Modifiers 7 | { 8 | [NodeTint(NodeColor.MODIFIER)] 9 | public class Sin : BaseNodeModifier 10 | { 11 | [SerializeField , OnValueChanged(nameof(DrawAsync))] 12 | private float strenght; 13 | 14 | protected override float ApplyModifier(float sample) 15 | { 16 | return SinCalculation(sample * strenght); 17 | } 18 | 19 | 20 | public float SinCalculation(float sample) 21 | { 22 | float f = sample * MathUtils.PI_TIMES_2; 23 | float resultValue = 0.5f *(1 + Mathf.Sin(f)); 24 | return resultValue; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/Sin.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 242dfc1c0d9a466fac22a0d73c57b528 3 | timeCreated: 1619275040 -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/Step.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | using NoiseUltra.Operations; 3 | using Sirenix.OdinInspector; 4 | using UnityEngine; 5 | 6 | namespace NoiseUltra.Modifiers 7 | { 8 | [NodeTint(NodeColor.MODIFIER)] 9 | public class Step : BaseNodeModifier 10 | { 11 | private const int MIN_STEPS = 1; 12 | private const int MAX_STEPS = 50; 13 | 14 | [SerializeField] 15 | [Range(MIN_STEPS, MAX_STEPS)] 16 | [OnValueChanged(nameof(DrawAsync))] 17 | private int steps = MIN_STEPS; 18 | 19 | protected override float ApplyModifier(float sample) 20 | { 21 | return Mathf.Floor(steps * sample) / MathUtils.NaNCheck(steps); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/Step.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d03f5d6a67306d645bda819869d6b6af 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/Tan.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | using UnityEngine; 3 | using Sirenix.OdinInspector; 4 | namespace NoiseUltra.Modifiers 5 | { 6 | [NodeTint(NodeColor.MODIFIER)] 7 | public class Tan : BaseNodeModifier 8 | { 9 | [SerializeField , OnValueChanged(nameof(DrawAsync))] 10 | private float strenght; 11 | protected override float ApplyModifier(float sample) 12 | { 13 | return Mathf.Tan(sample * strenght); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /UltraNoise5000/Modifiers/Tan.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2eb5ffa99c7b4630942754b18e657007 3 | timeCreated: 1619274987 -------------------------------------------------------------------------------- /UltraNoise5000/Nodes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18cfb8a591f903b438656d47f2be1d5c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UltraNoise5000/Nodes/Bound.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Sirenix.OdinInspector; 3 | using UnityEngine; 4 | using NoiseUltra.Nodes; 5 | 6 | namespace NoiseUltra.Nodes 7 | { 8 | [Serializable] 9 | public struct Bound 10 | { 11 | //[Range(NodeProprieties.MIN_VALUE, NodeProprieties.MAX_VALUE), ReadOnly] 12 | [HorizontalGroup(NodeLabels.MinMax)] 13 | [VerticalGroup(NodeLabels.MinMaxLEFTGroup)] 14 | [BoxGroup(NodeLabels.MinMaxLEFTGroupMIN) , HideLabel] 15 | public float min; 16 | 17 | //[Range(NodeProprieties.MIN_VALUE, NodeProprieties.MAX_VALUE), ReadOnly] 18 | [VerticalGroup(NodeLabels.MinMaxRIGHTGroup)] 19 | [BoxGroup(NodeLabels.MinMaxRIGHTGroupMax) , HideLabel] 20 | public float max; 21 | 22 | private readonly PreviewImage m_Preview; 23 | 24 | public Bound(PreviewImage image) 25 | { 26 | min = NodeProprieties.MAX_VALUE; 27 | max = NodeProprieties.MIN_VALUE; 28 | m_Preview = image; 29 | } 30 | 31 | public void Reset() 32 | { 33 | min = NodeProprieties.MAX_VALUE; 34 | max = NodeProprieties.MIN_VALUE; 35 | } 36 | 37 | public void IdentifyBounds(float sample) 38 | { 39 | sample = Mathf.Clamp01(sample); 40 | max = Mathf.Max(max, sample); 41 | min = Mathf.Min(min, sample); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /UltraNoise5000/Nodes/Bound.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c8868d03b554b5182e5ae60a6028ee7 3 | timeCreated: 1619038774 -------------------------------------------------------------------------------- /UltraNoise5000/Nodes/NodeBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d29369d1951b8449ba66db19f1f8c21 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Nodes/NodeDoubleInputOutput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3cfa2b5548f4f234ab56046985bbc009 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Nodes/NodeInputOutput.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | using XNode; 4 | 5 | namespace NoiseUltra.Nodes 6 | { 7 | /// 8 | /// Samples and processes a Single Input Node into a Single Output Node. 9 | /// 10 | public abstract class NodeInputOutput : NodeOutput 11 | { 12 | [Input] 13 | [SerializeField] 14 | private NodeBase input; 15 | 16 | #region Public 17 | public override float GetSample(float x) 18 | { 19 | return IsInputValid ? Mathf.Clamp01(GetInput().GetSample(x)) : NodeProprieties.INVALID_VALUE; 20 | } 21 | 22 | public override float GetSample(float x, float y) 23 | { 24 | return IsInputValid ? Mathf.Clamp01(GetInput().GetSample(x, y)) : NodeProprieties.INVALID_VALUE; 25 | } 26 | 27 | public override float GetSample(float x, float y, float z) 28 | { 29 | return IsInputValid ? Mathf.Clamp01(GetInput().GetSample(x, y, z)) : NodeProprieties.INVALID_VALUE; 30 | } 31 | 32 | protected bool isInputConnected(NodeBase node) 33 | { 34 | NodePort inputPort = GetPort("input"); 35 | List connectionList = inputPort.GetConnections(); 36 | for (int i = 0; i < connectionList.Count; i++) 37 | if (node == connectionList[i].node) return true; 38 | 39 | return false; 40 | } 41 | 42 | #endregion 43 | 44 | #region Private 45 | 46 | private NodeBase GetInput() 47 | { 48 | return GetInputNode(nameof(input), input); 49 | } 50 | 51 | private bool IsInputValid => GetInput() != null; 52 | #endregion 53 | } 54 | } -------------------------------------------------------------------------------- /UltraNoise5000/Nodes/NodeInputOutput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa386cbdfb567be4a9f5d0888afa8c2b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Nodes/NodeOutput.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using XNode; 3 | 4 | namespace NoiseUltra.Nodes 5 | { 6 | /// 7 | /// Class processes a Single Output Node. 8 | /// 9 | public abstract class NodeOutput : NodeBase 10 | { 11 | [Output] 12 | [SerializeField] 13 | private NodeBase output; 14 | 15 | public override void OnCreateConnection(NodePort source, NodePort target) 16 | { 17 | if (this != target.node) 18 | { 19 | DrawAsync(); 20 | } 21 | } 22 | 23 | private void UpdateOutPut() 24 | { 25 | if (!IsConnected(output)) 26 | { 27 | return; 28 | } 29 | 30 | NodePort port = GetPort(output); 31 | int connectionsCount = port.ConnectionCount; 32 | for (int i = 0; i < connectionsCount; ++i) 33 | { 34 | NodePort connectedPort = port.GetConnection(i); 35 | NodeBase node = connectedPort.node as NodeBase; 36 | if (node != null) 37 | { 38 | Debug.Log("UpdateOutPut Draw: " + node.name); 39 | node.DrawAsync(); 40 | } 41 | } 42 | } 43 | 44 | protected override void OnBeforeDrawPreview() 45 | { 46 | UpdateOutPut(); 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /UltraNoise5000/Nodes/NodeOutput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7aa328073d0b00a4087319a452b81e08 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Nodes/NodeProprieties.cs: -------------------------------------------------------------------------------- 1 | namespace NoiseUltra.Nodes 2 | { 3 | public static class NodeColor 4 | { 5 | public const string YELLOW = "#86853C"; 6 | 7 | public const string MODIFIER = "#8C7569"; 8 | public const string OPERATION = "#8C8C69"; 9 | public const string UTILITY = "#737373"; 10 | 11 | public const string GENERATOR_NOISE = "#529945"; 12 | public const string GENERATOR_OTHER = "#45996F"; 13 | 14 | public const string EXPORT_NODE = "#4273A6"; 15 | public const string EXPORT_TEXTURE = "#4B97A6"; 16 | 17 | public const string PAINTLAYER = "#927590"; 18 | public const string PAINTEXPORT = "#BA5381"; 19 | } 20 | 21 | public static class NodeLabels 22 | { 23 | public const string MinMax = "MinMax"; 24 | public const string Max = "Max"; 25 | public const string Min = "Min"; 26 | public const string Left = "Left"; 27 | public const string Right = "Right"; 28 | public const string Separator = "/"; 29 | 30 | 31 | public const string MinMaxLEFTGroup = MinMax + Separator + Left; 32 | public const string MinMaxLEFTGroupMIN = MinMaxLEFTGroup + Separator + Min; 33 | 34 | public const string MinMaxRIGHTGroup = MinMax + Separator + Right; 35 | public const string MinMaxRIGHTGroupMax = MinMaxRIGHTGroup + Separator + Max; 36 | } 37 | 38 | /// 39 | /// Global properties for nodes. 40 | /// 41 | public static class NodeProprieties 42 | { 43 | public const int DEFAULT_GLOBAL_ZOOM = 200; 44 | public const int DEFAULT_PREVIEW_SIZE = 256; 45 | public const int DEFAULT_TEXTURE_SIZE = 128; 46 | public const int NODE_WIDTH_PIXELS = 286; 47 | 48 | public const float MIN_VALUE = 0; 49 | public const float MAX_VALUE = 1; 50 | public const float INVALID_VALUE = -1; 51 | } 52 | } -------------------------------------------------------------------------------- /UltraNoise5000/Nodes/NodeProprieties.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24df71cafd85420d94ebf70aa178c747 3 | timeCreated: 1619028719 -------------------------------------------------------------------------------- /UltraNoise5000/Nodes/NodeTripleInputOutput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2e20fcd94bba7b42a5065b9743aed52 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Nodes/PreviewImage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e28bb4e78b3a474ca88264cf992f7a36 3 | timeCreated: 1619038792 -------------------------------------------------------------------------------- /UltraNoise5000/Operations.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 589ec82d398775e409ee34734d8416c0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UltraNoise5000/Operations/Add.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | 3 | namespace NoiseUltra.Operations 4 | { 5 | [NodeTint(NodeColor.OPERATION)] 6 | public class Add : NodeDoubleInputOutput 7 | { 8 | protected override float ExecuteOperation(float strengthenedA, float strengthenedB) 9 | { 10 | return strengthenedA + strengthenedB; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /UltraNoise5000/Operations/Add.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9787745fddbd39c4893e37fef650b9dc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Operations/Div.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | 3 | namespace NoiseUltra.Operations 4 | { 5 | [NodeTint(NodeColor.OPERATION)] 6 | public class Div : NodeDoubleInputOutput 7 | { 8 | protected override float ExecuteOperation(float strengthenedA, float strengthenedB) 9 | { 10 | return strengthenedA / MathUtils.NaNCheck(strengthenedB); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /UltraNoise5000/Operations/Div.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41dc0ddb75814d2f9271252fabc19a21 3 | timeCreated: 1619274631 -------------------------------------------------------------------------------- /UltraNoise5000/Operations/Lerp.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | using Sirenix.OdinInspector; 3 | using UnityEngine; 4 | 5 | namespace NoiseUltra.Operations 6 | { 7 | [NodeTint(NodeColor.OPERATION)] 8 | public class Lerp : NodeDoubleInputOutput 9 | { 10 | [SerializeField] 11 | [Range(NodeProprieties.MIN_VALUE, NodeProprieties.MAX_VALUE)] 12 | [OnValueChanged(nameof(DrawAsync))] 13 | private float factor; 14 | 15 | protected override float ExecuteOperation(float strengthenedA, float strengthenedB) 16 | { 17 | return Mathf.Lerp(strengthenedA, strengthenedB, factor); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /UltraNoise5000/Operations/Lerp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d19c03cc21b9c6f449f37123bd03bf45 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Operations/LerpNoise.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | using UnityEngine; 3 | 4 | namespace NoiseUltra.Operations 5 | { 6 | [NodeTint(NodeColor.OPERATION)] 7 | public class LerpNoise : NodeTripleInputOutput 8 | { 9 | protected override float ExecuteOperation(float strengthenedA, float strengthenedB, float strengthenedC) 10 | { 11 | return Mathf.Lerp(strengthenedA, strengthenedB, strengthenedC); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /UltraNoise5000/Operations/LerpNoise.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dfac2bd8c299fcd4b97fae361a903f35 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Operations/Mult.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | 3 | namespace NoiseUltra.Operations 4 | { 5 | [NodeTint(NodeColor.OPERATION)] 6 | public class Mult : NodeDoubleInputOutput 7 | { 8 | protected override float ExecuteOperation(float strengthenedA, float strengthenedB) 9 | { 10 | return strengthenedA * strengthenedB; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /UltraNoise5000/Operations/Mult.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 357805782b374bc4b6bf33cdede28919 3 | timeCreated: 1619274605 -------------------------------------------------------------------------------- /UltraNoise5000/Operations/Sub.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | 3 | namespace NoiseUltra.Operations 4 | { 5 | [NodeTint(NodeColor.OPERATION)] 6 | public class Sub : NodeDoubleInputOutput 7 | { 8 | protected override float ExecuteOperation(float strengthenedA, float strengthenedB) 9 | { 10 | return strengthenedA - strengthenedB; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /UltraNoise5000/Operations/Sub.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 67fc0f4608a5b1a449d5b194bc63ee0b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb61bdb57c64f1e448c41aa89d4a2310 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Mesh.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0e5265a3ee94c0bbbc404e3d03b5f55 3 | timeCreated: 1636023017 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Mesh/UltraMeshDeformationTool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ea91176da9a175418e0973ca290b8d7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Movement.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b017bff604c5c6f4b8d6ccc91aaeee93 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Movement/UltraNoiseMovement.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using NoiseUltra.Output; 4 | using UnityEngine; 5 | 6 | namespace NoiseUltra.Movement 7 | { 8 | public class UltraNoiseMovement : MonoBehaviour 9 | { 10 | // Start is called before the first frame update 11 | 12 | public UltraNoiseMovementSettings movementSettings; 13 | public UltraNoiseMovementSettings rotationSettings; 14 | 15 | void Start() 16 | { 17 | movementSettings.SetStart(transform.position); 18 | rotationSettings.SetStart(transform.rotation.eulerAngles); 19 | } 20 | 21 | // Update is called once per frame 22 | void FixedUpdate() 23 | { 24 | transform.position = movementSettings.CalculateVector(); 25 | transform.rotation = Quaternion.Euler(rotationSettings.CalculateVector()); 26 | } 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Movement/UltraNoiseMovement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de1ba4c2106bb3f43b2109ad478088cc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Movement/UltraNoiseMovementSettings.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Output; 2 | using UnityEngine; 3 | namespace NoiseUltra.Movement 4 | { 5 | [System.Serializable] 6 | public class UltraNoiseMovementSettings 7 | { 8 | 9 | [SerializeField]private ExportNode movementNoise; 10 | [SerializeField]private Vector3 maxMovement; 11 | [SerializeField]private Vector3 noiseOffeset; 12 | 13 | [SerializeField]private float moveSpeed; 14 | 15 | [SerializeField]private Vector3 start; 16 | 17 | 18 | public void SetStart(Vector3 _start) 19 | { 20 | start = _start; 21 | } 22 | 23 | public Vector3 CalculateVector() 24 | { 25 | var xpos = movementNoise.GetSample(Time.time * moveSpeed + noiseOffeset.x) - 0.5f; 26 | var ypos = movementNoise.GetSample(Time.time * moveSpeed + noiseOffeset.y) - 0.5f; 27 | var zpos = movementNoise.GetSample(Time.time * moveSpeed + noiseOffeset.z) - 0.5f; 28 | 29 | var newpos = start + new Vector3(xpos * maxMovement.x, ypos * maxMovement.y, zpos * maxMovement.z); 30 | 31 | return newpos; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Movement/UltraNoiseMovementSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7865f3860f6443a8d0759b2de5ec062 3 | timeCreated: 1640543167 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 378c45315542c744093d16e85e2ed164 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Base.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0179ccfc602413c45986a344a2baeac7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Base/PlacementItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Sirenix.OdinInspector; 3 | using UnityEngine; 4 | 5 | namespace NoiseUltra.Tools.Placement 6 | { 7 | [Serializable] 8 | public sealed class PlacementItem 9 | { 10 | [SerializeField] [TableColumnWidth(40, false)] 11 | public bool active; 12 | 13 | [SerializeField] [TableColumnWidth(60, false)] [Min(0.1f)] 14 | public float spacing = 10; 15 | 16 | public PlacementSettings settings; 17 | } 18 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Base/PlacementItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4527588edfee46418026fa66d197f1d7 3 | timeCreated: 1619874436 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Base/PlacementSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69ab16edd0906a344910085b4bfaa6c0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Base/PlacementVectorRange.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fefbb2f000dab404991e631f7e6dee70 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Base/PlacementVectorRangeRandom.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 53a0a7aeefc534679b54c56aaf8dd4a6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Base/PlacementVectorRangeValue.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace NoiseUltra.Tools.Placement 5 | { 6 | [Serializable] 7 | public class PlacementVectorRangeValue : PlacementVectorRange 8 | { 9 | public override Vector3 GetVectorRange(Vector3 pos, float threshold) 10 | { 11 | float value = useExternalNoise ? externalSource.GetSample(pos.x, pos.y, pos.z) : threshold; 12 | bool isUnified = axisType == AxisType.Unified; 13 | return isUnified ? GetUnifiedValue(value) : GetSeparatedValue(value); 14 | } 15 | 16 | private Vector3 GetUnifiedValue(float value) 17 | { 18 | if (rangeType == RangeType.MinusPlus) 19 | { 20 | minRange = -range; 21 | } 22 | 23 | float lerpValue = Mathf.Lerp(minRange, range, value); 24 | float roundValue = RoundValue(lerpValue); 25 | Vector3 resultVector = new Vector3(roundValue, roundValue, roundValue); 26 | return resultVector; 27 | } 28 | 29 | private Vector3 GetSeparatedValue(float value) 30 | { 31 | if (rangeType == RangeType.MinusPlus) 32 | { 33 | minRangeV3 = -rangeV3; 34 | } 35 | 36 | Vector3 resultVector = RoundValue(Vector3.Lerp(minRangeV3, rangeV3, value)); 37 | return resultVector; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Base/PlacementVectorRangeValue.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af25689dbc353458fb8985e9bf087243 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Base/enum.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 17772484cd7f34fcd847c1ca2432a78c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Base/enum/AxisType.cs: -------------------------------------------------------------------------------- 1 | namespace NoiseUltra.Tools.Placement 2 | { 3 | public enum AxisType 4 | { 5 | Unified, 6 | Separated 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Base/enum/AxisType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60f7797ef83fa45029e1fff5d955aaf1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Base/enum/RangeType.cs: -------------------------------------------------------------------------------- 1 | namespace NoiseUltra.Tools.Placement 2 | { 3 | public enum RangeType 4 | { 5 | MinusPlus, 6 | MinMax 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Base/enum/RangeType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba5535e3e3b254e92a0034ececb16ad6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/HeightPositioning.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 039296de1caefda4290fc209d0de6c1d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/HeightPositioning/GridHeightPos.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace NoiseUltra.Tools.Placement 5 | { 6 | [Serializable] 7 | public class GridHeightPos : HeightBase 8 | { 9 | public override bool HeightCheck(Vector3 pos) 10 | { 11 | return true; 12 | } 13 | 14 | public override float GetHeightPos(Vector3 pos) 15 | { 16 | return pos.y; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/HeightPositioning/GridHeightPos.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ffbc8e5b3f5893440bd50b3002ba8cee 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/HeightPositioning/HeightBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace NoiseUltra.Tools.Placement 5 | { 6 | [Serializable] 7 | public abstract class HeightBase : IHeightBase 8 | { 9 | public abstract bool HeightCheck(Vector3 pos); 10 | 11 | public abstract float GetHeightPos(Vector3 pos); 12 | } 13 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/HeightPositioning/HeightBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: efad0a4d94d74938851325aac002cf4d 3 | timeCreated: 1619866710 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/HeightPositioning/HeightPosType.cs: -------------------------------------------------------------------------------- 1 | namespace NoiseUltra.Tools.Placement 2 | { 3 | public enum HeightPosType 4 | { 5 | Raycast, 6 | Grid 7 | } 8 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/HeightPositioning/HeightPosType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62b4950ed420d3443b39ce0290d53e96 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/HeightPositioning/IHeightBase.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace NoiseUltra.Tools.Placement 4 | { 5 | public interface IHeightBase 6 | { 7 | bool HeightCheck(Vector3 pos); 8 | float GetHeightPos(Vector3 pos); 9 | } 10 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/HeightPositioning/IHeightBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b22c3ef16d24add8b9fdfadff56b72f 3 | timeCreated: 1619868542 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/HeightPositioning/NoiseHeightPos.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NoiseUltra.Output; 3 | using UnityEngine; 4 | 5 | namespace NoiseUltra.Tools.Placement 6 | { 7 | [Serializable] 8 | public class NoiseHeightPos : HeightBase 9 | { 10 | public ExportNode height; 11 | public float heightAmount; 12 | 13 | public override bool HeightCheck(Vector3 pos) 14 | { 15 | return true; 16 | } 17 | 18 | public override float GetHeightPos(Vector3 pos) 19 | { 20 | if (height) 21 | { 22 | var v = height.GetSample(pos.x, pos.z); 23 | return v * heightAmount; 24 | } 25 | 26 | return 0; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/HeightPositioning/NoiseHeightPos.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e240bfeffb2c11a44b3be787a6bd4d8c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/HeightPositioning/RayCastHeightPos.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace NoiseUltra.Tools.Placement 5 | { 6 | [Serializable] 7 | public class RayCastHeightPos : HeightBase 8 | { 9 | [Header("Height Settings")] public string tagCheck = "Ground"; 10 | 11 | public LayerMask layerMask; 12 | public bool showDebug; 13 | private RaycastHit hit; 14 | 15 | public override float GetHeightPos(Vector3 pos) 16 | { 17 | return hit.point.y; 18 | } 19 | 20 | public override bool HeightCheck(Vector3 pos) 21 | { 22 | return RayCastHitTest(pos); 23 | } 24 | 25 | public bool RayCastHitTest(Vector3 pos) 26 | { 27 | var raycastStartPoint = pos; 28 | raycastStartPoint.y += 500; 29 | 30 | if (Physics.Raycast(raycastStartPoint, Vector3.down, out hit, Mathf.Infinity, layerMask)) 31 | { 32 | if (tagCheck == "") 33 | return DrawDebug(true, raycastStartPoint, hit.point); 34 | if (tagCheck != "" && tagCheck == hit.transform.tag) 35 | return DrawDebug(true, raycastStartPoint, hit.point); 36 | return DrawDebug(false, raycastStartPoint, raycastStartPoint + Vector3.down * 100); 37 | } 38 | 39 | return DrawDebug(false, raycastStartPoint, raycastStartPoint + Vector3.down * 100); 40 | } 41 | 42 | public bool DrawDebug(bool hasHitted, Vector3 raycastStartPoint, Vector3 rayCastEndPoint) 43 | { 44 | if (showDebug) 45 | { 46 | if (hasHitted) Debug.DrawLine(raycastStartPoint, rayCastEndPoint, Color.green); 47 | else Debug.DrawLine(raycastStartPoint, rayCastEndPoint, Color.red); 48 | } 49 | 50 | return hasHitted; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/HeightPositioning/RayCastHeightPos.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a4fe81e96d120db49986a97132a20a04 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/PlacementItemGameObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 573d95cd014b4f238fa3e902a1303a8c 3 | timeCreated: 1613238774 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Settings.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e6758754b9b11b47bf453edc3c0d526 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Settings/BasePlacementSetting.cs: -------------------------------------------------------------------------------- 1 | using Sirenix.OdinInspector; 2 | using UnityEngine; 3 | 4 | namespace NoiseUltra.Tools.Placement 5 | { 6 | public abstract class BasePlacementSetting 7 | { 8 | [InlineProperty] 9 | [HideLabel] 10 | [TitleGroup("Value Range")] 11 | public PlacementVectorRangeValue placementValueRange = new PlacementVectorRangeValue(); 12 | 13 | [InlineProperty] 14 | [HideLabel] 15 | [TitleGroup("Random Range")] 16 | public PlacementVectorRangeRandom placementRandomizedRange = new PlacementVectorRangeRandom(); 17 | 18 | public BasePlacementSetting(float initialRangeValue, float initialRangeRandom) 19 | { 20 | placementValueRange.minRange = initialRangeValue; 21 | placementValueRange.range = initialRangeValue; 22 | 23 | placementRandomizedRange.minRange = initialRangeRandom; 24 | placementRandomizedRange.range = initialRangeRandom; 25 | } 26 | 27 | 28 | public virtual void Initialize() 29 | { 30 | placementValueRange.Initialize(); 31 | placementRandomizedRange.Initialize(); 32 | } 33 | 34 | public virtual void OnEnable() 35 | { 36 | } 37 | 38 | public virtual Vector3 Execute(Vector3 pos, float threshold) 39 | { 40 | return Vector3.zero; 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Settings/BasePlacementSetting.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fd5b6af77ce0d4943b6a6c833c5cbac0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Settings/PositionSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 47cede34c9f288147a32abcd14b16021 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Settings/RotationSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NoiseUltra.Nodes; 3 | using Sirenix.OdinInspector; 4 | using UnityEngine; 5 | using Random = System.Random; 6 | 7 | namespace NoiseUltra.Tools.Placement 8 | { 9 | [Serializable] 10 | public class RotationSettings :BasePlacementSetting 11 | { 12 | 13 | 14 | public override Vector3 Execute(Vector3 pos, float threshold) 15 | { 16 | Vector3 valueRotation = placementValueRange.GetVectorRange(pos, threshold); 17 | Vector3 randomRotation = placementRandomizedRange.GetVectorRange(pos, threshold); 18 | Vector3 rotationResult = (valueRotation + randomRotation) ; 19 | return rotationResult; 20 | } 21 | 22 | public RotationSettings(float initialRangeValue, float initialRangeRandom) : base(initialRangeValue, initialRangeRandom) 23 | { 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Settings/RotationSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30e2b82cf9ef3ba43a0a51861e9e2052 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Settings/ScaleSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace NoiseUltra.Tools.Placement 5 | { 6 | [Serializable] 7 | public class ScaleSettings : BasePlacementSetting 8 | { 9 | [SerializeField] 10 | private float size = 1; 11 | 12 | public override Vector3 Execute(Vector3 pos, float threshold) 13 | { 14 | Vector3 dynamicScale = placementValueRange.GetVectorRange(pos, threshold); 15 | Vector3 randomScale = placementRandomizedRange.GetVectorRange(pos, threshold); 16 | Vector3 result = (dynamicScale + randomScale) * size; 17 | return result; 18 | } 19 | 20 | public ScaleSettings(float initialRangeValue, float initialRangeRandom) : base(initialRangeValue, initialRangeRandom) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/Settings/ScaleSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85c5db40fa1df6a43a387693b3850319 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Placement/UltraPlacementTool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb6eed7a9a666ce4b95e2fbf14931db4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Terrain.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c15773aba820cf48920deab3ad59516 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Terrain/BaseTool.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Output; 2 | using NoiseUltra.Tasks; 3 | using UnityEngine; 4 | 5 | namespace NoiseUltra.Tools 6 | { 7 | public abstract class BaseTool : MonoBehaviour 8 | { 9 | [SerializeField] 10 | protected ExportNode sourceNode; 11 | protected TaskGroup taskGroup; 12 | 13 | private void OnEnable() 14 | { 15 | Initialize(); 16 | } 17 | 18 | protected virtual void Initialize() 19 | { 20 | taskGroup = new TaskGroup(OnCompleteTask); 21 | } 22 | 23 | protected virtual void OnCompleteTask() 24 | { 25 | 26 | } 27 | 28 | protected float GetSample(float sampleX) 29 | { 30 | return sourceNode.GetSample(sampleX); 31 | } 32 | 33 | protected float GetSample(float sampleX, float sampleY) 34 | { 35 | return sourceNode.GetSample(sampleX, sampleY); 36 | } 37 | 38 | protected float GetSample(float sampleX, float sampleY, float sampleZ) 39 | { 40 | return sourceNode.GetSample(sampleX, sampleY, sampleZ); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Terrain/BaseTool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80932af42fb1400e993d02ba1cd11641 3 | timeCreated: 1619896696 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Terrain/TerrainTool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 553a257e5ab9f6445b9ca8c3c952bc25 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Terrain/UltraTerrainPainter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 736bc4808ffa9c241a6767fb724077a3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Terrain/UltraTerrainShaper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57fc072f1f264aa3b454f31bbf6f7bbd 3 | timeCreated: 1619898890 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Transform.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc268f361aec464da10a314383412bc3 3 | timeCreated: 1640548463 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Transform/Position.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using NoiseUltra.Nodes; 3 | using Sirenix.OdinInspector; 4 | 5 | namespace NoiseUltra.TransformNodes 6 | { 7 | public class Position : NodeInputOutput 8 | { 9 | [SerializeField , OnValueChanged(nameof(DrawAsync))] 10 | private Vector3 offSet = new Vector3(0, 0, 0); 11 | 12 | public override float GetSample(float x) 13 | { 14 | 15 | return base.GetSample(x + offSet.x); 16 | } 17 | 18 | public override float GetSample(float x, float y) 19 | { 20 | 21 | return base.GetSample(x+ offSet.x, y + offSet.y); 22 | } 23 | 24 | public override float GetSample(float x, float y, float z) 25 | { 26 | 27 | return base.GetSample(x+ offSet.x, y+ offSet.y, z + offSet.z); 28 | } 29 | 30 | } 31 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Transform/Position.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad7b604d02f14bb8b34aab8a3da3727c 3 | timeCreated: 1640549057 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Transform/Rotation.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using NoiseUltra.Nodes; 3 | using Sirenix.OdinInspector; 4 | 5 | 6 | namespace NoiseUltra.TransformNodes 7 | { 8 | public class Rotation : NodeInputOutput 9 | { 10 | [SerializeField , OnValueChanged(nameof(DrawAsync))] 11 | [InfoBox("To adjust 2D noise use the 'z' Axis , 3D adjustments (X,Y) wont preview properly but work!-)")] 12 | 13 | private Vector3 roationOffSet = new Vector3(0, 0, 0); 14 | 15 | 16 | public override float GetSample(float x) 17 | { 18 | var resultVector = ConvertVector(new Vector3(x, 0, 0), Quaternion.Euler(roationOffSet), Vector3.zero, 19 | Vector3.one); 20 | 21 | return base.GetSample(resultVector.x); 22 | } 23 | 24 | public override float GetSample(float x, float y) 25 | { 26 | 27 | var resultVector = ConvertVector(new Vector3(x, y, 0), Quaternion.Euler(roationOffSet), Vector3.zero, 28 | Vector3.one); 29 | 30 | return base.GetSample(resultVector.x, resultVector.y); 31 | 32 | 33 | } 34 | 35 | public override float GetSample(float x, float y, float z) 36 | { 37 | var resultVector = ConvertVector(new Vector3(x, y, z), Quaternion.Euler(roationOffSet), Vector3.zero, 38 | Vector3.one); 39 | 40 | return base.GetSample(resultVector.x, resultVector.y, resultVector.z); 41 | } 42 | 43 | 44 | public Vector3 ConvertVector (Vector3 source, Quaternion rotate, Vector3 move, Vector3 scale) 45 | { 46 | Matrix4x4 m = Matrix4x4.TRS (move, rotate, scale); 47 | Vector3 result = m.MultiplyPoint3x4 (source); 48 | return result; 49 | } 50 | 51 | } 52 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Transform/Rotation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b3953d6f6da492e949f28f394196c5b 3 | timeCreated: 1640550130 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Transform/Scale.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using NoiseUltra.Nodes; 3 | using Sirenix.OdinInspector; 4 | namespace NoiseUltra.TransformNodes 5 | { 6 | public class Scale : NodeInputOutput 7 | { 8 | 9 | [SerializeField , OnValueChanged(nameof(DrawAsync))] 10 | private Vector3 scaleOffSet = new Vector3(1, 1, 1); 11 | 12 | public override float GetSample(float x) 13 | { 14 | 15 | return base.GetSample(x * scaleOffSet.x); 16 | } 17 | 18 | public override float GetSample(float x, float y) 19 | { 20 | 21 | return base.GetSample(x * scaleOffSet.x, y * scaleOffSet.y); 22 | } 23 | 24 | public override float GetSample(float x, float y, float z) 25 | { 26 | 27 | return base.GetSample(x * scaleOffSet.x, y * scaleOffSet.y, z * scaleOffSet.z); 28 | } 29 | 30 | } 31 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Transform/Scale.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82bfc49997724fb890e955605e122a3e 3 | timeCreated: 1640549185 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Utils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2999f1c23b54834aa8dfb00b94bfd63 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Utils/CoroutineWrapper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4ac81573b404e7695c109816cd4a3cf 3 | timeCreated: 1619898532 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Utils/MathUtils.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace NoiseUltra.Operations 4 | { 5 | public static class MathUtils 6 | { 7 | public const float PI_TIMES_2 = 2f * Mathf.PI; 8 | 9 | public static float NaNCheck(float number) 10 | { 11 | return Mathf.Approximately(0f, number) ? Mathf.Epsilon : number; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Utils/MathUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab54896f4bcc4467b51a138c8550f56f 3 | timeCreated: 1635690121 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Utils/PlacementBounds.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4db9c48214c2fe94d84eb104fe3a26c3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Utils/Profiler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace NoiseUltra.Generators 5 | { 6 | public static class Profiler 7 | { 8 | private static bool IsEnabled { get; } = false; 9 | private const string CLOSE_LOG_COLOR = ""; 10 | private const string OPEN_LOG_COLOR = ""; 11 | private static readonly string COLOR = ColorUtility.ToHtmlStringRGB(new Color(0, 0.8f, 0)); 12 | public static DateTime begin; 13 | public static void Start() 14 | { 15 | if (IsEnabled) 16 | { 17 | begin = DateTime.Now; 18 | } 19 | } 20 | 21 | public static void End(string context = "") 22 | { 23 | if(IsEnabled) 24 | { 25 | Debug.Log(string.Format(OPEN_LOG_COLOR, COLOR) 26 | + $"Elapsed Time: {(DateTime.Now.Subtract(begin).TotalSeconds)} Seconds {context}" 27 | + CLOSE_LOG_COLOR); 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Utils/Profiler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eff67f59c54e4359b748d909d442b063 3 | timeCreated: 1634998707 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Utils/ProgressBar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using Sirenix.OdinInspector; 4 | using UnityEngine; 5 | 6 | namespace NoiseUltra.Tools.Terrains 7 | { 8 | [Serializable] 9 | public sealed class ProgressBar 10 | { 11 | [ReadOnly] 12 | [ProgressBar(0, nameof(_maxValue))] 13 | public int currentValue; 14 | private int _iterationsPerFrame = 4096; 15 | private int _maxValue; 16 | private int _iterationsCount; 17 | 18 | public void SetSize(int max) 19 | { 20 | Reset(); 21 | _maxValue = max; 22 | } 23 | 24 | public void Reset() 25 | { 26 | currentValue = 0; 27 | _iterationsCount = 0; 28 | } 29 | 30 | public void Increment() 31 | { 32 | currentValue++; 33 | _iterationsCount++; 34 | } 35 | 36 | public IEnumerator ResetIteration() 37 | { 38 | _iterationsCount = 0; 39 | yield return null; 40 | } 41 | 42 | public bool TryProcess() 43 | { 44 | Increment(); 45 | return _iterationsCount < _iterationsPerFrame; 46 | } 47 | 48 | public void Decrement() 49 | { 50 | currentValue--; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Utils/ProgressBar.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be1790db1fd1435f8ef7c15ce7b5e52c 3 | timeCreated: 1619902066 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Utils/TaskGroup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | namespace NoiseUltra.Tasks 6 | { 7 | public sealed class TaskGroup 8 | { 9 | private readonly Action m_OnComplete; 10 | private readonly List m_Tasks; 11 | 12 | public TaskGroup(Action callback) 13 | { 14 | m_OnComplete = callback; 15 | m_Tasks = new List(); 16 | } 17 | 18 | public void AddTask(Action action) 19 | { 20 | if (action == null) 21 | { 22 | return; 23 | } 24 | 25 | Task task = Task.Run(action); 26 | m_Tasks.Add(task); 27 | } 28 | 29 | public void ExecuteAll() 30 | { 31 | Task.WaitAll(m_Tasks.ToArray()); 32 | m_OnComplete.Invoke(); 33 | } 34 | 35 | public void Clear() => m_Tasks.Clear(); 36 | } 37 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Utils/TaskGroup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15e88429cc8a47b0977a2c719baf4e15 3 | timeCreated: 1635087070 -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Utils/Wait.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace NoiseUltra.Tools 4 | { 5 | public static class Wait 6 | { 7 | public static WaitForSecondsRealtime CreateWaitRealtime(float realtime) => new WaitForSecondsRealtime(realtime); 8 | } 9 | } -------------------------------------------------------------------------------- /UltraNoise5000/UseTools/Utils/Wait.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6370476ea3f8460cbafd7e7a47518f3d 3 | timeCreated: 1636199236 -------------------------------------------------------------------------------- /UltraNoise5000/Utilities.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4f7a3001898b4fb4b1c31cc8df58dc6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UltraNoise5000/Utilities/CommentBox.cs: -------------------------------------------------------------------------------- 1 | using Sirenix.OdinInspector; 2 | using UnityEngine; 3 | using XNode; 4 | using NoiseUltra.Nodes; 5 | 6 | namespace NoiseUltra.Utilities 7 | { 8 | [NodeTint(NodeColor.UTILITY)] 9 | public class CommentBox : Node 10 | { 11 | [TextArea (20 , 100) , HideLabel] 12 | public string commentBox; 13 | 14 | } 15 | } -------------------------------------------------------------------------------- /UltraNoise5000/Utilities/CommentBox.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1128aa384c944b1c8d4779bc6188c82 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UltraNoise5000/Utilities/Coupler.cs: -------------------------------------------------------------------------------- 1 | using NoiseUltra.Nodes; 2 | 3 | namespace NoiseUltra.Utilities 4 | { 5 | [NodeTint(NodeColor.UTILITY)] 6 | public class Coupler : BaseNodeModifier 7 | { 8 | protected override float ApplyModifier(float sample) 9 | { 10 | return sample; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /UltraNoise5000/Utilities/Coupler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 849867cf3105f644087357f0f09c7793 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | --------------------------------------------------------------------------------