From 87dd56eb2bc4c3a3b42abd1d96a8c9e515bad9bc Mon Sep 17 00:00:00 2001 From: Sebastian Lague Date: Sat, 25 May 2019 19:18:17 +0200 Subject: [PATCH] Some optimizations, added obj placement example scene, moved everything into assets folder. --- PathCreator/.vscode/settings.json | 56 + PathCreator/{ => Assets}/Core.meta | 0 PathCreator/{ => Assets}/Core/Editor.meta | 0 .../{ => Assets}/Core/Editor/Helper.meta | 0 .../Core/Editor/Helper/MouseUtility.cs | 0 .../Core/Editor/Helper/MouseUtility.cs.meta | 0 .../Core/Editor/Helper/PathHandle.cs | 0 .../Core/Editor/Helper/PathHandle.cs.meta | 0 .../Core/Editor/Helper/ScreenSpacePolyLine.cs | 0 .../Editor/Helper/ScreenSpacePolyLine.cs.meta | 0 .../Core/Editor/PathCreatorEditor.asmdef | 0 .../Core/Editor/PathCreatorEditor.asmdef.meta | 0 .../{ => Assets}/Core/Editor/PathEditor.cs | 206 +- .../Core/Editor/PathEditor.cs.meta | 0 PathCreator/{ => Assets}/Core/Runtime.meta | 0 .../{ => Assets}/Core/Runtime/Objects.meta | 0 .../Core/Runtime/Objects/BezierPath.cs | 0 .../Core/Runtime/Objects/BezierPath.cs.meta | 0 .../Runtime/Objects/EndOfPathInstruction.cs | 0 .../Objects/EndOfPathInstruction.cs.meta | 0 .../Runtime/Objects/GlobalDisplaySettings.cs | 8 +- .../Objects/GlobalDisplaySettings.cs.meta | 0 .../Core/Runtime/Objects/MinMax3D.cs | 0 .../Core/Runtime/Objects/MinMax3D.cs.meta | 0 .../Core/Runtime/Objects/PathCreator.cs | 19 +- .../Core/Runtime/Objects/PathCreator.cs.meta | 0 .../Core/Runtime/Objects/PathCreatorData.cs | 4 +- .../Runtime/Objects/PathCreatorData.cs.meta | 0 .../Core/Runtime/Objects/PathSpace.cs | 0 .../Core/Runtime/Objects/PathSpace.cs.meta | 0 .../Core/Runtime/Objects/VertexPath.cs | 0 .../Core/Runtime/Objects/VertexPath.cs.meta | 0 .../Core/Runtime/PathCreator.asmdef | 0 .../Core/Runtime/PathCreator.asmdef.meta | 0 .../{ => Assets}/Core/Runtime/Utility.meta | 0 .../Runtime/Utility/CubicBezierUtility.cs | 136 + .../Utility/CubicBezierUtility.cs.meta | 0 .../Core/Runtime/Utility/MathUtility.cs | 0 .../Core/Runtime/Utility/MathUtility.cs.meta | 0 .../Core/Runtime/Utility/VertexPathUtility.cs | 0 .../Runtime/Utility/VertexPathUtility.cs.meta | 0 PathCreator/{ => Assets}/Core/Settings.meta | 0 .../Core/Settings/GlobalDisplaySettings.asset | 14 +- .../Settings/GlobalDisplaySettings.asset.meta | 0 PathCreator/{ => Assets}/Examples.meta | 0 .../{ => Assets}/Examples/Materials.meta | 0 .../{ => Assets}/Examples/Materials/Black.mat | 0 .../Examples/Materials/Black.mat.meta | 0 .../{ => Assets}/Examples/Materials/Blue.mat | 0 .../Examples/Materials/Blue.mat.meta | 0 .../Assets/Examples/Materials/Brown.mat | 77 + .../Assets/Examples/Materials/Brown.mat.meta | 10 + .../Assets/Examples/Materials/Dark Grey.mat | 77 + .../Examples/Materials/Dark Grey.mat.meta | 8 + .../{ => Assets}/Examples/Materials/Green.mat | 0 .../Examples/Materials/Green.mat.meta | 0 .../{ => Assets}/Examples/Materials/Red.mat | 0 .../Examples/Materials/Red.mat.meta | 0 .../Examples/Materials/Road Texture.png | Bin .../Examples/Materials/Road Texture.png.meta | 0 .../Examples/Materials/Road Underside.mat | 0 .../Materials/Road Underside.mat.meta | 0 .../{ => Assets}/Examples/Materials/Road.mat | 0 .../Examples/Materials/Road.mat.meta | 0 PathCreator/Assets/Examples/Prefabs.meta | 8 + .../Assets/Examples/Prefabs/Cube.prefab | 79 + .../Assets/Examples/Prefabs/Cube.prefab.meta | 7 + .../Assets/Examples/Prefabs/Sphere.prefab | 79 + .../Examples/Prefabs/Sphere.prefab.meta | 7 + PathCreator/{ => Assets}/Examples/Scenes.meta | 0 .../Examples/Scenes/Follow Path.unity | 0 .../Examples/Scenes/Follow Path.unity.meta | 0 .../Examples/Scenes/Generate Path.unity} | 151 +- .../Examples/Scenes/Generate Path.unity.meta} | 0 .../Examples/Scenes/Object Placement.unity | 2184 +++++++++++++++++ .../Scenes/Object Placement.unity.meta | 7 + .../{ => Assets}/Examples/Scenes/Road.unity | 0 .../Examples/Scenes/Road.unity.meta | 0 .../{ => Assets}/Examples/Scripts.meta | 0 .../{ => Assets}/Examples/Scripts/Editor.meta | 0 .../Scripts/Editor/PathSceneToolEditor.cs | 15 +- .../Editor/PathSceneToolEditor.cs.meta | 0 .../Examples/Scripts/GeneratePathExample.cs} | 9 +- .../Scripts/GeneratePathExample.cs.meta} | 0 .../Examples/Scripts/PathFollower.cs | 0 .../Examples/Scripts/PathFollower.cs.meta | 0 .../Assets/Examples/Scripts/PathPlacer.cs | 46 + .../Examples/Scripts/PathPlacer.cs.meta | 11 + .../Examples/Scripts/PathSceneTool.cs | 9 +- .../Examples/Scripts/PathSceneTool.cs.meta | 0 .../Examples/Scripts/RoadMeshCreator.cs | 0 .../Examples/Scripts/RoadMeshCreator.cs.meta | 0 .../Runtime/Utility/CubicBezierUtility.cs | 209 -- 93 files changed, 3015 insertions(+), 421 deletions(-) create mode 100644 PathCreator/.vscode/settings.json rename PathCreator/{ => Assets}/Core.meta (100%) rename PathCreator/{ => Assets}/Core/Editor.meta (100%) rename PathCreator/{ => Assets}/Core/Editor/Helper.meta (100%) rename PathCreator/{ => Assets}/Core/Editor/Helper/MouseUtility.cs (100%) rename PathCreator/{ => Assets}/Core/Editor/Helper/MouseUtility.cs.meta (100%) rename PathCreator/{ => Assets}/Core/Editor/Helper/PathHandle.cs (100%) rename PathCreator/{ => Assets}/Core/Editor/Helper/PathHandle.cs.meta (100%) rename PathCreator/{ => Assets}/Core/Editor/Helper/ScreenSpacePolyLine.cs (100%) rename PathCreator/{ => Assets}/Core/Editor/Helper/ScreenSpacePolyLine.cs.meta (100%) rename PathCreator/{ => Assets}/Core/Editor/PathCreatorEditor.asmdef (100%) rename PathCreator/{ => Assets}/Core/Editor/PathCreatorEditor.asmdef.meta (100%) rename PathCreator/{ => Assets}/Core/Editor/PathEditor.cs (77%) rename PathCreator/{ => Assets}/Core/Editor/PathEditor.cs.meta (100%) rename PathCreator/{ => Assets}/Core/Runtime.meta (100%) rename PathCreator/{ => Assets}/Core/Runtime/Objects.meta (100%) rename PathCreator/{ => Assets}/Core/Runtime/Objects/BezierPath.cs (100%) rename PathCreator/{ => Assets}/Core/Runtime/Objects/BezierPath.cs.meta (100%) rename PathCreator/{ => Assets}/Core/Runtime/Objects/EndOfPathInstruction.cs (100%) rename PathCreator/{ => Assets}/Core/Runtime/Objects/EndOfPathInstruction.cs.meta (100%) rename PathCreator/{ => Assets}/Core/Runtime/Objects/GlobalDisplaySettings.cs (93%) rename PathCreator/{ => Assets}/Core/Runtime/Objects/GlobalDisplaySettings.cs.meta (100%) rename PathCreator/{ => Assets}/Core/Runtime/Objects/MinMax3D.cs (100%) rename PathCreator/{ => Assets}/Core/Runtime/Objects/MinMax3D.cs.meta (100%) rename PathCreator/{ => Assets}/Core/Runtime/Objects/PathCreator.cs (84%) rename PathCreator/{ => Assets}/Core/Runtime/Objects/PathCreator.cs.meta (100%) rename PathCreator/{ => Assets}/Core/Runtime/Objects/PathCreatorData.cs (97%) rename PathCreator/{ => Assets}/Core/Runtime/Objects/PathCreatorData.cs.meta (100%) rename PathCreator/{ => Assets}/Core/Runtime/Objects/PathSpace.cs (100%) rename PathCreator/{ => Assets}/Core/Runtime/Objects/PathSpace.cs.meta (100%) rename PathCreator/{ => Assets}/Core/Runtime/Objects/VertexPath.cs (100%) rename PathCreator/{ => Assets}/Core/Runtime/Objects/VertexPath.cs.meta (100%) rename PathCreator/{ => Assets}/Core/Runtime/PathCreator.asmdef (100%) rename PathCreator/{ => Assets}/Core/Runtime/PathCreator.asmdef.meta (100%) rename PathCreator/{ => Assets}/Core/Runtime/Utility.meta (100%) create mode 100644 PathCreator/Assets/Core/Runtime/Utility/CubicBezierUtility.cs rename PathCreator/{ => Assets}/Core/Runtime/Utility/CubicBezierUtility.cs.meta (100%) rename PathCreator/{ => Assets}/Core/Runtime/Utility/MathUtility.cs (100%) rename PathCreator/{ => Assets}/Core/Runtime/Utility/MathUtility.cs.meta (100%) rename PathCreator/{ => Assets}/Core/Runtime/Utility/VertexPathUtility.cs (100%) rename PathCreator/{ => Assets}/Core/Runtime/Utility/VertexPathUtility.cs.meta (100%) rename PathCreator/{ => Assets}/Core/Settings.meta (100%) rename PathCreator/{ => Assets}/Core/Settings/GlobalDisplaySettings.asset (75%) rename PathCreator/{ => Assets}/Core/Settings/GlobalDisplaySettings.asset.meta (100%) rename PathCreator/{ => Assets}/Examples.meta (100%) rename PathCreator/{ => Assets}/Examples/Materials.meta (100%) rename PathCreator/{ => Assets}/Examples/Materials/Black.mat (100%) rename PathCreator/{ => Assets}/Examples/Materials/Black.mat.meta (100%) rename PathCreator/{ => Assets}/Examples/Materials/Blue.mat (100%) rename PathCreator/{ => Assets}/Examples/Materials/Blue.mat.meta (100%) create mode 100644 PathCreator/Assets/Examples/Materials/Brown.mat create mode 100644 PathCreator/Assets/Examples/Materials/Brown.mat.meta create mode 100644 PathCreator/Assets/Examples/Materials/Dark Grey.mat create mode 100644 PathCreator/Assets/Examples/Materials/Dark Grey.mat.meta rename PathCreator/{ => Assets}/Examples/Materials/Green.mat (100%) rename PathCreator/{ => Assets}/Examples/Materials/Green.mat.meta (100%) rename PathCreator/{ => Assets}/Examples/Materials/Red.mat (100%) rename PathCreator/{ => Assets}/Examples/Materials/Red.mat.meta (100%) rename PathCreator/{ => Assets}/Examples/Materials/Road Texture.png (100%) rename PathCreator/{ => Assets}/Examples/Materials/Road Texture.png.meta (100%) rename PathCreator/{ => Assets}/Examples/Materials/Road Underside.mat (100%) rename PathCreator/{ => Assets}/Examples/Materials/Road Underside.mat.meta (100%) rename PathCreator/{ => Assets}/Examples/Materials/Road.mat (100%) rename PathCreator/{ => Assets}/Examples/Materials/Road.mat.meta (100%) create mode 100644 PathCreator/Assets/Examples/Prefabs.meta create mode 100644 PathCreator/Assets/Examples/Prefabs/Cube.prefab create mode 100644 PathCreator/Assets/Examples/Prefabs/Cube.prefab.meta create mode 100644 PathCreator/Assets/Examples/Prefabs/Sphere.prefab create mode 100644 PathCreator/Assets/Examples/Prefabs/Sphere.prefab.meta rename PathCreator/{ => Assets}/Examples/Scenes.meta (100%) rename PathCreator/{ => Assets}/Examples/Scenes/Follow Path.unity (100%) rename PathCreator/{ => Assets}/Examples/Scenes/Follow Path.unity.meta (100%) rename PathCreator/{Examples/Scenes/Object Path.unity => Assets/Examples/Scenes/Generate Path.unity} (86%) rename PathCreator/{Examples/Scenes/Object Path.unity.meta => Assets/Examples/Scenes/Generate Path.unity.meta} (100%) create mode 100644 PathCreator/Assets/Examples/Scenes/Object Placement.unity create mode 100644 PathCreator/Assets/Examples/Scenes/Object Placement.unity.meta rename PathCreator/{ => Assets}/Examples/Scenes/Road.unity (100%) rename PathCreator/{ => Assets}/Examples/Scenes/Road.unity.meta (100%) rename PathCreator/{ => Assets}/Examples/Scripts.meta (100%) rename PathCreator/{ => Assets}/Examples/Scripts/Editor.meta (100%) rename PathCreator/{ => Assets}/Examples/Scripts/Editor/PathSceneToolEditor.cs (89%) rename PathCreator/{ => Assets}/Examples/Scripts/Editor/PathSceneToolEditor.cs.meta (100%) rename PathCreator/{Examples/Scripts/PathFromObjects.cs => Assets/Examples/Scripts/GeneratePathExample.cs} (81%) rename PathCreator/{Examples/Scripts/PathFromObjects.cs.meta => Assets/Examples/Scripts/GeneratePathExample.cs.meta} (100%) rename PathCreator/{ => Assets}/Examples/Scripts/PathFollower.cs (100%) rename PathCreator/{ => Assets}/Examples/Scripts/PathFollower.cs.meta (100%) create mode 100644 PathCreator/Assets/Examples/Scripts/PathPlacer.cs create mode 100644 PathCreator/Assets/Examples/Scripts/PathPlacer.cs.meta rename PathCreator/{ => Assets}/Examples/Scripts/PathSceneTool.cs (81%) rename PathCreator/{ => Assets}/Examples/Scripts/PathSceneTool.cs.meta (100%) rename PathCreator/{ => Assets}/Examples/Scripts/RoadMeshCreator.cs (100%) rename PathCreator/{ => Assets}/Examples/Scripts/RoadMeshCreator.cs.meta (100%) delete mode 100644 PathCreator/Core/Runtime/Utility/CubicBezierUtility.cs diff --git a/PathCreator/.vscode/settings.json b/PathCreator/.vscode/settings.json new file mode 100644 index 0000000..4edd970 --- /dev/null +++ b/PathCreator/.vscode/settings.json @@ -0,0 +1,56 @@ +{ + "files.exclude": + { + "**/.DS_Store":true, + "**/.git":true, + "**/.gitignore":true, + "**/.gitmodules":true, + "**/*.booproj":true, + "**/*.pidb":true, + "**/*.suo":true, + "**/*.user":true, + "**/*.userprefs":true, + "**/*.unityproj":true, + "**/*.dll":true, + "**/*.exe":true, + "**/*.pdf":true, + "**/*.mid":true, + "**/*.midi":true, + "**/*.wav":true, + "**/*.gif":true, + "**/*.ico":true, + "**/*.jpg":true, + "**/*.jpeg":true, + "**/*.png":true, + "**/*.psd":true, + "**/*.tga":true, + "**/*.tif":true, + "**/*.tiff":true, + "**/*.3ds":true, + "**/*.3DS":true, + "**/*.fbx":true, + "**/*.FBX":true, + "**/*.lxo":true, + "**/*.LXO":true, + "**/*.ma":true, + "**/*.MA":true, + "**/*.obj":true, + "**/*.OBJ":true, + "**/*.asset":true, + "**/*.cubemap":true, + "**/*.flare":true, + "**/*.mat":true, + "**/*.meta":true, + "**/*.prefab":true, + "**/*.unity":true, + "build/":true, + "Build/":true, + "Library/":true, + "library/":true, + "obj/":true, + "Obj/":true, + "ProjectSettings/":true, + "temp/":true, + "Temp/":true + } +} \ No newline at end of file diff --git a/PathCreator/Core.meta b/PathCreator/Assets/Core.meta similarity index 100% rename from PathCreator/Core.meta rename to PathCreator/Assets/Core.meta diff --git a/PathCreator/Core/Editor.meta b/PathCreator/Assets/Core/Editor.meta similarity index 100% rename from PathCreator/Core/Editor.meta rename to PathCreator/Assets/Core/Editor.meta diff --git a/PathCreator/Core/Editor/Helper.meta b/PathCreator/Assets/Core/Editor/Helper.meta similarity index 100% rename from PathCreator/Core/Editor/Helper.meta rename to PathCreator/Assets/Core/Editor/Helper.meta diff --git a/PathCreator/Core/Editor/Helper/MouseUtility.cs b/PathCreator/Assets/Core/Editor/Helper/MouseUtility.cs similarity index 100% rename from PathCreator/Core/Editor/Helper/MouseUtility.cs rename to PathCreator/Assets/Core/Editor/Helper/MouseUtility.cs diff --git a/PathCreator/Core/Editor/Helper/MouseUtility.cs.meta b/PathCreator/Assets/Core/Editor/Helper/MouseUtility.cs.meta similarity index 100% rename from PathCreator/Core/Editor/Helper/MouseUtility.cs.meta rename to PathCreator/Assets/Core/Editor/Helper/MouseUtility.cs.meta diff --git a/PathCreator/Core/Editor/Helper/PathHandle.cs b/PathCreator/Assets/Core/Editor/Helper/PathHandle.cs similarity index 100% rename from PathCreator/Core/Editor/Helper/PathHandle.cs rename to PathCreator/Assets/Core/Editor/Helper/PathHandle.cs diff --git a/PathCreator/Core/Editor/Helper/PathHandle.cs.meta b/PathCreator/Assets/Core/Editor/Helper/PathHandle.cs.meta similarity index 100% rename from PathCreator/Core/Editor/Helper/PathHandle.cs.meta rename to PathCreator/Assets/Core/Editor/Helper/PathHandle.cs.meta diff --git a/PathCreator/Core/Editor/Helper/ScreenSpacePolyLine.cs b/PathCreator/Assets/Core/Editor/Helper/ScreenSpacePolyLine.cs similarity index 100% rename from PathCreator/Core/Editor/Helper/ScreenSpacePolyLine.cs rename to PathCreator/Assets/Core/Editor/Helper/ScreenSpacePolyLine.cs diff --git a/PathCreator/Core/Editor/Helper/ScreenSpacePolyLine.cs.meta b/PathCreator/Assets/Core/Editor/Helper/ScreenSpacePolyLine.cs.meta similarity index 100% rename from PathCreator/Core/Editor/Helper/ScreenSpacePolyLine.cs.meta rename to PathCreator/Assets/Core/Editor/Helper/ScreenSpacePolyLine.cs.meta diff --git a/PathCreator/Core/Editor/PathCreatorEditor.asmdef b/PathCreator/Assets/Core/Editor/PathCreatorEditor.asmdef similarity index 100% rename from PathCreator/Core/Editor/PathCreatorEditor.asmdef rename to PathCreator/Assets/Core/Editor/PathCreatorEditor.asmdef diff --git a/PathCreator/Core/Editor/PathCreatorEditor.asmdef.meta b/PathCreator/Assets/Core/Editor/PathCreatorEditor.asmdef.meta similarity index 100% rename from PathCreator/Core/Editor/PathCreatorEditor.asmdef.meta rename to PathCreator/Assets/Core/Editor/PathCreatorEditor.asmdef.meta diff --git a/PathCreator/Core/Editor/PathEditor.cs b/PathCreator/Assets/Core/Editor/PathEditor.cs similarity index 77% rename from PathCreator/Core/Editor/PathEditor.cs rename to PathCreator/Assets/Core/Editor/PathEditor.cs index 646f160..6b16ebc 100644 --- a/PathCreator/Core/Editor/PathEditor.cs +++ b/PathCreator/Assets/Core/Editor/PathEditor.cs @@ -17,7 +17,6 @@ public class PathEditor : Editor { const float segmentSelectDistanceThreshold = 10f; const float screenPolylineMaxAngleError = .3f; const float screenPolylineMinVertexDst = .01f; - bool shareTransformsWithPath = false; // Should changes to pathcreator's transform affect the path (and vice versa) // Help messages: const string helpInfo = "Shift-click to add or insert new points. Control-click to delete points. For more detailed infomation, please refer to the documentation."; @@ -28,7 +27,7 @@ public class PathEditor : Editor { // Display const int inspectorSectionSpacing = 10; const float constantHandleScale = .01f; - const float normalsSpacing = .1f; + const float normalsSpacing = .2f; GUIStyle boldFoldoutStyle; // References: @@ -188,6 +187,11 @@ void DrawBezierPathInspector () { } void DrawVertexPathInspector () { + + GUILayout.Space (inspectorSectionSpacing); + EditorGUILayout.LabelField ("Vertex count: " + data.vertexPath.NumVertices); + GUILayout.Space (inspectorSectionSpacing); + data.showVertexPathOptions = EditorGUILayout.Foldout (data.showVertexPathOptions, new GUIContent ("Vertex Path Options"), true, boldFoldoutStyle); if (data.showVertexPathOptions) { using (var check = new EditorGUI.ChangeCheckScope ()) { @@ -206,8 +210,8 @@ void DrawVertexPathInspector () { data.showVertexPathDisplayOptions = EditorGUILayout.Foldout (data.showVertexPathDisplayOptions, new GUIContent ("Display Options"), true, boldFoldoutStyle); if (data.showVertexPathDisplayOptions) { using (var check = new EditorGUI.ChangeCheckScope ()) { - data.vertexHandleSize = EditorGUILayout.Slider (new GUIContent ("Vertex Scale"), data.vertexHandleSize, 0, 1); data.showNormalsInVertexMode = GUILayout.Toggle (data.showNormalsInVertexMode, new GUIContent ("Show Normals")); + data.showBezierPathInVertexMode = GUILayout.Toggle (data.showBezierPathInVertexMode, new GUIContent ("Show Bezier Path")); if (check.changed) { SceneView.RepaintAll (); @@ -237,20 +241,31 @@ void DrawGlobalDisplaySettingsInspector () { #region Scene GUI void OnSceneGUI () { + if (!globalDisplaySettings.visibleBehindObjects) { + Handles.zTest = UnityEngine.Rendering.CompareFunction.LessEqual; + } + + EventType eventType = Event.current.type; + using (var check = new EditorGUI.ChangeCheckScope ()) { handlesStartCol = Handles.color; switch (data.tabIndex) { case bezierPathTab: - ProcessBezierPathInput (Event.current); + if (eventType != EventType.Repaint && eventType != EventType.Layout) { + ProcessBezierPathInput (Event.current); + } + DrawBezierPathSceneEditor (); break; case vertexPathTab: - DrawVertexPathSceneEditor (); + if (eventType == EventType.Repaint) { + DrawVertexPathSceneEditor (); + } break; } // Don't allow clicking over empty space to deselect the object - if (Event.current.type == EventType.Layout) { + if (eventType == EventType.Layout) { HandleUtility.AddDefaultControl (0); } @@ -265,12 +280,15 @@ void DrawVertexPathSceneEditor () { Color bezierCol = globalDisplaySettings.bezierPath; bezierCol.a *= .5f; - for (int i = 0; i < bezierPath.NumSegments; i++) { - Vector3[] points = bezierPath.GetPointsInSegment (i); - Handles.DrawBezier (points[0], points[3], points[1], points[2], bezierCol, null, 2); + if (data.showBezierPathInVertexMode) { + for (int i = 0; i < bezierPath.NumSegments; i++) { + Vector3[] points = bezierPath.GetPointsInSegment (i); + Handles.DrawBezier (points[0], points[3], points[1], points[2], bezierCol, null, 2); + } } Handles.color = globalDisplaySettings.vertexPath; + for (int i = 0; i < creator.path.NumVertices; i++) { int nextIndex = (i + 1) % creator.path.NumVertices; if (nextIndex != 0 || bezierPath.IsClosed) { @@ -280,14 +298,12 @@ void DrawVertexPathSceneEditor () { if (data.showNormalsInVertexMode) { Handles.color = globalDisplaySettings.normals; + Vector3[] normalLines = new Vector3[creator.path.NumVertices * 2]; for (int i = 0; i < creator.path.NumVertices; i++) { - Handles.DrawLine (creator.path.vertices[i], creator.path.vertices[i] + creator.path.normals[i] * globalDisplaySettings.normalsLength); + normalLines[i * 2] = creator.path.vertices[i]; + normalLines[i * 2 + 1] = creator.path.vertices[i] + creator.path.normals[i] * globalDisplaySettings.normalsLength; } - } - - Handles.color = globalDisplaySettings.vertex; - for (int i = 0; i < creator.path.NumVertices; i++) { - Handles.SphereHandleCap (0, creator.path.vertices[i], Quaternion.identity, data.vertexHandleSize * .1f, EventType.Repaint); + Handles.DrawLines (normalLines); } } @@ -373,83 +389,63 @@ void ProcessBezierPathInput (Event e) { } } - if (shareTransformsWithPath) { - // Move bezier path if creator's transform position has changed - if (creator.transform.position != positionOld) { - bezierPath.Position += (creator.transform.position - positionOld); - positionOld = creator.transform.position; - } - // Rotate bezier path if creator's transform rotation has changed - if (creator.transform.rotation != rotationOld) { - bezierPath.Rotation = creator.transform.rotation; - creator.transform.rotation = bezierPath.Rotation; // set to constrained value - rotationOld = creator.transform.rotation; - } - // Scale bezier path if creator's transform scale has changed - if (creator.transform.localScale != scaleOld) { - bezierPath.Scale = creator.transform.localScale; - creator.transform.localScale = bezierPath.Scale; // set to constrained value - scaleOld = creator.transform.localScale; - } - } - shiftLastFrame = e.shift; } void DrawBezierPathSceneEditor () { + bool displayControlPoints = data.displayControlPoints && (bezierPath.ControlPointMode != BezierPath.ControlMode.Automatic || !globalDisplaySettings.hideAutoControls); Bounds bounds = bezierPath.PathBounds; - // Draw normals - if (data.showNormals) { - if (!hasUpdatedNormalsVertexPath) { - normalsVertexPath = new VertexPath (bezierPath, normalsSpacing); - hasUpdatedNormalsVertexPath = true; - } + if (Event.current.type == EventType.Repaint) { + for (int i = 0; i < bezierPath.NumSegments; i++) { + Vector3[] points = bezierPath.GetPointsInSegment (i); - if (editingNormalsOld != data.showNormals) { - editingNormalsOld = data.showNormals; - Repaint (); - } + if (data.showPerSegmentBounds) { + Bounds segmentBounds = CubicBezierUtility.CalculateBounds (points); + Handles.color = globalDisplaySettings.segmentBounds; + Handles.DrawWireCube (segmentBounds.center, segmentBounds.size); + } - Handles.color = globalDisplaySettings.normals; - for (int i = 0; i < normalsVertexPath.NumVertices; i++) { - Vector3 prevVertex = normalsVertexPath.vertices[Mathf.Max(0, i - 1)]; - Vector3 nextVertex = normalsVertexPath.vertices[Mathf.Min(normalsVertexPath.NumVertices - 1, i + 1)]; - Vector3 forward = prevVertex - nextVertex; - forward *= globalDisplaySettings.normalsWidth; - - Vector3[] points = new Vector3[4]; - points[0] = normalsVertexPath.vertices[i] - forward * 0.5f; - points[1] = points[0] + normalsVertexPath.normals[i] * globalDisplaySettings.normalsLength; - points[2] = points[1] + forward; - points[3] = points[0] + forward; - Handles.DrawSolidRectangleWithOutline(points, globalDisplaySettings.normals, globalDisplaySettings.normals); + // Draw lines between control points + if (displayControlPoints) { + Handles.color = (bezierPath.ControlPointMode == BezierPath.ControlMode.Automatic) ? globalDisplaySettings.handleDisabled : globalDisplaySettings.controlLine; + Handles.DrawLine (points[1], points[0]); + Handles.DrawLine (points[2], points[3]); + } + + // Draw path + bool highlightSegment = (i == selectedSegmentIndex && Event.current.shift && draggingHandleIndex == -1 && mouseOverHandleIndex == -1); + Color segmentCol = (highlightSegment) ? globalDisplaySettings.highlightedPath : globalDisplaySettings.bezierPath; + Handles.DrawBezier (points[0], points[3], points[1], points[2], segmentCol, null, 2); } - } + if (data.showPathBounds) { + Handles.color = globalDisplaySettings.bounds; + Handles.DrawWireCube (bounds.center, bounds.size); + } - for (int i = 0; i < bezierPath.NumSegments; i++) { - Vector3[] points = bezierPath.GetPointsInSegment (i); + // Draw normals + if (data.showNormals) { + if (!hasUpdatedNormalsVertexPath) { + normalsVertexPath = new VertexPath (bezierPath, normalsSpacing); + hasUpdatedNormalsVertexPath = true; + } - if (data.showPerSegmentBounds) { - Bounds segmentBounds = CubicBezierUtility.CalculateBounds (points); - Handles.color = globalDisplaySettings.segmentBounds; - Handles.DrawWireCube (segmentBounds.center, segmentBounds.size); - } + if (editingNormalsOld != data.showNormals) { + editingNormalsOld = data.showNormals; + Repaint (); + } - // Draw lines between control points - if (displayControlPoints) { - Handles.color = (bezierPath.ControlPointMode == BezierPath.ControlMode.Automatic) ? globalDisplaySettings.handleDisabled : globalDisplaySettings.controlLine; - Handles.DrawLine (points[1], points[0]); - Handles.DrawLine (points[2], points[3]); + Vector3[] normalLines = new Vector3[normalsVertexPath.NumVertices * 2]; + Handles.color = globalDisplaySettings.normals; + for (int i = 0; i < normalsVertexPath.NumVertices; i++) { + normalLines[i * 2] = normalsVertexPath.vertices[i]; + normalLines[i * 2 + 1] = normalsVertexPath.vertices[i] + normalsVertexPath.normals[i] * globalDisplaySettings.normalsLength; + } + Handles.DrawLines (normalLines); } - - // Draw path - bool highlightSegment = (i == selectedSegmentIndex && Event.current.shift && draggingHandleIndex == -1 && mouseOverHandleIndex == -1); - Color segmentCol = (highlightSegment) ? globalDisplaySettings.highlightedPath : globalDisplaySettings.bezierPath; - Handles.DrawBezier (points[0], points[3], points[1], points[2], segmentCol, null, 2); } // Draw rotate/scale/move tool @@ -462,17 +458,10 @@ void DrawBezierPathSceneEditor () { Quaternion newRot = deltaRot * bezierPath.Rotation; bezierPath.Rotation = newRot; - if (shareTransformsWithPath) { - creator.transform.rotation = newRot; - rotationOld = newRot; - } } else if (Tools.current == Tool.Scale) { Undo.RecordObject (creator, "Scale Path"); bezierPath.Scale = Handles.DoScaleHandle (bezierPath.Scale, bezierPath.Pivot, Quaternion.identity, HandleUtility.GetHandleSize (bezierPath.Pivot)); - if (shareTransformsWithPath) { - creator.transform.localScale = bezierPath.Scale; - scaleOld = bezierPath.Scale; - } + } else { Undo.RecordObject (creator, "Move Path"); @@ -480,17 +469,7 @@ void DrawBezierPathSceneEditor () { Vector3 newCentre = Handles.DoPositionHandle (bezierPath.Pivot, Quaternion.identity); Vector3 deltaCentre = newCentre - bezierPath.Pivot; bezierPath.Position += deltaCentre; - if (shareTransformsWithPath) { - creator.transform.position = bezierPath.Position; - positionOld = bezierPath.Position; - } } - - } - - if (data.showPathBounds) { - Handles.color = globalDisplaySettings.bounds; - Handles.DrawWireCube (bounds.center, bounds.size); } if (data.displayAnchorPoints) { @@ -593,45 +572,6 @@ void DrawHandle (int i) { Undo.RecordObject (creator, "Move point"); bezierPath.MovePoint (i, handlePosition); - // If the use is holding alt, try and mirror the control point. - if (Event.current.modifiers == EventModifiers.Alt) { - // 0 = Anchor, 1 = Left Control, 2 = Right Control - var pointType = i % 3; - - // If we are selecting a control point - if (pointType != 0) { - // If we are selecting the left control point - if (pointType == 2) { - // If the path doesn't loop and the user is selecting the last control point there isn't a control point to mirror - if (i < bezierPath.NumPoints - 2 && !bezierPath.IsClosed) - return; - // Get the index of this control's anchor. - var anchorIndex = (i + 1) % bezierPath.NumPoints; - var anchorPoint = bezierPath[anchorIndex]; - // Get the index of the anchors other control. - // We don't have to loop this index b/c if it's the last control, it's anchors index will be 1. - var otherControlPointIndex = anchorIndex + 1; - // Move the other control point to the opposite of the selected control point's position relative to it's anchor. - bezierPath.MovePoint (otherControlPointIndex, anchorPoint - (handlePosition - anchorPoint)); - } - // If we are selecting the right control point - else if (pointType == 1) { - // If the path doesn't loop and the user is selecting the first control point there isn't a control point to mirror. - if (i > 1 && !bezierPath.IsClosed) - return; - // Get the index of this control's anchor. - var anchorIndex = i - 1; - var anchorPoint = bezierPath[anchorIndex]; - // Get the index of the anchors other control. - var otherControlPointIndex = anchorIndex - 1; - // Make sure to loop this index back around if it is < 1. - if (otherControlPointIndex < 0) - otherControlPointIndex = bezierPath.NumPoints - Mathf.Abs (otherControlPointIndex); - // Move the other control point to the opposite of the selected control point's position relative to it's anchor. - bezierPath.MovePoint (otherControlPointIndex, anchorPoint - (handlePosition - anchorPoint)); - } - } - } } } diff --git a/PathCreator/Core/Editor/PathEditor.cs.meta b/PathCreator/Assets/Core/Editor/PathEditor.cs.meta similarity index 100% rename from PathCreator/Core/Editor/PathEditor.cs.meta rename to PathCreator/Assets/Core/Editor/PathEditor.cs.meta diff --git a/PathCreator/Core/Runtime.meta b/PathCreator/Assets/Core/Runtime.meta similarity index 100% rename from PathCreator/Core/Runtime.meta rename to PathCreator/Assets/Core/Runtime.meta diff --git a/PathCreator/Core/Runtime/Objects.meta b/PathCreator/Assets/Core/Runtime/Objects.meta similarity index 100% rename from PathCreator/Core/Runtime/Objects.meta rename to PathCreator/Assets/Core/Runtime/Objects.meta diff --git a/PathCreator/Core/Runtime/Objects/BezierPath.cs b/PathCreator/Assets/Core/Runtime/Objects/BezierPath.cs similarity index 100% rename from PathCreator/Core/Runtime/Objects/BezierPath.cs rename to PathCreator/Assets/Core/Runtime/Objects/BezierPath.cs diff --git a/PathCreator/Core/Runtime/Objects/BezierPath.cs.meta b/PathCreator/Assets/Core/Runtime/Objects/BezierPath.cs.meta similarity index 100% rename from PathCreator/Core/Runtime/Objects/BezierPath.cs.meta rename to PathCreator/Assets/Core/Runtime/Objects/BezierPath.cs.meta diff --git a/PathCreator/Core/Runtime/Objects/EndOfPathInstruction.cs b/PathCreator/Assets/Core/Runtime/Objects/EndOfPathInstruction.cs similarity index 100% rename from PathCreator/Core/Runtime/Objects/EndOfPathInstruction.cs rename to PathCreator/Assets/Core/Runtime/Objects/EndOfPathInstruction.cs diff --git a/PathCreator/Core/Runtime/Objects/EndOfPathInstruction.cs.meta b/PathCreator/Assets/Core/Runtime/Objects/EndOfPathInstruction.cs.meta similarity index 100% rename from PathCreator/Core/Runtime/Objects/EndOfPathInstruction.cs.meta rename to PathCreator/Assets/Core/Runtime/Objects/EndOfPathInstruction.cs.meta diff --git a/PathCreator/Core/Runtime/Objects/GlobalDisplaySettings.cs b/PathCreator/Assets/Core/Runtime/Objects/GlobalDisplaySettings.cs similarity index 93% rename from PathCreator/Core/Runtime/Objects/GlobalDisplaySettings.cs rename to PathCreator/Assets/Core/Runtime/Objects/GlobalDisplaySettings.cs index 83556ef..0d9254d 100644 --- a/PathCreator/Core/Runtime/Objects/GlobalDisplaySettings.cs +++ b/PathCreator/Assets/Core/Runtime/Objects/GlobalDisplaySettings.cs @@ -11,12 +11,13 @@ public class GlobalDisplaySettings : ScriptableObject public enum HandleType { Sphere, Circle, Square }; [Header("Appearance")] - public float anchorSize = 10; public float controlSize = 7f; + [Tooltip("Should the path still be drawn when behind objects in the scene?")] + public bool visibleBehindObjects = true; [Tooltip("Should the path be drawn even when the path object is not selected?")] - public bool alwaysDrawPath = true; + public bool visibleWhenNotSelected = true; [Tooltip("If true, control points will be hidden when the control point mode is set to automatic. Otherwise they will inactive, but still visible.")] public bool hideAutoControls = true; public HandleType anchorShape; @@ -43,14 +44,11 @@ public enum HandleType { Sphere, Circle, Square }; [Header("Vertex Path Colours")] public Color vertexPath = Color.white; - public Color vertex = Color.black; [Header("Normals")] public Color normals = Color.yellow; [Range(0,1)] public float normalsLength = .1f; - [Range(0.005f, 0.2f)] - public float normalsWidth = 0.01f; #if UNITY_EDITOR public static GlobalDisplaySettings Load() { diff --git a/PathCreator/Core/Runtime/Objects/GlobalDisplaySettings.cs.meta b/PathCreator/Assets/Core/Runtime/Objects/GlobalDisplaySettings.cs.meta similarity index 100% rename from PathCreator/Core/Runtime/Objects/GlobalDisplaySettings.cs.meta rename to PathCreator/Assets/Core/Runtime/Objects/GlobalDisplaySettings.cs.meta diff --git a/PathCreator/Core/Runtime/Objects/MinMax3D.cs b/PathCreator/Assets/Core/Runtime/Objects/MinMax3D.cs similarity index 100% rename from PathCreator/Core/Runtime/Objects/MinMax3D.cs rename to PathCreator/Assets/Core/Runtime/Objects/MinMax3D.cs diff --git a/PathCreator/Core/Runtime/Objects/MinMax3D.cs.meta b/PathCreator/Assets/Core/Runtime/Objects/MinMax3D.cs.meta similarity index 100% rename from PathCreator/Core/Runtime/Objects/MinMax3D.cs.meta rename to PathCreator/Assets/Core/Runtime/Objects/MinMax3D.cs.meta diff --git a/PathCreator/Core/Runtime/Objects/PathCreator.cs b/PathCreator/Assets/Core/Runtime/Objects/PathCreator.cs similarity index 84% rename from PathCreator/Core/Runtime/Objects/PathCreator.cs rename to PathCreator/Assets/Core/Runtime/Objects/PathCreator.cs index e910a46..b810b79 100644 --- a/PathCreator/Core/Runtime/Objects/PathCreator.cs +++ b/PathCreator/Assets/Core/Runtime/Objects/PathCreator.cs @@ -74,18 +74,19 @@ void OnPathUpdated () { // Draw the path when path objected is not selected (if enabled in settings) void OnDrawGizmos () { - if (path != null) { + // Only draw path gizmo if the path object is not selected + // (editor script is resposible for drawing when selected) + GameObject selectedObj = UnityEditor.Selection.activeGameObject; + if (selectedObj != gameObject) { - if (globalEditorDisplaySettings == null) { - globalEditorDisplaySettings = GlobalDisplaySettings.Load (); - } + if (path != null) { + + if (globalEditorDisplaySettings == null) { + globalEditorDisplaySettings = GlobalDisplaySettings.Load (); + } - if (globalEditorDisplaySettings.alwaysDrawPath) { + if (globalEditorDisplaySettings.visibleWhenNotSelected) { - // Only draw path gizmo if the path object is not selected - // (editor script is resposible for drawing when selected) - GameObject selectedObj = UnityEditor.Selection.activeGameObject; - if (selectedObj != gameObject) { Gizmos.color = globalEditorDisplaySettings.bezierPath; for (int i = 0; i < path.NumVertices; i++) { diff --git a/PathCreator/Core/Runtime/Objects/PathCreator.cs.meta b/PathCreator/Assets/Core/Runtime/Objects/PathCreator.cs.meta similarity index 100% rename from PathCreator/Core/Runtime/Objects/PathCreator.cs.meta rename to PathCreator/Assets/Core/Runtime/Objects/PathCreator.cs.meta diff --git a/PathCreator/Core/Runtime/Objects/PathCreatorData.cs b/PathCreator/Assets/Core/Runtime/Objects/PathCreatorData.cs similarity index 97% rename from PathCreator/Core/Runtime/Objects/PathCreatorData.cs rename to PathCreator/Assets/Core/Runtime/Objects/PathCreatorData.cs index f7b98a3..bdc69f3 100644 --- a/PathCreator/Core/Runtime/Objects/PathCreatorData.cs +++ b/PathCreator/Assets/Core/Runtime/Objects/PathCreatorData.cs @@ -23,7 +23,7 @@ public class PathCreatorData public float vertexPathMinVertexSpacing = 0.01f; // bezier display settings - public bool pathTransformationEnabled; + public bool pathTransformationEnabled = true; public bool showPathBounds; public bool showPerSegmentBounds; public bool displayAnchorPoints = true; @@ -33,8 +33,8 @@ public class PathCreatorData public bool keepConstantHandleSize; // vertex display settings - public float vertexHandleSize = .2f; public bool showNormalsInVertexMode; + public bool showBezierPathInVertexMode; // Editor display states public bool showDisplayOptions; diff --git a/PathCreator/Core/Runtime/Objects/PathCreatorData.cs.meta b/PathCreator/Assets/Core/Runtime/Objects/PathCreatorData.cs.meta similarity index 100% rename from PathCreator/Core/Runtime/Objects/PathCreatorData.cs.meta rename to PathCreator/Assets/Core/Runtime/Objects/PathCreatorData.cs.meta diff --git a/PathCreator/Core/Runtime/Objects/PathSpace.cs b/PathCreator/Assets/Core/Runtime/Objects/PathSpace.cs similarity index 100% rename from PathCreator/Core/Runtime/Objects/PathSpace.cs rename to PathCreator/Assets/Core/Runtime/Objects/PathSpace.cs diff --git a/PathCreator/Core/Runtime/Objects/PathSpace.cs.meta b/PathCreator/Assets/Core/Runtime/Objects/PathSpace.cs.meta similarity index 100% rename from PathCreator/Core/Runtime/Objects/PathSpace.cs.meta rename to PathCreator/Assets/Core/Runtime/Objects/PathSpace.cs.meta diff --git a/PathCreator/Core/Runtime/Objects/VertexPath.cs b/PathCreator/Assets/Core/Runtime/Objects/VertexPath.cs similarity index 100% rename from PathCreator/Core/Runtime/Objects/VertexPath.cs rename to PathCreator/Assets/Core/Runtime/Objects/VertexPath.cs diff --git a/PathCreator/Core/Runtime/Objects/VertexPath.cs.meta b/PathCreator/Assets/Core/Runtime/Objects/VertexPath.cs.meta similarity index 100% rename from PathCreator/Core/Runtime/Objects/VertexPath.cs.meta rename to PathCreator/Assets/Core/Runtime/Objects/VertexPath.cs.meta diff --git a/PathCreator/Core/Runtime/PathCreator.asmdef b/PathCreator/Assets/Core/Runtime/PathCreator.asmdef similarity index 100% rename from PathCreator/Core/Runtime/PathCreator.asmdef rename to PathCreator/Assets/Core/Runtime/PathCreator.asmdef diff --git a/PathCreator/Core/Runtime/PathCreator.asmdef.meta b/PathCreator/Assets/Core/Runtime/PathCreator.asmdef.meta similarity index 100% rename from PathCreator/Core/Runtime/PathCreator.asmdef.meta rename to PathCreator/Assets/Core/Runtime/PathCreator.asmdef.meta diff --git a/PathCreator/Core/Runtime/Utility.meta b/PathCreator/Assets/Core/Runtime/Utility.meta similarity index 100% rename from PathCreator/Core/Runtime/Utility.meta rename to PathCreator/Assets/Core/Runtime/Utility.meta diff --git a/PathCreator/Assets/Core/Runtime/Utility/CubicBezierUtility.cs b/PathCreator/Assets/Core/Runtime/Utility/CubicBezierUtility.cs new file mode 100644 index 0000000..930d7f0 --- /dev/null +++ b/PathCreator/Assets/Core/Runtime/Utility/CubicBezierUtility.cs @@ -0,0 +1,136 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace PathCreation.Utility { + + /// Collection of functions related to cubic bezier curves + /// (a curve with a start and end 'anchor' point, and two 'control' points to define the shape of the curve between the anchors) + public static class CubicBezierUtility { + + /// Returns point at time 't' (between 0 and 1) along bezier curve defined by 4 points (anchor_1, control_1, control_2, anchor_2) + public static Vector3 EvaluateCurve (Vector3[] points, float t) { + return EvaluateCurve (points[0], points[1], points[2], points[3], t); + } + + /// Returns point at time 't' (between 0 and 1) along bezier curve defined by 4 points (anchor_1, control_1, control_2, anchor_2) + public static Vector3 EvaluateCurve (Vector3 a1, Vector3 c1, Vector3 c2, Vector3 a2, float t) { + t = Mathf.Clamp01 (t); + return (1 - t) * (1 - t) * (1 - t) * a1 + 3 * (1 - t) * (1 - t) * t * c1 + 3 * (1 - t) * t * t * c2 + t * t * t * a2; + } + + /// Returns a vector tangent to the point at time 't' + /// This is the vector tangent to the curve at that point + public static Vector3 EvaluateCurveDerivative (Vector3[] points, float t) { + return EvaluateCurveDerivative (points[0], points[1], points[2], points[3], t); + } + + /// Calculates the derivative of the curve at time 't' + /// This is the vector tangent to the curve at that point + public static Vector3 EvaluateCurveDerivative (Vector3 a1, Vector3 c1, Vector3 c2, Vector3 a2, float t) { + t = Mathf.Clamp01 (t); + return 3 * (1 - t) * (1 - t) * (c1 - a1) + 6 * (1 - t) * t * (c2 - c1) + 3 * t * t * (a2 - c2); + } + + /// Returns the second derivative of the curve at time 't' + public static Vector3 EvaluateCurveSecondDerivative (Vector3[] points, float t) { + return EvaluateCurveSecondDerivative (points[0], points[1], points[2], points[3], t); + } + + ///Returns the second derivative of the curve at time 't' + public static Vector3 EvaluateCurveSecondDerivative (Vector3 a1, Vector3 c1, Vector3 c2, Vector3 a2, float t) { + t = Mathf.Clamp01 (t); + return 6 * (1 - t) * (c2 - 2 * c1 + a1) + 6 * t * (a2 - 2 * c2 + c1); + } + + /// Calculates the normal vector (vector perpendicular to the curve) at specified time + public static Vector3 Normal (Vector3[] points, float t) { + return Normal (points[0], points[1], points[2], points[3], t); + } + + /// Calculates the normal vector (vector perpendicular to the curve) at specified time + public static Vector3 Normal (Vector3 a1, Vector3 c1, Vector3 c2, Vector3 a2, float t) { + Vector3 tangent = EvaluateCurveDerivative (a1, c1, c2, a2, t); + Vector3 nextTangent = EvaluateCurveSecondDerivative (a1, c1, c2, a2, t); + Vector3 c = Vector3.Cross (nextTangent, tangent); + return Vector3.Cross (c, tangent).normalized; + } + + public static Bounds CalculateBounds (Vector3[] points) { + MinMax3D minMax = new MinMax3D (); + minMax.AddValue (points[0]); + minMax.AddValue (points[3]); + + List extremePointTimes = ExtremePointTimes (points[0], points[1], points[2], points[3]); + foreach (float t in extremePointTimes) { + minMax.AddValue (CubicBezierUtility.EvaluateCurve (points, t)); + } + + return new Bounds ((minMax.Min + minMax.Max) / 2, minMax.Max - minMax.Min); + } + + /// Splits curve into two curves at time t. Returns 2 arrays of 4 points. + public static Vector3[][] SplitCurve (Vector3[] points, float t) { + Vector3 a1 = Vector3.Lerp (points[0], points[1], t); + Vector3 a2 = Vector3.Lerp (points[1], points[2], t); + Vector3 a3 = Vector3.Lerp (points[2], points[3], t); + Vector3 b1 = Vector3.Lerp (a1, a2, t); + Vector3 b2 = Vector3.Lerp (a2, a3, t); + Vector3 pointOnCurve = Vector3.Lerp (b1, b2, t); + + return new Vector3[][] { + new Vector3[] { points[0], a1, b1, pointOnCurve }, + new Vector3[] { pointOnCurve, b2, a3, points[3] } + }; + } + + // Crude, but fast estimation of curve length. + public static float EstimateCurveLength (Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3) { + float controlNetLength = (p0 - p1).magnitude + (p1 - p2).magnitude + (p2 - p3).magnitude; + float estimatedCurveLength = (p0 - p3).magnitude + controlNetLength / 2f; + return estimatedCurveLength; + } + + /// Times of stationary points on curve (points where derivative is zero on any axis) + public static List ExtremePointTimes (Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3) { + // coefficients of derivative function + Vector3 a = 3 * (-p0 + 3 * p1 - 3 * p2 + p3); + Vector3 b = 6 * (p0 - 2 * p1 + p2); + Vector3 c = 3 * (p1 - p0); + + List times = new List (); + times.AddRange (StationaryPointTimes (a.x, b.x, c.x)); + times.AddRange (StationaryPointTimes (a.y, b.y, c.y)); + times.AddRange (StationaryPointTimes (a.z, b.z, c.z)); + return times; + } + + // Finds times of stationary points on curve defined by ax^2 + bx + c. + // Only times between 0 and 1 are considered as Bezier only uses values in that range + static IEnumerable StationaryPointTimes (float a, float b, float c) { + List times = new List (); + + // from quadratic equation: y = [-b +- sqrt(b^2 - 4ac)]/2a + if (a != 0) { + float discriminant = b * b - 4 * a * c; + if (discriminant >= 0) { + float s = Mathf.Sqrt (discriminant); + float t1 = (-b + s) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + times.Add (t1); + } + + if (discriminant != 0) { + float t2 = (-b - s) / (2 * a); + + if (t2 >= 0 && t2 <= 1) { + times.Add (t2); + } + } + } + } + return times; + } + + } +} \ No newline at end of file diff --git a/PathCreator/Core/Runtime/Utility/CubicBezierUtility.cs.meta b/PathCreator/Assets/Core/Runtime/Utility/CubicBezierUtility.cs.meta similarity index 100% rename from PathCreator/Core/Runtime/Utility/CubicBezierUtility.cs.meta rename to PathCreator/Assets/Core/Runtime/Utility/CubicBezierUtility.cs.meta diff --git a/PathCreator/Core/Runtime/Utility/MathUtility.cs b/PathCreator/Assets/Core/Runtime/Utility/MathUtility.cs similarity index 100% rename from PathCreator/Core/Runtime/Utility/MathUtility.cs rename to PathCreator/Assets/Core/Runtime/Utility/MathUtility.cs diff --git a/PathCreator/Core/Runtime/Utility/MathUtility.cs.meta b/PathCreator/Assets/Core/Runtime/Utility/MathUtility.cs.meta similarity index 100% rename from PathCreator/Core/Runtime/Utility/MathUtility.cs.meta rename to PathCreator/Assets/Core/Runtime/Utility/MathUtility.cs.meta diff --git a/PathCreator/Core/Runtime/Utility/VertexPathUtility.cs b/PathCreator/Assets/Core/Runtime/Utility/VertexPathUtility.cs similarity index 100% rename from PathCreator/Core/Runtime/Utility/VertexPathUtility.cs rename to PathCreator/Assets/Core/Runtime/Utility/VertexPathUtility.cs diff --git a/PathCreator/Core/Runtime/Utility/VertexPathUtility.cs.meta b/PathCreator/Assets/Core/Runtime/Utility/VertexPathUtility.cs.meta similarity index 100% rename from PathCreator/Core/Runtime/Utility/VertexPathUtility.cs.meta rename to PathCreator/Assets/Core/Runtime/Utility/VertexPathUtility.cs.meta diff --git a/PathCreator/Core/Settings.meta b/PathCreator/Assets/Core/Settings.meta similarity index 100% rename from PathCreator/Core/Settings.meta rename to PathCreator/Assets/Core/Settings.meta diff --git a/PathCreator/Core/Settings/GlobalDisplaySettings.asset b/PathCreator/Assets/Core/Settings/GlobalDisplaySettings.asset similarity index 75% rename from PathCreator/Core/Settings/GlobalDisplaySettings.asset rename to PathCreator/Assets/Core/Settings/GlobalDisplaySettings.asset index dcec943..53dbd17 100644 --- a/PathCreator/Core/Settings/GlobalDisplaySettings.asset +++ b/PathCreator/Assets/Core/Settings/GlobalDisplaySettings.asset @@ -14,15 +14,16 @@ MonoBehaviour: m_EditorClassIdentifier: anchorSize: 10 controlSize: 7 - alwaysDrawPath: 1 + visibleBehindObjects: 1 + visibleWhenNotSelected: 1 hideAutoControls: 1 anchorShape: 0 controlShape: 0 - anchor: {r: 0.95, g: 0.25, b: 0.25, a: 0.85} - anchorHighlighted: {r: 1, g: 0.4, b: 0.4, a: 1} + anchor: {r: 1, g: 0.3726415, b: 0.3726415, a: 1} + anchorHighlighted: {r: 0.735849, g: 0.03818085, b: 0.03818085, a: 1} anchorSelected: {r: 1, g: 1, b: 1, a: 1} - control: {r: 0.35, g: 0.6, b: 1, a: 0.85} - controlHighlighted: {r: 0.6, g: 0.6, b: 1, a: 1} + control: {r: 0.35, g: 0.6, b: 1, a: 1} + controlHighlighted: {r: 0.19579923, g: 0.19579923, b: 0.754717, a: 1} controlSelected: {r: 1, g: 1, b: 1, a: 1} handleDisabled: {r: 1, g: 1, b: 1, a: 0.2} controlLine: {r: 0, g: 0, b: 0, a: 0.7254902} @@ -31,6 +32,5 @@ MonoBehaviour: bounds: {r: 1, g: 1, b: 1, a: 0.4} segmentBounds: {r: 1, g: 1, b: 1, a: 0.4} vertexPath: {r: 1, g: 1, b: 1, a: 1} - vertex: {r: 0, g: 0, b: 0, a: 1} normals: {r: 1, g: 0.92156863, b: 0.015686275, a: 1} - normalsLength: 0.1 + normalsLength: 0.198 diff --git a/PathCreator/Core/Settings/GlobalDisplaySettings.asset.meta b/PathCreator/Assets/Core/Settings/GlobalDisplaySettings.asset.meta similarity index 100% rename from PathCreator/Core/Settings/GlobalDisplaySettings.asset.meta rename to PathCreator/Assets/Core/Settings/GlobalDisplaySettings.asset.meta diff --git a/PathCreator/Examples.meta b/PathCreator/Assets/Examples.meta similarity index 100% rename from PathCreator/Examples.meta rename to PathCreator/Assets/Examples.meta diff --git a/PathCreator/Examples/Materials.meta b/PathCreator/Assets/Examples/Materials.meta similarity index 100% rename from PathCreator/Examples/Materials.meta rename to PathCreator/Assets/Examples/Materials.meta diff --git a/PathCreator/Examples/Materials/Black.mat b/PathCreator/Assets/Examples/Materials/Black.mat similarity index 100% rename from PathCreator/Examples/Materials/Black.mat rename to PathCreator/Assets/Examples/Materials/Black.mat diff --git a/PathCreator/Examples/Materials/Black.mat.meta b/PathCreator/Assets/Examples/Materials/Black.mat.meta similarity index 100% rename from PathCreator/Examples/Materials/Black.mat.meta rename to PathCreator/Assets/Examples/Materials/Black.mat.meta diff --git a/PathCreator/Examples/Materials/Blue.mat b/PathCreator/Assets/Examples/Materials/Blue.mat similarity index 100% rename from PathCreator/Examples/Materials/Blue.mat rename to PathCreator/Assets/Examples/Materials/Blue.mat diff --git a/PathCreator/Examples/Materials/Blue.mat.meta b/PathCreator/Assets/Examples/Materials/Blue.mat.meta similarity index 100% rename from PathCreator/Examples/Materials/Blue.mat.meta rename to PathCreator/Assets/Examples/Materials/Blue.mat.meta diff --git a/PathCreator/Assets/Examples/Materials/Brown.mat b/PathCreator/Assets/Examples/Materials/Brown.mat new file mode 100644 index 0000000..f4b31a5 --- /dev/null +++ b/PathCreator/Assets/Examples/Materials/Brown.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Brown + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 10.66} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 10.66} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.4528302, g: 0.19663213, b: 0.10466359, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/PathCreator/Assets/Examples/Materials/Brown.mat.meta b/PathCreator/Assets/Examples/Materials/Brown.mat.meta new file mode 100644 index 0000000..479c137 --- /dev/null +++ b/PathCreator/Assets/Examples/Materials/Brown.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: d5b3a558a1e7f4a4182b166bb2f27cf7 +timeCreated: 1519840206 +licenseType: Pro +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/PathCreator/Assets/Examples/Materials/Dark Grey.mat b/PathCreator/Assets/Examples/Materials/Dark Grey.mat new file mode 100644 index 0000000..498e755 --- /dev/null +++ b/PathCreator/Assets/Examples/Materials/Dark Grey.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Dark Grey + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.16037738, g: 0.16037738, b: 0.16037738, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/PathCreator/Assets/Examples/Materials/Dark Grey.mat.meta b/PathCreator/Assets/Examples/Materials/Dark Grey.mat.meta new file mode 100644 index 0000000..b494506 --- /dev/null +++ b/PathCreator/Assets/Examples/Materials/Dark Grey.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 407e3de4fbbcf4a99b17bf5aac2d28d8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/PathCreator/Examples/Materials/Green.mat b/PathCreator/Assets/Examples/Materials/Green.mat similarity index 100% rename from PathCreator/Examples/Materials/Green.mat rename to PathCreator/Assets/Examples/Materials/Green.mat diff --git a/PathCreator/Examples/Materials/Green.mat.meta b/PathCreator/Assets/Examples/Materials/Green.mat.meta similarity index 100% rename from PathCreator/Examples/Materials/Green.mat.meta rename to PathCreator/Assets/Examples/Materials/Green.mat.meta diff --git a/PathCreator/Examples/Materials/Red.mat b/PathCreator/Assets/Examples/Materials/Red.mat similarity index 100% rename from PathCreator/Examples/Materials/Red.mat rename to PathCreator/Assets/Examples/Materials/Red.mat diff --git a/PathCreator/Examples/Materials/Red.mat.meta b/PathCreator/Assets/Examples/Materials/Red.mat.meta similarity index 100% rename from PathCreator/Examples/Materials/Red.mat.meta rename to PathCreator/Assets/Examples/Materials/Red.mat.meta diff --git a/PathCreator/Examples/Materials/Road Texture.png b/PathCreator/Assets/Examples/Materials/Road Texture.png similarity index 100% rename from PathCreator/Examples/Materials/Road Texture.png rename to PathCreator/Assets/Examples/Materials/Road Texture.png diff --git a/PathCreator/Examples/Materials/Road Texture.png.meta b/PathCreator/Assets/Examples/Materials/Road Texture.png.meta similarity index 100% rename from PathCreator/Examples/Materials/Road Texture.png.meta rename to PathCreator/Assets/Examples/Materials/Road Texture.png.meta diff --git a/PathCreator/Examples/Materials/Road Underside.mat b/PathCreator/Assets/Examples/Materials/Road Underside.mat similarity index 100% rename from PathCreator/Examples/Materials/Road Underside.mat rename to PathCreator/Assets/Examples/Materials/Road Underside.mat diff --git a/PathCreator/Examples/Materials/Road Underside.mat.meta b/PathCreator/Assets/Examples/Materials/Road Underside.mat.meta similarity index 100% rename from PathCreator/Examples/Materials/Road Underside.mat.meta rename to PathCreator/Assets/Examples/Materials/Road Underside.mat.meta diff --git a/PathCreator/Examples/Materials/Road.mat b/PathCreator/Assets/Examples/Materials/Road.mat similarity index 100% rename from PathCreator/Examples/Materials/Road.mat rename to PathCreator/Assets/Examples/Materials/Road.mat diff --git a/PathCreator/Examples/Materials/Road.mat.meta b/PathCreator/Assets/Examples/Materials/Road.mat.meta similarity index 100% rename from PathCreator/Examples/Materials/Road.mat.meta rename to PathCreator/Assets/Examples/Materials/Road.mat.meta diff --git a/PathCreator/Assets/Examples/Prefabs.meta b/PathCreator/Assets/Examples/Prefabs.meta new file mode 100644 index 0000000..6bab42a --- /dev/null +++ b/PathCreator/Assets/Examples/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3331696fd1c6e4ce399332471e58fe60 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/PathCreator/Assets/Examples/Prefabs/Cube.prefab b/PathCreator/Assets/Examples/Prefabs/Cube.prefab new file mode 100644 index 0000000..3c53ba0 --- /dev/null +++ b/PathCreator/Assets/Examples/Prefabs/Cube.prefab @@ -0,0 +1,79 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4033822839321833552 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 979840955744105011} + - component: {fileID: 590364381998773281} + - component: {fileID: 5190809732636690155} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &979840955744105011 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4033822839321833552} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -1.1922646, y: -0.4048736, z: -0.2549243} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &590364381998773281 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4033822839321833552} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5190809732636690155 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4033822839321833552} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 diff --git a/PathCreator/Assets/Examples/Prefabs/Cube.prefab.meta b/PathCreator/Assets/Examples/Prefabs/Cube.prefab.meta new file mode 100644 index 0000000..f8ce78f --- /dev/null +++ b/PathCreator/Assets/Examples/Prefabs/Cube.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f19b52bc2573b4e508c60232d5ba4c53 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/PathCreator/Assets/Examples/Prefabs/Sphere.prefab b/PathCreator/Assets/Examples/Prefabs/Sphere.prefab new file mode 100644 index 0000000..80dd763 --- /dev/null +++ b/PathCreator/Assets/Examples/Prefabs/Sphere.prefab @@ -0,0 +1,79 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1284304205642556215 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3168392299219943901} + - component: {fileID: 7484263716245627173} + - component: {fileID: 4367022514524041713} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3168392299219943901 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1284304205642556215} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7484263716245627173 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1284304205642556215} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &4367022514524041713 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1284304205642556215} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 diff --git a/PathCreator/Assets/Examples/Prefabs/Sphere.prefab.meta b/PathCreator/Assets/Examples/Prefabs/Sphere.prefab.meta new file mode 100644 index 0000000..6c54355 --- /dev/null +++ b/PathCreator/Assets/Examples/Prefabs/Sphere.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cb2e1e8aa0d44489c8d332b91c9a4202 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/PathCreator/Examples/Scenes.meta b/PathCreator/Assets/Examples/Scenes.meta similarity index 100% rename from PathCreator/Examples/Scenes.meta rename to PathCreator/Assets/Examples/Scenes.meta diff --git a/PathCreator/Examples/Scenes/Follow Path.unity b/PathCreator/Assets/Examples/Scenes/Follow Path.unity similarity index 100% rename from PathCreator/Examples/Scenes/Follow Path.unity rename to PathCreator/Assets/Examples/Scenes/Follow Path.unity diff --git a/PathCreator/Examples/Scenes/Follow Path.unity.meta b/PathCreator/Assets/Examples/Scenes/Follow Path.unity.meta similarity index 100% rename from PathCreator/Examples/Scenes/Follow Path.unity.meta rename to PathCreator/Assets/Examples/Scenes/Follow Path.unity.meta diff --git a/PathCreator/Examples/Scenes/Object Path.unity b/PathCreator/Assets/Examples/Scenes/Generate Path.unity similarity index 86% rename from PathCreator/Examples/Scenes/Object Path.unity rename to PathCreator/Assets/Examples/Scenes/Generate Path.unity index 79c4667..3f70dea 100644 --- a/PathCreator/Examples/Scenes/Object Path.unity +++ b/PathCreator/Assets/Examples/Scenes/Generate Path.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657844, g: 0.49641222, b: 0.57481694, a: 1} + m_IndirectSpecularColor: {r: 0.44657892, g: 0.4964127, b: 0.5748172, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -50,12 +50,11 @@ LightmapSettings: m_BounceScale: 1 m_IndirectOutputScale: 1 m_AlbedoBoost: 1 - m_TemporalCoherenceThreshold: 1 m_EnvironmentLightingMode: 0 m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 10 + serializedVersion: 12 m_Resolution: 2 m_BakeResolution: 40 m_AtlasSize: 1024 @@ -63,6 +62,7 @@ LightmapSettings: m_AOMaxDistance: 1 m_CompAOExponent: 1 m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 m_Padding: 2 m_LightmapParameters: {fileID: 0} m_LightmapsBakeMode: 1 @@ -77,10 +77,16 @@ LightmapSettings: m_PVRDirectSampleCount: 32 m_PVRSampleCount: 500 m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 m_PVRFilterTypeDirect: 0 m_PVRFilterTypeIndirect: 0 m_PVRFilterTypeAO: 0 - m_PVRFilteringMode: 1 + m_PVREnvironmentMIS: 0 m_PVRCulling: 1 m_PVRFilteringGaussRadiusDirect: 1 m_PVRFilteringGaussRadiusIndirect: 5 @@ -89,6 +95,7 @@ LightmapSettings: m_PVRFilteringAtrousPositionSigmaIndirect: 2 m_PVRFilteringAtrousPositionSigmaAO: 1 m_ShowResolutionOverlay: 1 + m_ExportTrainingData: 0 m_LightingDataAsset: {fileID: 0} m_UseShadowmask: 1 --- !u!196 &4 @@ -117,7 +124,8 @@ NavMeshSettings: GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 315902409} @@ -134,7 +142,8 @@ GameObject: MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 315902406} m_Enabled: 1 m_CastShadows: 1 @@ -144,6 +153,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 m_Materials: - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} m_StaticBatchInfo: @@ -169,14 +179,16 @@ MeshRenderer: MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 315902406} m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &315902409 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 315902406} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 6.54, y: -1.75, z: 6.2} @@ -189,7 +201,8 @@ Transform: GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 729862347} @@ -206,7 +219,8 @@ GameObject: MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 729862344} m_Enabled: 1 m_CastShadows: 1 @@ -216,6 +230,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 m_Materials: - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} m_StaticBatchInfo: @@ -241,14 +256,16 @@ MeshRenderer: MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 729862344} m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &729862347 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 729862344} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 9.1, y: 6.39, z: -3.51} @@ -261,7 +278,8 @@ Transform: GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 762964052} @@ -276,7 +294,8 @@ GameObject: Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 762964051} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} @@ -294,7 +313,8 @@ Transform: GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 839433807} @@ -312,7 +332,8 @@ TrailRenderer: serializedVersion: 2 m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 839433805} m_Enabled: 1 m_CastShadows: 1 @@ -322,6 +343,7 @@ TrailRenderer: m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 m_Materials: - {fileID: 10306, guid: 0000000000000000f000000000000000, type: 0} m_StaticBatchInfo: @@ -345,7 +367,7 @@ TrailRenderer: m_SortingOrder: 0 m_Time: 5 m_Parameters: - serializedVersion: 2 + serializedVersion: 3 widthMultiplier: 1 widthCurve: serializedVersion: 2 @@ -404,6 +426,7 @@ TrailRenderer: numCapVertices: 8 alignment: 0 textureMode: 0 + shadowBias: 0 generateLightingData: 0 m_MinVertexDistance: 0.1 m_Autodestruct: 0 @@ -412,7 +435,8 @@ TrailRenderer: Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 839433805} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} @@ -425,7 +449,8 @@ Transform: MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 839433805} m_Enabled: 1 m_EditorHideFlags: 0 @@ -438,12 +463,13 @@ MonoBehaviour: - {fileID: 1544419622} - {fileID: 729862347} - {fileID: 315902409} - speed: 10 + speed: 8 --- !u!1 &1295418881 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 1295418884} @@ -460,7 +486,8 @@ GameObject: MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1295418881} m_Enabled: 1 m_CastShadows: 1 @@ -470,6 +497,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 m_Materials: - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} m_StaticBatchInfo: @@ -495,14 +523,16 @@ MeshRenderer: MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1295418881} m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &1295418884 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1295418881} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} @@ -515,7 +545,8 @@ Transform: GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 1407856705} @@ -532,20 +563,24 @@ GameObject: AudioListener: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1407856702} m_Enabled: 1 --- !u!20 &1407856704 Camera: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1407856702} m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 m_SensorSize: {x: 36, y: 24} m_LensShift: {x: 0, y: 0} m_FocalLength: 50 @@ -579,7 +614,8 @@ Camera: Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1407856702} m_LocalRotation: {x: 0.12969545, y: -0.1184572, z: 0.015607949, w: 0.9843289} m_LocalPosition: {x: 3, y: 8.92, z: -18.23} @@ -592,7 +628,8 @@ Transform: GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 1544419622} @@ -609,7 +646,8 @@ GameObject: MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1544419619} m_Enabled: 1 m_CastShadows: 1 @@ -619,6 +657,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 m_Materials: - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} m_StaticBatchInfo: @@ -644,14 +683,16 @@ MeshRenderer: MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1544419619} m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &1544419622 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1544419619} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -6.17, y: 6.39, z: -10.04} @@ -664,7 +705,8 @@ Transform: GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 1612519937} @@ -680,15 +722,17 @@ GameObject: Light: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1612519935} m_Enabled: 1 - serializedVersion: 8 + serializedVersion: 9 m_Type: 1 m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 1 m_Range: 10 m_SpotAngle: 30 + m_InnerSpotAngle: 21.802082 m_CookieSize: 10 m_Shadows: m_Type: 2 @@ -698,6 +742,24 @@ Light: m_Bias: 0.05 m_NormalBias: 0.4 m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -705,19 +767,23 @@ Light: m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 + m_RenderingLayerMask: 1 m_Lightmapping: 4 m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 m_ColorTemperature: 6570 m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 --- !u!4 &1612519937 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1612519935} m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} m_LocalPosition: {x: 0, y: 3, z: 0} @@ -730,7 +796,8 @@ Transform: GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 2107402768} @@ -747,7 +814,8 @@ GameObject: MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2107402765} m_Enabled: 1 m_CastShadows: 1 @@ -757,6 +825,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 m_Materials: - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} m_StaticBatchInfo: @@ -782,14 +851,16 @@ MeshRenderer: MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2107402765} m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &2107402768 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2107402765} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -6.17, y: 1.4746776, z: 2.67} diff --git a/PathCreator/Examples/Scenes/Object Path.unity.meta b/PathCreator/Assets/Examples/Scenes/Generate Path.unity.meta similarity index 100% rename from PathCreator/Examples/Scenes/Object Path.unity.meta rename to PathCreator/Assets/Examples/Scenes/Generate Path.unity.meta diff --git a/PathCreator/Assets/Examples/Scenes/Object Placement.unity b/PathCreator/Assets/Examples/Scenes/Object Placement.unity new file mode 100644 index 0000000..f19fdb8 --- /dev/null +++ b/PathCreator/Assets/Examples/Scenes/Object Placement.unity @@ -0,0 +1,2184 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657892, g: 0.4964127, b: 0.5748172, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_ExportTrainingData: 0 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &56148411 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 56148412} + - component: {fileID: 56148414} + - component: {fileID: 56148413} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &56148412 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 56148411} + m_LocalRotation: {x: -0.41394958, y: 0.41394958, z: -0.57327634, w: 0.57327634} + m_LocalPosition: {x: 10.42605, y: 0.4048736, z: -10.052364} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 19 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &56148413 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 56148411} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &56148414 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 56148411} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &60515989 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 60515990} + - component: {fileID: 60515992} + - component: {fileID: 60515991} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &60515990 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 60515989} + m_LocalRotation: {x: -0.33047506, y: 0.33047506, z: -0.625129, w: 0.62512904} + m_LocalPosition: {x: 14.546493, y: 0.4048736, z: 1.708433} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &60515991 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 60515989} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &60515992 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 60515989} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &76106852 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 76106853} + - component: {fileID: 76106855} + - component: {fileID: 76106854} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &76106853 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76106852} + m_LocalRotation: {x: -0.20401506, y: 0.20401506, z: -0.67703617, w: 0.6770361} + m_LocalPosition: {x: 18.763145, y: 0.4048736, z: -2.1280043} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 21 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &76106854 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76106852} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &76106855 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76106852} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &131176157 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 131176158} + - component: {fileID: 131176160} + - component: {fileID: 131176159} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &131176158 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 131176157} + m_LocalRotation: {x: 0.6297472, y: -0.6297472, z: 0.3215874, w: -0.3215874} + m_LocalPosition: {x: -6.43158, y: 0.4048736, z: -12.164612} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 16 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &131176159 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 131176157} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &131176160 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 131176157} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &251751373 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 251751374} + - component: {fileID: 251751376} + - component: {fileID: 251751375} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &251751374 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 251751373} + m_LocalRotation: {x: -0.2403667, y: 0.2403667, z: -0.6649992, w: 0.6649991} + m_LocalPosition: {x: 15.3396845, y: 0.4048736, z: -6.954295} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 20 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &251751375 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 251751373} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &251751376 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 251751373} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &369380290 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 369380291} + - component: {fileID: 369380293} + - component: {fileID: 369380292} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &369380291 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 369380290} + m_LocalRotation: {x: 0.64991957, y: -0.64991957, z: -0.27857608, w: 0.27857608} + m_LocalPosition: {x: -11.498614, y: 0.4048736, z: 21.0816} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &369380292 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 369380290} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &369380293 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 369380290} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &370380073 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 370380074} + - component: {fileID: 370380076} + - component: {fileID: 370380075} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &370380074 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 370380073} + m_LocalRotation: {x: 0.7068989, y: -0.7068989, z: 0.017145969, w: -0.017145969} + m_LocalPosition: {x: -12.725294, y: 0.4048736, z: 15.455845} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &370380075 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 370380073} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &370380076 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 370380073} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &379837162 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 379837163} + - component: {fileID: 379837165} + - component: {fileID: 379837164} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &379837163 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 379837162} + m_LocalRotation: {x: 0.4510007, y: -0.4510007, z: -0.5446085, w: 0.5446085} + m_LocalPosition: {x: 5.772948, y: 0.4048736, z: 22.906626} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &379837164 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 379837162} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &379837165 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 379837162} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &425799023 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 425799024} + - component: {fileID: 425799026} + - component: {fileID: 425799025} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &425799024 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 425799023} + m_LocalRotation: {x: 0.49589783, y: -0.49589783, z: -0.5040688, w: 0.5040688} + m_LocalPosition: {x: -0.11454296, y: 0.4048736, z: 23.45682} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &425799025 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 425799023} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &425799026 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 425799023} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &443140621 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 443140622} + - component: {fileID: 443140624} + - component: {fileID: 443140623} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &443140622 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 443140621} + m_LocalRotation: {x: 0.23628241, y: -0.23628241, z: -0.6664613, w: 0.6664613} + m_LocalPosition: {x: 15.1349945, y: 0.4048736, z: 16.148664} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &443140623 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 443140621} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &443140624 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 443140621} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &859221706 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 859221707} + - component: {fileID: 859221709} + - component: {fileID: 859221708} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &859221707 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 859221706} + m_LocalRotation: {x: -0.43168253, y: 0.43168253, z: -0.5600448, w: 0.5600448} + m_LocalPosition: {x: 4.7244167, y: 0.4048736, z: -11.640591} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 18 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &859221708 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 859221706} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &859221709 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 859221706} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &870785749 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 870785750} + - component: {fileID: 870785752} + - component: {fileID: 870785751} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &870785750 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 870785749} + m_LocalRotation: {x: 0.70470375, y: -0.7047037, z: 0.058246676, w: -0.058246676} + m_LocalPosition: {x: -12.011151, y: 0.4048736, z: 9.58234} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 12 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &870785751 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 870785749} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &870785752 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 870785749} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &925033183 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 925033184} + - component: {fileID: 925033186} + - component: {fileID: 925033185} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &925033184 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 925033183} + m_LocalRotation: {x: 0.56813604, y: -0.568136, z: 0.4209768, w: -0.4209768} + m_LocalPosition: {x: 3.3699255, y: 0.4048736, z: 1.2684951} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &925033185 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 925033183} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &925033186 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 925033183} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &930619579 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 930619580} + - component: {fileID: 930619582} + - component: {fileID: 930619581} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &930619580 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 930619579} + m_LocalRotation: {x: -0.21098873, y: 0.21098873, z: -0.6748954, w: 0.67489535} + m_LocalPosition: {x: 18.892519, y: 0.4048736, z: 5.68619} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &930619581 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 930619579} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &930619582 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 930619579} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &997217131 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 997217132} + - component: {fileID: 997217134} + - component: {fileID: 997217133} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &997217132 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 997217131} + m_LocalRotation: {x: 0.52873677, y: -0.52873677, z: 0.46950766, w: -0.46950766} + m_LocalPosition: {x: 9.103928, y: 0.4048736, z: -0.17504176} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &997217133 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 997217131} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &997217134 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 997217131} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1045485630 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1045485633} + - component: {fileID: 1045485632} + - component: {fileID: 1045485631} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1045485631 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1045485630} + m_Enabled: 1 +--- !u!20 &1045485632 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1045485630} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1045485633 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1045485630} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1090496044 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1090496045} + - component: {fileID: 1090496047} + - component: {fileID: 1090496046} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1090496045 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1090496044} + m_LocalRotation: {x: 0.68600535, y: -0.68600535, z: 0.17145476, w: -0.17145476} + m_LocalPosition: {x: -10.599794, y: 0.4048736, z: -8.011976} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 15 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1090496046 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1090496044} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1090496047 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1090496044} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1100876285 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1100876286} + m_Layer: 0 + m_Name: Object Holder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1100876286 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1100876285} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -1.1922646, y: -0.4048736, z: -0.2549243} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 925033184} + - {fileID: 997217132} + - {fileID: 60515990} + - {fileID: 930619580} + - {fileID: 1477068311} + - {fileID: 443140622} + - {fileID: 1386765205} + - {fileID: 379837163} + - {fileID: 425799024} + - {fileID: 1208874232} + - {fileID: 369380291} + - {fileID: 370380074} + - {fileID: 870785750} + - {fileID: 1482030319} + - {fileID: 1937410346} + - {fileID: 1090496045} + - {fileID: 131176158} + - {fileID: 1501910447} + - {fileID: 859221707} + - {fileID: 56148412} + - {fileID: 251751374} + - {fileID: 76106853} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1163749077 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1163749079} + - component: {fileID: 1163749078} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &1163749078 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1163749077} + m_Enabled: 1 + serializedVersion: 9 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &1163749079 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1163749077} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &1173081723 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1173081726} + - component: {fileID: 1173081725} + - component: {fileID: 1173081724} + m_Layer: 0 + m_Name: Path + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1173081724 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1173081723} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8e5ac92bc18f545cc84cd886ece82b4d, type: 3} + m_Name: + m_EditorClassIdentifier: + editorData: + _bezierPath: + points: + - {x: 2.177661, y: 0, z: 1.0135708} + - {x: 5.199287, y: 0, z: 0.094109386} + - {x: 8.220913, y: 0, z: -0.825352} + - {x: 9.882347, y: 0, z: -0.37185097} + - {x: 12.258113, y: 0, z: 0.27663207} + - {x: 18.085125, y: 0, z: 4.4852686} + - {x: 18.365267, y: 0, z: 6.931963} + - {x: 18.82655, y: 0, z: 10.960705} + - {x: 11.143806, y: 0, z: 20.072712} + - {x: 7.4771137, y: 0, z: 21.80445} + - {x: 3.4255772, y: 0, z: 23.717943} + - {x: -9.849789, y: 0, z: 23.978157} + - {x: -12.857204, y: 0, z: 20.656733} + - {x: -15.660013, y: 0, z: 17.56128} + - {x: -12.177698, y: 0, z: 5.8667793} + - {x: -12.045687, y: 0, z: 1.6930351} + - {x: -11.977105, y: 0, z: -0.47527623} + - {x: -12.790092, y: 0, z: -6.2136345} + - {x: -11.843851, y: 0, z: -8.165789} + - {x: -10.975014, y: 0, z: -9.958253} + - {x: -6.7926598, y: 0, z: -13.46763} + - {x: -4.852582, y: 0, z: -13.9191885} + - {x: -3.491789, y: 0, z: -14.235916} + - {x: -0.017205, y: 0, z: -12.837134} + - {x: 1.3291776, y: 0, z: -12.463868} + - {x: 3.7942572, y: 0, z: -11.780458} + - {x: 10.303253, y: 0, z: -10.38054} + - {x: 12.403621, y: 0, z: -8.9203615} + - {x: 13.973428, y: 0, z: -7.82903} + - {x: 15.871395, y: 0, z: -4.956673} + - {x: 17.769363, y: 0, z: -2.0843163} + isClosed: 0 + localPosition: {x: 0, y: 0, z: 0} + space: 2 + controlMode: 3 + autoControlLength: 0.22 + boundsUpToDate: 1 + pivot: {x: 2.2200084, y: 0, z: 4.6212296} + bounds: + m_Center: {x: 2.2200084, y: 0, z: 4.6212296} + m_Extent: {x: 16.16514, y: 0, z: 18.586714} + rotation: {x: 0, y: 0, z: 0, w: 1} + scale: {x: 1, y: 1, z: 1} + perAnchorNormalsAngle: + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + globalNormalsAngle: 0 + flipNormals: 0 + vertexPathUpToDate: 1 + vertexPathMaxAngleError: 0.3 + vertexPathMinVertexSpacing: 0.01 + pathTransformationEnabled: 0 + showPathBounds: 0 + showPerSegmentBounds: 0 + displayAnchorPoints: 1 + displayControlPoints: 1 + bezierHandleScale: 7.64 + globalDisplaySettingsFoldout: 0 + keepConstantHandleSize: 0 + showNormalsInVertexMode: 0 + showBezierPathInVertexMode: 0 + showDisplayOptions: 1 + showPathOptions: 1 + showVertexPathDisplayOptions: 0 + showVertexPathOptions: 1 + showNormals: 0 + showNormalsHelpInfo: 0 + tabIndex: 0 + initialized: 1 +--- !u!114 &1173081725 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1173081723} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d12b1fe1b42884d7692049d7f6f79ee9, type: 3} + m_Name: + m_EditorClassIdentifier: + pathCreator: {fileID: 1173081724} + autoUpdate: 1 + prefab: {fileID: 4033822839321833552, guid: f19b52bc2573b4e508c60232d5ba4c53, type: 3} + holder: {fileID: 1100876285} + spacing: 5.92 +--- !u!4 &1173081726 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1173081723} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1208874231 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1208874232} + - component: {fileID: 1208874234} + - component: {fileID: 1208874233} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1208874232 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1208874231} + m_LocalRotation: {x: 0.53619653, y: -0.53619653, z: -0.46096995, w: 0.46096995} + m_LocalPosition: {x: -6.0172133, y: 0.4048736, z: 23.101475} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1208874233 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1208874231} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1208874234 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1208874231} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1386765204 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1386765205} + - component: {fileID: 1386765207} + - component: {fileID: 1386765206} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1386765205 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1386765204} + m_LocalRotation: {x: 0.29634115, y: -0.29634115, z: -0.6420139, w: 0.64201397} + m_LocalPosition: {x: 11.043332, y: 0.4048736, z: 20.416275} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1386765206 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1386765204} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1386765207 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1386765204} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1477068310 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1477068311} + - component: {fileID: 1477068313} + - component: {fileID: 1477068312} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1477068311 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1477068310} + m_LocalRotation: {x: 0.16633835, y: -0.16633835, z: -0.6872638, w: 0.68726385} + m_LocalPosition: {x: 18.428295, y: 0.4048736, z: 11.241245} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1477068312 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1477068310} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1477068313 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1477068310} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1482030318 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1482030319} + - component: {fileID: 1482030321} + - component: {fileID: 1482030320} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1482030319 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1482030318} + m_LocalRotation: {x: 0.7054323, y: -0.7054323, z: 0.048634227, w: -0.048634227} + m_LocalPosition: {x: -11.028815, y: 0.4048736, z: 3.7446494} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 13 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1482030320 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1482030318} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1482030321 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1482030318} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1501910446 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1501910447} + - component: {fileID: 1501910449} + - component: {fileID: 1501910448} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1501910447 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1501910446} + m_LocalRotation: {x: -0.4278265, y: 0.4278265, z: -0.56299603, w: 0.56299603} + m_LocalPosition: {x: -0.95369315, y: 0.4048736, z: -13.306965} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 17 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1501910448 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1501910446} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1501910449 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1501910446} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1937410345 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1937410346} + - component: {fileID: 1937410348} + - component: {fileID: 1937410347} + m_Layer: 0 + m_Name: Cube(Clone) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1937410346 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1937410345} + m_LocalRotation: {x: 0.7068624, y: -0.70686245, z: -0.018589003, w: 0.018589003} + m_LocalPosition: {x: -11.039193, y: 0.4048736, z: -2.1608486} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1100876286} + m_RootOrder: 14 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1937410347 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1937410345} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1937410348 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1937410345} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} diff --git a/PathCreator/Assets/Examples/Scenes/Object Placement.unity.meta b/PathCreator/Assets/Examples/Scenes/Object Placement.unity.meta new file mode 100644 index 0000000..23a9ebb --- /dev/null +++ b/PathCreator/Assets/Examples/Scenes/Object Placement.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f9d700f5f914447f48566abe5b02d921 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/PathCreator/Examples/Scenes/Road.unity b/PathCreator/Assets/Examples/Scenes/Road.unity similarity index 100% rename from PathCreator/Examples/Scenes/Road.unity rename to PathCreator/Assets/Examples/Scenes/Road.unity diff --git a/PathCreator/Examples/Scenes/Road.unity.meta b/PathCreator/Assets/Examples/Scenes/Road.unity.meta similarity index 100% rename from PathCreator/Examples/Scenes/Road.unity.meta rename to PathCreator/Assets/Examples/Scenes/Road.unity.meta diff --git a/PathCreator/Examples/Scripts.meta b/PathCreator/Assets/Examples/Scripts.meta similarity index 100% rename from PathCreator/Examples/Scripts.meta rename to PathCreator/Assets/Examples/Scripts.meta diff --git a/PathCreator/Examples/Scripts/Editor.meta b/PathCreator/Assets/Examples/Scripts/Editor.meta similarity index 100% rename from PathCreator/Examples/Scripts/Editor.meta rename to PathCreator/Assets/Examples/Scripts/Editor.meta diff --git a/PathCreator/Examples/Scripts/Editor/PathSceneToolEditor.cs b/PathCreator/Assets/Examples/Scripts/Editor/PathSceneToolEditor.cs similarity index 89% rename from PathCreator/Examples/Scripts/Editor/PathSceneToolEditor.cs rename to PathCreator/Assets/Examples/Scripts/Editor/PathSceneToolEditor.cs index 4ca318a..c8bd736 100644 --- a/PathCreator/Examples/Scripts/Editor/PathSceneToolEditor.cs +++ b/PathCreator/Assets/Examples/Scripts/Editor/PathSceneToolEditor.cs @@ -26,7 +26,7 @@ public override void OnInspectorGUI() if (pathTool.autoUpdate) { - pathTool.CreatePath(); + TriggerUpdate(); } } @@ -36,7 +36,7 @@ public override void OnInspectorGUI() { if (TryFindPathCreator()) { - pathTool.CreatePath(); + TriggerUpdate(); SceneView.RepaintAll(); } } @@ -44,11 +44,18 @@ public override void OnInspectorGUI() } + void TriggerUpdate() { + if (pathTool.pathCreator != null) { + pathTool.TriggerUpdate(); + } + } + + protected virtual void OnPathModified() { if (pathTool.autoUpdate) { - pathTool.CreatePath(); + TriggerUpdate(); } } @@ -60,7 +67,7 @@ protected virtual void OnEnable() if (TryFindPathCreator()) { Subscribe(); - pathTool.CreatePath(); + TriggerUpdate(); } } diff --git a/PathCreator/Examples/Scripts/Editor/PathSceneToolEditor.cs.meta b/PathCreator/Assets/Examples/Scripts/Editor/PathSceneToolEditor.cs.meta similarity index 100% rename from PathCreator/Examples/Scripts/Editor/PathSceneToolEditor.cs.meta rename to PathCreator/Assets/Examples/Scripts/Editor/PathSceneToolEditor.cs.meta diff --git a/PathCreator/Examples/Scripts/PathFromObjects.cs b/PathCreator/Assets/Examples/Scripts/GeneratePathExample.cs similarity index 81% rename from PathCreator/Examples/Scripts/PathFromObjects.cs rename to PathCreator/Assets/Examples/Scripts/GeneratePathExample.cs index db81e73..38041e0 100644 --- a/PathCreator/Examples/Scripts/PathFromObjects.cs +++ b/PathCreator/Assets/Examples/Scripts/GeneratePathExample.cs @@ -2,10 +2,11 @@ namespace PathCreation.Examples { - // Creates a path from an array of transforms and moves along it + // Example of creating a path at runtime from a set of points. + // Moves along the generated path. [RequireComponent(typeof(TrailRenderer))] - public class PathFromObjects : MonoBehaviour + public class GeneratePathExample : MonoBehaviour { public Transform[] waypoints; public float speed = 8; @@ -23,10 +24,6 @@ void Start() // Create a vertex path from the bezier path path = new VertexPath(bezierPath); } - else - { - Debug.Log("No waypoints assigned"); - } } void Update() diff --git a/PathCreator/Examples/Scripts/PathFromObjects.cs.meta b/PathCreator/Assets/Examples/Scripts/GeneratePathExample.cs.meta similarity index 100% rename from PathCreator/Examples/Scripts/PathFromObjects.cs.meta rename to PathCreator/Assets/Examples/Scripts/GeneratePathExample.cs.meta diff --git a/PathCreator/Examples/Scripts/PathFollower.cs b/PathCreator/Assets/Examples/Scripts/PathFollower.cs similarity index 100% rename from PathCreator/Examples/Scripts/PathFollower.cs rename to PathCreator/Assets/Examples/Scripts/PathFollower.cs diff --git a/PathCreator/Examples/Scripts/PathFollower.cs.meta b/PathCreator/Assets/Examples/Scripts/PathFollower.cs.meta similarity index 100% rename from PathCreator/Examples/Scripts/PathFollower.cs.meta rename to PathCreator/Assets/Examples/Scripts/PathFollower.cs.meta diff --git a/PathCreator/Assets/Examples/Scripts/PathPlacer.cs b/PathCreator/Assets/Examples/Scripts/PathPlacer.cs new file mode 100644 index 0000000..8e38ee3 --- /dev/null +++ b/PathCreator/Assets/Examples/Scripts/PathPlacer.cs @@ -0,0 +1,46 @@ +using PathCreation; +using UnityEngine; + +namespace PathCreation.Examples { + + [ExecuteInEditMode] + public class PathPlacer : PathSceneTool { + + public GameObject prefab; + public GameObject holder; + public float spacing = 3; + + const float minSpacing = .1f; + + void Generate () { + if (pathCreator != null && prefab != null && holder != null) { + DestroyObjects (); + + VertexPath path = pathCreator.path; + + spacing = Mathf.Max(minSpacing, spacing); + float dst = 0; + + while (dst < path.length) { + Vector3 point = path.GetPointAtDistance (dst); + Quaternion rot = path.GetRotationAtDistance (dst); + Instantiate (prefab, point, rot, holder.transform); + dst += spacing; + } + } + } + + void DestroyObjects () { + int numChildren = holder.transform.childCount; + for (int i = numChildren - 1; i >= 0; i--) { + DestroyImmediate (holder.transform.GetChild (i).gameObject, false); + } + } + + protected override void PathUpdated () { + if (pathCreator != null) { + Generate (); + } + } + } +} \ No newline at end of file diff --git a/PathCreator/Assets/Examples/Scripts/PathPlacer.cs.meta b/PathCreator/Assets/Examples/Scripts/PathPlacer.cs.meta new file mode 100644 index 0000000..8b69b4a --- /dev/null +++ b/PathCreator/Assets/Examples/Scripts/PathPlacer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d12b1fe1b42884d7692049d7f6f79ee9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/PathCreator/Examples/Scripts/PathSceneTool.cs b/PathCreator/Assets/Examples/Scripts/PathSceneTool.cs similarity index 81% rename from PathCreator/Examples/Scripts/PathSceneTool.cs rename to PathCreator/Assets/Examples/Scripts/PathSceneTool.cs index 92ef7a1..a1212c1 100644 --- a/PathCreator/Examples/Scripts/PathSceneTool.cs +++ b/PathCreator/Assets/Examples/Scripts/PathSceneTool.cs @@ -15,14 +15,11 @@ protected VertexPath path { } } - public void CreatePath() - { - if (pathCreator != null) - { - PathUpdated(); - } + public void TriggerUpdate() { + PathUpdated(); } + protected virtual void OnDestroy() { if (onDestroyed != null) { onDestroyed(); diff --git a/PathCreator/Examples/Scripts/PathSceneTool.cs.meta b/PathCreator/Assets/Examples/Scripts/PathSceneTool.cs.meta similarity index 100% rename from PathCreator/Examples/Scripts/PathSceneTool.cs.meta rename to PathCreator/Assets/Examples/Scripts/PathSceneTool.cs.meta diff --git a/PathCreator/Examples/Scripts/RoadMeshCreator.cs b/PathCreator/Assets/Examples/Scripts/RoadMeshCreator.cs similarity index 100% rename from PathCreator/Examples/Scripts/RoadMeshCreator.cs rename to PathCreator/Assets/Examples/Scripts/RoadMeshCreator.cs diff --git a/PathCreator/Examples/Scripts/RoadMeshCreator.cs.meta b/PathCreator/Assets/Examples/Scripts/RoadMeshCreator.cs.meta similarity index 100% rename from PathCreator/Examples/Scripts/RoadMeshCreator.cs.meta rename to PathCreator/Assets/Examples/Scripts/RoadMeshCreator.cs.meta diff --git a/PathCreator/Core/Runtime/Utility/CubicBezierUtility.cs b/PathCreator/Core/Runtime/Utility/CubicBezierUtility.cs deleted file mode 100644 index 809975e..0000000 --- a/PathCreator/Core/Runtime/Utility/CubicBezierUtility.cs +++ /dev/null @@ -1,209 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -namespace PathCreation.Utility -{ - - /// Collection of functions related to cubic bezier curves - /// (a curve with a start and end 'anchor' point, and two 'control' points to define the shape of the curve between the anchors) - public static class CubicBezierUtility - { - /// Returns point at time 't' (between 0 and 1) along bezier curve defined by 4 points (anchor_1, control_1, control_2, anchor_2) - public static Vector3 EvaluateCurve(Vector3[] points, float t) - { - Debug.Assert(points.Length == 4, "Incorrect number of points supplied to cubic bezier function (expected 4)"); - if (points.Length >= 4) - { - return EvaluateCurve(points[0], points[1], points[2], points[3], t); - } - return Vector3.zero; - } - - /// Returns point at time 't' (between 0 and 1) along bezier curve defined by 4 points (anchor_1, control_1, control_2, anchor_2) - public static Vector3 EvaluateCurve(Vector3 a1, Vector3 c1, Vector3 c2, Vector3 a2, float t) - { - t = t < 0f ? 0f : t > 1f ? 1f : t; - - float s1 = (1 - t) * (1 - t) * (1 - t); - float s2 = 3 * (1 - t) * (1 - t) * t; - float s3 = 3 * (1 - t) * t * t; - float s4 = t * t * t; - - float x = s1 * a1.x + s2 * c1.x + s3 * c2.x + s4 * a2.x; - float y = s1 * a1.y + s2 * c1.y + s3 * c2.y + s4 * a2.y; - float z = s1 * a1.z + s2 * c1.z + s3 * c2.z + s4 * a2.z; - - return new Vector3( x, y, z ); - } - - /// Returns a vector tangent to the point at time 't' - /// This is the vector tangent to the curve at that point - public static Vector3 EvaluateCurveDerivative(Vector3[] points, float t) - { - Debug.Assert(points.Length == 4, "Incorrect number of points supplied to cubic bezier function (expected 4)."); - if (points.Length >= 4) - { - return EvaluateCurveDerivative(points[0], points[1], points[2], points[3], t); - } - return Vector3.zero; - } - - /// Calculates the derivative of the curve at time 't' - /// This is the vector tangent to the curve at that point - public static Vector3 EvaluateCurveDerivative(Vector3 a1, Vector3 c1, Vector3 c2, Vector3 a2, float t) - { - t = t < 0f ? 0f : t > 1f ? 1f : t; - - float s1 = 3 * (1 - t) * (1 - t); - float s2 = 6 * (1 - t) * t; - float s3 = 3 * t * t; - - float x = s1 * (c1.x - a1.x) + s2 * (c2.x - c1.x) + s3 * (a2.x - c2.x); - float y = s1 * (c1.y - a1.y) + s2 * (c2.y - c1.y) + s3 * (a2.y - c2.y); - float z = s1 * (c1.z - a1.z) + s2 * (c2.z - c1.z) + s3 * (a2.z - c2.z); - - return new Vector3( x, y, z ); - } - - /// Returns the second derivative of the curve at time 't' - public static Vector3 EvaluateCurveSecondDerivative(Vector3[] points, float t) - { - Debug.Assert(points.Length == 4, "Incorrect number of points supplied to cubic bezier function (expected 4)."); - if (points.Length >= 4) - { - return EvaluateCurveSecondDerivative(points[0], points[1], points[2], points[3], t); - } - return Vector3.zero; - } - - ///Returns the second derivative of the curve at time 't' - public static Vector3 EvaluateCurveSecondDerivative(Vector3 a1, Vector3 c1, Vector3 c2, Vector3 a2, float t) - { - t = t < 0f ? 0f : t > 1f ? 1f : t; - - float s1 = 6 * (1 - t); - float s2 = 6 * t; - - float x = s1 * (c2.x - 2 * c1.x + a1.x) + s2 * (a2.x - 2 * c2.x + c1.x); - float y = s1 * (c2.y - 2 * c1.y + a1.y) + s2 * (a2.y - 2 * c2.y + c1.y); - float z = s1 * (c2.z - 2 * c1.z + a1.z) + s2 * (a2.z - 2 * c2.z + c1.z); - - return new Vector3( x, y, z ); - } - - - /// Calculates the normal vector (vector perpendicular to the curve) at specified time - public static Vector3 Normal(Vector3[] points, float t) - { - Debug.Assert(points.Length == 4, "Incorrect number of points supplied to cubic bezier function (expected 4)."); - if (points.Length >= 4) - { - return Normal(points[0], points[1], points[2], points[3], t); - } - return Vector3.zero; - } - - /// Calculates the normal vector (vector perpendicular to the curve) at specified time - public static Vector3 Normal(Vector3 a1, Vector3 c1, Vector3 c2, Vector3 a2, float t) - { - Vector3 tangent = EvaluateCurveDerivative(a1, c1, c2, a2, t); - Vector3 nextTangent = EvaluateCurveSecondDerivative(a1, c1, c2, a2, t); - Vector3 c = Vector3.Cross(nextTangent, tangent); - return Vector3.Cross(c, tangent).normalized; - } - - public static Bounds CalculateBounds(Vector3[] points) - { - Debug.Assert(points.Length == 4, "Incorrect number of points supplied to cubic bezier function (expected 4)"); - MinMax3D minMax = new MinMax3D(); - if (points.Length >= 4) - { - minMax.AddValue(points[0]); - minMax.AddValue(points[3]); - - List extremePointTimes = ExtremePointTimes(points[0], points[1], points[2], points[3]); - foreach (float t in extremePointTimes) - { - minMax.AddValue(CubicBezierUtility.EvaluateCurve(points, t)); - } - } - - return new Bounds((minMax.Min + minMax.Max) / 2, minMax.Max - minMax.Min); - } - - /// Splits curve into two curves at time t. Returns 2 arrays of 4 points. - public static Vector3[][] SplitCurve(Vector3[] points, float t) - { - Vector3 a1 = Vector3.Lerp(points[0], points[1], t); - Vector3 a2 = Vector3.Lerp(points[1], points[2], t); - Vector3 a3 = Vector3.Lerp(points[2], points[3], t); - Vector3 b1 = Vector3.Lerp(a1, a2, t); - Vector3 b2 = Vector3.Lerp(a2, a3, t); - Vector3 pointOnCurve = Vector3.Lerp(b1, b2, t); - - return new Vector3[][] { - new Vector3[] { points[0], a1, b1, pointOnCurve }, - new Vector3[] { pointOnCurve, b2, a3, points[3] } - }; - } - - // Crude, but fast estimation of curve length. - public static float EstimateCurveLength(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3) - { - float controlNetLength = (p0 - p1).magnitude + (p1 - p2).magnitude + (p2 - p3).magnitude; - float estimatedCurveLength = (p0 - p3).magnitude + controlNetLength / 2f; - return estimatedCurveLength; - } - - /// Times of stationary points on curve (points where derivative is zero on any axis) - public static List ExtremePointTimes(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3) - { - // coefficients of derivative function - Vector3 a = 3 * (-p0 + 3 * p1 - 3 * p2 + p3); - Vector3 b = 6 * (p0 - 2 * p1 + p2); - Vector3 c = 3 * (p1 - p0); - - List times = new List(); - times.AddRange(StationaryPointTimes(a.x, b.x, c.x)); - times.AddRange(StationaryPointTimes(a.y, b.y, c.y)); - times.AddRange(StationaryPointTimes(a.z, b.z, c.z)); - return times; - } - - - // Finds times of stationary points on curve defined by ax^2 + bx + c. - // Only times between 0 and 1 are considered as Bezier only uses values in that range - static IEnumerable StationaryPointTimes(float a, float b, float c) - { - List times = new List(); - - // from quadratic equation: y = [-b +- sqrt(b^2 - 4ac)]/2a - if (a != 0) - { - float discriminant = b * b - 4 * a * c; - if (discriminant >= 0) - { - float s = Mathf.Sqrt(discriminant); - float t1 = (-b + s) / (2 * a); - if (t1 >= 0 && t1 <= 1) - { - times.Add(t1); - } - - if (discriminant != 0) - { - float t2 = (-b - s) / (2 * a); - - if (t2 >= 0 && t2 <= 1) - { - times.Add(t2); - } - } - } - } - return times; - } - - } -}