From 78e34bdb4046558cfb1a918fd6b050f60321cbb4 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Wed, 14 Apr 2021 15:28:02 +0100 Subject: [PATCH 001/769] Update to Unity 2019.4.24f1 and associated package updates --- Packages/manifest.json | 8 ++++---- Packages/packages-lock.json | 15 ++++++++++----- ProjectSettings/ProjectVersion.txt | 4 ++-- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Packages/manifest.json b/Packages/manifest.json index becebff7eb..5f36eb190b 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -6,12 +6,12 @@ "com.unity.formats.usd": "1.0.3-preview.2", "com.unity.ide.rider": "1.1.4", "com.unity.ide.vscode": "1.2.3", - "com.unity.multiplayer-hlapi": "1.0.6", + "com.unity.multiplayer-hlapi": "1.0.8", "com.unity.performance.profile-analyzer": "0.6.0-preview.1", "com.unity.quicksearch": "1.4.1", - "com.unity.test-framework": "1.1.20", - "com.unity.textmeshpro": "2.0.1", - "com.unity.timeline": "1.2.6", + "com.unity.test-framework": "1.1.24", + "com.unity.textmeshpro": "2.1.4", + "com.unity.timeline": "1.2.18", "com.unity.ugui": "1.0.0", "com.unity.xr.oculus.android": "2.38.6", "com.unity.xr.oculus.standalone": "2.38.4", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 3713a9c311..f41e847da2 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -52,7 +52,7 @@ "url": "https://packages.unity.com" }, "com.unity.multiplayer-hlapi": { - "version": "1.0.6", + "version": "1.0.8", "depth": 0, "source": "registry", "dependencies": { @@ -75,7 +75,7 @@ "url": "https://packages.unity.com" }, "com.unity.test-framework": { - "version": "1.1.20", + "version": "1.1.24", "depth": 0, "source": "registry", "dependencies": { @@ -86,7 +86,7 @@ "url": "https://packages.unity.com" }, "com.unity.textmeshpro": { - "version": "2.0.1", + "version": "2.1.4", "depth": 0, "source": "registry", "dependencies": { @@ -95,10 +95,15 @@ "url": "https://packages.unity.com" }, "com.unity.timeline": { - "version": "1.2.6", + "version": "1.2.18", "depth": 0, "source": "registry", - "dependencies": {}, + "dependencies": { + "com.unity.modules.director": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0" + }, "url": "https://packages.unity.com" }, "com.unity.ugui": { diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index d8ee6b5ae0..1aeef8d90d 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2019.4.18f1 -m_EditorVersionWithRevision: 2019.4.18f1 (3310a4d4f880) +m_EditorVersion: 2019.4.24f1 +m_EditorVersionWithRevision: 2019.4.24f1 (5da6f0345e82) From 0882bd04395da875b5935c98d93f72d272b1959d Mon Sep 17 00:00:00 2001 From: Mike Miller Date: Fri, 9 Apr 2021 14:49:45 +0300 Subject: [PATCH 002/769] Switch to Unity 2019.4.24 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08155dff9e..cf5e52b4c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,12 +11,12 @@ on: # yamllint disable-line rule:truthy - "v*" env: - UNITY_VERSION: "2019.4.18f1" + UNITY_VERSION: "2019.4.24f1" UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} # If UNITY_SERIAL is not set, then use a hardcoded license. Otherwise, don't set this, so the game-ci actions will use EMAIL/PASS/SERIAL - UNITY_LICENSE: ${{ fromJSON('["\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \nEQ57QnLpZQy5Ft2KgPCV+PcFuPg=z+iLsAtgjx6jf0J41On79ErzFJdljmwNPvvBUEMpsdzf4E6GjFZIzpUfn1BA5livZmnmWTI3eF1V\nJ+0aIjkVfAIo0M8yhKcM1vj4+mUMhO7xZh3ipDtlnakdATvWrOBBFWLQO4rYADdkfvmIG1uLaadq\nGiTsxaXA/Vap2ffI+ECeUqtBdIwHLON4vEL6p1VKyUfbtAoafxnr9d1+kQaH0TAe60/J1Z8D6kmP\n5M/iCoWQaFq+Zo+0ACiXQikPt17lIhlwX0be+FuSa0WOwOBSnJyuzy+cpsd4ZQi724rQKbNtOx7M\nxq+FlamO+TPP26L6zIes+zfHCa/WD1+d9r1kuQ==", null]')[secrets.UNITY_SERIAL != null] }} + UNITY_LICENSE: ${{ fromJSON('["\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \nGYC1YpQHTB2q5CllgJhlpihJuAk=WE8iCxEU2CEWYaVo4EiFJzCmftuq994dQk7wPenZcQ0VZhJ7eXYLkxbJSXGCPbYv+Bphz0T0mhEy\nq2fV05Yfp1xiKryawbiA7kk7wIY6qTo35Oex+jEg5DX1V2Rf3uUeXfareHagnHTt43+slTCN1gNd\nbPHZhHetWWYBECMCkt95ISJg8R2eIxT2MeeHoey2Xr4+Y0MEJE57cmj2hYcd1rg5S6sbnovBlav4\nS5GdvS8ZufejTvuYrvhLMA+BBnJ2g1elqMaYJZu5nV1J2cTI/Xaipvp265CM5lykzRVrQAHxz5zt\n9M6hFRxnhRGamyTPOtxcCwG9Cl4xYKS1TyhEww==", null]')[secrets.UNITY_SERIAL != null] }} jobs: configuration: From f11d33100c37a8cffb90fb92ce2d4815e179ae61 Mon Sep 17 00:00:00 2001 From: Mike Miller Date: Wed, 14 Apr 2021 17:53:46 +0300 Subject: [PATCH 003/769] Download textmeshpro 2.1.4 instead of 2.0.1 (new unity) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf5e52b4c8..3d24b50f37 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -171,7 +171,7 @@ jobs: # version 2.0.1; must be updated if the version changes # This replaces the GUI's "Window -> TextMesh Pro -> Import TMP Essential Resources". I don't know why Unity makes this sort of thing so hard! mkdir tmp.plugin - wget -q https://download.packages.unity.com/com.unity.textmeshpro/-/com.unity.textmeshpro-2.0.1.tgz -O tmp.plugin/plugin.tgz + wget -q https://download.packages.unity.com/com.unity.textmeshpro/-/com.unity.textmeshpro-2.1.4.tgz -O tmp.plugin/plugin.tgz tar -C tmp.plugin -xzf tmp.plugin/plugin.tgz mkdir tmp.package tar -C tmp.package -xzf 'tmp.plugin/package/Package Resources/TMP Essential Resources.unitypackage' From 2278757ec4867e16ff224fd08b3557a7e6d28de0 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Fri, 16 Apr 2021 15:34:03 +0100 Subject: [PATCH 004/769] TMPro version in build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d24b50f37..59a8cec2a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -168,7 +168,7 @@ jobs: - name: Install TextMesh Pro package run: | - # version 2.0.1; must be updated if the version changes + # version 2.1.4; must be updated if the version changes # This replaces the GUI's "Window -> TextMesh Pro -> Import TMP Essential Resources". I don't know why Unity makes this sort of thing so hard! mkdir tmp.plugin wget -q https://download.packages.unity.com/com.unity.textmeshpro/-/com.unity.textmeshpro-2.1.4.tgz -O tmp.plugin/plugin.tgz From d8760bf7d54b5bcf99d4ee1882263e017162070f Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Tue, 20 Apr 2021 10:12:28 +0100 Subject: [PATCH 005/769] Reapply the changes from the previous branch --- Assets/API Examples.meta | 8 + Assets/API Examples/JSON to Stroke.html | 14 + Assets/API Examples/JSON to Stroke.html.meta | 7 + Assets/API Examples/SVG Path.html | 14 + Assets/API Examples/SVG Path.html.meta | 7 + Assets/Scripts/App.cs | 11 +- Assets/Scripts/AppApiHandler.cs | 281 ++++++ Assets/Scripts/AppApiHandler.cs.meta | 3 + Assets/Scripts/TextToStrokes.meta | 8 + Assets/Scripts/TextToStrokes/CHRFont.cs | 72 ++ Assets/Scripts/TextToStrokes/CHRFont.cs.meta | 11 + Assets/Scripts/TextToStrokes/Editor.meta | 3 + .../TextToStrokes/Editor/CHRImporter.cs | 15 + .../TextToStrokes/Editor/CHRImporter.cs.meta | 11 + Assets/Scripts/TextToStrokes/Resources.meta | 8 + .../TextToStrokes/Resources/arcade.chr | 95 ++ .../TextToStrokes/Resources/arcade.chr.meta | 10 + Assets/Scripts/TextToStrokes/TextToStrokes.cs | 45 + .../TextToStrokes/TextToStrokes.cs.meta | 11 + Assets/ThirdParty/SVGMeshUnity.meta | 8 + Assets/ThirdParty/SVGMeshUnity/LICENCE | 7 + Assets/ThirdParty/SVGMeshUnity/LICENCE.meta | 7 + Assets/ThirdParty/SVGMeshUnity/README.md | 285 ++++++ Assets/ThirdParty/SVGMeshUnity/README.md.meta | 7 + Assets/ThirdParty/SVGMeshUnity/Runtime.meta | 8 + .../SVGMeshUnity/Runtime/Internals.meta | 3 + .../Runtime/Internals/BezierToPolyline.cs | 251 +++++ .../Internals/BezierToPolyline.cs.meta | 3 + .../Runtime/Internals/BezierToVertex.cs | 262 ++++++ .../Runtime/Internals/BezierToVertex.cs.meta | 3 + .../SVGMeshUnity/Runtime/Internals/Cdt2d.meta | 3 + .../Runtime/Internals/Cdt2d/BinarySearch.cs | 232 +++++ .../Internals/Cdt2d/BinarySearch.cs.meta | 3 + .../Runtime/Internals/Cdt2d/DelaunayRefine.cs | 154 +++ .../Internals/Cdt2d/DelaunayRefine.cs.meta | 3 + .../Runtime/Internals/Cdt2d/Filter.cs | 337 +++++++ .../Runtime/Internals/Cdt2d/Filter.cs.meta | 3 + .../Internals/Cdt2d/MonotoneTriangulation.cs | 380 ++++++++ .../Cdt2d/MonotoneTriangulation.cs.meta | 3 + .../Runtime/Internals/Cdt2d/Robust.cs | 882 ++++++++++++++++++ .../Runtime/Internals/Cdt2d/Robust.cs.meta | 3 + .../Runtime/Internals/Cdt2d/Triangles.cs | 185 ++++ .../Runtime/Internals/Cdt2d/Triangles.cs.meta | 3 + .../Runtime/Internals/Cdt2d/Triangulation.cs | 72 ++ .../Internals/Cdt2d/Triangulation.cs.meta | 3 + .../SVGMeshUnity/Runtime/Internals/Curve.cs | 12 + .../Runtime/Internals/Curve.cs.meta | 3 + .../SVGMeshUnity/Runtime/Internals/Int2.cs | 23 + .../Runtime/Internals/Int2.cs.meta | 3 + .../SVGMeshUnity/Runtime/Internals/Int3.cs | 31 + .../Runtime/Internals/Int3.cs.meta | 3 + .../Runtime/Internals/MeshData.cs | 126 +++ .../Runtime/Internals/MeshData.cs.meta | 3 + .../SVGMeshUnity/Runtime/Internals/Sort.cs | 49 + .../Runtime/Internals/Sort.cs.meta | 3 + .../Runtime/Internals/WorkBuffer.cs | 166 ++++ .../Runtime/Internals/WorkBuffer.cs.meta | 3 + .../Runtime/Internals/WorkBufferPool.cs | 46 + .../Runtime/Internals/WorkBufferPool.cs.meta | 3 + .../SVGMeshUnity/Runtime/SVGData.cs | 586 ++++++++++++ .../SVGMeshUnity/Runtime/SVGData.cs.meta | 11 + .../SVGMeshUnity/Runtime/SVGMesh.cs | 66 ++ .../SVGMeshUnity/Runtime/SVGMesh.cs.meta | 3 + .../Runtime/SVGMeshUnity.Runtime.asmdef | 3 + .../Runtime/SVGMeshUnity.Runtime.asmdef.meta | 7 + .../SVGMeshUnity/Runtime/SVGPolyline.cs | 33 + .../SVGMeshUnity/Runtime/SVGPolyline.cs.meta | 3 + Assets/ThirdParty/SVGMeshUnity/url.txt | 1 + Assets/ThirdParty/SVGMeshUnity/url.txt.meta | 7 + 69 files changed, 4936 insertions(+), 2 deletions(-) create mode 100644 Assets/API Examples.meta create mode 100644 Assets/API Examples/JSON to Stroke.html create mode 100644 Assets/API Examples/JSON to Stroke.html.meta create mode 100644 Assets/API Examples/SVG Path.html create mode 100644 Assets/API Examples/SVG Path.html.meta create mode 100644 Assets/Scripts/AppApiHandler.cs create mode 100644 Assets/Scripts/AppApiHandler.cs.meta create mode 100644 Assets/Scripts/TextToStrokes.meta create mode 100644 Assets/Scripts/TextToStrokes/CHRFont.cs create mode 100644 Assets/Scripts/TextToStrokes/CHRFont.cs.meta create mode 100644 Assets/Scripts/TextToStrokes/Editor.meta create mode 100644 Assets/Scripts/TextToStrokes/Editor/CHRImporter.cs create mode 100644 Assets/Scripts/TextToStrokes/Editor/CHRImporter.cs.meta create mode 100644 Assets/Scripts/TextToStrokes/Resources.meta create mode 100644 Assets/Scripts/TextToStrokes/Resources/arcade.chr create mode 100644 Assets/Scripts/TextToStrokes/Resources/arcade.chr.meta create mode 100644 Assets/Scripts/TextToStrokes/TextToStrokes.cs create mode 100644 Assets/Scripts/TextToStrokes/TextToStrokes.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/LICENCE create mode 100644 Assets/ThirdParty/SVGMeshUnity/LICENCE.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/README.md create mode 100644 Assets/ThirdParty/SVGMeshUnity/README.md.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/BezierToPolyline.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/BezierToPolyline.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/BezierToVertex.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/BezierToVertex.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/BinarySearch.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/BinarySearch.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/DelaunayRefine.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/DelaunayRefine.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Filter.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Filter.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/MonotoneTriangulation.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/MonotoneTriangulation.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Robust.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Robust.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Triangles.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Triangles.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Triangulation.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Triangulation.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Curve.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Curve.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Int2.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Int2.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Int3.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Int3.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/MeshData.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/MeshData.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Sort.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Sort.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/WorkBuffer.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/WorkBuffer.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/WorkBufferPool.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/WorkBufferPool.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/SVGData.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/SVGData.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/SVGMesh.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/SVGMesh.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/SVGMeshUnity.Runtime.asmdef create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/SVGMeshUnity.Runtime.asmdef.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/SVGPolyline.cs create mode 100644 Assets/ThirdParty/SVGMeshUnity/Runtime/SVGPolyline.cs.meta create mode 100644 Assets/ThirdParty/SVGMeshUnity/url.txt create mode 100644 Assets/ThirdParty/SVGMeshUnity/url.txt.meta diff --git a/Assets/API Examples.meta b/Assets/API Examples.meta new file mode 100644 index 0000000000..236b7630a7 --- /dev/null +++ b/Assets/API Examples.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a1b682fb8865fa746a26d3dc9b52f4ee +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/API Examples/JSON to Stroke.html b/Assets/API Examples/JSON to Stroke.html new file mode 100644 index 0000000000..fef7a67a3f --- /dev/null +++ b/Assets/API Examples/JSON to Stroke.html @@ -0,0 +1,14 @@ + + + + + +
+
+ + +
+ + \ No newline at end of file diff --git a/Assets/API Examples/JSON to Stroke.html.meta b/Assets/API Examples/JSON to Stroke.html.meta new file mode 100644 index 0000000000..fe189fb005 --- /dev/null +++ b/Assets/API Examples/JSON to Stroke.html.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7d6858ede1a09a34e95e09ad3dc455d6 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/API Examples/SVG Path.html b/Assets/API Examples/SVG Path.html new file mode 100644 index 0000000000..12a6c851ed --- /dev/null +++ b/Assets/API Examples/SVG Path.html @@ -0,0 +1,14 @@ + + + + + +
+
+ + +
+ + \ No newline at end of file diff --git a/Assets/API Examples/SVG Path.html.meta b/Assets/API Examples/SVG Path.html.meta new file mode 100644 index 0000000000..99214cb37b --- /dev/null +++ b/Assets/API Examples/SVG Path.html.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f7f1057a8d946b94e920e785bf4d7ebb +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/App.cs b/Assets/Scripts/App.cs index 23d9377ddb..978677e077 100644 --- a/Assets/Scripts/App.cs +++ b/Assets/Scripts/App.cs @@ -36,7 +36,7 @@ [assembly: InternalsVisibleTo("Assembly-CSharp-Editor")] namespace TiltBrush { - public class App : MonoBehaviour + public partial class App : MonoBehaviour { // ------------------------------------------------------------ // Constants and types @@ -607,7 +607,11 @@ void Awake() { HttpServer.AddHttpHandler("/load", HttpLoadSketchCallback); } - +#if (UNITY_EDITOR || EXPERIMENTAL_ENABLED) + foreach (var urlPath in GetApiUrlPaths()) { + HttpServer.AddHttpHandler(urlPath, ApiCommandCallback); + } +#endif m_AutosaveRestoreFileExists = File.Exists(AutosaveRestoreFilePath()); m_GoogleUserSettings = new GoogleUserSettings(m_GoogleIdentity); @@ -1174,6 +1178,9 @@ void Update() // This should happen after SMS.ContinueDrawingFromMemory, so we're not loading and // continuing in one frame. HandleExternalTiltOpenRequest(); +#if (UNITY_EDITOR || EXPERIMENTAL_ENABLED) + HandleApiCommand(); +#endif break; case AppState.Reset: SketchControlsScript.m_Instance.UpdateControls(); diff --git a/Assets/Scripts/AppApiHandler.cs b/Assets/Scripts/AppApiHandler.cs new file mode 100644 index 0000000000..1ab16387ab --- /dev/null +++ b/Assets/Scripts/AppApiHandler.cs @@ -0,0 +1,281 @@ +#if (UNITY_EDITOR || EXPERIMENTAL_ENABLED) +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using Newtonsoft.Json; +using SVGMeshUnity; +using UnityEngine; + + +namespace TiltBrush +{ + public partial class App { + + private Queue m_RequestedCommandQueue = Queue.Synchronized(new Queue()); + + Vector3 stringToVec(string s) { + string[] temp = s.Split(','); + return new Vector3 (float.Parse(temp[0]), float.Parse(temp[1]), float.Parse(temp[2])); + } + + public string[] GetApiUrlPaths() { + return new[] + { + "/api/v1/draw", + "/api/v1/svgpath", + "/api/v1/brush", + "/api/v1/color", + "/api/v1/text", + "/api/v1/teleport", + "/api/v1/roll", + "/api/v1/pitch", + "/api/v1/yaw", + "/api/v1/turn", + }; + } + + string ApiCommandCallback(HttpListenerRequest request) { + + string[] urlParts = request.Url.Segments; + if (urlParts.Length!=4 || urlParts[1] != "api/" || urlParts[2] != "v1/") { + return null; // TODO Status codes + } + + KeyValuePair command; + string paramString = null; + + if (request.HasEntityBody) { + using (Stream body = request.InputStream) { + using (var reader = new StreamReader(body, request.ContentEncoding)) + { + var parts = Uri.UnescapeDataString(reader.ReadToEnd()).Split(new[] {'='}, 2); + paramString = parts[1].Replace("+", " "); + } + } + } + + if (string.IsNullOrEmpty(paramString)) { + if (request.Url.Query.Length > 1) { + paramString = Uri.UnescapeDataString(request.Url.Query.Substring(1)); + } + } + + if (!string.IsNullOrEmpty(paramString)) { + command = new KeyValuePair(urlParts[3].TrimEnd('/'), paramString); + m_RequestedCommandQueue.Enqueue(command); + return "OK"; + } + return null; // TODO Status codes + } + + private void HandleApiCommand() { + + KeyValuePair command; + try + { + command = (KeyValuePair) m_RequestedCommandQueue.Dequeue(); + } + catch (InvalidOperationException) + { + return; + } + + if (string.IsNullOrEmpty(command.Value)) return; + + switch (command.Key) + { + case "draw": + var jsonData = JsonConvert.DeserializeObject>>>(command.Value); + PathsToStrokes(jsonData); + break; + case "text": + var font = Resources.Load("arcade"); + var textToStroke = new TextToStrokes(font); + var polyline2d = textToStroke.Build(command.Value); + PathsToStrokes(polyline2d); + break; + case "svgpath": + SVGData svgData = new SVGData(); + svgData.Path(command.Value); + SVGPolyline svgPolyline = new SVGPolyline(); + svgPolyline.Fill(svgData); + PathsToStrokes(svgPolyline.Polyline, 0.01f, true); + break; + case "brush": + var brushId = command.Value; + BrushDescriptor brushDescriptor = null; + try + { + var guid = new Guid(brushId); + brushDescriptor = BrushCatalog.m_Instance.GetBrush(guid); + } + catch (FormatException e) + { + } + + if (brushDescriptor == null) + { + brushId = brushId.ToLower(); + brushDescriptor = BrushCatalog.m_Instance.AllBrushes.First(x => x.name.ToLower() == brushId); + } + + PointerManager.m_Instance.SetBrushForAllPointers(brushDescriptor); + break; + case "color": + Color color; + if (ColorUtility.TryParseHtmlString(command.Value, out color) || + ColorUtility.TryParseHtmlString($"#{command.Value}", out color)) + { + BrushColor.CurrentColor = color; + } + + break; + + case "teleport": + + TrTransform pose = Scene.Pose; + pose.translation -= stringToVec(command.Value); + float BoundsRadius = SceneSettings.m_Instance.HardBoundsRadiusMeters_SS; + pose = SketchControlsScript.MakeValidScenePose(pose, BoundsRadius); + App.Scene.Pose = pose; + break; + + case "yaw": + case "turn": + TurnBy(float.Parse(command.Value), Vector3.up); + break; + + case "pitch": + TurnBy(float.Parse(command.Value), Vector3.left); + break; + + case "roll": + TurnBy(float.Parse(command.Value), Vector3.forward); + break; + + case "lookdirection": + TrTransform lookPose = Scene.Pose; + var euler = stringToVec(command.Value); + Quaternion qNewRotation = Quaternion.Euler(euler.x, euler.y, euler.z); + lookPose.rotation = qNewRotation; + Scene.Pose = lookPose; + break; + } + } + + private void TurnBy(float angle, Vector3 axis) { + TrTransform lookPose = Scene.Pose; + Quaternion qOffsetRotation = Quaternion.AngleAxis(angle, axis); + Quaternion qNewRotation = qOffsetRotation * lookPose.rotation; + lookPose.rotation = qNewRotation; + Scene.Pose = lookPose; + } + + private static void PathsToStrokes(List>> floatPaths, float scale = 1f) + { + var paths = new List>(); + foreach (List> positionList in floatPaths) + { + var path = new List(); + foreach (List position in positionList) + { + path.Add(new Vector3(position[0], position[1], position[2])); + } + paths.Add(path); + } + PathsToStrokes(paths, scale); + } + + private static void PathsToStrokes(List> polyline2d, float scale = 1f, bool breakOnOrigin=false) + { + var paths = new List>(); + foreach (List positionList in polyline2d) + { + var path = new List(); + foreach (Vector2 position in positionList) + { + path.Add(new Vector3(position.x, position.y, 0)); + } + paths.Add(path); + } + PathsToStrokes(paths, scale, breakOnOrigin); + } + + private static void PathsToStrokes(List> paths, float scale = 1f, bool breakOnOrigin=false) + { + Vector3 pos = Vector3.zero; + var brush = PointerManager.m_Instance.MainPointer.CurrentBrush; + uint time = 0; + float minPressure = PointerManager.m_Instance.MainPointer.CurrentBrush.PressureSizeMin(false); + float pressure = Mathf.Lerp(minPressure, 1f, 0.5f); + + var strokes = new List(); + foreach (var path in paths) + { + if (path.Count < 2) continue; + float lineLength = 0; + var controlPoints = new List(); + for (var vertexIndex = 0; vertexIndex < path.Count - 1; vertexIndex++) + { + var coordList0 = path[vertexIndex]; + var vert = new Vector3(coordList0[0], coordList0[1], coordList0[2]) * scale; + var coordList1 = path[(vertexIndex + 1) % path.Count]; + // Fix for trailing zeros from SVG. + // TODO Find out why and fix it properly + if (breakOnOrigin && coordList1 == Vector3.zero) + { + break; + } + var nextVert = new Vector3(coordList1[0], coordList1[1], coordList1[2]) * scale; + for (float step = 0; step <= 1f; step += .25f) + { + controlPoints.Add(new PointerManager.ControlPoint + { + m_Pos = pos + vert + ((nextVert - vert) * step), + m_Orient = Quaternion.identity, //.LookRotation(face.Normal, Vector3.up), + m_Pressure = pressure, + m_TimestampMs = time++ + }); + } + + lineLength += (nextVert - vert).magnitude; // TODO Does this need scaling? Should be in Canvas space + } + + var stroke = new Stroke + { + m_Type = Stroke.Type.NotCreated, + m_IntendedCanvas = Scene.ActiveCanvas, + m_BrushGuid = brush.m_Guid, + m_BrushScale = 1f, + m_BrushSize = PointerManager.m_Instance.MainPointer.BrushSizeAbsolute, + m_Color = BrushColor.CurrentColor, + m_Seed = 0, + m_ControlPoints = controlPoints.ToArray(), + }; + stroke.m_ControlPointsToDrop = Enumerable.Repeat(false, stroke.m_ControlPoints.Length).ToArray(); + stroke.Uncreate(); + stroke.Recreate(null, Scene.ActiveCanvas); + + SketchMemoryScript.m_Instance.MemorizeBatchedBrushStroke( + stroke.m_BatchSubset, + stroke.m_Color, + stroke.m_BrushGuid, + stroke.m_BrushSize, + stroke.m_BrushScale, + stroke.m_ControlPoints.ToList(), + stroke.m_Flags, + WidgetManager.m_Instance.ActiveStencil, + lineLength, + 123 + ); + + strokes.Add(stroke); + } + } + + } +} +#endif \ No newline at end of file diff --git a/Assets/Scripts/AppApiHandler.cs.meta b/Assets/Scripts/AppApiHandler.cs.meta new file mode 100644 index 0000000000..0850061252 --- /dev/null +++ b/Assets/Scripts/AppApiHandler.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: dfe14ccbbdef412dab65bfab312387fc +timeCreated: 1618061743 \ No newline at end of file diff --git a/Assets/Scripts/TextToStrokes.meta b/Assets/Scripts/TextToStrokes.meta new file mode 100644 index 0000000000..461fed194c --- /dev/null +++ b/Assets/Scripts/TextToStrokes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cd6c324659a9280458f7de3db4d326cd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/TextToStrokes/CHRFont.cs b/Assets/Scripts/TextToStrokes/CHRFont.cs new file mode 100644 index 0000000000..a3b5bf1c69 --- /dev/null +++ b/Assets/Scripts/TextToStrokes/CHRFont.cs @@ -0,0 +1,72 @@ +using System.Collections.Generic; +using UnityEngine; + +public class CHRFont : ScriptableObject +{ + private Dictionary>> _outlines; + private Dictionary _widths; + public float Height; + public string DataRaw; + + public Dictionary>> Outlines + { + get { return _outlines; } + } + + public Dictionary Widths + { + get { return _widths; } + } + + private void OnEnable() + { + var fontDataLines = DataRaw.Split('\n'); + _outlines = new Dictionary>>(); + _widths = new Dictionary(); + + foreach (string line in fontDataLines) + { + if (line.Trim().Length<1) continue; + var item = line.Split(new []{';'}, 2); + var lineHeader = item[0]; + var lineHeaderData = lineHeader.Split(' '); + var asciiCode = int.Parse(lineHeaderData[0].Split('_')[1], System.Globalization.NumberStyles.HexNumber); + var width = float.Parse(lineHeaderData[1])/20f; + var lineData = item[1]; + if (lineData.Trim().Length < 1) continue; + var strokesStrings = lineData.Trim().Split(';'); + var strokes = new List>(); + foreach (var stroke in strokesStrings) + { + var pointsString = stroke.Trim().Split(' '); + if (pointsString.Length < 1) continue; + var points = new List(); + + foreach (var point in pointsString) + { + var coordsString = point.Trim().Split(','); + if (coordsString.Length < 1) continue; + float xCoord = float.Parse(coordsString[0]); + float yCoord = float.Parse(coordsString[1]); + var coord = new Vector2(xCoord/20f, yCoord/20f); + Height = Mathf.Max(Height, coord.y); + points.Add(coord); + } + + strokes.Add(points); + } + + _outlines[asciiCode] = strokes; + _widths[asciiCode] = width; + } + } +} + + + + + + + + + \ No newline at end of file diff --git a/Assets/Scripts/TextToStrokes/CHRFont.cs.meta b/Assets/Scripts/TextToStrokes/CHRFont.cs.meta new file mode 100644 index 0000000000..b02ca4ebe9 --- /dev/null +++ b/Assets/Scripts/TextToStrokes/CHRFont.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 12e7906e1981eb64a9193fce645fbcfd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/TextToStrokes/Editor.meta b/Assets/Scripts/TextToStrokes/Editor.meta new file mode 100644 index 0000000000..2c3d76cd29 --- /dev/null +++ b/Assets/Scripts/TextToStrokes/Editor.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f430c31349214d57b6b8c3bd50999ef5 +timeCreated: 1615121780 \ No newline at end of file diff --git a/Assets/Scripts/TextToStrokes/Editor/CHRImporter.cs b/Assets/Scripts/TextToStrokes/Editor/CHRImporter.cs new file mode 100644 index 0000000000..9142315521 --- /dev/null +++ b/Assets/Scripts/TextToStrokes/Editor/CHRImporter.cs @@ -0,0 +1,15 @@ +using System.IO; +using UnityEditor.Experimental.AssetImporters; + + +[ScriptedImporter(0, "chr")] +public class CHRImporter : ScriptedImporter +{ + public override void OnImportAsset(AssetImportContext ctx) + { + var font = new CHRFont(); + font.DataRaw = File.ReadAllText(ctx.assetPath); + ctx.AddObjectToAsset("font", font); + ctx.SetMainObject(font); + } +} \ No newline at end of file diff --git a/Assets/Scripts/TextToStrokes/Editor/CHRImporter.cs.meta b/Assets/Scripts/TextToStrokes/Editor/CHRImporter.cs.meta new file mode 100644 index 0000000000..d0e7097c4d --- /dev/null +++ b/Assets/Scripts/TextToStrokes/Editor/CHRImporter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 021db2b920a858941a14377221c79928 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/TextToStrokes/Resources.meta b/Assets/Scripts/TextToStrokes/Resources.meta new file mode 100644 index 0000000000..276bc9f8d1 --- /dev/null +++ b/Assets/Scripts/TextToStrokes/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 33c9f71cfc9cf454eaf4972f27abe499 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/TextToStrokes/Resources/arcade.chr b/Assets/Scripts/TextToStrokes/Resources/arcade.chr new file mode 100644 index 0000000000..21cca6b63d --- /dev/null +++ b/Assets/Scripts/TextToStrokes/Resources/arcade.chr @@ -0,0 +1,95 @@ +CHR_20 15; 3,0 +CHR_21 15; 9,18 9,3; 9,1.5 9,0 +CHR_22 15; 7.5,18 7.5,16.5 6,15; 12,18 12,16.5 10.5,15 +CHR_23 15; 3,12 15,12; 3,6 15,6; 6,18 6,0; 12,18 12,0 +CHR_24 15; 15,15 3,15 3,9 15,9 15,3 3,3; 3,9 15,9 +CHR_25 15; 15,18 3,0; 3,18 9,18 9,12 3,12 3,18; 9,6 15,6 15,0 9,0 9,6 +CHR_26 15; 3,0 +CHR_27 15; 7.5,18 7.5,16.5 6,15 +CHR_28 15; 9,18 3,12 3,6 9,0 +CHR_29 15; 3,18 9,12 9,6 3,0 +CHR_2A 15; 9,18 9,0; 3,9 15,9; 3,18 15,0; 15,18 3,0 +CHR_2B 15; 9,18 9,0; 3,9 15,9 +CHR_2C 15; 9,3 9,1.5 7.5,0 +CHR_2D 15; 3,9 15,9 +CHR_2E 15; 9,1.5 9,0 +CHR_2F 15; 3,0 15,18 +CHR_30 15; 3,18 15,18 15,0 3,0 3,18 +CHR_31 15; 9,18 9,0 +CHR_32 15; 3,18 15,18 15,9 3,9 3,0 15,0 +CHR_33 15; 3,18 15,18 15,0 3,0; 3,9 15,9 +CHR_34 15; 3,18 3,9 15,9; 15,18 15,0 +CHR_35 15; 15,18 3,18 3,9 15,9 15,0 3,0 +CHR_36 15; 3,18 3,0 15,0 15,9 3,9 +CHR_37 15; 3,18 15,18 15,0 +CHR_38 15; 3,18 15,18 15,0 3,0 3,18; 3,9 15,9 +CHR_39 15; 15,9 3,9 3,18 15,18 15,0 +CHR_3A 15; 9,12 9,10.5; 9,3 9,1.5 +CHR_3B 15; 9,12 9,10.5; 9,3 9,1.5 7.5,0 +CHR_3C 15; 15,18 3,9 15,0 +CHR_3D 15; 3,12 15,12; 3,6 15,6 +CHR_3E 15; 3,18 15,9 3,0 +CHR_3F 15; 3,18 15,18 15,9 9,9 9,3; 9,1.5 9,0 +CHR_40 15; 15,12 6,12 6,6 15,6 15,18 3,18 3,0 15,0 +CHR_41 15; 3,0 3,12 9,18 15,12 15,0; 3,6 15,6 +CHR_42 15; 3,0 3,18 12,18 15,15 15,12 12,9 3,9; 12,9 15,6 15,3 12,0 3,0 +CHR_43 15; 15,18 3,18 3,0 15,0 +CHR_44 15; 3,0 3,18 9,18 15,12 15,6 9,0 3,0 +CHR_45 15; 15,18 3,18 3,0, 15,0; 3,9 12,9 +CHR_46 15; 15,18 3,18 3,0; 3,9 12,9 +CHR_47 15; 15,18 3,18 3,0 15,0 15,9 9,9 +CHR_48 15; 3,18 3,0; 3,9 15,9; 15,18 15,0 +CHR_49 15; 9,18 9,0; 3,18 15,18; 3,0 15,0 +CHR_4A 15; 15,18, 15,0 9,0 3,6 +CHR_4B 15; 3,18 3,0; 3,9 15,18; 3,9 15,0 +CHR_4C 15; 3,18 3,0 15,0 +CHR_4D 15; 3,0 3,18 9,12 15,18 15,0 +CHR_4E 15; 3,0 3,18 15,0 15,18 +CHR_4F 15; 3,18 15,18 15,0 3,0 3,18 +CHR_50 15; 3,0 3,18 15,18 15,9 3,9 +CHR_51 15; 3,18 15,18 15,6 9,0 3,0 3,18; 9,6 15,0 +CHR_52 15; 3,0 3,18 15,18 15,9 3,9 15,0 +CHR_53 15; 15,18 3,18 3,9 15,9 15,0 3,0 +CHR_54 15; 3,18 15,18; 9,18 9,0 +CHR_55 15; 3,18 3,0 15,0 15,18 +CHR_56 15; 3,18 9,0 15,18 +CHR_57 15; 3,18 3,0 9,6 15,0 15,18 +CHR_58 15; 3,18 15,0; 15,18 3,0 +CHR_59 15; 3,18 9,9 15,18; 9,9 9,0 +CHR_5A 15; 3,18 15,18 3,0 15,0 +CHR_5B 15; 12,18 9,18 9,0 12,0 +CHR_5C 15; 3,18 15,0 +CHR_5D 15; 6,18 9,18 9,0 6,0 +CHR_5E 15; 6,15 9,18 12,15 +CHR_5F 15; 3,0 15,0 +CHR_60 12; 9,18 9,16.5 10.5,15 +CHR_61 15; 3,0 3,12 9,18 15,12 15,0; 3,6 15,6 +CHR_62 15; 3,0 3,18 12,18 15,15 15,12 12,9 3,9; 12,9 15,6 15,3 12,0 3,0 +CHR_63 15; 15,18 3,18 3,0 15,0 +CHR_64 15; 3,0 3,18 9,18 15,12 15,6 9,0 3,0 +CHR_65 15; 15,18 3,18 3,0, 15,0; 3,9 12,9 +CHR_66 15; 15,18 3,18 3,0; 3,9 12,9 +CHR_67 15; 15,18 3,18 3,0 15,0 15,9 9,9 +CHR_68 15; 3,18 3,0; 3,9 15,9; 15,18 15,0 +CHR_69 15; 9,18 9,0; 3,18 15,18; 3,0 15,0 +CHR_6A 15; 15,18, 15,0 9,0 3,6 +CHR_6B 15; 3,18 3,0; 3,9 15,18; 3,9 15,0 +CHR_6C 15; 3,18 3,0 15,0 +CHR_6D 15; 3,0 3,18 9,12 15,18 15,0 +CHR_6E 15; 3,0 3,18 15,0 15,18 +CHR_6F 15; 3,18 15,18 15,0 3,0 3,18 +CHR_70 15; 3,0 3,18 15,18 15,9 3,9 +CHR_71 15; 3,18 15,18 15,6 9,0 3,0 3,18; 9,6 15,0 +CHR_72 15; 3,0 3,18 15,18 15,9 3,9 15,0 +CHR_73 15; 15,18 3,18 3,9 15,9 15,0 3,0 +CHR_74 15; 3,18 15,18; 9,18 9,0 +CHR_75 15; 3,18 3,0 15,0 15,18 +CHR_76 15; 3,18 9,0 15,18 +CHR_77 15; 3,18 3,0 9,6 15,0 15,18 +CHR_78 15; 3,18 15,0; 15,18 3,0 +CHR_79 15; 3,18 9,9 15,18; 9,9 9,0 +CHR_7A 15; 3,18 15,18 3,0 15,0 +CHR_7B 15; 15,18 12,18 9,15 9,12 6,9 3,9; 6,9 9,6 9,3 12,0 15,0 +CHR_7C 15; 9,18 9,0 +CHR_7D 15; 3,18 6,18 9,15 9,12 12,9 15,9; 12,9 9,6 9,3 6,0 3,0 +CHR_7E 15; 3,9 6,12 12,9 15,12 diff --git a/Assets/Scripts/TextToStrokes/Resources/arcade.chr.meta b/Assets/Scripts/TextToStrokes/Resources/arcade.chr.meta new file mode 100644 index 0000000000..3e255da2c5 --- /dev/null +++ b/Assets/Scripts/TextToStrokes/Resources/arcade.chr.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 838b975d887e30c45941f98884858bbe +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 021db2b920a858941a14377221c79928, type: 3} diff --git a/Assets/Scripts/TextToStrokes/TextToStrokes.cs b/Assets/Scripts/TextToStrokes/TextToStrokes.cs new file mode 100644 index 0000000000..e743169821 --- /dev/null +++ b/Assets/Scripts/TextToStrokes/TextToStrokes.cs @@ -0,0 +1,45 @@ +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace TiltBrush +{ + + public class TextToStrokes + { + private CHRFont _font; + + public TextToStrokes(CHRFont font) + { + _font = font; + } + + public List> Build(string text) + { + var shape = new List>(); + Vector2 offset = Vector2.zero; + foreach (var character in text) + { + if (character == '\n') { + offset.y -= (_font.Height * 1.1f); + offset.x = 0; + continue; + } + if (character < _font.Outlines.Count) + { + List> letter = _font.Outlines[character]; + // Offset letter outline by the current total offset + shape.AddRange( + letter.Select( + path => path.Select( + point=>new Vector3(point.x + offset.x, point.y + offset.y, 0) + ).ToList() + ).ToList() + ); + offset.x += _font.Widths[character]; + } + } + return shape; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/TextToStrokes/TextToStrokes.cs.meta b/Assets/Scripts/TextToStrokes/TextToStrokes.cs.meta new file mode 100644 index 0000000000..38cee6b011 --- /dev/null +++ b/Assets/Scripts/TextToStrokes/TextToStrokes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 034eb910501cc0448b15822e3186cf6d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/SVGMeshUnity.meta b/Assets/ThirdParty/SVGMeshUnity.meta new file mode 100644 index 0000000000..5ab5db6f12 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f80eee569e096b740ad82fac35547cfc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/SVGMeshUnity/LICENCE b/Assets/ThirdParty/SVGMeshUnity/LICENCE new file mode 100644 index 0000000000..167ba466b0 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/LICENCE @@ -0,0 +1,7 @@ +Copyright 2021 Yoshihiro Shindo + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/LICENCE.meta b/Assets/ThirdParty/SVGMeshUnity/LICENCE.meta new file mode 100644 index 0000000000..535f256685 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/LICENCE.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 318032fb4285581499ddc65df6bad548 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/SVGMeshUnity/README.md b/Assets/ThirdParty/SVGMeshUnity/README.md new file mode 100644 index 0000000000..a480e72356 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/README.md @@ -0,0 +1,285 @@ +# SVGMeshUnity + +typo + +Generates mesh from [SVG path](https://github.com/beinteractive/SVGMeshUnity/blob/de472c2f716329e2991f75fcab9bd7253cc8ff12/Assets/Samples/Scripts/Simple.cs#L8-L14) in realtime for Unity. + +This is a port of https://github.com/mattdesl/svg-mesh-3d + +## Install + +Copy `Assets/SVGMeshUnity` directory to your Assets directory. + +Add a `SVGMesh` component to a GameObject that has `MeshFilter` and `MeshRenderer`. + +inspector + +## Usage + +### Create mesh from SVG path + +twitter twtitter-wire + +```C# +var mesh = GetComponent(); +var svg = new SVGData(); +svg.Path("M17.316,6.246c0.008,0.162,0.011,... and so on"); +mesh.Fill(svg); +``` + +Simply create an instance of `SVGData` and set SVG path data string by calling `SVGData.Path()`. +Then call `Mesh.Fill()`, a mesh will be generated. + +### Create mesh from code + +Instead of use SVG path data, you can directly make path data in your code. + + + +```C# +void Update() +{ + SVG.Clear(); + + var resolution = 5; + var radius = 3f; + + SVG.Move(NoisedR(radius, 0), 0f); + + for (var i = 0; i < resolution; ++i) + { + var i0 = i; + var i1 = (i + 1) % resolution; + + var angle0 = Mathf.PI * 2f * ((float) i0 / resolution); + var angle1 = Mathf.PI * 2f * ((float) i1 / resolution); + + var r0 = NoisedR(radius, i0); + var r1 = NoisedR(radius, i1); + var x0 = Mathf.Cos(angle0) * r0; + var y0 = Mathf.Sin(angle0) * r0; + var x1 = Mathf.Cos(angle1) * r1; + var y1 = Mathf.Sin(angle1) * r1; + + var cx = x0 + (x1 - x0) * 0.5f; + var cy = y0 + (y1 - y0) * 0.5f; + var ca = Mathf.Atan2(cy, cx); + var cr = 0.3f + (Mathf.PerlinNoise(Time.time, i * -100f) - 0.5f) * 1.15f; + cx += Mathf.Cos(ca) * cr; + cy += Mathf.Sin(ca) * cr; + + SVG.Curve(cx, cy, cx, cy, x1, y1); + } + + Mesh.Fill(SVG); +} + +private float NoisedR(float r, float randomize) +{ + return r + (Mathf.PerlinNoise(Time.time, randomize * 10f) - 0.5f) * 0.5f; +} +``` + + + +```C# +public class Move : MonoBehaviour +{ + [SerializeField] private float R = 0.5f; + [SerializeField] private float IntervalRate = 1f; + + [SerializeField] private SVGMesh HeadMesh; + [SerializeField] private SVGMesh TailMesh; + [SerializeField] private SVGMesh BodyMesh; + + private SVGData HeadSVG; + private SVGData TailSVG; + private SVGData BodySVG; + + private Vector2 Head; + private Vector2 Tail; + + private Vector2 To; + + private float HeadR; + private float TailR; + + private float Interval; + private float FollowTime; + + void Start() + { + HeadSVG = new SVGData(); + TailSVG = new SVGData(); + BodySVG = new SVGData(); + + Head = RandomField(); + Tail = Head; + } + + void Update() + { + HeadSVG.Clear(); + TailSVG.Clear(); + BodySVG.Clear(); + + Update(Time.deltaTime); + + var v = Mathf.Max(0.7f, 1.3f - Mathf.Clamp01((Head - Tail).magnitude / 3f)); + + Circle(HeadSVG, Head, HeadR); + Circle(TailSVG, Tail, TailR); + Metaball(BodySVG, Head, HeadR, Tail, TailR, v); + + HeadMesh.Fill(HeadSVG); + TailMesh.Fill(TailSVG); + BodyMesh.Fill(BodySVG); + } + + private void Update(float dt) + { + Interval -= dt; + FollowTime -= dt; + + if (Interval <= 0f) + { + To = RandomField(); + To = Head + Vector2.ClampMagnitude(To - Head, 2f); + HeadR = R * 0.15f; + TailR = R; + Interval = Random.Range(1.5f, 2.6f) * IntervalRate; + FollowTime = Random.Range(0.15f, 0.25f); + } + + Head = Vector2.Lerp(To, Head, Mathf.Exp(-5f * dt)); + + if (FollowTime <= 0f) + { + Tail = Vector2.Lerp(Head, Tail, Mathf.Exp(-5f * dt)); + + if (FollowTime <= -0.4f) + { + TailR = Mathf.Lerp(R, TailR, Mathf.Exp(-4f * dt)); + } + else + { + TailR = Mathf.Lerp(R * 0.05f, TailR, Mathf.Exp(-6f * dt)); + } + + HeadR = Mathf.Lerp(R, HeadR, Mathf.Exp(-3f * dt)); + } + } + + private Vector2 RandomField() + { + return new Vector2(Random.Range(-4f, 4f), Random.Range(-4f, 4f)); + } + + private void Circle(SVGData svg, Vector2 c, float r) + { + for (var i = 0; i < 4; ++i) + { + var angle0 = Mathf.PI * 0.5f * (i + 0); + var angle1 = Mathf.PI * 0.5f * (i + 1); + + var x0 = c.x + Mathf.Cos(angle0) * r; + var y0 = c.y - Mathf.Sin(angle0) * r; + var x1 = c.x + Mathf.Cos(angle1) * r; + var y1 = c.y - Mathf.Sin(angle1) * r; + + var a = r * (4f / 3f) * Mathf.Tan((angle1 - angle0) / 4f); + var inAngle = angle0 + Mathf.PI * 0.5f; + var inX = x0 + Mathf.Cos(inAngle) * a; + var inY = y0 - Mathf.Sin(inAngle) * a; + var outAngle = angle1 - Mathf.PI * 0.5f; + var outX = x1 + Mathf.Cos(outAngle) * a; + var outY = y1 - Mathf.Sin(outAngle) * a; + + if (i == 0) + { + svg.Move(x0, y0); + } + + svg.Curve(inX, inY, outX, outY, x1, y1); + } + } + + // http://shspage.com/aijs/ + + private void Metaball(SVGData svg, Vector2 c1, float r1, Vector2 c2, float r2, float v) + { + if (r1 == 0f || r2 == 0f) + { + return; + } + + var pi2 = Mathf.PI / 2f; + + var d = (c2 - c1).magnitude; + + var u1 = 0f; + var u2 = 0f; + if (d <= Mathf.Abs(r1 - r2)) + { + return; + } + else if (d < r1 + r2) + { + // case circles are overlapping + u1 = Mathf.Acos((r1 * r1 + d * d - r2 * r2) / (2 * r1 * d)); + u2 = Mathf.Acos((r2 * r2 + d * d - r1 * r1) / (2 * r2 * d)); + } + + var t1 = Mathf.Atan2(c2.y - c1.y, c2.x - c1.x); + var t2 = Mathf.Acos((r1 - r2) / d); + + var t1a = t1 + u1 + (t2 - u1) * v; + var t1b = t1 - u1 - (t2 - u1) * v; + var t2a = t1 + Mathf.PI - u2 - (Mathf.PI - u2 - t2) * v; + var t2b = t1 - Mathf.PI + u2 + (Mathf.PI - u2 - t2) * v; + + var p1a = PointOnCircle(c1, t1a, r1); + var p1b = PointOnCircle(c1, t1b, r1); + var p2a = PointOnCircle(c2, t2a, r2); + var p2b = PointOnCircle(c2, t2b, r2); + + // define handle length by the distance between both ends of the curve to draw + var handle_len_rate = 2; + var d2 = Mathf.Min(v * handle_len_rate, (p2a - p1a).magnitude / (r1 + r2)); + d2 *= Mathf.Min(1, d * 2 / (r1 + r2)); // case circles are overlapping + r1 *= d2; + r2 *= d2; + + svg.Move(p1a); + svg.Curve(PointOnCircle(p1a, t1a - pi2, r1), PointOnCircle(p2a, t2a + pi2, r2), p2a); + svg.Line(p2b); + svg.Curve(PointOnCircle(p2b, t2b - pi2, r2), PointOnCircle(p1b, t1b + pi2, r1), p1b); + svg.Line(p1a); + } + + private Vector2 PointOnCircle(Vector2 c, float angle, float r) + { + return c + new Vector2(Mathf.Cos(angle), Mathf.Sin(angle)) * r; + } +} +``` + +Use `SVGData.Move`, `SVGData.Line`, `SVGData.Curve`, ... and so on. Create realtime path as you like. + +### Options + +The following options are provided in SVGMesh component. + +- `Delaunay` (default `false`) + - whether to use Delaunay triangulation + - Delaunay triangulation is slower, but looks better +- `Scale` (default `1`) + - a positive number, the scale at which to [approximate the curves](https://github.com/mattdesl/adaptive-bezier-curve) from the SVG paths + - higher number leads to smoother corners, but slower triangulation +- `Interior` if set, only return interior faces. See note. (Default `true`) +- `Exterior` if set, only return exterior faces. See note. (Default `false`) +- `Infinity` if set, then the triangulation is augmented with a [point at infinity](https://en.wikipedia.org/wiki/Point_at_infinity) represented by the index `-1`. (Default `false`) + +## License + +MIT diff --git a/Assets/ThirdParty/SVGMeshUnity/README.md.meta b/Assets/ThirdParty/SVGMeshUnity/README.md.meta new file mode 100644 index 0000000000..31c39a75bd --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2635b83fe8015e2469862a7d0d02f99c +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime.meta new file mode 100644 index 0000000000..bb5b9e4800 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 94fbdbadf09ef49a29dd40de42e1631f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals.meta new file mode 100644 index 0000000000..fb2aee00a3 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5591c3a24384418190c7d9686b4f915b +timeCreated: 1519625297 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/BezierToPolyline.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/BezierToPolyline.cs new file mode 100644 index 0000000000..4a252499f9 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/BezierToPolyline.cs @@ -0,0 +1,251 @@ +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace SVGMeshUnity.Internals +{ + public class BezierToPolyline + { + // https://github.com/mattdesl/svg-path-contours + + public float Scale = 1f; + public float PathDistanceEpsilon = 1f; + public int RecursionLimit = 8; + public float FLTEpsilon = 1.19209290e-7f; + public float AngleEpsilon = 0.01f; + public float AngleTolerance = 0f; + public float CuspLimit = 0f; + public WorkBufferPool WorkBufferPool; + + private WorkBuffer WorkVertices; + + public void GetContours(SVGData svg, List> data) + { + WorkBufferPool.Get(ref WorkVertices); + + var pen = Vector2.zero; + + var curves = svg.Curves; + var l = curves.Count; + for (var i = 0; i < l; ++i) + { + var curve = curves[i]; + if (curve.IsMove) + { + EmitWorkVerticesIfNeeded(data); + } + else + { + FillBezier(pen, curve.InControl, curve.OutControl, curve.Position); + } + pen = curve.Position; + } + + EmitWorkVerticesIfNeeded(data); + WorkBufferPool.Release(ref WorkVertices); + } + + private void EmitWorkVerticesIfNeeded(List> data) + { + if (WorkVertices.UsedSize == 0) return; + // TODO: Simplify + data.Add(WorkVertices.Data.ToList()); + WorkVertices.Clear(); + } + + ////// Based on: + ////// https://github.com/pelson/antigrain/blob/master/agg-2.4/src/agg_curves.cpp + + private void FillBezier(Vector2 start, Vector2 c1, Vector2 c2, Vector2 end) + { + var distanceTolerance = PathDistanceEpsilon / Scale; + distanceTolerance *= distanceTolerance; + BeginFillBezier(start, c1, c2, end, distanceTolerance); + } + + private void BeginFillBezier(Vector2 start, Vector2 c1, Vector2 c2, Vector2 end, float distanceTolerance) + { + WorkVertices.Push(ref start); + RecursiveFillBezier(start, c1, c2, end, distanceTolerance, 0); + WorkVertices.Push(ref end); + } + + private void RecursiveFillBezier(Vector2 v1, Vector2 v2, Vector2 v3, Vector2 v4, float distanceTolerance, int level) + { + if (level > RecursionLimit) return; + var pi = Mathf.PI; + + // Calculate all the mid-points of the line segments + //---------------------- + var v12 = (v1 + v2) / 2f; + var v23 = (v2 + v3) / 2f; + var v34 = (v3 + v4) / 2f; + var v123 = (v12 + v23) / 2f; + var v234 = (v23 + v34) / 2f; + var v1234 = (v123 + v234) / 2f; + + // Enforce subdivision first time + if (level > 0) + { + // Try to approximate the full cubic curve by a single straight line + //------------------ + var d = v4 - v1; + + var d2 = Mathf.Abs((v2.x - v4.x) * d.y - (v2.y - v4.y) * d.x); + var d3 = Mathf.Abs((v3.x - v4.x) * d.y - (v3.y - v4.y) * d.x); + + if (d2 > FLTEpsilon && d3 > FLTEpsilon) + { + // Regular care + //----------------- + if ((d2 + d3) * (d2 + d3) <= distanceTolerance * (d.x * d.x + d.y * d.y)) + { + // If the curvature doesn't exceed the distanceTolerance value + // we tend to finish subdivisions. + //---------------------- + if (AngleTolerance < AngleEpsilon) + { + WorkVertices.Push(ref v1234); + return; + } + + // Angle & Cusp Condition + //---------------------- + var a23 = Mathf.Atan2(v3.y - v2.y, v3.x - v2.x); + var da1 = Mathf.Abs(a23 - Mathf.Atan2(v2.y - v1.y, v2.x - v1.x)); + var da2 = Mathf.Abs(Mathf.Atan2(v4.y - v3.y, v4.x - v3.x) - a23); + + if (da1 >= pi) + { + da1 = 2 * pi - da1; + } + + if (da2 >= pi) + { + da2 = 2 * pi - da2; + } + + if (da1 + da2 < AngleTolerance) + { + // Finally we can stop the recursion + //---------------------- + WorkVertices.Push(ref v1234); + return; + } + + if (CuspLimit > 0f) + { + if (da1 > CuspLimit) + { + WorkVertices.Push(ref v2); + return; + } + + if (da2 > CuspLimit) + { + WorkVertices.Push(ref v3); + return; + } + } + } + } + else + { + if (d2 > FLTEpsilon) + { + // p1,p3,p4 are collinear, p2 is considerable + //---------------------- + if (d2 * d2 <= distanceTolerance * (d.x * d.x + d.y * d.y)) + { + if (AngleTolerance < AngleEpsilon) + { + WorkVertices.Push(ref v1234); + return; + } + + // Angle Condition + //---------------------- + var da1 = Mathf.Abs(Mathf.Atan2(v3.y - v2.y, v3.x - v2.x) - + Mathf.Atan2(v2.y - v1.y, v2.x - v1.x)); + if (da1 >= pi) + { + da1 = 2 * pi - da1; + } + + if (da1 < AngleTolerance) + { + WorkVertices.Push(ref v2); + WorkVertices.Push(ref v3); + return; + } + + if (CuspLimit > 0f) + { + if (da1 > CuspLimit) + { + WorkVertices.Push(ref v2); + return; + } + } + } + } + else if (d3 > FLTEpsilon) + { + // p1,p2,p4 are collinear, p3 is considerable + //---------------------- + if (d3 * d3 <= distanceTolerance * (d.x * d.x + d.y * d.y)) + { + if (AngleTolerance < AngleEpsilon) + { + WorkVertices.Push(ref v1234); + return; + } + + // Angle Condition + //---------------------- + var da1 = Mathf.Abs(Mathf.Atan2(v4.y - v3.y, v4.x - v3.x) - + Mathf.Atan2(v3.y - v2.y, v3.x - v2.x)); + if (da1 >= pi) + { + da1 = 2 * pi - da1; + } + + if (da1 < AngleTolerance) + { + WorkVertices.Push(ref v2); + WorkVertices.Push(ref v3); + return; + } + + if (CuspLimit > 0f) + { + if (da1 > CuspLimit) + { + WorkVertices.Push(ref v3); + return; + } + } + } + } + else + { + // Collinear case + //----------------- + var dx = v1234.x - (v1.x + v4.x) / 2f; + var dy = v1234.y - (v1.y + v4.y) / 2f; + if (dx * dx + dy * dy <= distanceTolerance) + { + WorkVertices.Push(ref v1234); + return; + } + } + } + } + + // Continue subdivision + //---------------------- + RecursiveFillBezier(v1, v12, v123, v1234, distanceTolerance, level + 1); + RecursiveFillBezier(v1234, v234, v34, v4, distanceTolerance, level + 1); + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/BezierToPolyline.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/BezierToPolyline.cs.meta new file mode 100644 index 0000000000..2cb8b64fa5 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/BezierToPolyline.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7c16f121d3214a3c9ddbc306d9ee3179 +timeCreated: 1615377230 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/BezierToVertex.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/BezierToVertex.cs new file mode 100644 index 0000000000..cac3020c02 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/BezierToVertex.cs @@ -0,0 +1,262 @@ +using UnityEngine; + +namespace SVGMeshUnity.Internals +{ + public class BezierToVertex + { + // https://github.com/mattdesl/svg-path-contours + + public float Scale = 1f; + + public float PathDistanceEpsilon = 1f; + public int RecursionLimit = 8; + public float FLTEpsilon = 1.19209290e-7f; + + public float AngleEpsilon = 0.01f; + public float AngleTolerance = 0f; + public float CuspLimit = 0f; + + public WorkBufferPool WorkBufferPool; + + private WorkBuffer WorkVertices; + + public void GetContours(SVGData svg, MeshData data) + { + WorkBufferPool.Get(ref WorkVertices); + + var pen = Vector2.zero; + + var curves = svg.Curves; + var l = curves.Count; + for (var i = 0; i < l; ++i) + { + var curve = curves[i]; + if (curve.IsMove) + { + EmitWorkVerticesIfNeeded(data); + } + else + { + FillBezier(pen, curve.InControl, curve.OutControl, curve.Position); + } + pen = curve.Position; + } + + EmitWorkVerticesIfNeeded(data); + + WorkBufferPool.Release(ref WorkVertices); + } + + private void EmitWorkVerticesIfNeeded(MeshData data) + { + if (WorkVertices.UsedSize == 0) + { + return; + } + + // TODO: Simplify + + data.AddVertices(WorkVertices); + WorkVertices.Clear(); + } + + ////// Based on: + ////// https://github.com/pelson/antigrain/blob/master/agg-2.4/src/agg_curves.cpp + + private void FillBezier(Vector2 start, Vector2 c1, Vector2 c2, Vector2 end) + { + var distanceTolerance = PathDistanceEpsilon / Scale; + distanceTolerance *= distanceTolerance; + BeginFillBezier(start, c1, c2, end, distanceTolerance); + } + + private void BeginFillBezier(Vector2 start, Vector2 c1, Vector2 c2, Vector2 end, float distanceTolerance) + { + WorkVertices.Push(ref start); + RecursiveFillBezier(start, c1, c2, end, distanceTolerance, 0); + WorkVertices.Push(ref end); + } + + private void RecursiveFillBezier(Vector2 v1, Vector2 v2, Vector2 v3, Vector2 v4, float distanceTolerance, int level) + { + if (level > RecursionLimit) + { + return; + } + + var pi = Mathf.PI; + + // Calculate all the mid-points of the line segments + //---------------------- + var v12 = (v1 + v2) / 2f; + var v23 = (v2 + v3) / 2f; + var v34 = (v3 + v4) / 2f; + var v123 = (v12 + v23) / 2f; + var v234 = (v23 + v34) / 2f; + var v1234 = (v123 + v234) / 2f; + + // Enforce subdivision first time + if (level > 0) + { + // Try to approximate the full cubic curve by a single straight line + //------------------ + var d = v4 - v1; + + var d2 = Mathf.Abs((v2.x - v4.x) * d.y - (v2.y - v4.y) * d.x); + var d3 = Mathf.Abs((v3.x - v4.x) * d.y - (v3.y - v4.y) * d.x); + + if (d2 > FLTEpsilon && d3 > FLTEpsilon) + { + // Regular care + //----------------- + if ((d2 + d3) * (d2 + d3) <= distanceTolerance * (d.x * d.x + d.y * d.y)) + { + // If the curvature doesn't exceed the distanceTolerance value + // we tend to finish subdivisions. + //---------------------- + if (AngleTolerance < AngleEpsilon) + { + WorkVertices.Push(ref v1234); + return; + } + + // Angle & Cusp Condition + //---------------------- + var a23 = Mathf.Atan2(v3.y - v2.y, v3.x - v2.x); + var da1 = Mathf.Abs(a23 - Mathf.Atan2(v2.y - v1.y, v2.x - v1.x)); + var da2 = Mathf.Abs(Mathf.Atan2(v4.y - v3.y, v4.x - v3.x) - a23); + + if (da1 >= pi) + { + da1 = 2 * pi - da1; + } + + if (da2 >= pi) + { + da2 = 2 * pi - da2; + } + + if (da1 + da2 < AngleTolerance) + { + // Finally we can stop the recursion + //---------------------- + WorkVertices.Push(ref v1234); + return; + } + + if (CuspLimit > 0f) + { + if (da1 > CuspLimit) + { + WorkVertices.Push(ref v2); + return; + } + + if (da2 > CuspLimit) + { + WorkVertices.Push(ref v3); + return; + } + } + } + } + else + { + if (d2 > FLTEpsilon) + { + // p1,p3,p4 are collinear, p2 is considerable + //---------------------- + if (d2 * d2 <= distanceTolerance * (d.x * d.x + d.y * d.y)) + { + if (AngleTolerance < AngleEpsilon) + { + WorkVertices.Push(ref v1234); + return; + } + + // Angle Condition + //---------------------- + var da1 = Mathf.Abs(Mathf.Atan2(v3.y - v2.y, v3.x - v2.x) - + Mathf.Atan2(v2.y - v1.y, v2.x - v1.x)); + if (da1 >= pi) + { + da1 = 2 * pi - da1; + } + + if (da1 < AngleTolerance) + { + WorkVertices.Push(ref v2); + WorkVertices.Push(ref v3); + return; + } + + if (CuspLimit > 0f) + { + if (da1 > CuspLimit) + { + WorkVertices.Push(ref v2); + return; + } + } + } + } + else if (d3 > FLTEpsilon) + { + // p1,p2,p4 are collinear, p3 is considerable + //---------------------- + if (d3 * d3 <= distanceTolerance * (d.x * d.x + d.y * d.y)) + { + if (AngleTolerance < AngleEpsilon) + { + WorkVertices.Push(ref v1234); + return; + } + + // Angle Condition + //---------------------- + var da1 = Mathf.Abs(Mathf.Atan2(v4.y - v3.y, v4.x - v3.x) - + Mathf.Atan2(v3.y - v2.y, v3.x - v2.x)); + if (da1 >= pi) + { + da1 = 2 * pi - da1; + } + + if (da1 < AngleTolerance) + { + WorkVertices.Push(ref v2); + WorkVertices.Push(ref v3); + return; + } + + if (CuspLimit > 0f) + { + if (da1 > CuspLimit) + { + WorkVertices.Push(ref v3); + return; + } + } + } + } + else + { + // Collinear case + //----------------- + var dx = v1234.x - (v1.x + v4.x) / 2f; + var dy = v1234.y - (v1.y + v4.y) / 2f; + if (dx * dx + dy * dy <= distanceTolerance) + { + WorkVertices.Push(ref v1234); + return; + } + } + } + } + + // Continue subdivision + //---------------------- + RecursiveFillBezier(v1, v12, v123, v1234, distanceTolerance, level + 1); + RecursiveFillBezier(v1234, v234, v34, v4, distanceTolerance, level + 1); + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/BezierToVertex.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/BezierToVertex.cs.meta new file mode 100644 index 0000000000..6f1a22f9b6 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/BezierToVertex.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d0446926ab40486abe8a0e4ab9380186 +timeCreated: 1519697284 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d.meta new file mode 100644 index 0000000000..64f2675e02 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 532f777b59434eef9747b681c744be7e +timeCreated: 1519699774 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/BinarySearch.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/BinarySearch.cs new file mode 100644 index 0000000000..fa9f34edfd --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/BinarySearch.cs @@ -0,0 +1,232 @@ +using System; + +namespace SVGMeshUnity.Internals.Cdt2d +{ + public static class BinarySearch + { + // https://github.com/mikolalysenko/binary-search-bounds + + public interface IComparer + { + int Compare(G x, E y); + } + + public static int GE(G[] a, E y, IComparer c, int l, int h) + { + var i = h + 1; + while (l <= h) + { + var m = (int) (uint) (l + h) >> 1; + var x = a[m]; + if (c.Compare(x, y) >= 0) + { + i = m; + h = m - 1; + } + else + { + l = m + 1; + } + } + + return i; + } + + public static int GE(G[] a, G y, int l, int h) where G : IComparable + { + var i = h + 1; + while (l <= h) + { + var m = (int) (uint) (l + h) >> 1; + var x = a[m]; + if (x.CompareTo(y) >= 0) + { + i = m; + h = m - 1; + } + else + { + l = m + 1; + } + } + + return i; + } + + public static int GT(G[] a, E y, IComparer c, int l, int h) + { + var i = h + 1; + while (l <= h) + { + var m = (int) (uint) (l + h) >> 1; + var x = a[m]; + if (c.Compare(x, y) > 0) + { + i = m; + h = m - 1; + } + else + { + l = m + 1; + } + } + + return i; + } + + public static int GT(G[] a, G y, int l, int h) where G : IComparable + { + var i = h + 1; + while (l <= h) + { + var m = (int) (uint) (l + h) >> 1; + var x = a[m]; + if (x.CompareTo(y) > 0) + { + i = m; + h = m - 1; + } + else + { + l = m + 1; + } + } + + return i; + } + + public static int LT(G[] a, E y, IComparer c, int l, int h) + { + var i = l - 1; + while (l <= h) + { + var m = (int) (uint) (l + h) >> 1; + var x = a[m]; + if (c.Compare(x, y) < 0) + { + i = m; + l = m + 1; + } + else + { + h = m - 1; + } + } + + return i; + } + + public static int LT(G[] a, G y, int l, int h) where G : IComparable + { + var i = l - 1; + while (l <= h) + { + var m = (int) (uint) (l + h) >> 1; + var x = a[m]; + if (x.CompareTo(y) < 0) + { + i = m; + l = m + 1; + } + else + { + h = m - 1; + } + } + + return i; + } + + public static int LE(G[] a, E y, IComparer c, int l, int h) + { + var i = l - 1; + while (l <= h) + { + var m = (int) (uint) (l + h) >> 1; + var x = a[m]; + if (c.Compare(x, y) <= 0) + { + i = m; + l = m + 1; + } + else + { + h = m - 1; + } + } + + return i; + } + + public static int LE(G[] a, G y, int l, int h) where G : IComparable + { + var i = l - 1; + while (l <= h) + { + var m = (int) (uint) (l + h) >> 1; + var x = a[m]; + if (x.CompareTo(y) <= 0) + { + i = m; + l = m + 1; + } + else + { + h = m - 1; + } + } + + return i; + } + + public static int EQ(G[] a, E y, IComparer c, int l, int h) + { + while (l <= h) + { + var m = (int) (uint) (l + h) >> 1; + var x = a[m]; + var p = c.Compare(x, y); + if (p == 0) + { + return m; + } + + if (p <= 0) + { + l = m + 1; + } + else + { + h = m - 1; + } + } + + return -1; + } + + public static int EQ(G[] a, G y, int l, int h) where G : IComparable + { + while (l <= h) + { + var m = (int) (uint) (l + h) >> 1; + var x = a[m]; + var p = x.CompareTo(y); + if (p == 0) + { + return m; + } + + if (p <= 0) + { + l = m + 1; + } + else + { + h = m - 1; + } + } + + return -1; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/BinarySearch.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/BinarySearch.cs.meta new file mode 100644 index 0000000000..d0e4e93f09 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/BinarySearch.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ebc1111a29cd4d6c89f5458aa07da178 +timeCreated: 1519710584 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/DelaunayRefine.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/DelaunayRefine.cs new file mode 100644 index 0000000000..86c374e710 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/DelaunayRefine.cs @@ -0,0 +1,154 @@ +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace SVGMeshUnity.Internals.Cdt2d +{ + public class DelaunayRefine + { + public WorkBufferPool WorkBufferPool; + + //Assume edges are sorted lexicographically + public void RefineTriangles(Triangles triangles) + { + var stack = WorkBufferPool.Get(); + + var points = triangles.Vertices; + var numPoints = points.Count; + var stars = triangles.Stars; + for (var a = 0; a < numPoints; ++a) + { + var star = stars[a]; + var starData = star.Data; + var sl = star.UsedSize; + for (var j = 0; j < sl; ++j) + { + var s = starData[j]; + var b = s.y; + + //If order is not consistent, then skip edge + if (b < a) + { + continue; + } + + //Check if edge is constrained + if (triangles.IsConstraint(a, b)) + { + continue; + } + + //Find opposite edge + var x = s.x; + var y = -1; + for (var k = 0; k < sl; ++k) + { + if (starData[k].x == b) + { + y = starData[k].y; + break; + } + } + + //If this is a boundary edge, don't flip it + if (y < 0) + { + continue; + } + + //If edge is in circle, flip it + if (Robust.InSphere(points[a], points[b], points[x], points[y]) < 0f) + { + var v = new Int2(a, b); + stack.Push(ref v); + } + } + } + + while (stack.UsedSize > 0) + { + var v = stack.Pop(); + var a = v.x; + var b = v.y; + + //Find opposite pairs + var x = -1; + var y = -1; + var star = stars[a]; + var starData = star.Data; + var sl = star.UsedSize; + for (var i = 0; i < sl; ++i) + { + var s = starData[i].x; + var t = starData[i].y; + if (s == b) + { + y = t; + } + else if (t == b) + { + x = s; + } + } + + //If x/y are both valid then skip edge + if (x < 0 || y < 0) + { + continue; + } + + //If edge is now delaunay, then don't flip it + if (Robust.InSphere(points[a], points[b], points[x], points[y]) >= 0f) + { + continue; + } + + //Flip the edge + triangles.Flip(a, b); + + //Test flipping neighboring edges + TestFlip(points, triangles, stack, x, a, y); + TestFlip(points, triangles, stack, a, y, x); + TestFlip(points, triangles, stack, y, b, x); + TestFlip(points, triangles, stack, b, x, y); + } + + WorkBufferPool.Release(ref stack); + } + + private void TestFlip(List points, Triangles triangles, WorkBuffer stack, int a, int b, int x) + { + var y = triangles.Opposite(a, b); + + //Test boundary edge + if (y < 0) + { + return; + } + + //Swap edge if order flipped + if (b < a) + { + var tmp = a; + a = b; + b = tmp; + tmp = x; + x = y; + y = tmp; + } + + //Test if edge is constrained + if (triangles.IsConstraint(a, b)) + { + return; + } + + //Test if edge is delaunay + if (Robust.InSphere(points[a], points[b], points[x], points[y]) < 0f) + { + var v = new Int2(a, b); + stack.Push(ref v); + } + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/DelaunayRefine.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/DelaunayRefine.cs.meta new file mode 100644 index 0000000000..7228d336c1 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/DelaunayRefine.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: daf4535a11864f7e9737bf2657ad86e1 +timeCreated: 1519795855 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Filter.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Filter.cs new file mode 100644 index 0000000000..4281293a09 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Filter.cs @@ -0,0 +1,337 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace SVGMeshUnity.Internals.Cdt2d +{ + public class Filter + { + public int Target; + public bool Infinity; + + public WorkBufferPool WorkBufferPool; + + public void Do(Triangles triangles, List result) + { + using (var index = IndexCells(triangles)) + { + var cellN = index.Cells.UsedSize; + + if (result.Capacity < cellN * 3) + { + result.Capacity = cellN * 3; + } + + result.Clear(); + + if (Target == 0) + { + if (Infinity) + { + FillTriangles(index.Cells, result); + FillTriangles(index.Boundary, result); + return; + } + else + { + FillTriangles(index.Cells, result); + return; + } + } + + var side = 1; + var active = index.Active; + var next = index.Next; + var flags = index.Flags; + var flagsData = flags.Data; + var cells = index.Cells; + var constraint = index.Constraint; + var constraintData = constraint.Data; + var neighbor = index.Neighbor; + var neighborData = neighbor.Data; + + while (active.UsedSize > 0 || next.UsedSize > 0) + { + while (active.UsedSize > 0) + { + var t = active.Pop(); + if (flagsData[t] == -side) + { + continue; + } + + flagsData[t] = side; + for (var j = 0; j < 3; ++j) + { + var f = neighborData[3 * t + j]; + if (f >= 0 && flagsData[f] == 0) + { + if (constraintData[3 * t + j]) + { + next.Push(ref f); + } + else + { + active.Push(ref f); + flagsData[f] = side; + } + } + } + } + + //Swap arrays and loop + var tmp = next; + next = active; + active = tmp; + next.Clear(); + side = -side; + } + + FilterCells(cells, flags); + FillTriangles(cells, result); + + if (Infinity) + { + FillTriangles(index.Boundary, result); + } + } + } + + private class FaceIndex : IDisposable + { + public FaceIndex(WorkBufferPool pool) + { + WorkBufferPool = pool; + pool.Get(ref Cells); + pool.Get(ref Neighbor); + pool.Get(ref Constraint); + pool.Get(ref Flags); + pool.Get(ref Active); + pool.Get(ref Next); + pool.Get(ref Boundary); + } + + public WorkBuffer Cells; + public WorkBuffer Neighbor; + public WorkBuffer Constraint; + public WorkBuffer Flags; + public WorkBuffer Active; + public WorkBuffer Next; + public WorkBuffer Boundary; + + private WorkBufferPool WorkBufferPool; + private bool Disposed = false; + + public void Dispose() + { + Dispose(true); + } + + private void Dispose(bool disposing) + { + if (Disposed) + { + return; + } + + if (disposing) + { + WorkBufferPool.Release(ref Boundary); + WorkBufferPool.Release(ref Next); + WorkBufferPool.Release(ref Active); + WorkBufferPool.Release(ref Flags); + WorkBufferPool.Release(ref Constraint); + WorkBufferPool.Release(ref Neighbor); + WorkBufferPool.Release(ref Cells); + } + + Disposed = true; + } + + public void Dump() + { + Debug.LogFormat("Cells:\n{0}\n", Dump(Cells)); + Debug.LogFormat("Neighbor:\n{0}\n", Dump(Neighbor)); + Debug.LogFormat("Flags:\n{0}\n", Dump(Flags)); + Debug.LogFormat("Constraint:\n{0}\n", Dump(Constraint)); + Debug.LogFormat("Active:\n{0}\n", Dump(Active)); + Debug.LogFormat("Next:\n{0}\n", Dump(Next)); + Debug.LogFormat("Boundary:\n{0}\n", Dump(Boundary)); + } + + private string Dump(WorkBuffer buf) + { + return buf.Data.Take(buf.UsedSize).Aggregate("", (_, s) => _ + " " + s.ToString() + ",\n"); + } + } + + private FaceIndex IndexCells(Triangles triangles) + { + var zero = 0; + var fals = false; + + var index = new FaceIndex(WorkBufferPool); + + triangles.Fill(index.Cells); + + //First get cells and canonicalize + var cells = index.Cells; + var nc = cells.UsedSize; + var cellsData = cells.Data; + for (var i = 0; i < nc; ++i) + { + var c = cellsData[i]; + var x = c.x; + var y = c.y; + var z = c.z; + if (y < z) + { + if (y < x) + { + c.x = y; + c.y = z; + c.z = x; + cellsData[i] = c; + } + } + else if (z < x) + { + c.x = z; + c.y = x; + c.z = y; + cellsData[i] = c; + } + } + + WorkBuffer.Sort(cells); + + //Initialize flag array + var flags = index.Flags; + flags.Fill(ref zero, nc); + + //Build neighbor index, initialize queues + var active = index.Active; + var next = index.Next; + var neighbor = index.Neighbor; + var constraint = index.Constraint; + var boundary = index.Boundary; + neighbor.Fill(ref zero, nc * 3); + constraint.Fill(ref fals, nc * 3); + var flagsData = flags.Data; + var neighborData = neighbor.Data; + var constraintData = constraint.Data; + for (var i = 0; i < nc; ++i) + { + var c = cellsData[i]; + for (var j = 0; j < 3; ++j) + { + var x = 0; + var y = 0; + + switch (j) + { + case 0: + x = c.x; + y = c.y; + break; + case 1: + x = c.y; + y = c.z; + break; + case 2: + x = c.z; + y = c.x; + break; + } + + var a = neighborData[3 * i + j] = Locate(cells, y, x, triangles.Opposite(y, x)); + var b = constraintData[3 * i + j] = triangles.IsConstraint(x, y); + if (a < 0) + { + if (b) + { + next.Push(ref i); + } + else + { + active.Push(ref i); + flagsData[i] = 1; + } + + if (Infinity) + { + var v = new Int3(y, x, -1); + boundary.Push(ref v); + } + } + } + } + + return index; + } + + private int Locate(WorkBuffer cells, int a, int b, int c) + { + var x = a; + var y = b; + var z = c; + if (b < c) + { + if (b < a) + { + x = b; + y = c; + z = a; + } + } + else if (c < a) + { + x = c; + y = a; + z = b; + } + + if (x < 0) + { + return -1; + } + + return BinarySearch.EQ(cells.Data, new Int3(x, y, z), 0, cells.UsedSize - 1); + } + + private void FilterCells(WorkBuffer cells, WorkBuffer flags) + { + var ptr = 0; + var n = cells.UsedSize; + var cellsData = cells.Data; + var flagsData = flags.Data; + for (var i = 0; i < n; ++i) { + if(flagsData[i] == Target) + { + cellsData[ptr++] = cellsData[i]; + } + } + cells.RemoveLast(n - ptr); + } + + private void FillTriangles(WorkBuffer from, List to) + { + var n = from.UsedSize; + + if (to.Capacity < n * 3) + { + to.Capacity = n * 3; + } + + var data = from.Data; + for (var i = 0; i < n; ++i) + { + var v = data[i]; + to.Add(v.x); + to.Add(v.y); + to.Add(v.z); + } + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Filter.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Filter.cs.meta new file mode 100644 index 0000000000..7b25c729ba --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Filter.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1384c72d4a744c9db5fbd24870a9c0e5 +timeCreated: 1519830352 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/MonotoneTriangulation.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/MonotoneTriangulation.cs new file mode 100644 index 0000000000..425381f69c --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/MonotoneTriangulation.cs @@ -0,0 +1,380 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace SVGMeshUnity.Internals.Cdt2d +{ + public class MonotoneTriangulation + { + private static readonly bool Verbose = false; + + public WorkBufferPool WorkBufferPool; + + private enum EventType + { + Point = 0, + End = 1, + Start = 2, + } + + //An event in the sweep line procedure + private class Event : IComparable + { + public Vector2 A; + public Vector2 B; + public EventType Type; + public int Index; + + //This is used to compare events for the sweep line procedure + // Points are: + // 1. sorted lexicographically + // 2. sorted by type (point < end < start) + // 3. segments sorted by winding order + // 4. sorted by index + public int CompareTo(Event b) + { + var d = 0; + + d = Sign(A.x - b.A.x); + if (d != 0) return d; + + d = Sign(A.y - b.A.y); + if (d != 0) return d; + + d = Type - b.Type; + if (d != 0) return d; + + if (Type != EventType.Point) + { + d = Sign(Robust.Orientation(A, B, b.B)); + if (d != 0) return d; + } + + return Index - b.Index; + } + } + + //A partial convex hull fragment, made of two unimonotone polygons + private class PartialHull + { + public Vector2 A; + public Vector2 B; + public int Index; + public WorkBuffer LowerIds = new WorkBuffer(8); + public WorkBuffer UpperIds = new WorkBuffer(8); + } + + public void BuildTriangles(MeshData data) + { + var numPoints = data.Vertices.Count; + var numEdges = data.Edges.Count; + + data.Triangles.Capacity = numPoints * 3; + + var events = WorkBufferPool.Get(); + if (events.NewForClass == null) + { + events.NewForClass = () => new Event(); + } + + //Create point events + for (var i = 0; i < numPoints; ++i) + { + var e = events.Push(); + e.A = data.Vertices[i]; + e.B = Vector2.zero; + e.Type = EventType.Point; + e.Index = i; + } + + //Create edge events + for(var i=0; i b.x) + { + { + var e = events.Push(); + e.A = b; + e.B = a; + e.Type = EventType.Start; + e.Index = i; + } + { + var e = events.Push(); + e.A = a; + e.B = b; + e.Type = EventType.End; + e.Index = i; + } + } + } + + //Sort events + WorkBuffer.Sort(events); + + if (Verbose) + { + DumpEvents(events); + } + + //Initialize hull + var minX = events.Data[0].A.x - 1f; + var hulls = WorkBufferPool.Get(); + if (hulls.NewForClass == null) + { + hulls.NewForClass = () => new PartialHull(); + } + var h = hulls.Push(); + h.A = new Vector2(minX, 1f); + h.B = new Vector2(minX, 0f); + h.Index = -1; + h.LowerIds.Clear(); + h.UpperIds.Clear(); + + //Process events in order + var numEvents = events.UsedSize; + for (var i = 0; i < numEvents; ++i) + { + var e = events.Data[i]; + + if (Verbose) + { + Debug.Log(""); + Debug.Log(i); + DumpEvent(e); + } + + switch (e.Type) + { + case EventType.Point: + AddPoint(data.Triangles, hulls, data.Vertices, e.A, e.Index); + break; + case EventType.Start: + SplitHulls(hulls, e); + break; + case EventType.End: + MergeHulls(hulls, e); + break; + } + + if (Verbose) + { + Debug.Log(""); + } + } + + WorkBufferPool.Release(ref hulls); + WorkBufferPool.Release(ref events); + } + + private static int Sign(float n) + { + if (n < 0f) + { + return -1; + } + + if (n > 0f) + { + return 1; + } + + return 0; + } + + private void AddPoint(List cells, WorkBuffer hulls, List points, Vector2 p, int idx) + { + var lo = BinarySearch.LT(hulls.Data, p, TestPoint.Default, 0, hulls.UsedSize - 1); + var hi = BinarySearch.GT(hulls.Data, p, TestPoint.Default, 0, hulls.UsedSize - 1); + for (var i = lo; i < hi; ++i) + { + var hull = hulls.Data[i]; + + //Insert p into lower hull + { + var lowerIds = hull.LowerIds; + var m = lowerIds.UsedSize; + var lowerIdsData = lowerIds.Data; + while (m > 1 && Robust.Orientation(points[lowerIdsData[m - 2]], points[lowerIdsData[m - 1]], p) > 0f) + { + cells.Add(lowerIdsData[m - 1]); + cells.Add(lowerIdsData[m - 2]); + cells.Add(idx); + m -= 1; + } + + if (m < lowerIds.UsedSize) + { + lowerIds.RemoveLast(lowerIds.UsedSize - m); + } + + lowerIds.Push(ref idx); + } + + //Insert p into upper hull + { + var upperIds = hull.UpperIds; + var m = upperIds.UsedSize; + var upperIdsData = upperIds.Data; + while (m > 1 && Robust.Orientation(points[upperIdsData[m - 2]], points[upperIdsData[m - 1]], p) < 0f) + { + cells.Add(upperIdsData[m - 2]); + cells.Add(upperIdsData[m - 1]); + cells.Add(idx); + m -= 1; + } + + if (m < upperIds.UsedSize) + { + upperIds.RemoveLast(upperIds.UsedSize - m); + } + + upperIds.Push(ref idx); + } + } + + if (Verbose) + { + Debug.Log("Add"); + DumpHulls(hulls); + hulls.Dump(); + } + } + + private void SplitHulls(WorkBuffer hulls, Event e) + { + var splitIdx = BinarySearch.LE(hulls.Data, e, FindSplit.Default, 0, hulls.UsedSize - 1); + var hull = hulls.Data[splitIdx]; + var upperIds = hull.UpperIds; + var x = upperIds.Data[upperIds.UsedSize - 1]; + hull.UpperIds = new WorkBuffer(8); + hull.UpperIds.Push(ref x); + var h = hulls.Insert(splitIdx + 1); + h.A = e.A; + h.B = e.B; + h.Index = e.Index; + h.LowerIds.Clear(); + h.LowerIds.Push(ref x); + h.UpperIds = upperIds; + + if (Verbose) + { + Debug.Log("Split: " + splitIdx); + DumpHulls(hulls); + hulls.Dump(); + } + } + + private void MergeHulls(WorkBuffer hulls, Event e) + { + //Swap pointers for merge search + var tmp = e.A; + e.A = e.B; + e.B = tmp; + var mergeIdx = BinarySearch.EQ(hulls.Data, e, FindSplit.Default, 0, hulls.UsedSize - 1); + var upper = hulls.Data[mergeIdx]; + var lower = hulls.Data[mergeIdx - 1]; + lower.UpperIds = upper.UpperIds; + hulls.RemoveAt(mergeIdx); + + if (Verbose) + { + Debug.Log("Merge: " + mergeIdx); + DumpHulls(hulls); + hulls.Dump(); + } + } + + private class TestPoint : BinarySearch.IComparer + { + public static readonly TestPoint Default = new TestPoint(); + + public int Compare(PartialHull hull, Vector2 p) + { + return Sign(Robust.Orientation(hull.A, hull.B, p)); + } + } + + private class FindSplit : BinarySearch.IComparer + { + public static readonly FindSplit Default = new FindSplit(); + + public int Compare(PartialHull hull, Event edge) + { + var d = 0; + + if (hull.A.x < edge.A.x) + { + d = Sign(Robust.Orientation(hull.A, hull.B, edge.A)); + } else + { + d = Sign(Robust.Orientation(edge.B, edge.A, hull.A)); + } + + if (d != 0) return d; + + if (edge.B.x < hull.B.x) + { + d = Sign(Robust.Orientation(hull.A, hull.B, edge.B)); + } else + { + d = Sign(Robust.Orientation(edge.B, edge.A, hull.B)); + } + + if (d != 0) return d; + + return hull.Index - edge.Index; + } + } + + + #region Debug + + private void DumpEvent(Event _) + { + Debug.Log(string.Format("{{ a: {0}, b: {1}, type: {2}, idx: {3} }}", _.A, _.B, _.Type, _.Index)); + } + + private void DumpEvents(WorkBuffer events) + { + Debug.Log(events.Data.Take(events.UsedSize) + .Select(_ => string.Format("{{ a: {0}, b: {1}, type: {2}, idx: {3} }}", _.A, _.B, _.Type, _.Index)) + .Aggregate("", (_, s) => _ + s + "\n")); + } + + private void DumpHulls(WorkBuffer hulls) + { + Debug.Log(hulls.Data.Take(hulls.UsedSize) + .Select(_ => string.Format("{{ a: {0}, b: {1}, idx: {2}, lowerIds: [ {3} ], upperIds: [ {4} ] }}", _.A, _.B, _.Index, ToString(_.LowerIds), ToString(_.UpperIds))) + .Aggregate("", (_, s) => _ + s + "\n")); + } + + private string ToString(WorkBuffer list) + { + return string.Join(", ", list.Data.Take(list.UsedSize).Select(_ => _.ToString()).ToArray()); + } + + #endregion + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/MonotoneTriangulation.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/MonotoneTriangulation.cs.meta new file mode 100644 index 0000000000..029d775e77 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/MonotoneTriangulation.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f3f866907d0c43a086ba61429b3d2b8a +timeCreated: 1519699803 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Robust.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Robust.cs new file mode 100644 index 0000000000..583fb350bf --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Robust.cs @@ -0,0 +1,882 @@ +using UnityEngine; + +namespace SVGMeshUnity.Internals.Cdt2d +{ + public static class Robust + { + // https://github.com/mikolalysenko/robust-orientation + // https://github.com/mikolalysenko/robust-in-sphere + // https://github.com/mikolalysenko/robust-sum + // https://github.com/mikolalysenko/robust-subtract + // https://github.com/mikolalysenko/robust-scale + // https://github.com/mikolalysenko/two-product + // https://github.com/mikolalysenko/two-sum + + private static readonly float Epsilon = 1.1102230246251565e-16f; + private static readonly float Errbound3 = (3.0f + 16.0f * Epsilon) * Epsilon; + + private static readonly float Splitter = +(Mathf.Pow(2f, 27f) + 1.0f); + + private static float[][] BufferPool = new float[32][]; + private static int BufferPoolSize = 0; + + private static float[] GetTemporaryBuffer() + { + if (BufferPoolSize > 0) + { + return BufferPool[--BufferPoolSize]; + } + return new float[16]; + } + + private static void ReleaseTemporaryBuffer(ref float[] buf) + { + if (BufferPool.Length == BufferPoolSize) + { + var newBufferPool = new float[BufferPool.Length + 32][]; + BufferPool.CopyTo(newBufferPool, 0); + BufferPool = newBufferPool; + } + + BufferPool[BufferPoolSize++] = buf; + buf = null; + } + + public static float Orientation(Vector2 a, Vector2 b, Vector2 c) + { + var l = (a.y - c.y) * (b.x - c.x); + var r = (a.x - c.x) * (b.y - c.y); + var det = l - r; + var s = 0f; + if (l > 0) + { + if (r <= 0) + { + return det; + } + else + { + s = l + r; + } + } + else if (l < 0) + { + if (r >= 0) + { + return det; + } + else + { + s = -(l + r); + } + } + else + { + return det; + } + + var tol = Errbound3 * s; + if (det >= tol || det <= -tol) + { + return det; + } + + var m0 = a; + var m1 = b; + var m2 = c; + + var sL = GetTemporaryBuffer(); + var sR = GetTemporaryBuffer(); + + var p = GetTemporaryBuffer(); + var n = GetTemporaryBuffer(); + var d = GetTemporaryBuffer(); + + var pN = 0; + var nN = 0; + var dN = 0; + + var pL = GetTemporaryBuffer(); + var pR = GetTemporaryBuffer(); + + var pLN = 0; + var pRN = 0; + + TwoProd( m1.y, m2.x, sL); + TwoProd(-m2.y, m1.x, sR); + Sum(sL, 2, sR, 2, pL, out pLN); + + TwoProd( m0.y, m1.x, sL); + TwoProd(-m1.y, m0.x, sR); + Sum(sL, 2, sR, 2, pR, out pRN); + + Sum(pL, pLN, pR, pRN, p, out pN); + + ReleaseTemporaryBuffer(ref pL); + ReleaseTemporaryBuffer(ref pR); + + TwoProd( m0.y, m2.x, sL); + TwoProd(-m2.y, m0.x, sR); + Sum(sL, 2, sR, 2, n, out nN); + + ReleaseTemporaryBuffer(ref sL); + ReleaseTemporaryBuffer(ref sR); + + Sub(p, pN, n, nN, d, out dN); + + var result = d[dN - 1]; + + ReleaseTemporaryBuffer(ref p); + ReleaseTemporaryBuffer(ref n); + ReleaseTemporaryBuffer(ref d); + + return result; + } + + public static float InSphere(Vector2 m0, Vector2 m1, Vector2 m2, Vector2 m3) + { + var w = GetTemporaryBuffer(); + var wL = GetTemporaryBuffer(); + var wR = GetTemporaryBuffer(); + + var wN = 0; + + var w0m1 = GetTemporaryBuffer(); + var w0m2 = GetTemporaryBuffer(); + var w0m3 = GetTemporaryBuffer(); + var w1m0 = GetTemporaryBuffer(); + var w1m2 = GetTemporaryBuffer(); + var w1m3 = GetTemporaryBuffer(); + var w2m0 = GetTemporaryBuffer(); + var w2m1 = GetTemporaryBuffer(); + var w2m3 = GetTemporaryBuffer(); + var w3m0 = GetTemporaryBuffer(); + var w3m1 = GetTemporaryBuffer(); + var w3m2 = GetTemporaryBuffer(); + + var w0m1N = 0; + var w0m2N = 0; + var w0m3N = 0; + var w1m0N = 0; + var w1m2N = 0; + var w1m3N = 0; + var w2m0N = 0; + var w2m1N = 0; + var w2m3N = 0; + var w3m0N = 0; + var w3m1N = 0; + var w3m2N = 0; + + TwoProd(m0[0], m0[0], wL); + TwoProd(m0[1], m0[1], wR); + Sum(wL, 2, wR, 2, w, out wN); + Scale(w, wN, m1[0], w0m1, out w0m1N); + Scale(w, wN, m2[0], w0m2, out w0m2N); + Scale(w, wN, m3[0], w0m3, out w0m3N); + + TwoProd(m1[0], m1[0], wL); + TwoProd(m1[1], m1[1], wR); + Sum(wL, 2, wR, 2, w, out wN); + Scale(w, wN, m0[0], w1m0, out w1m0N); + Scale(w, wN, m2[0], w1m2, out w1m2N); + Scale(w, wN, m3[0], w1m3, out w1m3N); + + TwoProd(m2[0], m2[0], wL); + TwoProd(m2[1], m2[1], wR); + Sum(wL, 2, wR, 2, w, out wN); + Scale(w, wN, m0[0], w2m0, out w2m0N); + Scale(w, wN, m1[0], w2m1, out w2m1N); + Scale(w, wN, m3[0], w2m3, out w2m3N); + + TwoProd(m3[0], m3[0], wL); + TwoProd(m3[1], m3[1], wR); + Sum(wL, 2, wR, 2, w, out wN); + Scale(w, wN, m0[0], w3m0, out w3m0N); + Scale(w, wN, m1[0], w3m1, out w3m1N); + Scale(w, wN, m2[0], w3m2, out w3m2N); + + ReleaseTemporaryBuffer(ref wL); + ReleaseTemporaryBuffer(ref wR); + ReleaseTemporaryBuffer(ref w); + + var p = GetTemporaryBuffer(); + var n = GetTemporaryBuffer(); + var d = GetTemporaryBuffer(); + + var pN = 0; + var nN = 0; + var dN = 0; + + var pL = GetTemporaryBuffer(); + var pR = GetTemporaryBuffer(); + + var pLN = 0; + var pRN = 0; + + var pLLL = GetTemporaryBuffer(); + var pLL = GetTemporaryBuffer(); + var pLRLL = GetTemporaryBuffer(); + var pLRL = GetTemporaryBuffer(); + var pLRRL = GetTemporaryBuffer(); + var pLRR = GetTemporaryBuffer(); + var pLR = GetTemporaryBuffer(); + + var pLLLN = 0; + var pLLN = 0; + var pLRLLN = 0; + var pLRLN = 0; + var pLRRLN = 0; + var pLRRN = 0; + var pLRN = 0; + + Sub(w3m2, w3m2N, w2m3, w2m3N, pLLL, out pLLLN); + Scale(pLLL, pLLLN, m1[1], pLL, out pLLN); + Sub(w3m1, w3m1N, w1m3, w1m3N, pLRLL, out pLRLLN); + Scale(pLRLL, pLRLLN, -m2[1], pLRL, out pLRLN); + Sub(w2m1, w2m1N, w1m2, w1m2N, pLRRL, out pLRRLN); + Scale(pLRRL, pLRRLN, m3[1], pLRR, out pLRRN); + Sum(pLRL, pLRLN, pLRR, pLRRN, pLR, out pLRN); + Sum(pLL, pLLN, pLR, pLRN, pL, out pLN); + + ReleaseTemporaryBuffer(ref pLLL); + ReleaseTemporaryBuffer(ref pLL); + ReleaseTemporaryBuffer(ref pLRLL); + ReleaseTemporaryBuffer(ref pLRL); + ReleaseTemporaryBuffer(ref pLRRL); + ReleaseTemporaryBuffer(ref pLRR); + ReleaseTemporaryBuffer(ref pLR); + + var pRLL = GetTemporaryBuffer(); + var pRL = GetTemporaryBuffer(); + var pRRLL = GetTemporaryBuffer(); + var pRRL = GetTemporaryBuffer(); + var pRRRL = GetTemporaryBuffer(); + var pRRR = GetTemporaryBuffer(); + var pRR = GetTemporaryBuffer(); + + var pRLLN = 0; + var pRLN = 0; + var pRRLLN = 0; + var pRRLN = 0; + var pRRRLN = 0; + var pRRRN = 0; + var pRRN = 0; + + Sub(w3m1, w3m1N, w1m3, w1m3N, pRLL, out pRLLN); + Scale(pRLL, pRLLN, m0[1], pRL, out pRLN); + Sub(w3m0, w3m0N, w0m3, w0m3N, pRRLL, out pRRLLN); + Scale(pRRLL, pRRLLN, -m1[1], pRRL, out pRRLN); + Sub(w1m0, w1m0N, w0m1, w0m1N, pRRRL, out pRRRLN); + Scale(pRRRL, pRRRLN, m3[1], pRRR, out pRRRN); + Sum(pRRL, pRRLN, pRRR, pRRRN, pRR, out pRRN); + Sum(pRL, pRLN, pRR, pRRN, pR, out pRN); + + ReleaseTemporaryBuffer(ref pRLL); + ReleaseTemporaryBuffer(ref pRL); + ReleaseTemporaryBuffer(ref pRRLL); + ReleaseTemporaryBuffer(ref pRRL); + ReleaseTemporaryBuffer(ref pRRRL); + ReleaseTemporaryBuffer(ref pRRR); + ReleaseTemporaryBuffer(ref pRR); + + Sum(pL, pLN, pR, pRN, p, out pN); + + ReleaseTemporaryBuffer(ref pL); + ReleaseTemporaryBuffer(ref pR); + + var nL = GetTemporaryBuffer(); + var nR = GetTemporaryBuffer(); + + var nLN = 0; + var nRN = 0; + + var nLLL = GetTemporaryBuffer(); + var nLL = GetTemporaryBuffer(); + var nLRLL = GetTemporaryBuffer(); + var nLRL = GetTemporaryBuffer(); + var nLRRL = GetTemporaryBuffer(); + var nLRR = GetTemporaryBuffer(); + var nLR = GetTemporaryBuffer(); + + var nLLLN = 0; + var nLLN = 0; + var nLRLLN = 0; + var nLRLN = 0; + var nLRRLN = 0; + var nLRRN = 0; + var nLRN = 0; + + Sub(w3m2, w3m2N, w2m3, w2m3N, nLLL, out nLLLN); + Scale(nLLL, nLLLN, m0[1], nLL, out nLLN); + Sub(w3m0, w3m0N, w0m3, w0m3N, nLRLL, out nLRLLN); + Scale(nLRLL, nLRLLN, -m2[1], nLRL, out nLRLN); + Sub(w2m0, w2m0N, w0m2, w0m2N, nLRRL, out nLRRLN); + Scale(nLRRL, nLRRLN, m3[1], nLRR, out nLRRN); + Sum(nLRL, nLRLN, nLRR, nLRRN, nLR, out nLRN); + Sum(nLL, nLLN, nLR, nLRN, nL, out nLN); + + ReleaseTemporaryBuffer(ref nLLL); + ReleaseTemporaryBuffer(ref nLL); + ReleaseTemporaryBuffer(ref nLRLL); + ReleaseTemporaryBuffer(ref nLRL); + ReleaseTemporaryBuffer(ref nLRRL); + ReleaseTemporaryBuffer(ref nLRR); + ReleaseTemporaryBuffer(ref nLR); + + var nRLL = GetTemporaryBuffer(); + var nRL = GetTemporaryBuffer(); + var nRRLL = GetTemporaryBuffer(); + var nRRL = GetTemporaryBuffer(); + var nRRRL = GetTemporaryBuffer(); + var nRRR = GetTemporaryBuffer(); + var nRR = GetTemporaryBuffer(); + + var nRLLN = 0; + var nRLN = 0; + var nRRLLN = 0; + var nRRLN = 0; + var nRRRLN = 0; + var nRRRN = 0; + var nRRN = 0; + + Sub(w2m1, w2m1N, w1m2, w1m2N, nRLL, out nRLLN); + Scale(nRLL, nRLLN, m0[1], nRL, out nRLN); + Sub(w2m0, w2m0N, w0m2, w0m2N, nRRLL, out nRRLLN); + Scale(nRRLL, nRRLLN, -m1[1], nRRL, out nRRLN); + Sub(w1m0, w1m0N, w0m1, w0m1N, nRRRL, out nRRRLN); + Scale(nRRRL, nRRRLN, m2[1], nRRR, out nRRRN); + Sum(nRRL, nRRLN, nRRR, nRRRN, nRR, out nRRN); + Sum(nRL, nRLN, nRR, nRRN, nR, out nRN); + + ReleaseTemporaryBuffer(ref nRLL); + ReleaseTemporaryBuffer(ref nRL); + ReleaseTemporaryBuffer(ref nRRLL); + ReleaseTemporaryBuffer(ref nRRL); + ReleaseTemporaryBuffer(ref nRRRL); + ReleaseTemporaryBuffer(ref nRRR); + ReleaseTemporaryBuffer(ref nRR); + + Sum(nL, nLN, nR, nRN, n, out nN); + + ReleaseTemporaryBuffer(ref nL); + ReleaseTemporaryBuffer(ref nR); + + ReleaseTemporaryBuffer(ref w0m1); + ReleaseTemporaryBuffer(ref w0m2); + ReleaseTemporaryBuffer(ref w0m3); + ReleaseTemporaryBuffer(ref w1m0); + ReleaseTemporaryBuffer(ref w1m2); + ReleaseTemporaryBuffer(ref w1m3); + ReleaseTemporaryBuffer(ref w2m0); + ReleaseTemporaryBuffer(ref w2m1); + ReleaseTemporaryBuffer(ref w2m3); + ReleaseTemporaryBuffer(ref w3m0); + ReleaseTemporaryBuffer(ref w3m1); + ReleaseTemporaryBuffer(ref w3m2); + + Sub(p, pN, n, nN, d, out dN); + + var result = d[dN - 1]; + + ReleaseTemporaryBuffer(ref p); + ReleaseTemporaryBuffer(ref n); + ReleaseTemporaryBuffer(ref d); + + return result; + } + + private static void TwoProd(float a, float b, float[] result) + { + var x = a * b; + + var c = Splitter * a; + var abig = c - a; + var ahi = c - abig; + var alo = a - ahi; + + var d = Splitter * b; + var bbig = d - b; + var bhi = d - bbig; + var blo = b - bhi; + + var err1 = x - (ahi * bhi); + var err2 = err1 - (alo * bhi); + var err3 = err2 - (ahi * blo); + + var y = alo * blo - err3; + + result[0] = y; + result[1] = x; + } + + private static void TwoSum(float a, float b, float[] result) + { + var x = a + b; + var bv = x - a; + var av = x - bv; + var br = b - bv; + var ar = a - av; + + result[0] = ar + br; + result[1] = x; + } + + private static void Sum(float[] e, int eN, float[] f, int fN, float[] result, out int resultN) + { + if(eN == 1 && fN == 1) + { + ScalarScalar(e[0], f[0], result, out resultN); + return; + } + + resultN = 0; + + var eptr = 0; + var fptr = 0; + var ei = e[eptr]; + var ea = Mathf.Abs(ei); + var fi = f[fptr]; + var fa = Mathf.Abs(fi); + var a = 0f; + var b = 0f; + if (ea < fa) + { + b = ei; + eptr += 1; + if (eptr < eN) + { + ei = e[eptr]; + ea = Mathf.Abs(ei); + } + } + else + { + b = fi; + fptr += 1; + if (fptr < fN) + { + fi = f[fptr]; + fa = Mathf.Abs(fi); + } + } + + if ((eptr < eN && ea < fa) || (fptr >= fN)) + { + a = ei; + eptr += 1; + if (eptr < eN) + { + ei = e[eptr]; + ea = Mathf.Abs(ei); + } + } + else + { + a = fi; + fptr += 1; + if (fptr < fN) + { + fi = f[fptr]; + fa = Mathf.Abs(fi); + } + } + + var x = a + b; + var bv = x - a; + var y = b - bv; + var q0 = y; + var q1 = x; + var _x = 0f; + var _bv = 0f; + var _av = 0f; + var _br = 0f; + var _ar = 0f; + while (eptr < eN && fptr < fN) + { + if (ea < fa) + { + a = ei; + eptr += 1; + if (eptr < eN) + { + ei = e[eptr]; + ea = Mathf.Abs(ei); + } + } + else + { + a = fi; + fptr += 1; + if (fptr < fN) + { + fi = f[fptr]; + fa = Mathf.Abs(fi); + } + } + + b = q0; + x = a + b; + bv = x - a; + y = b - bv; + if (y != 0f) + { + result[resultN++] = y; + } + + _x = q1 + x; + _bv = _x - q1; + _av = _x - _bv; + _br = x - _bv; + _ar = q1 - _av; + q0 = _ar + _br; + q1 = _x; + } + + while (eptr < eN) + { + a = ei; + b = q0; + x = a + b; + bv = x - a; + y = b - bv; + if (y != 0f) + { + result[resultN++] = y; + } + + _x = q1 + x; + _bv = _x - q1; + _av = _x - _bv; + _br = x - _bv; + _ar = q1 - _av; + q0 = _ar + _br; + q1 = _x; + eptr += 1; + if (eptr < eN) + { + ei = e[eptr]; + } + } + + while (fptr < fN) + { + a = fi; + b = q0; + x = a + b; + bv = x - a; + y = b - bv; + if (y != 0f) + { + result[resultN++] = y; + } + + _x = q1 + x; + _bv = _x - q1; + _av = _x - _bv; + _br = x - _bv; + _ar = q1 - _av; + q0 = _ar + _br; + q1 = _x; + fptr += 1; + if (fptr < fN) + { + fi = f[fptr]; + } + } + + if (q0 != 0f) + { + result[resultN++] = q0; + } + + if (q1 != 0f) + { + result[resultN++] = q1; + } + + if (resultN == 0) + { + result[resultN++] = 0f; + } + } + + private static void Sub(float[] e, int eN, float[] f, int fN, float[] result, out int resultN) + { + if (eN == 1 && fN == 1) + { + ScalarScalar(e[0], -f[0], result, out resultN); + return; + } + + resultN = 0; + + var eptr = 0; + var fptr = 0; + var ei = e[eptr]; + var ea = Mathf.Abs(ei); + var fi = -f[fptr]; + var fa = Mathf.Abs(fi); + var a = 0f; + var b = 0f; + if (ea < fa) + { + b = ei; + eptr += 1; + if (eptr < eN) + { + ei = e[eptr]; + ea = Mathf.Abs(ei); + } + } + else + { + b = fi; + fptr += 1; + if (fptr < fN) + { + fi = -f[fptr]; + fa = Mathf.Abs(fi); + } + } + + if ((eptr < eN && ea < fa) || (fptr >= fN)) + { + a = ei; + eptr += 1; + if (eptr < eN) + { + ei = e[eptr]; + ea = Mathf.Abs(ei); + } + } + else + { + a = fi; + fptr += 1; + if (fptr < fN) + { + fi = -f[fptr]; + fa = Mathf.Abs(fi); + } + } + + var x = a + b; + var bv = x - a; + var y = b - bv; + var q0 = y; + var q1 = x; + var _x = 0f; + var _bv = 0f; + var _av = 0f; + var _br = 0f; + var _ar = 0f; + while (eptr < eN && fptr < fN) + { + if (ea < fa) + { + a = ei; + eptr += 1; + if (eptr < eN) + { + ei = e[eptr]; + ea = Mathf.Abs(ei); + } + } + else + { + a = fi; + fptr += 1; + if (fptr < fN) + { + fi = -f[fptr]; + fa = Mathf.Abs(fi); + } + } + + b = q0; + x = a + b; + bv = x - a; + y = b - bv; + if (y != 0f) + { + result[resultN++] = y; + } + + _x = q1 + x; + _bv = _x - q1; + _av = _x - _bv; + _br = x - _bv; + _ar = q1 - _av; + q0 = _ar + _br; + q1 = _x; + } + + while (eptr < eN) + { + a = ei; + b = q0; + x = a + b; + bv = x - a; + y = b - bv; + if (y != 0f) + { + result[resultN++] = y; + } + + _x = q1 + x; + _bv = _x - q1; + _av = _x - _bv; + _br = x - _bv; + _ar = q1 - _av; + q0 = _ar + _br; + q1 = _x; + eptr += 1; + if (eptr < eN) + { + ei = e[eptr]; + } + } + + while (fptr < fN) + { + a = fi; + b = q0; + x = a + b; + bv = x - a; + y = b - bv; + if (y != 0f) + { + result[resultN++] = y; + } + + _x = q1 + x; + _bv = _x - q1; + _av = _x - _bv; + _br = x - _bv; + _ar = q1 - _av; + q0 = _ar + _br; + q1 = _x; + fptr += 1; + if (fptr < fN) + { + fi = -f[fptr]; + } + } + + if (q0 != 0f) + { + result[resultN++] = q0; + } + + if (q1 != 0f) + { + result[resultN++] = q1; + } + + if (resultN == 0) + { + result[resultN++] = 0.0f; + } + } + + private static void Scale(float[] e, int eN, float scale, float[] result, out int resultN) + { + if (eN == 1) + { + var ts = GetTemporaryBuffer(); + + TwoProd(e[0], scale, ts); + + if (ts[0] != 0f) + { + result[0] = ts[0]; + result[1] = ts[1]; + resultN = 2; + ReleaseTemporaryBuffer(ref ts); + return; + } + + result[0] = ts[1]; + resultN = 1; + ReleaseTemporaryBuffer(ref ts); + return; + } + + var q = GetTemporaryBuffer(); + var t = GetTemporaryBuffer(); + + q[0] = 0.1f; + q[1] = 0.1f; + t[0] = 0.1f; + t[1] = 0.1f; + + resultN = 0; + + TwoProd(e[0], scale, q); + + if (q[0] != 0f) + { + result[resultN++] = q[0]; + } + + for (var i = 1; i < eN; ++i) + { + TwoProd(e[i], scale, t); + + var pq = q[1]; + + TwoSum(pq, t[0], q); + + if (q[0] != 0f) + { + result[resultN++] = q[0]; + } + + var a = t[1]; + var b = q[1]; + var x = a + b; + var bv = x - a; + var y = b - bv; + q[1] = x; + + if (y != 0f) + { + result[resultN++] = y; + } + } + + if (q[1] != 0f) + { + result[resultN++] = q[1]; + } + + ReleaseTemporaryBuffer(ref q); + ReleaseTemporaryBuffer(ref t); + + if (resultN == 0) + { + result[resultN++] = 0.0f; + } + } + + //Easy case: Add two scalars + private static void ScalarScalar(float a, float b, float[] result, out int resultN) + { + var x = a + b; + var bv = x - a; + var av = x - bv; + var br = b - bv; + var ar = a - av; + var y = ar + br; + if (y != 0f) + { + result[0] = y; + result[1] = x; + resultN = 2; + return; + } + result[0] = x; + resultN = 1; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Robust.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Robust.cs.meta new file mode 100644 index 0000000000..69bbec5ea3 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Robust.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 76852b2115774598947fe907402ed9fd +timeCreated: 1519703003 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Triangles.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Triangles.cs new file mode 100644 index 0000000000..0b187bc305 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Triangles.cs @@ -0,0 +1,185 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace SVGMeshUnity.Internals.Cdt2d +{ + public class Triangles + { + public Triangles(MeshData data) + { + PrivateVertices = data.Vertices; + CreateStars(data.Vertices.Count); + CreateEdges(data.Edges); + CreateTriangles(data.Triangles); + } + + public List Vertices + { + get { return PrivateVertices; } + } + + public WorkBuffer[] Stars + { + get { return PrivateStars; } + } + + private List PrivateVertices; + private WorkBuffer[] PrivateStars; + private Int2[] Edges; + + private void CreateStars(int n) + { + var stars = new WorkBuffer[n]; + for (var i = 0; i < n; ++i) + { + stars[i] = new WorkBuffer(16); + } + PrivateStars = stars; + } + + private void CreateEdges(List source) + { + var l = source.Count; + var edges = new Int2[l]; + for (var i = 0; i < l; ++i) + { + var edge = source[i]; + if (edge.y < edge.x) + { + var x = edge.x; + edge.x = edge.y; + edge.y = x; + } + edges[i] = edge; + } + Sort.QuickSort(edges, 0, edges.Length - 1); + Edges = edges; + } + + private void CreateTriangles(List source) + { + var l = source.Count; + for (var i = 0; i < l; i += 3) + { + AddTriangle(source[i + 0], source[i + 1], source[i + 2]); + } + } + + public void AddTriangle(int i, int j, int k) + { + var jk = new Int2(j, k); + var ki = new Int2(k, i); + var ij = new Int2(i, j); + PrivateStars[i].Push(ref jk); + PrivateStars[j].Push(ref ki); + PrivateStars[k].Push(ref ij); + } + + public void RemoveTriangle(int i, int j, int k) + { + RemovePair(PrivateStars[i], j, k); + RemovePair(PrivateStars[j], k, i); + RemovePair(PrivateStars[k], i, j); + } + + private void RemovePair(WorkBuffer list, int j, int k) + { + var n = list.UsedSize; + var data = list.Data; + for (var i = 0; i < n; ++i) + { + var s = data[i]; + if (s.x == j && s.y == k) + { + data[i] = data[n - 1]; + list.RemoveLast(1); + return; + } + } + } + + public int Opposite(int j, int i) + { + var list = PrivateStars[i]; + var n = list.UsedSize; + var data = list.Data; + for (var k = 0; k < n; ++k) + { + if (data[k].y == j) + { + return data[k].x; + } + } + return -1; + } + + public void Flip(int i, int j) + { + var a = Opposite(i, j); + var b = Opposite(j, i); + RemoveTriangle(i, j, a); + RemoveTriangle(j, i, b); + AddTriangle(i, b, a); + AddTriangle(j, a, b); + } + + public bool IsConstraint(int i, int j) + { + var e = new Int2(Mathf.Min(i, j), Mathf.Max(i, j)); + return BinarySearch.EQ(Edges, e, 0, Edges.Length) >= 0; + } + + public void Fill(List triangles) + { + var n = PrivateStars.Length; + + if (triangles.Capacity < n) + { + triangles.Capacity = n; + } + triangles.Clear(); + + for(var i = 0; i < n; ++i) + { + var list = PrivateStars[i]; + var data = list.Data; + var m = list.UsedSize; + for(var j = 0; j < m; ++j) + { + var s = data[j]; + if(i < Mathf.Min(s.x, s.y)) + { + triangles.Add(i); + triangles.Add(s.x); + triangles.Add(s.y); + } + } + } + } + + public void Fill(WorkBuffer triangles) + { + var n = PrivateStars.Length; + + triangles.Extend(n); + triangles.Clear(); + + for(var i = 0; i < n; ++i) + { + var list = PrivateStars[i]; + var data = list.Data; + var m = list.UsedSize; + for(var j = 0; j < m; ++j) + { + var s = data[j]; + if(i < Mathf.Min(s.x, s.y)) + { + var v = new Int3(i, s.x, s.y); + triangles.Push(ref v); + } + } + } + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Triangles.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Triangles.cs.meta new file mode 100644 index 0000000000..77ca4a8d08 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Triangles.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0ae927e5d9354637b7361e1a99ac6aa9 +timeCreated: 1519790845 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Triangulation.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Triangulation.cs new file mode 100644 index 0000000000..360aa65d03 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Triangulation.cs @@ -0,0 +1,72 @@ +namespace SVGMeshUnity.Internals.Cdt2d +{ + public class Triangulation + { + // https://github.com/mikolalysenko/cdt2d + + public bool Delaunay = true; + public bool Interior = true; + public bool Exterior = true; + public bool Infinity = false; + + public WorkBufferPool WorkBufferPool; + + private MonotoneTriangulation MonotoneTriangulation = new MonotoneTriangulation(); + private DelaunayRefine DelaunayRefine = new DelaunayRefine(); + private Filter Filter = new Filter(); + + public void BuildTriangles(MeshData data) + { + //Handle trivial case + if ((!Interior && !Exterior) || data.Vertices.Count == 0) + { + return; + } + + //Construct initial triangulation + MonotoneTriangulation.WorkBufferPool = WorkBufferPool; + MonotoneTriangulation.BuildTriangles(data); + + //If delaunay refinement needed, then improve quality by edge flipping + if (Delaunay || Interior != Exterior || Infinity) + { + //Index all of the cells to support fast neighborhood queries + var triangles = new Triangles(data); + + //Run edge flipping + if (Delaunay) + { + DelaunayRefine.WorkBufferPool = WorkBufferPool; + DelaunayRefine.RefineTriangles(triangles); + } + + Filter.WorkBufferPool = WorkBufferPool; + Filter.Infinity = Infinity; + + //Filter points + if (!Exterior) + { + Filter.Target = -1; + Filter.Do(triangles, data.Triangles); + return; + } + if (!Interior) + { + Filter.Target = 1; + Filter.Do(triangles, data.Triangles); + return; + } + if (Infinity) + { + Filter.Target = 0; + Filter.Do(triangles, data.Triangles); + return; + } + + triangles.Fill(data.Triangles); + + } + } + + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Triangulation.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Triangulation.cs.meta new file mode 100644 index 0000000000..52e1afa0fd --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Cdt2d/Triangulation.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 781d3a8656524a829b4205bab46ef8de +timeCreated: 1519698011 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Curve.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Curve.cs new file mode 100644 index 0000000000..128aa1b123 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Curve.cs @@ -0,0 +1,12 @@ +using UnityEngine; + +namespace SVGMeshUnity.Internals +{ + public struct Curve + { + public bool IsMove; + public Vector2 Position; + public Vector2 InControl; + public Vector2 OutControl; + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Curve.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Curve.cs.meta new file mode 100644 index 0000000000..68c99decc8 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Curve.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6d1543b2c42a4cf6a556b45007e9a7d7 +timeCreated: 1519625420 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Int2.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Int2.cs new file mode 100644 index 0000000000..8657284aa7 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Int2.cs @@ -0,0 +1,23 @@ +using System; + +namespace SVGMeshUnity.Internals +{ + public struct Int2 : IComparable + { + public Int2(int x, int y) + { + this.x = x; + this.y = y; + } + + public int x; + public int y; + + public int CompareTo(Int2 b) + { + var d = x - b.x; + if (d != 0) return d; + return y - b.y; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Int2.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Int2.cs.meta new file mode 100644 index 0000000000..c1869cca77 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Int2.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d8e3039a00c54f89a570bbde07b4932d +timeCreated: 1519872919 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Int3.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Int3.cs new file mode 100644 index 0000000000..3e9dd8516c --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Int3.cs @@ -0,0 +1,31 @@ +using System; + +namespace SVGMeshUnity.Internals +{ + public struct Int3 : IComparable + { + public Int3(int x, int y, int z) + { + this.x = x; + this.y = y; + this.z = z; + } + + public int x; + public int y; + public int z; + + public int CompareTo(Int3 b) + { + var d = 0; + + d = x - b.x; + if (d != 0) return d; + + d = y - b.y; + if (d != 0) return d; + + return z - b.z; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Int3.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Int3.cs.meta new file mode 100644 index 0000000000..74596c9fc5 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Int3.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 518c1f26691e43c3a27c0837c39e25f4 +timeCreated: 1519873038 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/MeshData.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/MeshData.cs new file mode 100644 index 0000000000..bfacb1b45b --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/MeshData.cs @@ -0,0 +1,126 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace SVGMeshUnity.Internals +{ + public class MeshData + { + public MeshData() + { + Vertices = new List(); + Edges = new List(); + Triangles = new List(); + VertexIndices = new Hashtable(); + } + + public List Vertices { get; private set; } + public List Edges { get; private set; } + public List Triangles { get; private set; } + + private Hashtable VertexIndices; + + public void Clear() + { + Vertices.Clear(); + Edges.Clear(); + Triangles.Clear(); + VertexIndices.Clear(); + } + + public void AddVertices(WorkBuffer buffer) + { + var firstEdgeIdx = -1; + var prevEdgeidx = -1; + + var vertices = Vertices; + var edges = Edges; + var indicies = VertexIndices; + + var size = buffer.UsedSize; + var data = buffer.Data; + + for (var i = 0; i < size; ++i) + { + var v = data[i]; + var idx = -1; + + var index = indicies[v]; + if (index != null) + { + idx = (int) index; + } + + if (idx == -1) + { + vertices.Add(v); + idx = vertices.Count - 1; + indicies[v] = idx; + } + + if (idx == prevEdgeidx) + { + continue; + } + + if (i == 0) + { + firstEdgeIdx = idx; + } + else + { + edges.Add(new Int2(prevEdgeidx, idx)); + } + + prevEdgeidx = idx; + } + + if (prevEdgeidx != firstEdgeIdx) + { + edges.Add(new Int2(prevEdgeidx, firstEdgeIdx)); + } + } + + public void MakeUnityFriendly() + { + { + var vertices = Vertices; + var l = vertices.Count; + for (var i = 0; i < l; ++i) + { + var v = vertices[i]; + v.y *= -1f; + vertices[i] = v; + } + } + { + var triangles = Triangles; + var l = triangles.Count; + for (var i = 0; i < l; i += 3) + { + var a = triangles[i + 0]; + var b = triangles[i + 1]; + var c = triangles[i + 2]; + triangles[i + 0] = b; + triangles[i + 1] = c; + triangles[i + 2] = a; + } + } + } + + public void Upload(Mesh m) + { + m.Clear(); + m.SetVertices(Vertices); + m.SetTriangles(Triangles, 0); + m.RecalculateBounds(); + m.RecalculateNormals(); + } + + public void DumpTriangles() + { + Debug.Log(Triangles.Aggregate("", (_, i) => _ + i.ToString() + "\n")); + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/MeshData.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/MeshData.cs.meta new file mode 100644 index 0000000000..17183b1331 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/MeshData.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 71c31466ffeb411f87eeb5849aaf19b2 +timeCreated: 1519696938 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Sort.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Sort.cs new file mode 100644 index 0000000000..ab93364bef --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Sort.cs @@ -0,0 +1,49 @@ +using System; + +namespace SVGMeshUnity.Internals +{ + public static class Sort where T : IComparable + { + public static void QuickSort(T[] elements, int left, int right) + { + var i = left; + var j = right; + var pivot = elements[(left + right) >> 1]; + + while (i <= j) + { + while (elements[i].CompareTo(pivot) < 0) + { + ++i; + } + + while (elements[j].CompareTo(pivot) > 0) + { + --j; + } + + if (i <= j) + { + // Swap + var tmp = elements[i]; + elements[i] = elements[j]; + elements[j] = tmp; + + i++; + j--; + } + } + + // Recursive calls + if (left < j) + { + QuickSort(elements, left, j); + } + + if (i < right) + { + QuickSort(elements, i, right); + } + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Sort.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Sort.cs.meta new file mode 100644 index 0000000000..b1d1822dd6 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/Sort.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c8b61e3455704b8780c63fbcd0724afd +timeCreated: 1519879160 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/WorkBuffer.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/WorkBuffer.cs new file mode 100644 index 0000000000..e04a3eb5c7 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/WorkBuffer.cs @@ -0,0 +1,166 @@ +using System; +using System.Linq; +using UnityEngine; + +namespace SVGMeshUnity.Internals +{ + public class WorkBuffer + { + public WorkBuffer(int size = 32) + { + GrowSize = size; + PrivateData = new T[size]; + } + + public T[] Data + { + get { return PrivateData; } + } + public int UsedSize + { + get { return PrivateUsedSize; } + } + + public Func NewForClass; + + private int GrowSize; + private T[] PrivateData; + private int PrivateUsedSize; + + private void Grow(int size) + { + var newPrivateData = new T[size]; + PrivateData.CopyTo(newPrivateData, 0); + PrivateData = newPrivateData; + } + + private void GrowIfNeeded() + { + if (PrivateData.Length == PrivateUsedSize) + { + Grow(PrivateData.Length + GrowSize); + } + } + + public void Extend(int size) + { + if (PrivateData.Length < size) + { + Grow(size); + } + } + + public void Fill(ref T val, int n) + { + if (PrivateData.Length < n) + { + Grow(n); + } + + for (var i = 0; i < n; ++i) + { + PrivateData[i] = val; + } + + PrivateUsedSize = n; + } + + public void Push(ref T val) + { + GrowIfNeeded(); + PrivateData[PrivateUsedSize] = val; + ++PrivateUsedSize; + } + + public T Push() + { + GrowIfNeeded(); + + var val = PrivateData[PrivateUsedSize]; + + if (val == null) + { + val = NewForClass(); + PrivateData[PrivateUsedSize] = val; + } + + ++PrivateUsedSize; + + return val; + } + + public T Pop() + { + var val = PrivateData[PrivateUsedSize - 1]; + --PrivateUsedSize; + return val; + } + + public T Insert(int index) + { + if (index == PrivateUsedSize) + { + return Push(); + } + + GrowIfNeeded(); + + var val = PrivateData[PrivateUsedSize]; + + for (var i = PrivateUsedSize - 1; i >= index; --i) + { + PrivateData[i + 1] = PrivateData[i]; + } + + if (val == null) + { + val = NewForClass(); + } + + PrivateData[index] = val; + + ++PrivateUsedSize; + + return val; + } + + public void RemoveAt(int index) + { + var old = PrivateData[index]; + + for (var i = index; i < PrivateUsedSize - 1; ++i) + { + PrivateData[i] = PrivateData[i + 1]; + } + + PrivateData[PrivateUsedSize - 1] = old; + + --PrivateUsedSize; + } + + public static void Sort(WorkBuffer buf) where G : IComparable + { + Internals.Sort.QuickSort(buf.PrivateData, 0, buf.PrivateUsedSize - 1); + } + + public void RemoveLast(int n) + { + PrivateUsedSize -= n; + } + + public void Clear() + { + PrivateUsedSize = 0; + } + + public void Dump() + { + Debug.Log(PrivateData.Take(PrivateUsedSize).Aggregate("", (_, s) => _ + s.ToString() + "\n")); + } + + public void DumpHash() + { + Debug.LogFormat("{0}{1}", PrivateUsedSize, PrivateData.Select(_ => string.Format("{0:x}",_ != null ? _.GetHashCode() : 0)).Aggregate("", (_, s) => _ + ", " + s)); + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/WorkBuffer.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/WorkBuffer.cs.meta new file mode 100644 index 0000000000..01057528d3 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/WorkBuffer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c9f5042ad1d1418ebe4901c4d1a76acf +timeCreated: 1519696456 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/WorkBufferPool.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/WorkBufferPool.cs new file mode 100644 index 0000000000..e3ccebf217 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/WorkBufferPool.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace SVGMeshUnity.Internals +{ + public class WorkBufferPool + { + private readonly Dictionary> Pool = new Dictionary>(); + + public WorkBuffer Get() + { + Stack list; + WorkBuffer buf = null; + + if (Pool.TryGetValue(typeof(T), out list)) + { + if (list.Count > 0) + { + buf = (WorkBuffer)list.Pop(); + } + } + + return buf ?? new WorkBuffer(); + } + + public void Get(ref WorkBuffer buf) + { + buf = Get(); + } + + public void Release(ref WorkBuffer buf) + { + Stack list; + + buf.Clear(); + + if (!Pool.TryGetValue(typeof(T), out list)) + { + Pool[typeof(T)] = list = new Stack(); + } + + list.Push(buf); + buf = null; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/WorkBufferPool.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/WorkBufferPool.cs.meta new file mode 100644 index 0000000000..8960b96592 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/Internals/WorkBufferPool.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4e9185cc3eef4289807b77668196dd7f +timeCreated: 1519698762 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGData.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGData.cs new file mode 100644 index 0000000000..994297bfdb --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGData.cs @@ -0,0 +1,586 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using SVGMeshUnity.Internals; +using UnityEngine; + +namespace SVGMeshUnity +{ + public class SVGData + { + // https://github.com/jkroso/abs-svg-path + // https://github.com/jkroso/normalize-svg-path + // https://github.com/colinmeinke/svg-arc-to-cubic-bezier + + // https://github.com/jkroso/parse-svg-path + + public List Curves = new List(); + + private Vector2 Start; + private Vector2 Current; + private Nullable Bezier; + private Nullable Quad; + + public void Clear() + { + Curves.Clear(); + Start = Vector2.zero; + Current = Vector2.zero; + Bezier = null; + Quad = null; + } + + public void Move(float x, float y) + { + Move(new Vector2(x, y)); + } + + public void MoveRelative(float x, float y) + { + Move(Current.x + x, Current.y + y); + } + + public void Move(Vector2 v) + { + Start = v; + Curves.Add(new Curve() + { + IsMove = true, + Position = v, + }); + Current = v; + Bezier = null; + Quad = null; + } + + public void MoveRelative(Vector2 v) + { + Move(Current + v); + } + + public void Curve(float inX, float inY, float outX, float outY, float x, float y) + { + Curve(new Vector2(inX, inY), new Vector2(outX, outY), new Vector2(x, y)); + } + + public void Curve(Vector2 inControl, Vector2 outControl, Vector2 v) + { + CurveInternal(inControl, outControl, v); + Bezier = outControl; + } + + private void CurveInternal(Vector2 inControl, Vector2 outControl, Vector2 v) + { + Curves.Add(new Curve() + { + Position = v, + InControl = inControl, + OutControl = outControl, + }); + Current = v; + Bezier = null; + Quad = null; + } + + public void CurveRelative(float inX, float inY, float outX, float outY, float x, float y) + { + CurveRelative(new Vector2(inX, inY), new Vector2(outX, outY), new Vector2(x, y)); + } + + public void CurveRelative(Vector2 inControl, Vector2 outControl, Vector2 v) + { + Curve(Current + inControl, Current + outControl, Current + v); + } + + public void CurveSmooth(float controlX, float controlY, float x, float y) + { + CurveSmooth(new Vector2(controlX, controlY), new Vector2(x, y)); + } + + public void CurveSmooth(Vector2 control, Vector2 v) + { + Curve(Bezier != null ? Current * 2f - Bezier.Value : Current, control, v); + } + + public void CurveSmoothRelative(float controlX, float controlY, float x, float y) + { + CurveSmoothRelative(new Vector2(controlX, controlY), new Vector2(x, y)); + } + + public void CurveSmoothRelative(Vector2 control, Vector2 v) + { + CurveSmooth(Current + control, Current + v); + } + + public void Quadratic(float controlX, float controlY, float x, float y) + { + Quadratic(new Vector2(controlX, controlY), new Vector2(x, y)); + } + + public void Quadratic(Vector2 control, Vector2 v) + { + CurveInternal(Current / 3f + (2f / 3f) * control, v / 3f + (2f / 3f) * control, v); + Quad = control; + } + + public void QuadraticRelative(float controlX, float controlY, float x, float y) + { + QuadraticRelative(new Vector2(controlX, controlY), new Vector2(x, y)); + } + + public void QuadraticRelative(Vector2 control, Vector2 v) + { + Quadratic(Current + control, Current + v); + } + + public void QuadraticSmooth(float x, float y) + { + QuadraticSmooth(new Vector2(x, y)); + } + + public void QuadraticSmooth(Vector2 v) + { + Quadratic(Quad != null ? Current * 2f - Quad.Value : Current, v); + } + + public void QuadraticSmoothRelative(float x, float y) + { + QuadraticSmooth(Current.x + x, Current.y + y); + } + + public void QuadraticSmoothRelative(Vector2 v) + { + QuadraticSmooth(Current + v); + } + + public void Arc(float radiusX, float radiusY, float xAxisRotation, bool largeArcFlag, bool sweepFlag, float x, float y) + { + Arc(new Vector2(radiusX, radiusY), xAxisRotation, largeArcFlag, sweepFlag, new Vector2(x, y)); + } + + public void ArcRelative(float radiusX, float radiusY, float xAxisRotation, bool largeArcFlag, bool sweepFlag, float x, float y) + { + ArcRelative(new Vector2(radiusX, radiusY), xAxisRotation, largeArcFlag, sweepFlag, new Vector2(x, y)); + } + + public void ArcRelative(Vector2 radius, float xAxisRotation, bool largeArcFlag, bool sweepFlag, Vector2 v) + { + Arc(radius, xAxisRotation, largeArcFlag, sweepFlag, Current + v); + } + + public void Line(float x, float y) + { + Line(new Vector2(x, y)); + } + + public void Line(Vector2 v) + { + CurveInternal(Current, v, v); + } + + public void LineRelative(float x, float y) + { + Line(Current.x + x, Current.y + y); + } + + public void LineRelative(Vector2 v) + { + Line(Current + v); + } + + public void LineHorizontal(float x) + { + Line(x, Current.y); + } + + public void LineHorizontalRelative(float x) + { + LineHorizontal(Current.x + x); + } + + public void LineVertical(float y) + { + Line(Current.x, y); + } + + public void LineVerticalRelative(float y) + { + LineVertical(Current.y + y); + } + + public void Close() + { + Line(Start); + } + + + #region Arc + + public void Arc(Vector2 radius, float xAxisRotation, bool largeArcFlag, bool sweepFlag, Vector2 v) + { + if (radius.x == 0f || radius.y == 0f) + { + return; + } + + const float TAU = Mathf.PI * 2f; + + var sinphi = Mathf.Sin(xAxisRotation * TAU / 360f); + var cosphi = Mathf.Cos(xAxisRotation * TAU / 360f); + + var pxp = cosphi * (Current.x - v.x) / 2f + sinphi * (Current.y - v.y) / 2f; + var pyp = -sinphi * (Current.x - v.x) / 2f + cosphi * (Current.y - v.y) / 2f; + + if (pxp == 0f && pyp == 0f) + { + return; + } + + var rx = Mathf.Abs(radius.x); + var ry = Mathf.Abs(radius.y); + + var lambda = + Mathf.Pow(pxp, 2f) / Mathf.Pow(rx, 2f) + + Mathf.Pow(pyp, 2f) / Mathf.Pow(ry, 2); + + if (lambda > 1f) + { + rx *= Mathf.Sqrt(lambda); + ry *= Mathf.Sqrt(lambda); + } + + var rxsq = Mathf.Pow(rx, 2f); + var rysq = Mathf.Pow(ry, 2f); + var pxpsq = Mathf.Pow(pxp, 2f); + var pypsq = Mathf.Pow(pyp, 2f); + + var radicant = (rxsq * rysq) - (rxsq * pypsq) - (rysq * pxpsq); + + if (radicant < 0f) + { + radicant = 0f; + } + + radicant /= (rxsq * pypsq) + (rysq * pxpsq); + radicant = Mathf.Sqrt(radicant) * (largeArcFlag == sweepFlag ? -1f : 1f); + + var centerxp = radicant * rx / ry * pyp; + var centeryp = radicant * -ry / rx * pxp; + + var centerx = cosphi * centerxp - sinphi * centeryp + (Current.x + v.x) / 2f; + var centery = sinphi * centerxp + cosphi * centeryp + (Current.y + v.y) / 2f; + + var vx1 = (pxp - centerxp) / rx; + var vy1 = (pyp - centeryp) / ry; + var vx2 = (-pxp - centerxp) / rx; + var vy2 = (-pyp - centeryp) / ry; + + var ang1 = VectorAngle(1, 0f, vx1, vy1); + var ang2 = VectorAngle(vx1, vy1, vx2, vy2); + + if (sweepFlag == false && ang2 > 0f) + { + ang2 -= TAU; + } + + if (sweepFlag == true && ang2 < 0f) + { + ang2 += TAU; + } + + var segments = Mathf.Max(Mathf.Ceil(Mathf.Abs(ang2) / (TAU / 4f)), 1f); + + ang2 /= segments; + + for (var i = 0; i < segments; ++i) + { + var a = 4f / 3f * Mathf.Tan(ang2 / 4f); + + var x1 = Mathf.Cos(ang1); + var y1 = Mathf.Sin(ang1); + var x2 = Mathf.Cos(ang1 + ang2); + var y2 = Mathf.Sin(ang1 + ang2); + + var curve0 = new Vector2(x1 - y1 * a, y1 + x1 * a); + var curve1 = new Vector2(x2 + y2 * a, y2 - x2 * a); + var curve2 = new Vector2(x2, y2); + + MapToEllipse(ref curve0, rx, ry, cosphi, sinphi, centerx, centery); + MapToEllipse(ref curve1, rx, ry, cosphi, sinphi, centerx, centery); + MapToEllipse(ref curve2, rx, ry, cosphi, sinphi, centerx, centery); + + CurveInternal(curve0, curve1, curve2); + + ang1 += ang2; + } + } + + private float VectorAngle(float ux, float uy, float vx, float vy) + { + var sign = Mathf.Sign(ux * vy - uy * vx); + var umag = Mathf.Sqrt(ux * ux + uy * uy); + var vmag = Mathf.Sqrt(ux * ux + uy * uy); + var dot = ux * vx + uy * vy; + + var div = dot / (umag * vmag); + + if (div > 1f) + { + div = 1f; + } + + if (div < -1f) + { + div = -1f; + } + + return sign * Mathf.Acos(div); + } + + private void MapToEllipse(ref Vector2 v, float rx, float ry, float cosphi, float sinphi, float centerx, float centery) + { + var x = v.x * rx; + var y = v.y * ry; + + v.x = cosphi * x - sinphi * y + centerx; + v.y = sinphi * x + cosphi * y + centery; + } + + #endregion + + + #region Path Parser + + private static readonly Regex Segment = new Regex("([astvzqmhlc])([^astvzqmhlc]*)", RegexOptions.IgnoreCase | RegexOptions.Multiline); + private static readonly Dictionary ArgumentLengthes = new Dictionary() + { + { "a", 7 }, { "c", 6 }, { "h", 1 }, { "l", 2 }, { "m", 2 }, { "q", 4 }, { "s", 4 }, { "t", 2 }, { "v", 1 }, { "z", 0 } + }; + + public void Path(string data) + { + var args = new float[32]; + var numArgs = 0; + + foreach (Match seg in Segment.Matches(data)) + { + var command = seg.Groups[1].Value; + var type = command.ToLower(); + + ParseArgs(seg.Groups[2].Value, ref args, out numArgs); + + var argsIndex = 0; + + if (type == "m" && numArgs > 2) + { + LoadCommand(command, type, args, numArgs, ref argsIndex); + type = "l"; + command = command == "m" ? "l" : "L"; + } + + for (;;) + { + if (LoadCommand(command, type, args, numArgs, ref argsIndex)) + { + break; + } + } + } + } + + private bool LoadCommand(string command, string type, float[] args, int numArgs, ref int argsIndex) + { + if (numArgs!=0 && argsIndex == numArgs) + { + return true; + } + + var len = ArgumentLengthes[type]; + + if (argsIndex + len > numArgs) + { + throw new ArgumentException("Malformed path data"); + } + + var i = argsIndex; + switch (command) + { + case "A": + Arc(args[i + 0], args[i + 1], args[i + 2], args[i + 3] > 0f, args[i + 4] > 0f, args[i + 5], + args[i + 6]); + break; + case "a": + ArcRelative(args[i + 0], args[i + 1], args[i + 2], args[i + 3] > 0f, args[i + 4] > 0f, args[i + 5], + args[i + 6]); + break; + case "C": + Curve(args[i + 0], args[i + 1], args[i + 2], args[i + 3], args[i + 4], args[i + 5]); + break; + case "c": + CurveRelative(args[i + 0], args[i + 1], args[i + 2], args[i + 3], args[i + 4], args[i + 5]); + break; + case "H": + LineHorizontal(args[i + 0]); + break; + case "h": + LineHorizontalRelative(args[i + 0]); + break; + case "L": + Line(args[i + 0], args[i + 1]); + break; + case "l": + LineRelative(args[i + 0], args[i + 1]); + break; + case "M": + Move(args[i + 0], args[i + 1]); + break; + case "m": + MoveRelative(args[i + 0], args[i + 1]); + break; + case "Q": + Quadratic(args[i + 0], args[i + 1], args[i + 2], args[i + 3]); + break; + case "q": + QuadraticRelative(args[i + 0], args[i + 1], args[i + 2], args[i + 3]); + break; + case "S": + CurveSmooth(args[i + 0], args[i + 1], args[i + 2], args[i + 3]); + break; + case "s": + CurveSmoothRelative(args[i + 0], args[i + 1], args[i + 2], args[i + 3]); + break; + case "T": + QuadraticSmooth(args[i + 0], args[i + 1]); + break; + case "t": + QuadraticSmoothRelative(args[i + 0], args[i + 1]); + break; + case "V": + LineVertical(args[i + 0]); + break; + case "v": + LineVerticalRelative(args[i + 0]); + break; + case "Z": + case "z": + Close(); + break; + } + + argsIndex += len; + + if (numArgs == 0) return true; + + return false; + } + + private void ParseArgs(string s, ref float[] args, out int numArgs) + { + numArgs = 0; + + var l = s.Length; + var buf = new StringBuilder(16); + var lastIsE = false; + var includesDot = false; + for (var i = 0; i < l; ++i) + { + var isBreak = false; + var c = s[i]; + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + buf.Append(c); + lastIsE = false; + break; + case '.': + if (includesDot) + { + isBreak = true; + --i; + } + else + { + buf.Append(c); + includesDot = true; + lastIsE = false; + } + break; + case 'e': + buf.Append(c); + lastIsE = true; + break; + case '+': + case '-': + if (buf.Length > 0 && !lastIsE) + { + isBreak = true; + --i; + } + else + { + buf.Append(c); + lastIsE = false; + } + break; + default: + isBreak = true; + break; + } + + if (isBreak || i == l - 1) + { + if (buf.Length > 0) + { + if (args.Length == numArgs) + { + var newArgs = new float[args.Length + 32]; + args.CopyTo(newArgs, 0); + args = newArgs; + } + + args[numArgs] = float.Parse(buf.ToString()); + numArgs++; + buf.Length = 0; + lastIsE = false; + includesDot = false; + } + } + } + } + + #endregion + + + #region Debug + + public string Dump() + { + return Curves + .Select(_ => + { + if (_.IsMove) + { + return string.Format("M {0} {1}", _.Position.x, _.Position.y); + } + else + { + return string.Format("C {0} {1}, {2} {3}, {4} {5}", _.InControl.x, _.InControl.y, _.OutControl.x, _.OutControl.y, _.Position.x, _.Position.y); + } + }) + .Aggregate("", (_, s) => _ + s + " "); + } + + #endregion + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGData.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGData.cs.meta new file mode 100644 index 0000000000..ba3a7c92d9 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7927a8fbe7ef84ebc95a11f2b57680f5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGMesh.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGMesh.cs new file mode 100644 index 0000000000..8d5c82823d --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGMesh.cs @@ -0,0 +1,66 @@ +using SVGMeshUnity.Internals; +using SVGMeshUnity.Internals.Cdt2d; +using UnityEngine; + +namespace SVGMeshUnity +{ + public class SVGMesh : MonoBehaviour + { + // https://github.com/mattdesl/adaptive-bezier-curve + + public float Scale = 1f; + + public bool Delaunay = false; + public bool Interior = true; + public bool Exterior = false; + public bool Infinity = false; + + private static WorkBufferPool WorkBufferPool = new WorkBufferPool(); + + private MeshData MeshData = new MeshData(); + private Mesh Mesh; + + private BezierToVertex BezierToVertex; + private Triangulation Triangulation; + + private void Awake() + { + BezierToVertex = new BezierToVertex(); + BezierToVertex.WorkBufferPool = WorkBufferPool; + + Triangulation = new Triangulation(); + Triangulation.WorkBufferPool = WorkBufferPool; + } + + public void Fill(SVGData svg) + { + MeshData.Clear(); + + // convert curves into discrete points + BezierToVertex.Scale = Scale; + BezierToVertex.GetContours(svg, MeshData); + + // triangulate mesh + Triangulation.Delaunay = Delaunay; + Triangulation.Interior = Interior; + Triangulation.Exterior = Exterior; + Triangulation.Infinity = Infinity; + Triangulation.BuildTriangles(MeshData); + + if (Mesh == null) + { + Mesh = new Mesh(); + Mesh.MarkDynamic(); + } + + MeshData.MakeUnityFriendly(); + MeshData.Upload(Mesh); + + var filter = GetComponent(); + if (filter != null) + { + filter.sharedMesh = Mesh; + } + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGMesh.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGMesh.cs.meta new file mode 100644 index 0000000000..64a6dca954 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGMesh.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3646afd5fb564c6b914c04b46d4417c8 +timeCreated: 1519635751 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGMeshUnity.Runtime.asmdef b/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGMeshUnity.Runtime.asmdef new file mode 100644 index 0000000000..299e37f55d --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGMeshUnity.Runtime.asmdef @@ -0,0 +1,3 @@ +{ + "name": "SVGMeshUnity" +} diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGMeshUnity.Runtime.asmdef.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGMeshUnity.Runtime.asmdef.meta new file mode 100644 index 0000000000..904401ea49 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGMeshUnity.Runtime.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 13ced72b5c60b45cda3a649cd6d40f5b +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGPolyline.cs b/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGPolyline.cs new file mode 100644 index 0000000000..0f1c06fbe9 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGPolyline.cs @@ -0,0 +1,33 @@ +using System.Collections.Generic; +using SVGMeshUnity.Internals; +using SVGMeshUnity.Internals.Cdt2d; +using UnityEditor; +using UnityEngine; + +namespace SVGMeshUnity +{ + public class SVGPolyline + { + // https://github.com/mattdesl/adaptive-bezier-curve + + public float Scale = 1f; + public List> Polyline = new List>(); + + private static WorkBufferPool WorkBufferPool = new WorkBufferPool(); + private BezierToPolyline BezierToPolyline; + + public SVGPolyline() + { + BezierToPolyline = new BezierToPolyline(); + BezierToPolyline.WorkBufferPool = WorkBufferPool; + } + + public void Fill(SVGData svg) + { + Polyline.Clear(); + BezierToPolyline.Scale = Scale; + BezierToPolyline.GetContours(svg, Polyline); + + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGPolyline.cs.meta b/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGPolyline.cs.meta new file mode 100644 index 0000000000..2a575dfc29 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/Runtime/SVGPolyline.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5d7bda29948f4ef78f32a4967ab9f22b +timeCreated: 1615377073 \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/url.txt b/Assets/ThirdParty/SVGMeshUnity/url.txt new file mode 100644 index 0000000000..82281e7302 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/url.txt @@ -0,0 +1 @@ +https://github.com/beinteractive/SVGMeshUnity \ No newline at end of file diff --git a/Assets/ThirdParty/SVGMeshUnity/url.txt.meta b/Assets/ThirdParty/SVGMeshUnity/url.txt.meta new file mode 100644 index 0000000000..02fe7826e2 --- /dev/null +++ b/Assets/ThirdParty/SVGMeshUnity/url.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 451ef29677066164b8ccc5234ecad871 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From cf06a5949eb4d7ac2c2c43598162ccb365ec4d2b Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Thu, 6 May 2021 22:59:17 +0100 Subject: [PATCH 006/769] Well this almost makes sense. --- Assets/Prefabs/Panels/ColorPickerPanel.prefab | 403 ++++++++- .../Panels/Widgets/JitterSlider.prefab | 621 +++++++++++++ .../Panels/Widgets/JitterSlider.prefab.meta | 7 + .../PopUps/PopUpWindow_ColorOptions.prefab | 844 ++++++++++++++++++ .../PopUpWindow_ColorOptions.prefab.meta | 7 + Assets/Scripts/GUI/ColorJitterSlider.cs.meta | 3 + Assets/Scripts/GUI/ColorPickerPopupButton.cs | 23 + .../GUI/ColorPickerPopupButton.cs.meta | 3 + Assets/Scripts/PointerManager.cs | 36 +- Assets/Scripts/SketchControlsScript.cs | 1 + 10 files changed, 1930 insertions(+), 18 deletions(-) create mode 100644 Assets/Prefabs/Panels/Widgets/JitterSlider.prefab create mode 100644 Assets/Prefabs/Panels/Widgets/JitterSlider.prefab.meta create mode 100644 Assets/Prefabs/PopUps/PopUpWindow_ColorOptions.prefab create mode 100644 Assets/Prefabs/PopUps/PopUpWindow_ColorOptions.prefab.meta create mode 100644 Assets/Scripts/GUI/ColorJitterSlider.cs.meta create mode 100644 Assets/Scripts/GUI/ColorPickerPopupButton.cs create mode 100644 Assets/Scripts/GUI/ColorPickerPopupButton.cs.meta diff --git a/Assets/Prefabs/Panels/ColorPickerPanel.prefab b/Assets/Prefabs/Panels/ColorPickerPanel.prefab index 9629006e6e..de93736f75 100644 --- a/Assets/Prefabs/Panels/ColorPickerPanel.prefab +++ b/Assets/Prefabs/Panels/ColorPickerPanel.prefab @@ -32,6 +32,8 @@ Transform: - {fileID: 4000013204761718} - {fileID: 4567308084348702} - {fileID: 4000010635123818} + - {fileID: 5035783189062963130} + - {fileID: 5829039265654114525} - {fileID: 4438075100088248} m_Father: {fileID: 4000011237366108} m_RootOrder: 2 @@ -178,7 +180,9 @@ MonoBehaviour: m_Border: {fileID: 23000010616956562} m_MeshCollider: {fileID: 65000011921694012} m_ParticleBounds: {x: 1.75, y: 1.75, z: 0} - m_PanelPopUpMap: [] + m_PanelPopUpMap: + - m_PopUpPrefab: {fileID: 197348, guid: d239309283424304dbea4303c5b675ba, type: 3} + m_Command: 7000 m_PanelDescription: Color Picker m_PanelDescriptionPrefab: {fileID: 160918, guid: 3491f4f01ba6cac47b1633f36d7c6c84, type: 3} @@ -318,6 +322,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -329,6 +334,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -410,6 +416,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -421,6 +428,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -472,6 +480,7 @@ MonoBehaviour: m_ZAdjustHover: -0.02 m_ZAdjustClick: 0.05 m_HoverScale: 1.1 + m_HoverBoxColliderGrow: 0.2 m_AddOverlay: 0 m_ShowRotation: 1 m_RotationSpeedMultiplier: 14.3 @@ -570,6 +579,7 @@ MeshRenderer: m_MotionVectors: 0 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -581,6 +591,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -656,6 +667,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -667,6 +679,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -757,6 +770,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -768,6 +782,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -821,7 +836,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1058598581371676} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.3237505, y: 0, z: 0} + m_LocalPosition: {x: -0.30000016, y: -0.124999754, z: 0.000000092433766} m_LocalScale: {x: 0.1125, y: 0.11250001, z: 0.1125} m_Children: [] m_Father: {fileID: 4438075100088248} @@ -849,6 +864,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -860,6 +876,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -911,6 +928,7 @@ MonoBehaviour: m_ZAdjustHover: -0.02 m_ZAdjustClick: 0.04 m_HoverScale: 1.35 + m_HoverBoxColliderGrow: 0.2 m_AddOverlay: 0 m_ColorTexture: {fileID: 2800000, guid: d21c4cae08e56704b98251732eca90cb, type: 3} m_Trash: 0 @@ -960,6 +978,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -971,6 +990,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1042,6 +1062,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1053,6 +1074,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1127,7 +1149,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1260967163303688} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.4862504, y: 0, z: 0} + m_LocalPosition: {x: -0.15000015, y: -0.124999754, z: -0.000000008381903} m_LocalScale: {x: 0.1125, y: 0.11250001, z: 0.1125} m_Children: [] m_Father: {fileID: 4438075100088248} @@ -1155,6 +1177,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1166,6 +1189,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1217,6 +1241,7 @@ MonoBehaviour: m_ZAdjustHover: -0.02 m_ZAdjustClick: 0.04 m_HoverScale: 1.35 + m_HoverBoxColliderGrow: 0.2 m_AddOverlay: 0 m_ColorTexture: {fileID: 2800000, guid: d21c4cae08e56704b98251732eca90cb, type: 3} m_Trash: 0 @@ -1248,7 +1273,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1389479448930036} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.32375047, y: 0, z: 0} + m_LocalPosition: {x: -0.30000025, y: 0.073999114, z: 0.00000014714897} m_LocalScale: {x: 0.1125, y: 0.11250001, z: 0.1125} m_Children: [] m_Father: {fileID: 4438075100088248} @@ -1276,6 +1301,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1287,6 +1313,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1338,6 +1365,7 @@ MonoBehaviour: m_ZAdjustHover: -0.02 m_ZAdjustClick: 0.04 m_HoverScale: 1.35 + m_HoverBoxColliderGrow: 0.2 m_AddOverlay: 0 m_ColorTexture: {fileID: 2800000, guid: d21c4cae08e56704b98251732eca90cb, type: 3} m_Trash: 0 @@ -1369,7 +1397,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1438628857629690} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.1612502, y: 0, z: 0} + m_LocalPosition: {x: -0.45000014, y: -0.124999754, z: 0.000000092433766} m_LocalScale: {x: 0.1125, y: 0.11250001, z: 0.1125} m_Children: [] m_Father: {fileID: 4438075100088248} @@ -1397,6 +1425,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1408,6 +1437,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1459,6 +1489,7 @@ MonoBehaviour: m_ZAdjustHover: -0.02 m_ZAdjustClick: 0.04 m_HoverScale: 1.35 + m_HoverBoxColliderGrow: 0.2 m_AddOverlay: 0 m_ColorTexture: {fileID: 2800000, guid: d21c4cae08e56704b98251732eca90cb, type: 3} m_Trash: 0 @@ -1490,7 +1521,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1496081396447916} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: -0.00000022910535, y: 0.073999114, z: 0.00000014714897} m_LocalScale: {x: 0.1125, y: 0.11250001, z: 0.1125} m_Children: [] m_Father: {fileID: 4438075100088248} @@ -1518,6 +1549,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1529,6 +1561,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1580,6 +1613,7 @@ MonoBehaviour: m_ZAdjustHover: -0.02 m_ZAdjustClick: 0.04 m_HoverScale: 1.35 + m_HoverBoxColliderGrow: 0.2 m_AddOverlay: 0 m_ColorTexture: {fileID: 2800000, guid: d21c4cae08e56704b98251732eca90cb, type: 3} m_Trash: 0 @@ -1610,7 +1644,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1565688636885708} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0.238, y: -0.642, z: 0.05} + m_LocalPosition: {x: -0.238, y: -0.596, z: 0.05} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 4277394945041956} @@ -1620,9 +1654,10 @@ Transform: - {fileID: 4365206483374124} - {fileID: 4096361563012652} - {fileID: 4970236307616174} + - {fileID: 5600472376624797025} - {fileID: 4178990938195600} m_Father: {fileID: 4000012065142580} - m_RootOrder: 5 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &114262722981440484 MonoBehaviour: @@ -1650,6 +1685,7 @@ MonoBehaviour: - {fileID: 114569216444465652} - {fileID: 114351879027055406} - {fileID: 114415058837065838} + - {fileID: 1898800821892531385} m_TrashButton: {fileID: 114282612100180912} m_TrashButtonPlacementOffset: {x: 0, y: -0.1, z: 0} --- !u!65 &65730247382608146 @@ -1732,6 +1768,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1743,6 +1780,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1796,7 +1834,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1724890649733238} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.48625037, y: 0, z: 0} + m_LocalPosition: {x: -0.45000023, y: 0.073999114, z: 0.00000014714897} m_LocalScale: {x: 0.1125, y: 0.11250001, z: 0.1125} m_Children: [] m_Father: {fileID: 4438075100088248} @@ -1824,6 +1862,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1835,6 +1874,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1886,6 +1926,7 @@ MonoBehaviour: m_ZAdjustHover: -0.02 m_ZAdjustClick: 0.04 m_HoverScale: 1.35 + m_HoverBoxColliderGrow: 0.2 m_AddOverlay: 0 m_ColorTexture: {fileID: 2800000, guid: d21c4cae08e56704b98251732eca90cb, type: 3} m_Trash: 0 @@ -1917,7 +1958,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1729974805708252} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.16125016, y: 0, z: 0} + m_LocalPosition: {x: -0.15, y: 0.074, z: -0} m_LocalScale: {x: 0.1125, y: 0.11250001, z: 0.1125} m_Children: [] m_Father: {fileID: 4438075100088248} @@ -1945,6 +1986,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1956,6 +1998,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -2007,6 +2050,7 @@ MonoBehaviour: m_ZAdjustHover: -0.02 m_ZAdjustClick: 0.04 m_HoverScale: 1.35 + m_HoverBoxColliderGrow: 0.2 m_AddOverlay: 0 m_ColorTexture: {fileID: 2800000, guid: d21c4cae08e56704b98251732eca90cb, type: 3} m_Trash: 0 @@ -2038,11 +2082,11 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1750809462802766} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.4862504, y: -0.11824989, z: -0.00124979} + m_LocalPosition: {x: 0.15, y: 0, z: -0.001} m_LocalScale: {x: 0.1125, y: 0.11250001, z: 0.1125} m_Children: [] m_Father: {fileID: 4438075100088248} - m_RootOrder: 7 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!33 &33096607024201348 MeshFilter: @@ -2066,6 +2110,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -2077,6 +2122,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -2115,6 +2161,7 @@ MonoBehaviour: m_ZAdjustHover: -0.02 m_ZAdjustClick: 0.04 m_HoverScale: 1.3 + m_HoverBoxColliderGrow: 0.2 m_AddOverlay: 0 m_ColorTexture: {fileID: 2800000, guid: d21c4cae08e56704b98251732eca90cb, type: 3} m_Trash: 1 @@ -2186,6 +2233,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -2197,6 +2245,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -2277,6 +2326,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -2288,6 +2338,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -2339,8 +2390,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1979369907720730} 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_LocalPosition: {x: 0, y: 0.1, z: -0} + m_LocalScale: {x: 0.95, y: 0.95, z: 0.95} m_Children: - {fileID: 4456978593412232} - {fileID: 4815117117886146} @@ -2384,3 +2435,327 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 1.6, y: 1.3, z: 0.01} m_Center: {x: 0, y: 0.15, z: 0} +--- !u!1 &1465978937589314202 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5600472376624797025} + - component: {fileID: 7076992563822189059} + - component: {fileID: 5728572260582071885} + - component: {fileID: 8106456083465655573} + - component: {fileID: 1898800821892531385} + m_Layer: 16 + m_Name: Palette8 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5600472376624797025 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1465978937589314202} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.125, z: 0} + m_LocalScale: {x: 0.1125, y: 0.11250001, z: 0.1125} + m_Children: [] + m_Father: {fileID: 4438075100088248} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7076992563822189059 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1465978937589314202} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5728572260582071885 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1465978937589314202} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 0c298b4a41e7c5b4daf56d8987a83788, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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!65 &8106456083465655573 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1465978937589314202} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 0.01} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &1898800821892531385 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1465978937589314202} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: eab8685dfd387584198a5374f9755351, type: 3} + m_Name: + m_EditorClassIdentifier: + m_DescriptionType: -1 + m_DescriptionYOffset: 0 + m_DescriptionText: + m_DescriptionTextExtra: + m_DescriptionActivateSpeed: 12 + m_DescriptionZScale: 1 + m_ButtonTexture: {fileID: 2800000, guid: 4c7ba8aa81fca19479a7011750724531, type: 3} + m_AtlasTexture: 0 + m_ToggleButton: 0 + m_LongPressReleaseButton: 0 + m_ButtonHasPressedAudio: 1 + m_ZAdjustHover: -0.02 + m_ZAdjustClick: 0.04 + m_HoverScale: 1.35 + m_HoverBoxColliderGrow: 0.2 + m_AddOverlay: 0 + m_ColorTexture: {fileID: 2800000, guid: d21c4cae08e56704b98251732eca90cb, type: 3} + m_Trash: 0 +--- !u!1001 &3173646394997737499 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 4000012065142580} + m_Modifications: + - target: {fileID: 7525759816367303735, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_Command + value: 7000 + objectReference: {fileID: 0} + - target: {fileID: 7525759816367303735, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_ButtonTexture + value: + objectReference: {fileID: 2800000, guid: 9b82f38d1c06a854faadd9c2ea76b48b, type: 3} + - target: {fileID: 7630606763700834929, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_Name + value: OpenColourOptionsPopup + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_LocalScale.x + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_LocalScale.y + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_LocalScale.z + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_LocalPosition.x + value: 0.34999996 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_LocalPosition.y + value: -0.64800024 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_LocalPosition.z + value: 0.050000206 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 71757eb1eb6bebe489a852e972821df3, type: 3} +--- !u!4 &5035783189062963130 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7631838532712089505, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + m_PrefabInstance: {fileID: 3173646394997737499} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &4111035363666907004 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 4000012065142580} + m_Modifications: + - target: {fileID: 7630606763700834929, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_Name + value: ActionButton + objectReference: {fileID: 0} + - target: {fileID: 7630606763700834929, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_LocalScale.x + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_LocalScale.y + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_LocalScale.z + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_LocalPosition.x + value: 0.35 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_LocalPosition.y + value: -0.648 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_LocalPosition.z + value: 0.05 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7631838532712089505, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7879899076693153277, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + propertyPath: m_ButtonTexture + value: + objectReference: {fileID: 2800000, guid: 9b82f38d1c06a854faadd9c2ea76b48b, type: 3} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 0963942396a615f4fb1b390436e881b8, type: 3} +--- !u!4 &5829039265654114525 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7631838532712089505, guid: 0963942396a615f4fb1b390436e881b8, + type: 3} + m_PrefabInstance: {fileID: 4111035363666907004} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/Prefabs/Panels/Widgets/JitterSlider.prefab b/Assets/Prefabs/Panels/Widgets/JitterSlider.prefab new file mode 100644 index 0000000000..a3bbac5317 --- /dev/null +++ b/Assets/Prefabs/Panels/Widgets/JitterSlider.prefab @@ -0,0 +1,621 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &975834435814208152 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 975834435814114336} + - component: {fileID: 975834435817497818} + - component: {fileID: 975834435816094086} + m_Layer: 16 + m_Name: Cap + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &975834435814114336 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814208152} + m_LocalRotation: {x: 0, y: 0, z: 1, w: 0} + m_LocalPosition: {x: 0.1683, y: 0, z: 0.00021062419} + m_LocalScale: {x: 0.0375, y: 0.0375, z: 0.0375} + m_Children: [] + m_Father: {fileID: 975834435814123574} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &975834435817497818 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814208152} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &975834435816094086 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814208152} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: ca448c25e886c544796b10b98d8aa9cc, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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!1 &975834435814209696 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 975834435814035598} + - component: {fileID: 975834435817565662} + - component: {fileID: 975834435816409572} + - component: {fileID: 975834435824087934} + m_Layer: 16 + m_Name: MinIcon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &975834435814035598 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814209696} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.2715, y: 0, z: 0} + m_LocalScale: {x: 0.8, y: 0.8, z: 0.8} + m_Children: [] + m_Father: {fileID: 975834435814123574} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &975834435817565662 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814209696} + m_Mesh: {fileID: 4300000, guid: 260cc07aabcea6d41a633a35c1103a6c, type: 3} +--- !u!23 &975834435816409572 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814209696} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 40d29de2bdc11f04dbfa25059165916e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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!114 &975834435824087934 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814209696} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0fda994627665a24b888af25f8c55ce4, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 2800000, guid: f74f6eac3e3e3c640b1a343ec46ba2dd, type: 3} +--- !u!1 &975834435814213458 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 975834435814149948} + - component: {fileID: 975834435816397226} + - component: {fileID: 975834435817486590} + m_Layer: 16 + m_Name: Mesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &975834435814149948 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814213458} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.3, y: 0.0375, z: 1} + m_Children: [] + m_Father: {fileID: 975834435814123574} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &975834435816397226 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814213458} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: db2d9e5107064e64ea8ce921e6f24458, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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 &975834435817486590 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814213458} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &975834435814379256 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 975834435814079746} + - component: {fileID: 975834435817477596} + - component: {fileID: 975834435816411850} + - component: {fileID: 975834435824077772} + m_Layer: 16 + m_Name: MaxIcon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &975834435814079746 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814379256} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.2698, y: -0, z: 0} + m_LocalScale: {x: 0.8, y: 0.8, z: 1} + m_Children: [] + m_Father: {fileID: 975834435814123574} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &975834435817477596 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814379256} + m_Mesh: {fileID: 4300000, guid: 260cc07aabcea6d41a633a35c1103a6c, type: 3} +--- !u!23 &975834435816411850 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814379256} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 40d29de2bdc11f04dbfa25059165916e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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!114 &975834435824077772 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814379256} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0fda994627665a24b888af25f8c55ce4, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 2800000, guid: ab8b9a0b96b6cb74ca1e518f3c56b425, type: 3} +--- !u!1 &975834435814379478 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 975834435814123574} + - component: {fileID: 842595788728861292} + m_Layer: 16 + m_Name: JitterSlider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &975834435814123574 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814379478} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.45, z: -0.03} + m_LocalScale: {x: 2, y: 2, z: 2} + m_Children: + - {fileID: 975834435814037876} + - {fileID: 975834435814149948} + - {fileID: 975834435814146394} + - {fileID: 975834435814114336} + - {fileID: 975834435814062736} + - {fileID: 975834435814035598} + - {fileID: 975834435814079746} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &842595788728861292 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814379478} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e666c33c1f8d4893919cca053b306646, type: 3} + m_Name: + m_EditorClassIdentifier: + m_DescriptionType: 1 + m_DescriptionYOffset: 0 + m_DescriptionText: Jitter + m_DescriptionTextExtra: + m_DescriptionActivateSpeed: 12 + m_DescriptionZScale: 10 + m_Nob: {fileID: 975834435814391916} + m_Mesh: {fileID: 975834435816397226} + JitterProperty: 0 +--- !u!1 &975834435814391916 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 975834435814146394} + - component: {fileID: 975834435817539988} + - component: {fileID: 975834435816447630} + - component: {fileID: 873033023682696816} + m_Layer: 16 + m_Name: SliderPosition + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &975834435814146394 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814391916} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.1307, y: 0, z: 0} + m_LocalScale: {x: 0.01, y: 0.03, z: 0.015} + m_Children: [] + m_Father: {fileID: 975834435814123574} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &975834435817539988 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814391916} + m_Mesh: {fileID: 4300000, guid: 5ef960ddf11c1fd4983638f56f6a8be0, type: 3} +--- !u!23 &975834435816447630 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814391916} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 3e92ccbfed650604686991e69902e663, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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!114 &873033023682696816 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814391916} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1aaefde5afe80784e908d27fcb05a101, type: 3} + m_Name: + m_EditorClassIdentifier: + m_OffsetOverride: -1 +--- !u!1 &975834435814400432 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 975834435814037876} + - component: {fileID: 975834435811877436} + m_Layer: 16 + m_Name: Collider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &975834435814037876 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814400432} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.295, y: 0.109721534, z: 1} + m_Children: [] + m_Father: {fileID: 975834435814123574} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &975834435811877436 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814400432} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 0.1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &975834435814423874 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 975834435814062736} + - component: {fileID: 975834435817503334} + - component: {fileID: 975834435816451644} + m_Layer: 16 + m_Name: Cap + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &975834435814062736 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814423874} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.1682, y: -0, z: 0.0002105044} + m_LocalScale: {x: 0.0375, y: 0.0375, z: 0.0375} + m_Children: [] + m_Father: {fileID: 975834435814123574} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &975834435817503334 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814423874} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &975834435816451644 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 975834435814423874} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: ca448c25e886c544796b10b98d8aa9cc, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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/Assets/Prefabs/Panels/Widgets/JitterSlider.prefab.meta b/Assets/Prefabs/Panels/Widgets/JitterSlider.prefab.meta new file mode 100644 index 0000000000..170a898f56 --- /dev/null +++ b/Assets/Prefabs/Panels/Widgets/JitterSlider.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3930ecf208aacf0498f0c2b545249067 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/PopUps/PopUpWindow_ColorOptions.prefab b/Assets/Prefabs/PopUps/PopUpWindow_ColorOptions.prefab new file mode 100644 index 0000000000..a89fe9272d --- /dev/null +++ b/Assets/Prefabs/PopUps/PopUpWindow_ColorOptions.prefab @@ -0,0 +1,844 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &197348 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 461372} + - component: {fileID: 6590698} + - component: {fileID: 11477574} + - component: {fileID: 114378360279916084} + m_Layer: 16 + m_Name: PopUpWindow_ColorOptions + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &461372 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 197348} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.42369986, y: 9.294, z: 0.0048000813} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4000013863059372} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &6590698 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 197348} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1.45, y: 1.26, z: 0.01} + m_Center: {x: 0, y: 0, z: -0.0125} +--- !u!114 &11477574 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 197348} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac3bbf6d1bcd3034ab32fd1367d2a2d3, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Background: {fileID: 1000011805813252} + m_TopBorder: {fileID: 1000011506748792} + m_BottomBorder: {fileID: 1000011506748792} + m_WindowText: {fileID: 102250525659386834} + m_WindowSubText: {fileID: 0} + m_CharacterWidth: 0.175 + m_SubtitleCharacterWidth: 0.05625 + m_ButtonWidth: 0.6 + m_BaseButtonOffset: {x: 0, y: 0, z: 0} + m_ReticleBounds: {x: 1.65, y: 2, z: -0.35} + m_PopUpForwardOffset: -0.25 + m_AutoPlaceButtons: [] + m_TransitionDuration: 0.1 + m_OpenDelay: 0 + m_Persistent: 0 + m_AudioOnOpen: 1 + m_BlockUndoRedo: 0 + m_IsLongPressPopUp: 0 + m_OrderedPageButtons: [] + m_PrevButton: {fileID: 0} + m_NextButton: {fileID: 0} + m_ColorTransitionDuration: 0.2 +--- !u!114 &114378360279916084 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 197348} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 739d5b1996234d64992a2ae60c3723e9, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1000011506748792 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4000011863039138} + - component: {fileID: 33000013223101232} + - component: {fileID: 23000011128244564} + m_Layer: 16 + m_Name: PopupBorder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000011863039138 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000011506748792} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 100, y: 100, z: 100} + m_Children: [] + m_Father: {fileID: 4000014139754862} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &33000013223101232 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000011506748792} + m_Mesh: {fileID: 4300000, guid: e16d00464172b7048aa398008f83907d, type: 3} +--- !u!23 &23000011128244564 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000011506748792} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 77dd4ff8b1158a84397aba783cd0af05, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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!1 &1000011805813252 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4000011965635686} + - component: {fileID: 33000010302420914} + - component: {fileID: 23000013678226396} + m_Layer: 16 + m_Name: PopupBg + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000011965635686 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000011805813252} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 100, y: 100, z: 100} + m_Children: [] + m_Father: {fileID: 4000014139754862} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &33000010302420914 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000011805813252} + m_Mesh: {fileID: 4300002, guid: e16d00464172b7048aa398008f83907d, type: 3} +--- !u!23 &23000013678226396 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000011805813252} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: db0305ff9081c3b448ac79e85d26e5d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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!1 &1000013661770288 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4000013863059372} + m_Layer: 16 + m_Name: Mesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000013863059372 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000013661770288} + 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: + - {fileID: 4408143530714042} + - {fileID: 7625513260310874408} + - {fileID: 672854963316639820} + - {fileID: 4000014139754862} + m_Father: {fileID: 461372} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1000013872528560 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4000014139754862} + m_Layer: 16 + m_Name: MorePopupMesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000014139754862 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000013872528560} + 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: + - {fileID: 4000011965635686} + - {fileID: 4000011863039138} + m_Father: {fileID: 4000013863059372} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1193448101192846 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4408143530714042} + - component: {fileID: 23387439866973640} + - component: {fileID: 102250525659386834} + m_Layer: 16 + m_Name: TextLine + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4408143530714042 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1193448101192846} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.6693, y: 0.601, z: -0.002} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000013863059372} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23387439866973640 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1193448101192846} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 543b312efaeb6aa4aa25a9e07e815953, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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!102 &102250525659386834 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1193448101192846} + m_Text: Description + m_OffsetZ: 0 + m_CharacterSize: 0.03 + m_LineSpacing: 1 + m_Anchor: 0 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 64 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: aa94fec06c672f74d86409a6979db921, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!1 &6169776631466976002 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7625513260310874408} + m_Layer: 16 + m_Name: Sliders + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7625513260310874408 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169776631466976002} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.9, y: 0.9, z: 0.9} + m_Children: + - {fileID: 7275121953736061568} + - {fileID: 8620010356955259900} + - {fileID: 1367974747965274959} + m_Father: {fileID: 4000013863059372} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &672854963317086212 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 4000013863059372} + m_Modifications: + - target: {fileID: 148172, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} + propertyPath: m_Name + value: PopUpButton_Confirm + objectReference: {fileID: 0} + - target: {fileID: 479304, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 479304, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} + propertyPath: m_LocalScale.x + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: 479304, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} + propertyPath: m_LocalScale.y + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: 479304, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} + propertyPath: m_LocalScale.z + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: 479304, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} + propertyPath: m_LocalPosition.x + value: 0.444 + objectReference: {fileID: 0} + - target: {fileID: 479304, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} + propertyPath: m_LocalPosition.y + value: -0.619 + objectReference: {fileID: 0} + - target: {fileID: 479304, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} + propertyPath: m_LocalPosition.z + value: -0.02 + objectReference: {fileID: 0} + - target: {fileID: 479304, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 479304, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 479304, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 479304, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 479304, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 479304, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 479304, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 11488472, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} + propertyPath: m_ButtonTexture + value: + objectReference: {fileID: 2800000, guid: 4ca620df5430af448aaf4f3ff20ad5c4, type: 3} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, type: 3} +--- !u!4 &672854963316639820 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 479304, guid: a5c1c72b25e95a34fadfdb03c9ab2b1b, + type: 3} + m_PrefabInstance: {fileID: 672854963317086212} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &2267239116643488633 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 7625513260310874408} + m_Modifications: + - target: {fileID: 842595788728861292, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: JitterProperty + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 842595788728861292, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_DescriptionText + value: Brightness + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalScale.x + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalScale.y + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalScale.z + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalPosition.y + value: -0.33700085 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalPosition.z + value: -0.03 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814379478, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_Name + value: JitterSlider V + objectReference: {fileID: 0} + - target: {fileID: 975834435824073636, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: JitterProperty + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 975834435824073636, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_DescriptionText + value: Brightness + objectReference: {fileID: 0} + - target: {fileID: 975834435824077772, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_Icon + value: + objectReference: {fileID: 2800000, guid: ab8b9a0b96b6cb74ca1e518f3c56b425, type: 3} + - target: {fileID: 975834435824087934, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_Icon + value: + objectReference: {fileID: 2800000, guid: f74f6eac3e3e3c640b1a343ec46ba2dd, type: 3} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3930ecf208aacf0498f0c2b545249067, type: 3} +--- !u!4 &1367974747965274959 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + m_PrefabInstance: {fileID: 2267239116643488633} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &7601144751179307702 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 7625513260310874408} + m_Modifications: + - target: {fileID: 842595788728861292, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_DescriptionText + value: Hue + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalPosition.y + value: 0.20299911 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalPosition.z + value: -0.03 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814379478, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_Name + value: JitterSlider H + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3930ecf208aacf0498f0c2b545249067, type: 3} +--- !u!4 &7275121953736061568 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + m_PrefabInstance: {fileID: 7601144751179307702} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &8803043587056651210 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 7625513260310874408} + m_Modifications: + - target: {fileID: 842595788728861292, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: JitterProperty + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 842595788728861292, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_DescriptionText + value: Saturation + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalScale.x + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalScale.y + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalScale.z + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalPosition.y + value: -0.067 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalPosition.z + value: -0.03 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 975834435814379478, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_Name + value: JitterSlider S + objectReference: {fileID: 0} + - target: {fileID: 975834435824073636, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: JitterProperty + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 975834435824073636, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_DescriptionText + value: Saturation + objectReference: {fileID: 0} + - target: {fileID: 975834435824077772, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_Icon + value: + objectReference: {fileID: 2800000, guid: ab8b9a0b96b6cb74ca1e518f3c56b425, type: 3} + - target: {fileID: 975834435824087934, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + propertyPath: m_Icon + value: + objectReference: {fileID: 2800000, guid: f74f6eac3e3e3c640b1a343ec46ba2dd, type: 3} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3930ecf208aacf0498f0c2b545249067, type: 3} +--- !u!4 &8620010356955259900 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 975834435814123574, guid: 3930ecf208aacf0498f0c2b545249067, + type: 3} + m_PrefabInstance: {fileID: 8803043587056651210} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/Prefabs/PopUps/PopUpWindow_ColorOptions.prefab.meta b/Assets/Prefabs/PopUps/PopUpWindow_ColorOptions.prefab.meta new file mode 100644 index 0000000000..5c2d64dc96 --- /dev/null +++ b/Assets/Prefabs/PopUps/PopUpWindow_ColorOptions.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d239309283424304dbea4303c5b675ba +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/GUI/ColorJitterSlider.cs.meta b/Assets/Scripts/GUI/ColorJitterSlider.cs.meta new file mode 100644 index 0000000000..52d43051bc --- /dev/null +++ b/Assets/Scripts/GUI/ColorJitterSlider.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e666c33c1f8d4893919cca053b306646 +timeCreated: 1620314733 \ No newline at end of file diff --git a/Assets/Scripts/GUI/ColorPickerPopupButton.cs b/Assets/Scripts/GUI/ColorPickerPopupButton.cs new file mode 100644 index 0000000000..b058e3c039 --- /dev/null +++ b/Assets/Scripts/GUI/ColorPickerPopupButton.cs @@ -0,0 +1,23 @@ +// Copyright 2020 The Tilt Brush Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; + +namespace TiltBrush +{ + public class ColorPickerPopupButton : OptionButton + { + + } +} // namespace TiltBrush diff --git a/Assets/Scripts/GUI/ColorPickerPopupButton.cs.meta b/Assets/Scripts/GUI/ColorPickerPopupButton.cs.meta new file mode 100644 index 0000000000..ca2fdddd8d --- /dev/null +++ b/Assets/Scripts/GUI/ColorPickerPopupButton.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 52a637c1c82845bba8ccdf9befbcd252 +timeCreated: 1620219466 \ No newline at end of file diff --git a/Assets/Scripts/PointerManager.cs b/Assets/Scripts/PointerManager.cs index 4feed251ac..f79420fb83 100644 --- a/Assets/Scripts/PointerManager.cs +++ b/Assets/Scripts/PointerManager.cs @@ -17,6 +17,7 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using ControllerName = TiltBrush.InputManager.ControllerName; +using Random = UnityEngine.Random; namespace TiltBrush { @@ -151,6 +152,8 @@ struct StoredBrushInfo private SymmetryMode m_CurrentSymmetryMode; private SymmetryWidget m_SymmetryWidgetScript; private bool m_UseSymmetryWidget = false; + private Color m_lastChosenColor { get; set; } + public Vector3 colorJitter { get; set; } // These variables are legacy for supporting z-fighting control on the sketch surface // panel in monoscopic mode. @@ -177,15 +180,23 @@ public PointerScript MainPointer get { return m_MainPointerData.m_Script; } } + /// Only call this if you don't want to update m_lastChosenColor + /// Used by color jitter on new stroke + private void ChangeAllPointerColorsDirectly(Color value) + { + for (int i = 0; i < m_NumActivePointers; ++i) + { + m_Pointers[i].m_Script.SetColor(value); + } + } + public Color PointerColor { get { return m_MainPointerData.m_Script.GetCurrentColor(); } set { - for (int i = 0; i < m_NumActivePointers; ++i) - { - m_Pointers[i].m_Script.SetColor(value); - } + ChangeAllPointerColorsDirectly(value); + m_lastChosenColor = value; OnPointerColorChange(); } } @@ -997,6 +1008,23 @@ void CheckGestures() private void Transition_WaitingForInput_RecordingInput() { + // Can't check for null as Color is a struct + // But it's harmless to call this if the color really has been set to black + if (m_lastChosenColor == Color.black) + { + m_lastChosenColor = PointerColor; + } + + float h, s, v; + Color.RGBToHSV(m_lastChosenColor, out h, out s, out v); + + // Bypass the code in the PointerColor setter + ChangeAllPointerColorsDirectly(Random.ColorHSV( + h-colorJitter.x, h+colorJitter.x, + s-colorJitter.y, h+colorJitter.y, + v-colorJitter.z, h+colorJitter.z + )); + if (m_StraightEdgeEnabled) { StraightEdgeGuide.SetTempShape(StraightEdgeGuideScript.Shape.Line); diff --git a/Assets/Scripts/SketchControlsScript.cs b/Assets/Scripts/SketchControlsScript.cs index 0152dc708e..aec24eec0d 100644 --- a/Assets/Scripts/SketchControlsScript.cs +++ b/Assets/Scripts/SketchControlsScript.cs @@ -140,6 +140,7 @@ public enum GlobalCommands LoadWaitOnDownload, SignOutConfirm, ReadOnlyNotice, + OpenColorOptionsPopup = 7000 } public enum ControlsType From 9929f0cdca1e8f5d8ebe740d9b23843ae200c8e8 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Fri, 7 May 2021 13:46:10 +0100 Subject: [PATCH 007/769] Add a missing file [CI BUILD] --- Assets/Scripts/GUI/ColorJitterSlider.cs | 81 +++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 Assets/Scripts/GUI/ColorJitterSlider.cs diff --git a/Assets/Scripts/GUI/ColorJitterSlider.cs b/Assets/Scripts/GUI/ColorJitterSlider.cs new file mode 100644 index 0000000000..6540a57841 --- /dev/null +++ b/Assets/Scripts/GUI/ColorJitterSlider.cs @@ -0,0 +1,81 @@ +// Copyright 2020 The Tilt Brush Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using UnityEngine; +namespace TiltBrush +{ + + public class ColorJitterSlider : BaseSlider + { + + private float pow = 1.5f; + + [Serializable] + public enum JitterProperties + { + Hue, + Saturation, + Value + } + public JitterProperties JitterProperty; + + protected override void Awake() + { + + float adjust(float val) {return Mathf.Pow(val * 2f, 1f/pow);} + base.Awake(); + var jitter = PointerManager.m_Instance.colorJitter; + switch (JitterProperty) + { + case JitterProperties.Hue: + m_CurrentValue = adjust(jitter.x); + break; + case JitterProperties.Saturation: + m_CurrentValue = adjust(jitter.y); + break; + case JitterProperties.Value: + m_CurrentValue = adjust(jitter.z); + break; + } + SetSliderPositionToReflectValue(); + } + + public override void UpdateValue(float fValue) + { + var jitter = PointerManager.m_Instance.colorJitter; + float val = Mathf.Pow(fValue, pow) / 2f; // Lower values are more interesting so square it + switch (JitterProperty) + { + case JitterProperties.Hue: + jitter.x = val; + break; + case JitterProperties.Saturation: + jitter.y = val; + break; + case JitterProperties.Value: + jitter.z = val; + break; + } + PointerManager.m_Instance.colorJitter = jitter; + m_CurrentValue = fValue; + Debug.Log($"val {fValue}: {PointerManager.m_Instance.colorJitter} = {jitter}"); + } + + public override void ResetState() + { + base.ResetState(); + } + } +} // namespace TiltBrush From 7a24a645da94c5111670314bacbc24ae19c6826d Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Fri, 7 May 2021 14:59:50 +0100 Subject: [PATCH 008/769] Fix label for colour options popup [CI BUILD] --- Assets/Prefabs/Panels/ColorPickerPanel.prefab | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Assets/Prefabs/Panels/ColorPickerPanel.prefab b/Assets/Prefabs/Panels/ColorPickerPanel.prefab index de93736f75..9c42ac7fd2 100644 --- a/Assets/Prefabs/Panels/ColorPickerPanel.prefab +++ b/Assets/Prefabs/Panels/ColorPickerPanel.prefab @@ -2571,6 +2571,11 @@ PrefabInstance: propertyPath: m_Command value: 7000 objectReference: {fileID: 0} + - target: {fileID: 7525759816367303735, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_PopupText + value: Color Jitter + objectReference: {fileID: 0} - target: {fileID: 7525759816367303735, guid: 71757eb1eb6bebe489a852e972821df3, type: 3} propertyPath: m_ButtonTexture From b1c3734b20bb0a6c784242ccd7b1e8a6d80bde32 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Sun, 9 May 2021 17:11:46 +0100 Subject: [PATCH 009/769] Refactor to use reflection and attributes. Nicer API. Fix examples and add more turtles. I like turtles. [CI BUILD] --- Assets/Prefabs/HttpServer.prefab | 291 ++++ .../HttpServer.prefab.meta} | 4 +- Assets/Scenes/Main.unity | 1195 +++++++---------- .../SVG Path.html.meta => Scripts/API.meta} | 5 +- Assets/Scripts/API/ApiEndpointAttribute.cs | 62 + .../Scripts/API/ApiEndpointAttribute.cs.meta | 11 + Assets/Scripts/API/ApiManager.cs | 154 +++ Assets/Scripts/API/ApiManager.cs.meta | 11 + Assets/Scripts/API/ApiMethods.cs | 230 ++++ Assets/Scripts/API/ApiMethods.cs.meta | 3 + Assets/Scripts/API/DrawStrokes.cs | 98 ++ Assets/Scripts/API/DrawStrokes.cs.meta | 3 + Assets/Scripts/App.cs | 8 - Assets/Scripts/AppApiHandler.cs | 281 ---- Assets/Scripts/AppApiHandler.cs.meta | 3 - Assets/Scripts/TextToStrokes/TextToStrokes.cs | 30 +- .../API Examples/JSON to Stroke.html | 6 +- .../API Examples/SVG Path.html | 6 +- Support/API Examples/Simple Form.html | 11 + 19 files changed, 1364 insertions(+), 1048 deletions(-) create mode 100644 Assets/Prefabs/HttpServer.prefab rename Assets/{API Examples/JSON to Stroke.html.meta => Prefabs/HttpServer.prefab.meta} (62%) rename Assets/{API Examples/SVG Path.html.meta => Scripts/API.meta} (57%) create mode 100644 Assets/Scripts/API/ApiEndpointAttribute.cs create mode 100644 Assets/Scripts/API/ApiEndpointAttribute.cs.meta create mode 100644 Assets/Scripts/API/ApiManager.cs create mode 100644 Assets/Scripts/API/ApiManager.cs.meta create mode 100644 Assets/Scripts/API/ApiMethods.cs create mode 100644 Assets/Scripts/API/ApiMethods.cs.meta create mode 100644 Assets/Scripts/API/DrawStrokes.cs create mode 100644 Assets/Scripts/API/DrawStrokes.cs.meta delete mode 100644 Assets/Scripts/AppApiHandler.cs delete mode 100644 Assets/Scripts/AppApiHandler.cs.meta rename {Assets => Support}/API Examples/JSON to Stroke.html (51%) rename {Assets => Support}/API Examples/SVG Path.html (67%) create mode 100644 Support/API Examples/Simple Form.html diff --git a/Assets/Prefabs/HttpServer.prefab b/Assets/Prefabs/HttpServer.prefab new file mode 100644 index 0000000000..53af8361c5 --- /dev/null +++ b/Assets/Prefabs/HttpServer.prefab @@ -0,0 +1,291 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4492044765706507690 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4492044765706507693} + - component: {fileID: 4492044765706507692} + m_Layer: 0 + m_Name: GoogleIdentity + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4492044765706507693 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4492044765706507690} + 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: + - {fileID: 2648746681971917433} + m_Father: {fileID: 4492044765854677289} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4492044765706507692 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4492044765706507690} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e1689780c428aa14ea42c2125e391b45, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Service: 0 + m_OAuthScopes: + - openid + - https://www.googleapis.com/auth/userinfo.profile + - https://www.googleapis.com/auth/userinfo.email + - https://www.googleapis.com/auth/vrassetdata.readonly + - https://www.googleapis.com/auth/drive.file + - https://www.googleapis.com/auth/drive.appdata + m_AdditionalDesktopOAuthScopes: + - https://www.googleapis.com/auth/youtube.upload + - https://www.googleapis.com/auth/youtube.readonly + m_CallbackPath: /authorize + m_LoggedInTexture: {fileID: 2800000, guid: 0d05cda193064458a9a7bb085905c5a1, type: 3} + m_TokenStorePrefix: GoogleOAuth2 + m_AuthorizationServerUrl: + m_TokenServerUrl: +--- !u!1 &4492044765854677286 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4492044765854677289} + m_Layer: 0 + m_Name: Google + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4492044765854677289 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4492044765854677286} + 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: + - {fileID: 4492044765706507693} + m_Father: {fileID: 4492044767078796625} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &4492044765921076526 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4492044765921076689} + - component: {fileID: 4492044765921076688} + m_Layer: 0 + m_Name: SketchfabIdentity + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4492044765921076689 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4492044765921076526} + 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: 4492044767078796625} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4492044765921076688 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4492044765921076526} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e1689780c428aa14ea42c2125e391b45, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Service: 1 + m_OAuthScopes: [] + m_AdditionalDesktopOAuthScopes: [] + m_CallbackPath: /sketchfab + m_LoggedInTexture: {fileID: 2800000, guid: 0d05cda193064458a9a7bb085905c5a1, type: 3} + m_TokenStorePrefix: SketchfabOAuth2 + m_AuthorizationServerUrl: https://sketchfab.com/oauth2/authorize/ + m_TokenServerUrl: https://sketchfab.com/oauth2/token/ +--- !u!1 &4492044767078796463 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4492044767078796625} + - component: {fileID: 4492044767078796462} + - component: {fileID: 4003205861538169308} + - component: {fileID: 5713667951292597152} + m_Layer: 0 + m_Name: HttpServer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4492044767078796625 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4492044767078796463} + 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: + - {fileID: 4492044765854677289} + - {fileID: 4492044765921076689} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4492044767078796462 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4492044767078796463} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8bb47373d55d0954dbf3ea78d9e9f5ed, type: 3} + m_Name: + m_EditorClassIdentifier: + m_httpListenerPort: 40074 +--- !u!114 &4003205861538169308 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4492044767078796463} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3129917865c64490b8b93df59ca75fb6, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &5713667951292597152 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4492044767078796463} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3915bbb84fd81584aa2afe132e221ad9, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &8659939412555803041 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 4492044765706507693} + m_Modifications: + - target: {fileID: 5277329131170554394, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + type: 3} + propertyPath: m_Name + value: AuthWebServer + objectReference: {fileID: 0} + - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, type: 3} +--- !u!4 &2648746681971917433 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + type: 3} + m_PrefabInstance: {fileID: 8659939412555803041} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/API Examples/JSON to Stroke.html.meta b/Assets/Prefabs/HttpServer.prefab.meta similarity index 62% rename from Assets/API Examples/JSON to Stroke.html.meta rename to Assets/Prefabs/HttpServer.prefab.meta index fe189fb005..7b4bfcb796 100644 --- a/Assets/API Examples/JSON to Stroke.html.meta +++ b/Assets/Prefabs/HttpServer.prefab.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 7d6858ede1a09a34e95e09ad3dc455d6 -TextScriptImporter: +guid: 382dabebd59956d499aefb54b02f804d +PrefabImporter: externalObjects: {} userData: assetBundleName: diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index c22f1ddc86..52b10851ab 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -667,13 +667,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 3 m_fontSizeBase: 3 m_fontWeight: 400 @@ -681,6 +680,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 257 m_characterSpacing: 0 m_wordSpacing: 0 @@ -691,10 +692,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -702,42 +701,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 0} - characterCount: 12 - spriteCount: 0 - spaceCount: 2 - wordCount: 3 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 12781057} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!222 &12781055 CanvasRenderer: m_ObjectHideFlags: 2 @@ -1258,7 +1238,6 @@ GameObject: m_Component: - component: {fileID: 815137833} - component: {fileID: 53960734} - - component: {fileID: 53960733} - component: {fileID: 53960732} - component: {fileID: 53960731} m_Layer: 18 @@ -1319,13 +1298,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 1.93 m_fontSizeBase: 1.93 m_fontWeight: 400 @@ -1333,7 +1311,9 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_textAlignment: 257 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 m_lineSpacing: 0 @@ -1343,10 +1323,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -1354,51 +1332,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: -1.8046212, w: -0.33301544} - m_textInfo: - textComponent: {fileID: 53960732} - characterCount: 18 - spriteCount: 0 - spaceCount: 4 - wordCount: 4 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 53960734} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 ---- !u!33 &53960733 -MeshFilter: - m_ObjectHideFlags: 2 - m_CorrespondingSourceObject: {fileID: 3316878, guid: f636b2bdcf1c7f5498e324d362ac1ba8, - type: 3} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 53960730} - m_Mesh: {fileID: 0} + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!23 &53960734 MeshRenderer: m_ObjectHideFlags: 0 @@ -2693,13 +2643,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 2 m_fontSizeBase: 2 m_fontWeight: 400 @@ -2707,6 +2656,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 513 m_characterSpacing: 0 m_wordSpacing: 0 @@ -2717,10 +2668,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -2728,42 +2677,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 129869458} - characterCount: 4 - spriteCount: 0 - spaceCount: 1 - wordCount: 2 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 103787546} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1 &130210064 GameObject: m_ObjectHideFlags: 0 @@ -2826,13 +2756,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 3 m_fontSizeBase: 3 m_fontWeight: 400 @@ -2840,6 +2769,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 257 m_characterSpacing: 0 m_wordSpacing: 0 @@ -2850,10 +2781,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -2861,42 +2790,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 0} - characterCount: 8 - spriteCount: 0 - spaceCount: 0 - wordCount: 1 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 130210068} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!222 &130210066 CanvasRenderer: m_ObjectHideFlags: 2 @@ -3283,7 +3193,7 @@ MonoBehaviour: m_FakeCommandLineArgsInEditor: m_PlatformConfig: {fileID: 11400000, guid: 0764a106823cbec4e8d75b2816f3cbd3, type: 2} m_IsExperimental: 1 - m_SdkMode: 1 + m_SdkMode: 3 m_AutoProfile: 0 m_AutoProfileWaitTime: 10 Secrets: {fileID: 11400000, guid: 2f5f8e93c6bc7be49a5023148b50e7a0, type: 2} @@ -5400,13 +5310,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 3 m_fontSizeBase: 3 m_fontWeight: 400 @@ -5414,6 +5323,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 257 m_characterSpacing: 0 m_wordSpacing: 0 @@ -5424,10 +5335,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -5435,42 +5344,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 0} - characterCount: 9 - spriteCount: 0 - spaceCount: 1 - wordCount: 1 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 271027829} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!222 &271027827 CanvasRenderer: m_ObjectHideFlags: 2 @@ -7234,13 +7124,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 1.5 m_fontSizeBase: 1.5 m_fontWeight: 400 @@ -7248,6 +7137,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 32 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 1025 m_characterSpacing: 0 m_wordSpacing: 0 @@ -7258,10 +7149,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -7269,42 +7158,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: -0.013912916, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 413759583} - characterCount: 20 - spriteCount: 0 - spaceCount: 2 - wordCount: 3 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 512959152} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1001 &420987293 PrefabInstance: m_ObjectHideFlags: 0 @@ -8245,13 +8115,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 1.5 m_fontSizeBase: 1.5 m_fontWeight: 400 @@ -8259,6 +8128,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 32 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 1026 m_characterSpacing: 0 m_wordSpacing: 0 @@ -8269,10 +8140,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -8280,42 +8149,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: -0.013912916, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 0} - characterCount: 12 - spriteCount: 0 - spaceCount: 0 - wordCount: 1 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 1843353005} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1 &512959151 GameObject: m_ObjectHideFlags: 0 @@ -8623,13 +8473,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 1.5 m_fontSizeBase: 1.5 m_fontWeight: 400 @@ -8637,6 +8486,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 257 m_characterSpacing: 0 m_wordSpacing: 0 @@ -8647,10 +8498,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -8658,42 +8507,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0.3169704, y: 0, z: -0.43391293, w: 0} - m_textInfo: - textComponent: {fileID: 581738634} - characterCount: 0 - spriteCount: 0 - spaceCount: 0 - wordCount: 0 - linkCount: 0 - lineCount: 0 - pageCount: 0 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 1877187485} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1001 &584147934 PrefabInstance: m_ObjectHideFlags: 0 @@ -8996,7 +8826,6 @@ GameObject: m_Component: - component: {fileID: 586145411} - component: {fileID: 1454494319} - - component: {fileID: 613080584} - component: {fileID: 1498237885} - component: {fileID: 613080583} m_Layer: 18 @@ -9014,15 +8843,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 613080582} m_CullTransparentMesh: 0 ---- !u!33 &613080584 -MeshFilter: - m_ObjectHideFlags: 2 - m_CorrespondingSourceObject: {fileID: 3316878, guid: f636b2bdcf1c7f5498e324d362ac1ba8, - type: 3} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 613080582} - m_Mesh: {fileID: 0} --- !u!1 &617891837 GameObject: m_ObjectHideFlags: 0 @@ -10062,52 +9882,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ba223429cfccd914bb3b358738b234bd, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!1 &669339390 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 669339392} - - component: {fileID: 669339391} - m_Layer: 0 - m_Name: HttpServer - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &669339391 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 669339390} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8bb47373d55d0954dbf3ea78d9e9f5ed, type: 3} - m_Name: - m_EditorClassIdentifier: - m_httpListenerPort: 40074 ---- !u!4 &669339392 +--- !u!4 &669339392 stripped Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 4492044767078796625, guid: 382dabebd59956d499aefb54b02f804d, + type: 3} + m_PrefabInstance: {fileID: 4492044766644994641} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 669339390} - 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: - - {fileID: 1894562680} - - {fileID: 2095572864} - m_Father: {fileID: 652605545} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &670109498 PrefabInstance: m_ObjectHideFlags: 0 @@ -11804,13 +11584,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 1.4 m_fontSizeBase: 1.4 m_fontWeight: 400 @@ -11818,6 +11597,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 257 m_characterSpacing: 0 m_wordSpacing: 0 @@ -11828,10 +11609,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -11839,42 +11618,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 0} - characterCount: 15 - spriteCount: 0 - spaceCount: 2 - wordCount: 3 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 825726041} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!222 &825726039 CanvasRenderer: m_ObjectHideFlags: 2 @@ -15143,66 +14903,18 @@ MonoBehaviour: m_FrontSideColor: {r: 0.3529412, g: 0.3529412, b: 0.3529412, a: 1} m_BackSideColor: {r: 0.627451, g: 0, b: 0, a: 1} m_AdjustBrushSizeScalar: 0.4 ---- !u!1 &1209128955 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1209128956} - - component: {fileID: 1209128957} - m_Layer: 0 - m_Name: GoogleIdentity - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1209128956 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1209128955} - 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: - - {fileID: 1382018444} - m_Father: {fileID: 1894562680} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1209128957 +--- !u!114 &1209128957 stripped MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 4492044765706507692, guid: 382dabebd59956d499aefb54b02f804d, + type: 3} + m_PrefabInstance: {fileID: 4492044766644994641} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1209128955} + m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: e1689780c428aa14ea42c2125e391b45, type: 3} m_Name: m_EditorClassIdentifier: - m_Service: 0 - m_OAuthScopes: - - openid - - https://www.googleapis.com/auth/userinfo.profile - - https://www.googleapis.com/auth/userinfo.email - - https://www.googleapis.com/auth/vrassetdata.readonly - - https://www.googleapis.com/auth/drive.file - - https://www.googleapis.com/auth/drive.appdata - m_AdditionalDesktopOAuthScopes: - - https://www.googleapis.com/auth/youtube.upload - - https://www.googleapis.com/auth/youtube.readonly - m_CallbackPath: /authorize - m_LoggedInTexture: {fileID: 2800000, guid: 0d05cda193064458a9a7bb085905c5a1, type: 3} - m_TokenStorePrefix: GoogleOAuth2 - m_AuthorizationServerUrl: - m_TokenServerUrl: --- !u!1 &1213600507 GameObject: m_ObjectHideFlags: 0 @@ -15920,13 +15632,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 36 m_fontSizeBase: 36 m_fontWeight: 400 @@ -15934,6 +15645,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 1028 m_characterSpacing: 0 m_wordSpacing: 0 @@ -15944,10 +15657,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -15955,40 +15666,18 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 1295357952} - characterCount: 3 - spriteCount: 0 - spaceCount: 0 - wordCount: 2 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!222 &1295357953 @@ -16278,7 +15967,6 @@ GameObject: m_Component: - component: {fileID: 83051504} - component: {fileID: 1311996754} - - component: {fileID: 1311996753} - component: {fileID: 1311996752} - component: {fileID: 1311996751} m_Layer: 18 @@ -16339,13 +16027,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 1.93 m_fontSizeBase: 1.93 m_fontWeight: 400 @@ -16353,7 +16040,9 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_textAlignment: 257 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 m_lineSpacing: 0 @@ -16363,10 +16052,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -16374,51 +16061,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 1311996752} - characterCount: 18 - spriteCount: 0 - spaceCount: 4 - wordCount: 4 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 1311996754} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 ---- !u!33 &1311996753 -MeshFilter: - m_ObjectHideFlags: 2 - m_CorrespondingSourceObject: {fileID: 3316878, guid: f636b2bdcf1c7f5498e324d362ac1ba8, - type: 3} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1311996750} - m_Mesh: {fileID: 0} + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!23 &1311996754 MeshRenderer: m_ObjectHideFlags: 0 @@ -17104,12 +16763,6 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1375069022} m_Mesh: {fileID: 4300000, guid: 9f87d3c16e7a3c94988f41b6a92aaa3e, type: 3} ---- !u!4 &1382018444 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, - type: 3} - m_PrefabInstance: {fileID: 5078015190248467440} - m_PrefabAsset: {fileID: 0} --- !u!1 &1382397702 GameObject: m_ObjectHideFlags: 0 @@ -18903,13 +18556,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 5.2 m_fontSizeBase: 5.2 m_fontWeight: 400 @@ -18917,7 +18569,9 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_textAlignment: 257 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 m_lineSpacing: 0 @@ -18927,10 +18581,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -18938,42 +18590,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: -2.382012, w: -0.6436424} - m_textInfo: - textComponent: {fileID: 1498237885} - characterCount: 10 - spriteCount: 0 - spaceCount: 1 - wordCount: 1 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 1454494319} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1 &1498770772 GameObject: m_ObjectHideFlags: 0 @@ -19657,13 +19290,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 1 m_fontSizeBase: 1 m_fontWeight: 400 @@ -19671,6 +19303,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 33 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 1025 m_characterSpacing: 0 m_wordSpacing: 0 @@ -19681,10 +19315,8 @@ MonoBehaviour: m_enableWordWrapping: 0 m_wordWrappingRatios: 0.4 m_overflowMode: 3 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -19692,42 +19324,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: -0.013912916, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 1577979162} - characterCount: 0 - spriteCount: 0 - spaceCount: 0 - wordCount: 0 - linkCount: 0 - lineCount: 0 - pageCount: 0 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 745882611} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1 &1578975888 GameObject: m_ObjectHideFlags: 0 @@ -20620,13 +20233,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 2.5 m_fontSizeBase: 2.5 m_fontWeight: 400 @@ -20634,6 +20246,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 257 m_characterSpacing: 0 m_wordSpacing: 0 @@ -20644,10 +20258,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -20655,42 +20267,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 0} - characterCount: 5 - spriteCount: 0 - spaceCount: 0 - wordCount: 1 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 1277487074} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1 &1637135394 GameObject: m_ObjectHideFlags: 0 @@ -28273,13 +27866,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 5.2 m_fontSizeBase: 5.2 m_fontWeight: 400 @@ -28287,7 +27879,9 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_textAlignment: 257 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 m_lineSpacing: 0 @@ -28297,10 +27891,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -28308,42 +27900,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 1808834036} - characterCount: 7 - spriteCount: 0 - spaceCount: 1 - wordCount: 1 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 448780583} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1 &1810551365 stripped GameObject: m_CorrespondingSourceObject: {fileID: 100000, guid: d6b0c4fb3312a2b478110813b1ed3d69, @@ -29427,37 +29000,6 @@ MeshRenderer: type: 3} m_PrefabInstance: {fileID: 245270310} m_PrefabAsset: {fileID: 0} ---- !u!1 &1894562679 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1894562680} - m_Layer: 0 - m_Name: Google - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1894562680 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1894562679} - 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: - - {fileID: 1209128956} - m_Father: {fileID: 669339392} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1903256355 GameObject: m_ObjectHideFlags: 0 @@ -29552,7 +29094,6 @@ GameObject: m_Component: - component: {fileID: 1808834035} - component: {fileID: 448780583} - - component: {fileID: 1904300009} - component: {fileID: 1808834036} - component: {fileID: 1904300008} m_Layer: 18 @@ -29570,15 +29111,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1904300007} m_CullTransparentMesh: 0 ---- !u!33 &1904300009 -MeshFilter: - m_ObjectHideFlags: 2 - m_CorrespondingSourceObject: {fileID: 3316878, guid: f636b2bdcf1c7f5498e324d362ac1ba8, - type: 3} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1904300007} - m_Mesh: {fileID: 0} --- !u!1 &1910856519 GameObject: m_ObjectHideFlags: 0 @@ -29947,6 +29479,52 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4444ce35d262aa648ad0c425a559b931, type: 3} m_Name: m_EditorClassIdentifier: + currentOverlayType: 2 + isDynamic: 0 + isProtectedContent: 0 + srcRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + srcRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + invertTextureRects: 0 + overrideTextureRectMatrix: 0 + overridePerLayerColorScaleAndOffset: 0 + colorScale: {x: 1, y: 1, z: 1, w: 1} + colorOffset: {x: 0, y: 0, z: 0, w: 0} + useExpensiveSuperSample: 0 + hidden: 0 + isExternalSurface: 0 + externalSurfaceWidth: 0 + externalSurfaceHeight: 0 + compositionDepth: 0 + noDepthBufferTesting: 0 + layerTextureFormat: 0 + currentOverlayShape: 0 + textures: + - {fileID: 0} + - {fileID: 0} + isAlphaPremultiplied: 0 + _previewInEditor: 0 --- !u!114 &1915877483 MonoBehaviour: m_ObjectHideFlags: 0 @@ -29959,6 +29537,52 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4444ce35d262aa648ad0c425a559b931, type: 3} m_Name: m_EditorClassIdentifier: + currentOverlayType: 2 + isDynamic: 0 + isProtectedContent: 0 + srcRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + srcRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + invertTextureRects: 0 + overrideTextureRectMatrix: 0 + overridePerLayerColorScaleAndOffset: 0 + colorScale: {x: 1, y: 1, z: 1, w: 1} + colorOffset: {x: 0, y: 0, z: 0, w: 0} + useExpensiveSuperSample: 0 + hidden: 0 + isExternalSurface: 0 + externalSurfaceWidth: 0 + externalSurfaceHeight: 0 + compositionDepth: 0 + noDepthBufferTesting: 0 + layerTextureFormat: 0 + currentOverlayShape: 0 + textures: + - {fileID: 0} + - {fileID: 0} + isAlphaPremultiplied: 0 + _previewInEditor: 0 --- !u!114 &1915877484 MonoBehaviour: m_ObjectHideFlags: 0 @@ -29971,6 +29595,52 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4444ce35d262aa648ad0c425a559b931, type: 3} m_Name: m_EditorClassIdentifier: + currentOverlayType: 2 + isDynamic: 0 + isProtectedContent: 0 + srcRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + srcRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + invertTextureRects: 0 + overrideTextureRectMatrix: 0 + overridePerLayerColorScaleAndOffset: 0 + colorScale: {x: 1, y: 1, z: 1, w: 1} + colorOffset: {x: 0, y: 0, z: 0, w: 0} + useExpensiveSuperSample: 0 + hidden: 0 + isExternalSurface: 0 + externalSurfaceWidth: 0 + externalSurfaceHeight: 0 + compositionDepth: 0 + noDepthBufferTesting: 0 + layerTextureFormat: 0 + currentOverlayShape: 0 + textures: + - {fileID: 0} + - {fileID: 0} + isAlphaPremultiplied: 0 + _previewInEditor: 0 --- !u!4 &1915877485 Transform: m_ObjectHideFlags: 0 @@ -29997,6 +29667,52 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4444ce35d262aa648ad0c425a559b931, type: 3} m_Name: m_EditorClassIdentifier: + currentOverlayType: 2 + isDynamic: 0 + isProtectedContent: 0 + srcRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + srcRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + invertTextureRects: 0 + overrideTextureRectMatrix: 0 + overridePerLayerColorScaleAndOffset: 0 + colorScale: {x: 1, y: 1, z: 1, w: 1} + colorOffset: {x: 0, y: 0, z: 0, w: 0} + useExpensiveSuperSample: 0 + hidden: 0 + isExternalSurface: 0 + externalSurfaceWidth: 0 + externalSurfaceHeight: 0 + compositionDepth: 0 + noDepthBufferTesting: 0 + layerTextureFormat: 0 + currentOverlayShape: 0 + textures: + - {fileID: 0} + - {fileID: 0} + isAlphaPremultiplied: 0 + _previewInEditor: 0 --- !u!114 &1915877487 MonoBehaviour: m_ObjectHideFlags: 0 @@ -30009,6 +29725,52 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4444ce35d262aa648ad0c425a559b931, type: 3} m_Name: m_EditorClassIdentifier: + currentOverlayType: 2 + isDynamic: 0 + isProtectedContent: 0 + srcRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + srcRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + invertTextureRects: 0 + overrideTextureRectMatrix: 0 + overridePerLayerColorScaleAndOffset: 0 + colorScale: {x: 1, y: 1, z: 1, w: 1} + colorOffset: {x: 0, y: 0, z: 0, w: 0} + useExpensiveSuperSample: 0 + hidden: 0 + isExternalSurface: 0 + externalSurfaceWidth: 0 + externalSurfaceHeight: 0 + compositionDepth: 0 + noDepthBufferTesting: 0 + layerTextureFormat: 0 + currentOverlayShape: 0 + textures: + - {fileID: 0} + - {fileID: 0} + isAlphaPremultiplied: 0 + _previewInEditor: 0 --- !u!114 &1915877488 MonoBehaviour: m_ObjectHideFlags: 0 @@ -30021,6 +29783,52 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4444ce35d262aa648ad0c425a559b931, type: 3} m_Name: m_EditorClassIdentifier: + currentOverlayType: 2 + isDynamic: 0 + isProtectedContent: 0 + srcRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + srcRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + invertTextureRects: 0 + overrideTextureRectMatrix: 0 + overridePerLayerColorScaleAndOffset: 0 + colorScale: {x: 1, y: 1, z: 1, w: 1} + colorOffset: {x: 0, y: 0, z: 0, w: 0} + useExpensiveSuperSample: 0 + hidden: 0 + isExternalSurface: 0 + externalSurfaceWidth: 0 + externalSurfaceHeight: 0 + compositionDepth: 0 + noDepthBufferTesting: 0 + layerTextureFormat: 0 + currentOverlayShape: 0 + textures: + - {fileID: 0} + - {fileID: 0} + isAlphaPremultiplied: 0 + _previewInEditor: 0 --- !u!1001 &1916224247 PrefabInstance: m_ObjectHideFlags: 0 @@ -31198,13 +31006,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 0.75 m_fontSizeBase: 0.75 m_fontWeight: 400 @@ -31212,6 +31019,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 257 m_characterSpacing: 0 m_wordSpacing: 0 @@ -31222,10 +31031,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -31233,42 +31040,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0.3169704, y: 0, z: -0.4266512, w: 0} - m_textInfo: - textComponent: {fileID: 2040347685} - characterCount: 0 - spriteCount: 0 - spaceCount: 0 - wordCount: 0 - linkCount: 0 - lineCount: 0 - pageCount: 0 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 261597284} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1001 &2052658242 PrefabInstance: m_ObjectHideFlags: 0 @@ -31595,57 +31383,18 @@ GameObject: type: 3} m_PrefabInstance: {fileID: 2094189263} m_PrefabAsset: {fileID: 0} ---- !u!1 &2095572863 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2095572864} - - component: {fileID: 2095572865} - m_Layer: 0 - m_Name: SketchfabIdentity - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &2095572864 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2095572863} - 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: 669339392} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &2095572865 +--- !u!114 &2095572865 stripped MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 4492044765921076688, guid: 382dabebd59956d499aefb54b02f804d, + type: 3} + m_PrefabInstance: {fileID: 4492044766644994641} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2095572863} + m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: e1689780c428aa14ea42c2125e391b45, type: 3} m_Name: m_EditorClassIdentifier: - m_Service: 1 - m_OAuthScopes: [] - m_AdditionalDesktopOAuthScopes: [] - m_CallbackPath: /sketchfab - m_LoggedInTexture: {fileID: 2800000, guid: 0d05cda193064458a9a7bb085905c5a1, type: 3} - m_TokenStorePrefix: SketchfabOAuth2 - m_AuthorizationServerUrl: https://sketchfab.com/oauth2/authorize/ - m_TokenServerUrl: https://sketchfab.com/oauth2/token/ --- !u!1001 &2103185551 PrefabInstance: m_ObjectHideFlags: 0 @@ -32160,13 +31909,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 1.25 m_fontSizeBase: 1.25 m_fontWeight: 400 @@ -32174,6 +31922,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 1 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 1026 m_characterSpacing: 5.45 m_wordSpacing: 0 @@ -32184,10 +31934,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -32195,42 +31943,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 2129205351} - characterCount: 7 - spriteCount: 0 - spaceCount: 0 - wordCount: 3 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 1317145831} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1001 &2135251106 PrefabInstance: m_ObjectHideFlags: 0 @@ -32616,75 +32345,75 @@ Transform: m_Father: {fileID: 5080288855832605660} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: -90.00001, y: 0, z: -180.00002} ---- !u!1001 &5078015190248467440 +--- !u!1001 &4492044766644994641 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: - m_TransformParent: {fileID: 1209128956} + m_TransformParent: {fileID: 652605545} m_Modifications: - - target: {fileID: 5277329131170554394, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + - target: {fileID: 4492044767078796463, guid: 382dabebd59956d499aefb54b02f804d, type: 3} propertyPath: m_Name - value: AuthWebServer + value: HttpServer objectReference: {fileID: 0} - - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + - target: {fileID: 4492044767078796625, guid: 382dabebd59956d499aefb54b02f804d, type: 3} propertyPath: m_RootOrder - value: 0 + value: 3 objectReference: {fileID: 0} - - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + - target: {fileID: 4492044767078796625, guid: 382dabebd59956d499aefb54b02f804d, type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + - target: {fileID: 4492044767078796625, guid: 382dabebd59956d499aefb54b02f804d, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + - target: {fileID: 4492044767078796625, guid: 382dabebd59956d499aefb54b02f804d, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + - target: {fileID: 4492044767078796625, guid: 382dabebd59956d499aefb54b02f804d, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + - target: {fileID: 4492044767078796625, guid: 382dabebd59956d499aefb54b02f804d, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + - target: {fileID: 4492044767078796625, guid: 382dabebd59956d499aefb54b02f804d, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + - target: {fileID: 4492044767078796625, guid: 382dabebd59956d499aefb54b02f804d, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + - target: {fileID: 4492044767078796625, guid: 382dabebd59956d499aefb54b02f804d, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + - target: {fileID: 4492044767078796625, guid: 382dabebd59956d499aefb54b02f804d, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 6695854365496142808, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, + - target: {fileID: 4492044767078796625, guid: 382dabebd59956d499aefb54b02f804d, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 5cd6cd4eb5929eb448978b35e1eb86d7, type: 3} + m_SourcePrefab: {fileID: 100100000, guid: 382dabebd59956d499aefb54b02f804d, type: 3} --- !u!4 &5080288855832605660 Transform: m_ObjectHideFlags: 0 diff --git a/Assets/API Examples/SVG Path.html.meta b/Assets/Scripts/API.meta similarity index 57% rename from Assets/API Examples/SVG Path.html.meta rename to Assets/Scripts/API.meta index 99214cb37b..364ec4c320 100644 --- a/Assets/API Examples/SVG Path.html.meta +++ b/Assets/Scripts/API.meta @@ -1,6 +1,7 @@ fileFormatVersion: 2 -guid: f7f1057a8d946b94e920e785bf4d7ebb -TextScriptImporter: +guid: 4d0bf6a3e8724334a8e33256c6a94833 +folderAsset: yes +DefaultImporter: externalObjects: {} userData: assetBundleName: diff --git a/Assets/Scripts/API/ApiEndpointAttribute.cs b/Assets/Scripts/API/ApiEndpointAttribute.cs new file mode 100644 index 0000000000..2331600c76 --- /dev/null +++ b/Assets/Scripts/API/ApiEndpointAttribute.cs @@ -0,0 +1,62 @@ +using System; +using System.ComponentModel; +using System.Reflection; +using UnityEngine; + +[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] +public class ApiEndpoint : Attribute +{ + private string endpoint; + public Type type; + public MethodInfo methodInfo; + public object instance; + public ParameterInfo[] parameterInfo; + + public ApiEndpoint(string endpoint) + { + this.endpoint = endpoint; + } + + public virtual string Endpoint + { + get {return endpoint;} + } + + public void Invoke(System.Object[] parameters) + { + methodInfo.Invoke(instance, parameters); + } + + public object[] DecodeParams(string commandValue) + { + var parameters = new object[parameterInfo.Length]; + + // TODO multiple parameters. + // Do we need them? + // for (var i = 0; i < parameterInfo.Length; i++) + // { + int i = 0; + ParameterInfo paramType = parameterInfo[i]; + object paramValue; + if (paramType.ParameterType == typeof(string)) + { + paramValue = commandValue; + } + else if (paramType.ParameterType == typeof(float)) + { + paramValue = float.Parse(commandValue); + } + else if (paramType.ParameterType == typeof(Vector3)) + { + string[] temp = commandValue.Split(','); + paramValue = new Vector3(float.Parse(temp[0]), float.Parse(temp[1]), float.Parse(temp[2])); + } + else + { + paramValue = TypeDescriptor.GetConverter(paramType).ConvertFromString(commandValue); + } + parameters[i] = paramValue; + // } + return parameters; + } +} diff --git a/Assets/Scripts/API/ApiEndpointAttribute.cs.meta b/Assets/Scripts/API/ApiEndpointAttribute.cs.meta new file mode 100644 index 0000000000..7060ec50f2 --- /dev/null +++ b/Assets/Scripts/API/ApiEndpointAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a2bbeead51812b0459b195a72181017b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/API/ApiManager.cs b/Assets/Scripts/API/ApiManager.cs new file mode 100644 index 0000000000..e4f09d10f4 --- /dev/null +++ b/Assets/Scripts/API/ApiManager.cs @@ -0,0 +1,154 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using TiltBrush; +using UnityEngine; + +public class ApiManager : MonoBehaviour +{ + private const string ROOT_API_PATH = "/api/v1"; + + private Queue m_RequestedCommandQueue = Queue.Synchronized(new Queue()); + private static ApiManager m_Instance; + private Dictionary endpoints; + + [NonSerialized] public Vector3 BrushPosition; + [NonSerialized] public Quaternion BrushBearing = Quaternion.LookRotation(Vector3.forward, Vector3.up); + + public static ApiManager Instance + { + get { return m_Instance; } + } + + void Awake() + { + m_Instance = this; + Populate(); + } + private void Populate() + { + endpoints = new Dictionary(); + var types = AppDomain.CurrentDomain.GetAssemblies() + .SelectMany(t => t.GetTypes()) + .Where(t => t.IsClass && t.Namespace == "TiltBrush"); + + foreach (var type in types) + { + foreach (MethodInfo methodInfo in type.GetMethods()) + { + var attrs = Attribute.GetCustomAttributes(methodInfo, typeof(ApiEndpoint)); + foreach (Attribute attr in attrs) + { + ApiEndpoint apiEndpoint = (ApiEndpoint)attr; + bool valid = false; + if (type.IsAbstract && type.IsSealed) // therefore is static + { + apiEndpoint.instance = null; + valid = true; + } + else if (type.IsSubclassOf(typeof(MonoBehaviour))) + { + apiEndpoint.instance = FindObjectOfType(type); + if (apiEndpoint.instance != null) + { + valid = true; + } + else + { + Debug.LogWarning($"No instance found for ApiEndpoint on: {type}"); + } + } + if (valid) + { + apiEndpoint.type = type; + apiEndpoint.methodInfo = methodInfo; + apiEndpoint.parameterInfo = methodInfo.GetParameters(); + endpoints[apiEndpoint.Endpoint] = apiEndpoint; + } + else + { + Debug.LogWarning($"ApiEndpoint declared on invalid class: {type}"); + } + } + } + } + App.HttpServer.AddHttpHandler(ROOT_API_PATH, ApiCommandCallback); + } + public bool InvokeEndpoint(KeyValuePair command) + { + if (endpoints.ContainsKey(command.Key)) + { + var endpoint = endpoints[command.Key]; + var parameters = endpoint.DecodeParams(command.Value); + endpoint.Invoke(parameters); + return true; + } + else + { + Debug.LogError($"Invalid API command: {command.Key}"); + } + return false; + } + + string ApiCommandCallback(HttpListenerRequest request) + { + + KeyValuePair command; + + // Handle GET + foreach (string pair in request.Url.Query.TrimStart('?').Split('&')) + { + var kv = pair.Split(new[]{'='}, 2); + command = new KeyValuePair(kv[0], kv[1]); + m_RequestedCommandQueue.Enqueue(command); + } + + // Handle POST + // TODO also accept JSON + if (request.HasEntityBody) + { + using (Stream body = request.InputStream) + { + using (var reader = new StreamReader(body, request.ContentEncoding)) + { + var formdata = Uri.UnescapeDataString(reader.ReadToEnd()); + var pairs = formdata.Split('&'); + foreach (var pair in pairs) + { + var kv = pair.Split(new[]{'='}, 2); + command = new KeyValuePair(kv[0], kv[1]); + m_RequestedCommandQueue.Enqueue(command); + } + } + } + } + + return "OK"; + } + + private bool HandleApiCommand() + { + KeyValuePair command; + try + { + command = (KeyValuePair)m_RequestedCommandQueue.Dequeue(); + } + catch (InvalidOperationException) + { + return false; + } + + return Instance.InvokeEndpoint(command); + } + + private void Update() + { + HandleApiCommand(); + } + +} diff --git a/Assets/Scripts/API/ApiManager.cs.meta b/Assets/Scripts/API/ApiManager.cs.meta new file mode 100644 index 0000000000..0513e90415 --- /dev/null +++ b/Assets/Scripts/API/ApiManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3129917865c64490b8b93df59ca75fb6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 300 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/API/ApiMethods.cs b/Assets/Scripts/API/ApiMethods.cs new file mode 100644 index 0000000000..8e0b5b6ee1 --- /dev/null +++ b/Assets/Scripts/API/ApiMethods.cs @@ -0,0 +1,230 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Newtonsoft.Json; +using SVGMeshUnity; +using UnityEngine; + +namespace TiltBrush +{ + // ReSharper disable once UnusedType.Global + public static class ApiMethods + { + + private static void ChangeBrushBearing(float angle, Vector3 axis) + { + Quaternion bearingOffset = Quaternion.AngleAxis(angle, axis); + Quaternion newBearing = bearingOffset * ApiManager.Instance.BrushBearing; + ApiManager.Instance.BrushBearing = newBearing; + } + private static void ChangeCameraBearing(float angle, Vector3 axis) + { + TrTransform lookPose = App.Scene.Pose; + Quaternion qOffsetRotation = Quaternion.AngleAxis(angle, axis); + Quaternion qNewRotation = qOffsetRotation * lookPose.rotation; + lookPose.rotation = qNewRotation; + App.Scene.Pose = lookPose; + } + + [ApiEndpoint("draw.path")] + public static void Draw(string jsonString) + { + var origin = ApiManager.Instance.BrushPosition; + var jsonData = JsonConvert.DeserializeObject>>>(jsonString); + DrawStrokes.PathsToStrokes(jsonData, origin); + } + + [ApiEndpoint("draw.text")] + public static void Text(string text) + { + var origin = ApiManager.Instance.BrushPosition; + var font = Resources.Load("arcade"); + var textToStroke = new TextToStrokes(font); + var polyline2d = textToStroke.Build(text); + DrawStrokes.PathsToStrokes(polyline2d, origin); + } + + [ApiEndpoint("draw.svg")] + public static void SvgPath(string pathString) + { + var origin = ApiManager.Instance.BrushPosition; + SVGData svgData = new SVGData(); + svgData.Path(pathString); + SVGPolyline svgPolyline = new SVGPolyline(); + svgPolyline.Fill(svgData); + DrawStrokes.PathsToStrokes(svgPolyline.Polyline, origin, 0.01f, true); + } + + [ApiEndpoint("brush.type")] + public static void Brush(string brushId) + { + BrushDescriptor brushDescriptor = null; + try + { + var guid = new Guid(brushId); + brushDescriptor = BrushCatalog.m_Instance.GetBrush(guid); + } + catch (FormatException e) + { + } + + if (brushDescriptor == null) + { + brushId = brushId.ToLower(); + brushDescriptor = BrushCatalog.m_Instance.AllBrushes.First(x => x.name.ToLower() == brushId); + } + + if (brushDescriptor != null) + { + PointerManager.m_Instance.SetBrushForAllPointers(brushDescriptor); + } + else + { + Debug.LogError($"No brush found with the name or guid: {brushId}"); + } + } + + [ApiEndpoint("brush.color.shift")] + public static void ShiftColor(Vector3 hsv) + { + float h, s, v; + Color.RGBToHSV(App.BrushColor.CurrentColor, out h, out s, out v); + App.BrushColor.CurrentColor = Color.HSVToRGB(h + hsv.x, s + hsv.y, v + hsv.z); + } + + [ApiEndpoint("brush.color")] + public static void SetColor(string colorString) + { + Color color; + if (ColorUtility.TryParseHtmlString(colorString, out color) || + ColorUtility.TryParseHtmlString($"#{colorString}", out color)) + { + App.BrushColor.CurrentColor = color; + } + } + + [ApiEndpoint("brush.size")] + public static void BrushSize(float size) + { + PointerManager.m_Instance.MainPointer.BrushSize01 = size; + } + + [ApiEndpoint("brush.enlarge")] + public static void BrushEnlarge(float size) + { + PointerManager.m_Instance.MainPointer.BrushSize01 += size; + } + + [ApiEndpoint("brush.reduce")] + public static void BrushReduce(float size) + { + PointerManager.m_Instance.MainPointer.BrushSize01 -= size; + } + + [ApiEndpoint("camera.teleport")] + public static void TeleportCamera(Vector3 translation) + { + + TrTransform pose = App.Scene.Pose; + pose.translation -= translation; + float BoundsRadius = SceneSettings.m_Instance.HardBoundsRadiusMeters_SS; + pose = SketchControlsScript.MakeValidScenePose(pose, BoundsRadius); + App.Scene.Pose = pose; + } + + [ApiEndpoint("camera.turn")] + [ApiEndpoint("camera.turn.y")] + [ApiEndpoint("camera.yaw")] + public static void Yaw(float angle) + { + ChangeCameraBearing(angle, Vector3.up); + } + + [ApiEndpoint("camera.pitch")] + [ApiEndpoint("camera.turn.x")] + public static void Pitch(float angle) + { + ChangeCameraBearing(angle, Vector3.left); + } + + [ApiEndpoint("camera.roll")] + [ApiEndpoint("camera.turn.z")] + public static void Roll(float angle) + { + ChangeCameraBearing(angle, Vector3.forward); + } + + [ApiEndpoint("camera.lookat")] + public static void CameraDirection(Vector3 direction) + { + TrTransform lookPose = App.Scene.Pose; + Quaternion qNewRotation = Quaternion.Euler(direction.x, direction.y, direction.z); + lookPose.rotation = qNewRotation; + App.Scene.Pose = lookPose; + } + + [ApiEndpoint("brush.moveto")] + public static void BrushMoveTo(Vector3 position) + { + ApiManager.Instance.BrushPosition = position; + } + + [ApiEndpoint("brush.moveby")] + public static void BrushMoveBy(Vector3 offset) + { + ApiManager.Instance.BrushPosition += offset; + } + + [ApiEndpoint("brush.move")] + public static void BrushMove(float distance) + { + var currentPosition = ApiManager.Instance.BrushPosition; + var directionVector = ApiManager.Instance.BrushBearing * Vector3.up; + var newPosition = currentPosition + (directionVector * distance); + ApiManager.Instance.BrushPosition = newPosition; + } + + [ApiEndpoint("brush.draw")] + public static void BrushDraw(float distance) + { + var directionVector = ApiManager.Instance.BrushBearing * Vector3.up; + var end = directionVector * distance; + var path = new List> + { + new List{Vector3.zero, end} + }; + var origin = ApiManager.Instance.BrushPosition; + DrawStrokes.PathsToStrokes(path, origin); + ApiManager.Instance.BrushPosition += end; + } + + [ApiEndpoint("brush.turn")] + [ApiEndpoint("brush.turn.y")] + [ApiEndpoint("brush.yaw")] + public static void BrushYaw(float angle) + { + ChangeBrushBearing(angle, Vector3.up); + } + + [ApiEndpoint("brush.pitch")] + [ApiEndpoint("brush.turn.x")] + public static void BrushPitch(float angle) + { + ChangeBrushBearing(angle, Vector3.left); + } + + [ApiEndpoint("brush.roll")] + [ApiEndpoint("brush.turn.z")] + public static void BrushRoll(float angle) + { + ChangeBrushBearing(angle, Vector3.forward); + } + + [ApiEndpoint("brush.lookat")] + public static void BrushLookAt(Vector3 direction) + { + Quaternion newBearing = Quaternion.LookRotation(direction, Vector3.up); + ApiManager.Instance.BrushBearing = newBearing; + } + } +} diff --git a/Assets/Scripts/API/ApiMethods.cs.meta b/Assets/Scripts/API/ApiMethods.cs.meta new file mode 100644 index 0000000000..83cc0de4ef --- /dev/null +++ b/Assets/Scripts/API/ApiMethods.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7f038eff0c6a4b528ce34ef23ec7c464 +timeCreated: 1620479064 \ No newline at end of file diff --git a/Assets/Scripts/API/DrawStrokes.cs b/Assets/Scripts/API/DrawStrokes.cs new file mode 100644 index 0000000000..3ed59f7ae0 --- /dev/null +++ b/Assets/Scripts/API/DrawStrokes.cs @@ -0,0 +1,98 @@ +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +namespace TiltBrush +{ + public static class DrawStrokes + { + public static void PathsToStrokes(List>> floatPaths, Vector3 origin, float scale = 1f) + { + var paths = new List>(); + foreach (List> positionList in floatPaths) + { + var path = new List(); + foreach (List position in positionList) + { + path.Add(new Vector3(position[0], position[1], position[2])); + } + paths.Add(path); + } + PathsToStrokes(paths, origin, scale); + } + public static void PathsToStrokes(List> polyline2d, Vector3 origin, float scale = 1f, bool breakOnOrigin = false) + { + var paths = new List>(); + foreach (List positionList in polyline2d) + { + var path = new List(); + foreach (Vector2 position in positionList) + { + path.Add(new Vector3(position.x, position.y, 0)); + } + paths.Add(path); + } + PathsToStrokes(paths, origin, scale, breakOnOrigin); + } + public static void PathsToStrokes(List> paths, Vector3 origin, float scale = 1f, bool breakOnOrigin = false) + { + Vector3 pos = origin; + var brush = PointerManager.m_Instance.MainPointer.CurrentBrush; + uint time = 0; + float minPressure = PointerManager.m_Instance.MainPointer.CurrentBrush.PressureSizeMin(false); + float pressure = Mathf.Lerp(minPressure, 1f, 0.5f); + var group = App.GroupManager.NewUnusedGroup(); + for (var pathIndex = 0; pathIndex < paths.Count; pathIndex++) + { + var path = paths[pathIndex]; + if (path.Count < 2) continue; + float lineLength = 0; + var controlPoints = new List(); + for (var vertexIndex = 0; vertexIndex < path.Count - 1; vertexIndex++) + { + var coordList0 = path[vertexIndex]; + var vert = new Vector3(coordList0[0], coordList0[1], coordList0[2]) * scale; + var coordList1 = path[(vertexIndex + 1) % path.Count]; + // Fix for trailing zeros from SVG. + // TODO Find out why and fix it properly + if (breakOnOrigin && coordList1 == Vector3.zero) + { + break; + } + var nextVert = new Vector3(coordList1[0], coordList1[1], coordList1[2]) * scale; + + for (float step = 0; step <= 1f; step += .25f) + { + controlPoints.Add(new PointerManager.ControlPoint + { + m_Pos = pos + vert + ((nextVert - vert) * step), + m_Orient = Quaternion.identity, //.LookRotation(face.Normal, Vector3.up), + m_Pressure = pressure, + m_TimestampMs = time++ + }); + } + + lineLength += (nextVert - vert).magnitude; // TODO Does this need scaling? Should be in Canvas space + } + var stroke = new Stroke + { + m_Type = Stroke.Type.NotCreated, + m_IntendedCanvas = App.Scene.ActiveCanvas, + m_BrushGuid = brush.m_Guid, + m_BrushScale = 1f, + m_BrushSize = PointerManager.m_Instance.MainPointer.BrushSizeAbsolute, + m_Color = App.BrushColor.CurrentColor, + m_Seed = 0, + m_ControlPoints = controlPoints.ToArray(), + }; + stroke.m_ControlPointsToDrop = Enumerable.Repeat(false, stroke.m_ControlPoints.Length).ToArray(); + stroke.Group = @group; + stroke.Recreate(null, App.Scene.ActiveCanvas); + if (pathIndex != 0) stroke.m_Flags = SketchMemoryScript.StrokeFlags.IsGroupContinue; + SketchMemoryScript.m_Instance.MemoryListAdd(stroke); + SketchMemoryScript.m_Instance.PerformAndRecordCommand( + new BrushStrokeCommand(stroke, WidgetManager.m_Instance.ActiveStencil, 123) // TODO calc length + ); + } + } + } +} diff --git a/Assets/Scripts/API/DrawStrokes.cs.meta b/Assets/Scripts/API/DrawStrokes.cs.meta new file mode 100644 index 0000000000..3e9eba5a84 --- /dev/null +++ b/Assets/Scripts/API/DrawStrokes.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b76e947b8cc3459f9065ac41303340c2 +timeCreated: 1620560275 \ No newline at end of file diff --git a/Assets/Scripts/App.cs b/Assets/Scripts/App.cs index 978677e077..5962725c27 100644 --- a/Assets/Scripts/App.cs +++ b/Assets/Scripts/App.cs @@ -607,11 +607,6 @@ void Awake() { HttpServer.AddHttpHandler("/load", HttpLoadSketchCallback); } -#if (UNITY_EDITOR || EXPERIMENTAL_ENABLED) - foreach (var urlPath in GetApiUrlPaths()) { - HttpServer.AddHttpHandler(urlPath, ApiCommandCallback); - } -#endif m_AutosaveRestoreFileExists = File.Exists(AutosaveRestoreFilePath()); m_GoogleUserSettings = new GoogleUserSettings(m_GoogleIdentity); @@ -1178,9 +1173,6 @@ void Update() // This should happen after SMS.ContinueDrawingFromMemory, so we're not loading and // continuing in one frame. HandleExternalTiltOpenRequest(); -#if (UNITY_EDITOR || EXPERIMENTAL_ENABLED) - HandleApiCommand(); -#endif break; case AppState.Reset: SketchControlsScript.m_Instance.UpdateControls(); diff --git a/Assets/Scripts/AppApiHandler.cs b/Assets/Scripts/AppApiHandler.cs deleted file mode 100644 index 1ab16387ab..0000000000 --- a/Assets/Scripts/AppApiHandler.cs +++ /dev/null @@ -1,281 +0,0 @@ -#if (UNITY_EDITOR || EXPERIMENTAL_ENABLED) -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using Newtonsoft.Json; -using SVGMeshUnity; -using UnityEngine; - - -namespace TiltBrush -{ - public partial class App { - - private Queue m_RequestedCommandQueue = Queue.Synchronized(new Queue()); - - Vector3 stringToVec(string s) { - string[] temp = s.Split(','); - return new Vector3 (float.Parse(temp[0]), float.Parse(temp[1]), float.Parse(temp[2])); - } - - public string[] GetApiUrlPaths() { - return new[] - { - "/api/v1/draw", - "/api/v1/svgpath", - "/api/v1/brush", - "/api/v1/color", - "/api/v1/text", - "/api/v1/teleport", - "/api/v1/roll", - "/api/v1/pitch", - "/api/v1/yaw", - "/api/v1/turn", - }; - } - - string ApiCommandCallback(HttpListenerRequest request) { - - string[] urlParts = request.Url.Segments; - if (urlParts.Length!=4 || urlParts[1] != "api/" || urlParts[2] != "v1/") { - return null; // TODO Status codes - } - - KeyValuePair command; - string paramString = null; - - if (request.HasEntityBody) { - using (Stream body = request.InputStream) { - using (var reader = new StreamReader(body, request.ContentEncoding)) - { - var parts = Uri.UnescapeDataString(reader.ReadToEnd()).Split(new[] {'='}, 2); - paramString = parts[1].Replace("+", " "); - } - } - } - - if (string.IsNullOrEmpty(paramString)) { - if (request.Url.Query.Length > 1) { - paramString = Uri.UnescapeDataString(request.Url.Query.Substring(1)); - } - } - - if (!string.IsNullOrEmpty(paramString)) { - command = new KeyValuePair(urlParts[3].TrimEnd('/'), paramString); - m_RequestedCommandQueue.Enqueue(command); - return "OK"; - } - return null; // TODO Status codes - } - - private void HandleApiCommand() { - - KeyValuePair command; - try - { - command = (KeyValuePair) m_RequestedCommandQueue.Dequeue(); - } - catch (InvalidOperationException) - { - return; - } - - if (string.IsNullOrEmpty(command.Value)) return; - - switch (command.Key) - { - case "draw": - var jsonData = JsonConvert.DeserializeObject>>>(command.Value); - PathsToStrokes(jsonData); - break; - case "text": - var font = Resources.Load("arcade"); - var textToStroke = new TextToStrokes(font); - var polyline2d = textToStroke.Build(command.Value); - PathsToStrokes(polyline2d); - break; - case "svgpath": - SVGData svgData = new SVGData(); - svgData.Path(command.Value); - SVGPolyline svgPolyline = new SVGPolyline(); - svgPolyline.Fill(svgData); - PathsToStrokes(svgPolyline.Polyline, 0.01f, true); - break; - case "brush": - var brushId = command.Value; - BrushDescriptor brushDescriptor = null; - try - { - var guid = new Guid(brushId); - brushDescriptor = BrushCatalog.m_Instance.GetBrush(guid); - } - catch (FormatException e) - { - } - - if (brushDescriptor == null) - { - brushId = brushId.ToLower(); - brushDescriptor = BrushCatalog.m_Instance.AllBrushes.First(x => x.name.ToLower() == brushId); - } - - PointerManager.m_Instance.SetBrushForAllPointers(brushDescriptor); - break; - case "color": - Color color; - if (ColorUtility.TryParseHtmlString(command.Value, out color) || - ColorUtility.TryParseHtmlString($"#{command.Value}", out color)) - { - BrushColor.CurrentColor = color; - } - - break; - - case "teleport": - - TrTransform pose = Scene.Pose; - pose.translation -= stringToVec(command.Value); - float BoundsRadius = SceneSettings.m_Instance.HardBoundsRadiusMeters_SS; - pose = SketchControlsScript.MakeValidScenePose(pose, BoundsRadius); - App.Scene.Pose = pose; - break; - - case "yaw": - case "turn": - TurnBy(float.Parse(command.Value), Vector3.up); - break; - - case "pitch": - TurnBy(float.Parse(command.Value), Vector3.left); - break; - - case "roll": - TurnBy(float.Parse(command.Value), Vector3.forward); - break; - - case "lookdirection": - TrTransform lookPose = Scene.Pose; - var euler = stringToVec(command.Value); - Quaternion qNewRotation = Quaternion.Euler(euler.x, euler.y, euler.z); - lookPose.rotation = qNewRotation; - Scene.Pose = lookPose; - break; - } - } - - private void TurnBy(float angle, Vector3 axis) { - TrTransform lookPose = Scene.Pose; - Quaternion qOffsetRotation = Quaternion.AngleAxis(angle, axis); - Quaternion qNewRotation = qOffsetRotation * lookPose.rotation; - lookPose.rotation = qNewRotation; - Scene.Pose = lookPose; - } - - private static void PathsToStrokes(List>> floatPaths, float scale = 1f) - { - var paths = new List>(); - foreach (List> positionList in floatPaths) - { - var path = new List(); - foreach (List position in positionList) - { - path.Add(new Vector3(position[0], position[1], position[2])); - } - paths.Add(path); - } - PathsToStrokes(paths, scale); - } - - private static void PathsToStrokes(List> polyline2d, float scale = 1f, bool breakOnOrigin=false) - { - var paths = new List>(); - foreach (List positionList in polyline2d) - { - var path = new List(); - foreach (Vector2 position in positionList) - { - path.Add(new Vector3(position.x, position.y, 0)); - } - paths.Add(path); - } - PathsToStrokes(paths, scale, breakOnOrigin); - } - - private static void PathsToStrokes(List> paths, float scale = 1f, bool breakOnOrigin=false) - { - Vector3 pos = Vector3.zero; - var brush = PointerManager.m_Instance.MainPointer.CurrentBrush; - uint time = 0; - float minPressure = PointerManager.m_Instance.MainPointer.CurrentBrush.PressureSizeMin(false); - float pressure = Mathf.Lerp(minPressure, 1f, 0.5f); - - var strokes = new List(); - foreach (var path in paths) - { - if (path.Count < 2) continue; - float lineLength = 0; - var controlPoints = new List(); - for (var vertexIndex = 0; vertexIndex < path.Count - 1; vertexIndex++) - { - var coordList0 = path[vertexIndex]; - var vert = new Vector3(coordList0[0], coordList0[1], coordList0[2]) * scale; - var coordList1 = path[(vertexIndex + 1) % path.Count]; - // Fix for trailing zeros from SVG. - // TODO Find out why and fix it properly - if (breakOnOrigin && coordList1 == Vector3.zero) - { - break; - } - var nextVert = new Vector3(coordList1[0], coordList1[1], coordList1[2]) * scale; - for (float step = 0; step <= 1f; step += .25f) - { - controlPoints.Add(new PointerManager.ControlPoint - { - m_Pos = pos + vert + ((nextVert - vert) * step), - m_Orient = Quaternion.identity, //.LookRotation(face.Normal, Vector3.up), - m_Pressure = pressure, - m_TimestampMs = time++ - }); - } - - lineLength += (nextVert - vert).magnitude; // TODO Does this need scaling? Should be in Canvas space - } - - var stroke = new Stroke - { - m_Type = Stroke.Type.NotCreated, - m_IntendedCanvas = Scene.ActiveCanvas, - m_BrushGuid = brush.m_Guid, - m_BrushScale = 1f, - m_BrushSize = PointerManager.m_Instance.MainPointer.BrushSizeAbsolute, - m_Color = BrushColor.CurrentColor, - m_Seed = 0, - m_ControlPoints = controlPoints.ToArray(), - }; - stroke.m_ControlPointsToDrop = Enumerable.Repeat(false, stroke.m_ControlPoints.Length).ToArray(); - stroke.Uncreate(); - stroke.Recreate(null, Scene.ActiveCanvas); - - SketchMemoryScript.m_Instance.MemorizeBatchedBrushStroke( - stroke.m_BatchSubset, - stroke.m_Color, - stroke.m_BrushGuid, - stroke.m_BrushSize, - stroke.m_BrushScale, - stroke.m_ControlPoints.ToList(), - stroke.m_Flags, - WidgetManager.m_Instance.ActiveStencil, - lineLength, - 123 - ); - - strokes.Add(stroke); - } - } - - } -} -#endif \ No newline at end of file diff --git a/Assets/Scripts/AppApiHandler.cs.meta b/Assets/Scripts/AppApiHandler.cs.meta deleted file mode 100644 index 0850061252..0000000000 --- a/Assets/Scripts/AppApiHandler.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: dfe14ccbbdef412dab65bfab312387fc -timeCreated: 1618061743 \ No newline at end of file diff --git a/Assets/Scripts/TextToStrokes/TextToStrokes.cs b/Assets/Scripts/TextToStrokes/TextToStrokes.cs index e743169821..c0883aa3ac 100644 --- a/Assets/Scripts/TextToStrokes/TextToStrokes.cs +++ b/Assets/Scripts/TextToStrokes/TextToStrokes.cs @@ -25,19 +25,23 @@ public List> Build(string text) offset.x = 0; continue; } - if (character < _font.Outlines.Count) - { - List> letter = _font.Outlines[character]; - // Offset letter outline by the current total offset - shape.AddRange( - letter.Select( - path => path.Select( - point=>new Vector3(point.x + offset.x, point.y + offset.y, 0) - ).ToList() - ).ToList() - ); - offset.x += _font.Widths[character]; - } + // try + // { + List> letter = _font.Outlines[character]; + // Offset letter outline by the current total offset + shape.AddRange( + letter.Select( + path => path.Select( + point => new Vector3(point.x + offset.x, point.y + offset.y, 0) + ).ToList() + ).ToList() + ); + offset.x += _font.Widths[character]; + // } + // catch (Ex e) + // { + // + // } } return shape; } diff --git a/Assets/API Examples/JSON to Stroke.html b/Support/API Examples/JSON to Stroke.html similarity index 51% rename from Assets/API Examples/JSON to Stroke.html rename to Support/API Examples/JSON to Stroke.html index fef7a67a3f..058d633d78 100644 --- a/Assets/API Examples/JSON to Stroke.html +++ b/Support/API Examples/JSON to Stroke.html @@ -3,9 +3,9 @@ -
-
- diff --git a/Assets/API Examples/SVG Path.html b/Support/API Examples/SVG Path.html similarity index 67% rename from Assets/API Examples/SVG Path.html rename to Support/API Examples/SVG Path.html index 12a6c851ed..9392554747 100644 --- a/Assets/API Examples/SVG Path.html +++ b/Support/API Examples/SVG Path.html @@ -3,9 +3,9 @@ - -
- diff --git a/Support/API Examples/Simple Form.html b/Support/API Examples/Simple Form.html new file mode 100644 index 0000000000..a65f42a547 --- /dev/null +++ b/Support/API Examples/Simple Form.html @@ -0,0 +1,11 @@ + + + + + + + + +
+ + \ No newline at end of file From d2e23c7823fb8557156563b852fa2b47b21ba9ce Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Sun, 9 May 2021 17:43:08 +0100 Subject: [PATCH 010/769] User bearing vector instead of quaternion for brush movement. --- Assets/API Examples.meta | 8 -------- Assets/Scripts/API/ApiManager.cs | 2 +- Assets/Scripts/API/ApiMethods.cs | 12 ++++++------ 3 files changed, 7 insertions(+), 15 deletions(-) delete mode 100644 Assets/API Examples.meta diff --git a/Assets/API Examples.meta b/Assets/API Examples.meta deleted file mode 100644 index 236b7630a7..0000000000 --- a/Assets/API Examples.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a1b682fb8865fa746a26d3dc9b52f4ee -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/API/ApiManager.cs b/Assets/Scripts/API/ApiManager.cs index e4f09d10f4..437509ba03 100644 --- a/Assets/Scripts/API/ApiManager.cs +++ b/Assets/Scripts/API/ApiManager.cs @@ -18,7 +18,7 @@ public class ApiManager : MonoBehaviour private Dictionary endpoints; [NonSerialized] public Vector3 BrushPosition; - [NonSerialized] public Quaternion BrushBearing = Quaternion.LookRotation(Vector3.forward, Vector3.up); + [NonSerialized] public Vector3 BrushBearing = Vector3.forward; public static ApiManager Instance { diff --git a/Assets/Scripts/API/ApiMethods.cs b/Assets/Scripts/API/ApiMethods.cs index 8e0b5b6ee1..1001c2cdb8 100644 --- a/Assets/Scripts/API/ApiMethods.cs +++ b/Assets/Scripts/API/ApiMethods.cs @@ -13,8 +13,7 @@ public static class ApiMethods private static void ChangeBrushBearing(float angle, Vector3 axis) { - Quaternion bearingOffset = Quaternion.AngleAxis(angle, axis); - Quaternion newBearing = bearingOffset * ApiManager.Instance.BrushBearing; + Vector3 newBearing = Quaternion.AngleAxis(angle, axis) * ApiManager.Instance.BrushBearing; ApiManager.Instance.BrushBearing = newBearing; } private static void ChangeCameraBearing(float angle, Vector3 axis) @@ -147,6 +146,8 @@ public static void Pitch(float angle) ChangeCameraBearing(angle, Vector3.left); } + // TODO doesn't actually make any difference at the moment + // As we don't store orientation - only bearing. [ApiEndpoint("camera.roll")] [ApiEndpoint("camera.turn.z")] public static void Roll(float angle) @@ -179,7 +180,7 @@ public static void BrushMoveBy(Vector3 offset) public static void BrushMove(float distance) { var currentPosition = ApiManager.Instance.BrushPosition; - var directionVector = ApiManager.Instance.BrushBearing * Vector3.up; + var directionVector = ApiManager.Instance.BrushBearing; var newPosition = currentPosition + (directionVector * distance); ApiManager.Instance.BrushPosition = newPosition; } @@ -187,7 +188,7 @@ public static void BrushMove(float distance) [ApiEndpoint("brush.draw")] public static void BrushDraw(float distance) { - var directionVector = ApiManager.Instance.BrushBearing * Vector3.up; + var directionVector = ApiManager.Instance.BrushBearing; var end = directionVector * distance; var path = new List> { @@ -223,8 +224,7 @@ public static void BrushRoll(float angle) [ApiEndpoint("brush.lookat")] public static void BrushLookAt(Vector3 direction) { - Quaternion newBearing = Quaternion.LookRotation(direction, Vector3.up); - ApiManager.Instance.BrushBearing = newBearing; + ApiManager.Instance.BrushBearing = direction.normalized; } } } From d9245325c4bba61c70f41b77a6f13605642b77a0 Mon Sep 17 00:00:00 2001 From: Mike Miller Date: Sun, 9 May 2021 14:35:48 +0300 Subject: [PATCH 011/769] Name builds based on the source In order to make it easier to run multiple versions, instead of a fixed "-github" name (and package name of com.icosa.openbrushgithub), this commit changes the logic for CI builds. * Builds from PRs are named PR#xx (PRxx in the package name) * Builds from branches (triggered with a [CI BUILD] tag) are named based on the branch name. Special characters of /[#_-]/ are removed from the package name * All commits on main have the same name, whether they're pre-release builds or formal release builds. This means that the pre-release builds will NOT have a unique name, but this will allow us to upload them to a "beta" release channel --- .github/workflows/build.yml | 35 ++++++++++++++++++++++----------- Assets/Editor/BuildTiltBrush.cs | 18 ++++++++--------- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0288fffd21..5d1d5584ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,8 +37,8 @@ jobs: stamp: ${{ steps.version.outputs.stamp }} prerelease: ${{ steps.version.outputs.prerelease }} changelog: ${{ steps.changelog.outputs.changelog }} - btbgithub: ${{ steps.github.outputs.btbgithub }} basename: ${{ steps.github.outputs.basename }} + description: ${{ steps.github.outputs.description}} steps: - name: Checkout repository uses: actions/checkout@v2 @@ -81,18 +81,31 @@ jobs: CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" echo "::set-output name=changelog::$CHANGELOG" - - name: Set github suffix if relevant + - name: Set custom app name and package name, if relevant id: github env: PRERELEASE: ${{ steps.version.outputs.prerelease }} run: | - if [ "$PRERELEASE" == "true" ] + # For a PR action (i.e., syncronize / open), the value of github.ref will be refs/pull/1234/merge + # For a push action, it will be either refs/heads/foo_branch_name OR refs/tags/v1234. + # We want to use the base name for pushes of tags or to main, the PR number for PRs, and the branch name for named branches. + if [[ "$PRERELEASE" == "false" || ${{ github.ref }} == refs/heads/main ]] then - echo "::set-output name=btbgithub::-btb-github" - echo "::set-output name=basename::OpenBrush-github" - else - echo "::set-output name=btbgithub::" echo "::set-output name=basename::OpenBrush" + echo "::set-output name=description::" + else + if [[ ${{ github.ref }} == refs/pull/* ]] + then + DESCRIPTION="PR#$(echo ${{ github.ref }} | sed -e 's#refs/pull/##' -e 's#/merge##')" + elif [[ ${{ github.ref }} == refs/heads/* ]] + then + DESCRIPTION="$(echo ${{ github.ref }} | sed -e 's#refs/heads/##')" + else + DESCRIPTION="Unknown" + fi + echo "::set-output name=description::-btb-description ${DESCRIPTION}" + IDENTIFIER=$(echo ${DESCRIPTION} | sed -e 's/[#_-]//g') + echo "::set-output name=basename::OpenBrush-${IDENTIFIER}" fi build: name: ${{ matrix.name }} @@ -242,7 +255,7 @@ jobs: env: BASENAME: ${{ needs.configuration.outputs.basename}} run: - echo "filename=com.Icosa.$(echo $BASENAME | sed -e 's/-//g').apk" >> $GITHUB_ENV + echo "filename=com.Icosa.$BASENAME.apk" >> $GITHUB_ENV - name: Set build stamp if: ${{ needs.configuration.outputs.stamp }} @@ -293,7 +306,7 @@ jobs: allowDirtyBuild: true # Because of the OVR Update, the build tree might be dirty unityVersion: ${{ env.UNITY_VERSION }} targetPlatform: ${{ matrix.targetPlatform }} - customParameters: -btb-target ${{ matrix.targetPlatform }} -btb-display ${{ matrix.vrsdk }} -btb-out /github/workspace/build/${{ matrix.targetPlatform }}-${{ matrix.vrsdk }}/${{ env.filename }} ${{ needs.configuration.outputs.btbgithub }} ${{ env.stamp }} ${{ matrix.extraoptions }} + customParameters: -btb-target ${{ matrix.targetPlatform }} -btb-display ${{ matrix.vrsdk }} -btb-out /github/workspace/build/${{ matrix.targetPlatform }}-${{ matrix.vrsdk }}/${{ env.filename }} ${{ needs.configuration.outputs.description}} ${{ env.stamp }} ${{ matrix.extraoptions }} versioning: Custom version: ${{ needs.configuration.outputs.version }} buildMethod: BuildTiltBrush.CommandLine @@ -400,9 +413,9 @@ jobs: zip -r OpenBrush_Desktop_Experimental_$VERSION.zip OpenBrush_Desktop_Experimental_$VERSION/ zip -r OpenBrush_Rift_$VERSION.zip OpenBrush_Rift_$VERSION/ zip -r OpenBrush_Rift_Experimental_$VERSION.zip OpenBrush_Rift_Experimental_$VERSION/ - chmod a+x OpenBrush_Linux_$VERSION/OpenBrush || chmod a+x OpenBrush_Linux_$VERSION/OpenBrush-github + chmod a+x OpenBrush_Linux_$VERSION/OpenBrush* tar cvfz OpenBrush_Linux_$VERSION.tgz OpenBrush_Linux_$VERSION/ - chmod a+x OpenBrush_Linux_Experimental_$VERSION/OpenBrush || chmod a+x OpenBrush_Linux_Experimental_$VERSION/OpenBrush-github + chmod a+x OpenBrush_Linux_Experimental_$VERSION/OpenBrush* tar cvfz OpenBrush_Linux_Experimental_$VERSION.tgz OpenBrush_Linux_Experimental_$VERSION/ rm -rf OpenBrush_Desktop_$VERSION rm -rf OpenBrush_Desktop_Experimental_$VERSION diff --git a/Assets/Editor/BuildTiltBrush.cs b/Assets/Editor/BuildTiltBrush.cs index 5d639fecbf..7e8395cf13 100644 --- a/Assets/Editor/BuildTiltBrush.cs +++ b/Assets/Editor/BuildTiltBrush.cs @@ -47,7 +47,7 @@ public class TiltBuildOptions public string Location; public string Stamp; public BuildOptions UnityOptions; - public bool Github; + public string Description; } [Serializable()] @@ -304,7 +304,7 @@ public static TiltBuildOptions GetGuiOptions() UnityOptions = GuiDevelopment ? (BuildOptions.AllowDebugging | BuildOptions.Development) : BuildOptions.None, - Github = false, + Description = "(unity editor)", }; } @@ -742,9 +742,9 @@ static void CommandLine() { tiltOptions.Experimental = true; } - else if (args[i] == "-btb-github") + else if (args[i] == "-btb-description") { - tiltOptions.Github = true; + tiltOptions.Description = args[++i]; } else if (args[i] == "-btb-il2cpp") { @@ -937,7 +937,7 @@ class TempSetAppNames : IDisposable private string m_name; private string m_company; private bool m_isAndroid; - public TempSetAppNames(bool isAndroid, bool isGithub) + public TempSetAppNames(bool isAndroid, string Description) { m_isAndroid = isAndroid; m_identifier = PlayerSettings.GetApplicationIdentifier(BuildTargetGroup.Android); @@ -945,10 +945,10 @@ public TempSetAppNames(bool isAndroid, bool isGithub) m_company = PlayerSettings.companyName; string new_name = App.kAppDisplayName; string new_identifier = App.kGuiBuildAndroidApplicationIdentifier; - if (isGithub) + if (!String.IsNullOrEmpty(Description)) { - new_name += " (Github)"; - new_identifier += "-github"; + new_name += " (" + Description + ")"; + new_identifier += Description.Replace("_", "").Replace("#", "").Replace("-", ""); } if (m_isAndroid) { @@ -1242,7 +1242,7 @@ public static void DoBuild(TiltBuildOptions tiltOptions) using (var unused4 = new TempHookUpSingletons()) using (var unused5 = new TempSetScriptingBackend(target, tiltOptions.Il2Cpp)) using (var unused6 = new TempSetBundleVersion(App.Config.m_VersionNumber, stamp)) - using (var unused10 = new TempSetAppNames(target == BuildTarget.Android, tiltOptions.Github)) + using (var unused10 = new TempSetAppNames(target == BuildTarget.Android, tiltOptions.Description)) using (var unused7 = new RestoreVrSdks()) using (var unused9 = new RestoreFileContents( Path.Combine(Path.GetDirectoryName(Application.dataPath), From f153ec8b4906dc032fc7f79cbb1de62c14c70b67 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Sun, 9 May 2021 23:02:53 +0100 Subject: [PATCH 012/769] [CI BUILD] test [CI BUILD] --- Assets/Scripts/API/ApiMethods.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Assets/Scripts/API/ApiMethods.cs b/Assets/Scripts/API/ApiMethods.cs index 1001c2cdb8..4f6fc83dba 100644 --- a/Assets/Scripts/API/ApiMethods.cs +++ b/Assets/Scripts/API/ApiMethods.cs @@ -7,6 +7,7 @@ namespace TiltBrush { + // ReSharper disable once UnusedType.Global public static class ApiMethods { From c7df2ce56a42b5230c075d7751e88e3b16fa0d6b Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Mon, 10 May 2021 08:42:20 +0100 Subject: [PATCH 013/769] Fix button label [CI BUILD] --- Assets/Prefabs/Panels/ColorPickerPanel.prefab | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Assets/Prefabs/Panels/ColorPickerPanel.prefab b/Assets/Prefabs/Panels/ColorPickerPanel.prefab index 9c42ac7fd2..e3484a7c2d 100644 --- a/Assets/Prefabs/Panels/ColorPickerPanel.prefab +++ b/Assets/Prefabs/Panels/ColorPickerPanel.prefab @@ -2581,6 +2581,11 @@ PrefabInstance: propertyPath: m_ButtonTexture value: objectReference: {fileID: 2800000, guid: 9b82f38d1c06a854faadd9c2ea76b48b, type: 3} + - target: {fileID: 7525759816367303735, guid: 71757eb1eb6bebe489a852e972821df3, + type: 3} + propertyPath: m_DescriptionText + value: Color Jitter + objectReference: {fileID: 0} - target: {fileID: 7630606763700834929, guid: 71757eb1eb6bebe489a852e972821df3, type: 3} propertyPath: m_Name From df23e81d2cee46d39add26cd8796ffa0fc4a9992 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Mon, 10 May 2021 10:22:20 +0100 Subject: [PATCH 014/769] Allow external api calls on experimental builds [CI BUILD] --- Assets/Scripts/Sharing/HttpServer.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Sharing/HttpServer.cs b/Assets/Scripts/Sharing/HttpServer.cs index 290feb9b67..5d2135bb3a 100644 --- a/Assets/Scripts/Sharing/HttpServer.cs +++ b/Assets/Scripts/Sharing/HttpServer.cs @@ -56,9 +56,15 @@ void Awake() // Abort, even though it has already disposed the context. break; } + +#if (UNITY_EDITOR || EXPERIMENTAL_ENABLED) + bool allowExternalApiCalls = true; +#else + bool allowExternalApiCalls = false; +#endif try { - if (!ctx.Request.IsLocal) + if (!ctx.Request.IsLocal || allowExternalApiCalls) { // Return 403: Forbidden if the originator was non-local. ctx.Response.StatusCode = (int)HttpStatusCode.Forbidden; From 173aa045e5b46f5ace63e0b585256edeb1d31791 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Tue, 11 May 2021 12:02:32 +0100 Subject: [PATCH 015/769] Initial rough implementation --- Assets/Scripts/SelectionManager.cs | 16 ++++++++++++ Assets/Scripts/Tools/SelectionTool.cs | 7 +++++ Assets/Scripts/Widgets/GrabWidget.cs | 8 +++++- Assets/Scripts/Widgets/SelectionWidget.cs | 32 +++++++++++++++++++++++ 4 files changed, 62 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/SelectionManager.cs b/Assets/Scripts/SelectionManager.cs index 42c8af4bc8..76eb91e64c 100644 --- a/Assets/Scripts/SelectionManager.cs +++ b/Assets/Scripts/SelectionManager.cs @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +using System; using System.Collections.Generic; using System.Linq; using UnityEngine; @@ -66,6 +67,10 @@ public class SelectionManager : MonoBehaviour private bool m_IsAnimatingTossFromGrabbingGroup; private bool m_IsGrabbingGroup; private BaseTool.ToolType m_ToolTypeBeforeGrabbingGroup; + + [NonSerialized] public float m_snappingAngle = 45; // TODO access control + private float[] angleSnaps; + private int currentSnap; // As opposed to 'add to selection'. When this is true, strokes picked up // by the selection tool will be removed from selected strokes. When false, they'll be added @@ -379,6 +384,7 @@ void Awake() m_Instance = this; m_SelectedStrokes = new HashSet(); m_SelectedWidgets = new HashSet(); + angleSnaps = new[] {0f, 15f, 30f, 45f, 60f, 75f, 90f}; } public void CacheSelectionTool(SelectionTool tool) @@ -928,6 +934,16 @@ Bounds GetBoundsOfSelectedWidgets_SelectionCanvasSpace() return totalBounds_CS; } + + public void IncrementSnappingAngle() + { + currentSnap++; + currentSnap %= angleSnaps.Length; + m_snappingAngle = angleSnaps[currentSnap]; + // TODO + // GetComponentInChildren().text = m_snappingAngle.ToString(); + + } } } // namespace TiltBrush diff --git a/Assets/Scripts/Tools/SelectionTool.cs b/Assets/Scripts/Tools/SelectionTool.cs index d266f8cd64..62cc1d161e 100644 --- a/Assets/Scripts/Tools/SelectionTool.cs +++ b/Assets/Scripts/Tools/SelectionTool.cs @@ -122,6 +122,13 @@ override public void OnUpdateDetection() } else { + if (InputManager.m_Instance.GetCommandDown(InputManager.SketchCommands.DuplicateSelection)) + { + // TODO UI + Debug.Log($"{SelectionManager.m_Instance.m_snappingAngle}"); + SelectionManager.m_Instance.IncrementSnappingAngle(); + Debug.Log($"{SelectionManager.m_Instance.m_snappingAngle}"); + } // Toggle selection/deselection if we have a selection, or if we're currently on deselect. bool bShouldRemoveFromSelection = SelectionManager.m_Instance.ShouldRemoveFromSelection(); if (SelectionManager.m_Instance.HasSelection || bShouldRemoveFromSelection) diff --git a/Assets/Scripts/Widgets/GrabWidget.cs b/Assets/Scripts/Widgets/GrabWidget.cs index 86e90929a3..45b16ef7db 100644 --- a/Assets/Scripts/Widgets/GrabWidget.cs +++ b/Assets/Scripts/Widgets/GrabWidget.cs @@ -1306,7 +1306,8 @@ protected virtual Vector3 GetHomeSnapLocation(Quaternion snapOrient) virtual protected TrTransform GetDesiredTransform(TrTransform xf_GS) { TrTransform outXf_GS = xf_GS; - if (m_AllowSnapping && SnapEnabled) + + if (AllowSnapping()) { outXf_GS = GetSnappedTransform(xf_GS); @@ -1352,6 +1353,11 @@ virtual protected TrTransform GetDesiredTransform(TrTransform xf_GS) } return outXf_GS; } + + protected virtual bool AllowSnapping() + { + return m_AllowSnapping && SnapEnabled; + } // Extension point for RecordAndSet*. // Called after it has finished doing all its work. diff --git a/Assets/Scripts/Widgets/SelectionWidget.cs b/Assets/Scripts/Widgets/SelectionWidget.cs index 6e5d3f330d..8476b0d0f6 100644 --- a/Assets/Scripts/Widgets/SelectionWidget.cs +++ b/Assets/Scripts/Widgets/SelectionWidget.cs @@ -14,6 +14,7 @@ using System.Collections.Generic; using UnityEngine; +using UnityEngine.SceneManagement; namespace TiltBrush { @@ -117,6 +118,37 @@ override public float GetSignedWidgetSize() { return transform.localScale.Max(); } + + private Quaternion QuantizeAngle(Quaternion rotation) + { + var snapAngle = SelectionManager.m_Instance.m_snappingAngle; + float round(float val) {return Mathf.Round(val / snapAngle) * snapAngle;} + + Vector3 euler = rotation.eulerAngles; + euler = new Vector3(round(euler.x), round(euler.y), round(euler.z)); + return Quaternion.Euler(euler); + } + + protected override bool AllowSnapping() + { + return true; + } + + protected override TrTransform GetSnappedTransform(TrTransform xf_GS) + { + + TrTransform outXf_GS = xf_GS; + + outXf_GS.rotation = App.Scene.Pose.rotation * QuantizeAngle(xf_GS.rotation); + + Quaternion qDelta = outXf_GS.rotation * Quaternion.Inverse(xf_GS.rotation); + Vector3 grabSpot = InputManager.m_Instance.GetControllerPosition(m_InteractingController); + Vector3 grabToCenter = xf_GS.translation - grabSpot; + outXf_GS.translation = grabSpot + qDelta * grabToCenter; + + return outXf_GS; + + } override protected void SetWidgetSizeInternal(float fSize) { From 2d366dd7afe90d69c9e730875f1217e73adc1f01 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Wed, 12 May 2021 19:14:49 +0100 Subject: [PATCH 016/769] Basic UI panel for angle snap settings --- Assets/Prefabs/Panels/LabsPanel.prefab | 112 +- .../Prefabs/Panels/SnapSettingsPanel.prefab | 748 ++++++++++++++ .../Panels/SnapSettingsPanel.prefab.meta | 7 + .../OptionButton_SnapSettings.prefab | 126 +++ .../OptionButton_SnapSettings.prefab.meta | 7 + Assets/Scenes/Main.unity | 977 ++++++++---------- Assets/Scripts/GUI/MultistateButton.cs | 8 +- Assets/Scripts/GUI/SnapAngleButton.cs | 27 + Assets/Scripts/GUI/SnapAngleButton.cs.meta | 3 + Assets/Scripts/GUI/SnapSettingsPanel.cs | 27 + Assets/Scripts/GUI/SnapSettingsPanel.cs.meta | 3 + Assets/Scripts/SelectionManager.cs | 23 +- Assets/Scripts/SketchControlsScript.cs | 1 + Assets/Scripts/Tools/SelectionTool.cs | 7 - Assets/Scripts/Widgets/SelectionWidget.cs | 5 +- 15 files changed, 1516 insertions(+), 565 deletions(-) create mode 100644 Assets/Prefabs/Panels/SnapSettingsPanel.prefab create mode 100644 Assets/Prefabs/Panels/SnapSettingsPanel.prefab.meta create mode 100644 Assets/Prefabs/UIComponents/OptionButton_SnapSettings.prefab create mode 100644 Assets/Prefabs/UIComponents/OptionButton_SnapSettings.prefab.meta create mode 100644 Assets/Scripts/GUI/SnapAngleButton.cs create mode 100644 Assets/Scripts/GUI/SnapAngleButton.cs.meta create mode 100644 Assets/Scripts/GUI/SnapSettingsPanel.cs create mode 100644 Assets/Scripts/GUI/SnapSettingsPanel.cs.meta diff --git a/Assets/Prefabs/Panels/LabsPanel.prefab b/Assets/Prefabs/Panels/LabsPanel.prefab index 466be6b43a..e614864d69 100644 --- a/Assets/Prefabs/Panels/LabsPanel.prefab +++ b/Assets/Prefabs/Panels/LabsPanel.prefab @@ -55,6 +55,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -66,6 +67,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -189,6 +191,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -200,6 +203,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -285,10 +289,11 @@ Transform: - {fileID: 4626429713668410} - {fileID: 4000011596321798} - {fileID: 4000012572946912} - - {fileID: 434412} + - {fileID: 8834356383330366397} - {fileID: 4000011486688576} - {fileID: 499404} - {fileID: 415298} + - {fileID: 434412} m_Father: {fileID: 485948} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -328,7 +333,7 @@ Transform: - {fileID: 468986} - {fileID: 430698} m_Father: {fileID: 402684} - m_RootOrder: 7 + m_RootOrder: 11 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &11452096 MonoBehaviour: @@ -484,6 +489,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -495,6 +501,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -570,6 +577,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -581,6 +589,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -661,6 +670,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -672,6 +682,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -751,6 +762,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -762,6 +774,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -944,7 +957,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1000010690061500} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: -0.3, z: 0.05} + m_LocalPosition: {x: -0.195, y: -0.3, z: 0.05} m_LocalScale: {x: 0.35, y: 0.35, z: 0.35} m_Children: [] m_Father: {fileID: 402684} @@ -972,6 +985,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -983,6 +997,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1103,6 +1118,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1114,6 +1130,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1234,6 +1251,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1245,6 +1263,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1365,6 +1384,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1376,6 +1396,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1495,6 +1516,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1506,6 +1528,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1587,6 +1610,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1598,6 +1622,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1707,6 +1732,7 @@ MeshRenderer: m_MotionVectors: 0 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1718,6 +1744,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1786,6 +1813,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1797,6 +1825,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1917,6 +1946,7 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1928,6 +1958,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1983,3 +2014,78 @@ MonoBehaviour: m_AddOverlay: 0 m_Tool: 22 m_EatGazeInputOnPress: 1 +--- !u!1001 &3004629833920728976 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 402684} + m_Modifications: + - target: {fileID: 4969199155606796208, guid: 3a98611722d498f4c93e269bfc1ba325, + type: 3} + propertyPath: m_Name + value: OptionButton_SnapSettings + objectReference: {fileID: 0} + - target: {fileID: 5992996673163279405, guid: 3a98611722d498f4c93e269bfc1ba325, + type: 3} + propertyPath: m_RootOrder + value: 7 + objectReference: {fileID: 0} + - target: {fileID: 5992996673163279405, guid: 3a98611722d498f4c93e269bfc1ba325, + type: 3} + propertyPath: m_LocalPosition.x + value: 0.22 + objectReference: {fileID: 0} + - target: {fileID: 5992996673163279405, guid: 3a98611722d498f4c93e269bfc1ba325, + type: 3} + propertyPath: m_LocalPosition.y + value: -0.3 + objectReference: {fileID: 0} + - target: {fileID: 5992996673163279405, guid: 3a98611722d498f4c93e269bfc1ba325, + type: 3} + propertyPath: m_LocalPosition.z + value: 0.05 + objectReference: {fileID: 0} + - target: {fileID: 5992996673163279405, guid: 3a98611722d498f4c93e269bfc1ba325, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5992996673163279405, guid: 3a98611722d498f4c93e269bfc1ba325, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5992996673163279405, guid: 3a98611722d498f4c93e269bfc1ba325, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5992996673163279405, guid: 3a98611722d498f4c93e269bfc1ba325, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 5992996673163279405, guid: 3a98611722d498f4c93e269bfc1ba325, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5992996673163279405, guid: 3a98611722d498f4c93e269bfc1ba325, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5992996673163279405, guid: 3a98611722d498f4c93e269bfc1ba325, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3a98611722d498f4c93e269bfc1ba325, type: 3} +--- !u!4 &8834356383330366397 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 5992996673163279405, guid: 3a98611722d498f4c93e269bfc1ba325, + type: 3} + m_PrefabInstance: {fileID: 3004629833920728976} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/Prefabs/Panels/SnapSettingsPanel.prefab b/Assets/Prefabs/Panels/SnapSettingsPanel.prefab new file mode 100644 index 0000000000..3bf8b5f46d --- /dev/null +++ b/Assets/Prefabs/Panels/SnapSettingsPanel.prefab @@ -0,0 +1,748 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &153348 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 415298} + - component: {fileID: 3364774} + m_Layer: 16 + m_Name: HighlightMesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &415298 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 153348} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.1} + m_LocalScale: {x: 1, y: 1, z: 0.01} + m_Children: [] + m_Father: {fileID: 402684} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3364774 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 153348} + m_Mesh: {fileID: 4300000, guid: 2e84a1bef3eae8d44ae00479eeace4d1, type: 3} +--- !u!1 &160772 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 402684} + m_Layer: 16 + m_Name: Mesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &402684 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 160772} + 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: + - {fileID: 4000010460034712} + - {fileID: 2087480651278533659} + - {fileID: 4000011486688576} + - {fileID: 499404} + - {fileID: 415298} + m_Father: {fileID: 485948} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &164352 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 442914} + - component: {fileID: 6531256} + m_Layer: 16 + m_Name: Collider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &442914 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 164352} + 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: 485948} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &6531256 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 164352} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1.9, y: 2.4, z: 0.5} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &168032 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 499404} + - component: {fileID: 6547610} + m_Layer: 16 + m_Name: MeshCollider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &499404 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 168032} + 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: 402684} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &6547610 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 168032} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1.4, y: 1.9, z: 0.02} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &199434 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 485948} + - component: {fileID: 114019824221785570} + - component: {fileID: 11478692} + - component: {fileID: 114675876165215544} + m_Layer: 16 + m_Name: SnapSettingsPanel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &485948 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 199434} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 10, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4000014070374570} + - {fileID: 442914} + - {fileID: 402684} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &114019824221785570 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 199434} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a7d0b1933e6839443a2050b4306ef453, type: 3} + m_Name: + m_EditorClassIdentifier: + m_PanelType: 8000 + m_Collider: {fileID: 6531256} + m_Mesh: {fileID: 160772} + m_Border: {fileID: 23000010265477920} + m_MeshCollider: {fileID: 6547610} + m_ParticleBounds: {x: 1.2, y: 1.2, z: 0} + m_PanelPopUpMap: [] + m_PanelDescription: Snap Settings + m_PanelDescriptionPrefab: {fileID: 160918, guid: 3491f4f01ba6cac47b1633f36d7c6c84, + type: 3} + m_PanelDescriptionOffset: {x: 1.15, y: 1.3, z: 0} + m_PanelDescriptionColor: {r: 1, g: 1, b: 1, a: 1} + m_PanelFlairPrefab: {fileID: 0} + m_PanelFlairOffset: {x: 0, y: 0, z: 0} + m_DescriptionSpringK: 4 + m_DescriptionSpringDampen: 0.2 + m_DescriptionClosedAngle: -90 + m_DescriptionOpenAngle: 0 + m_DescriptionAlphaDistance: 90 + m_Decor: [] + m_GazeHighlightScaleMultiplier: 1.1 + m_BorderMeshWidth: 0.02 + m_BorderMeshAdvWidth: 0.01 + m_PanelSensitivity: 0.1 + m_ClampToBounds: 1 + m_ReticleBounds: {x: 1.35, y: 1.55, z: 0} + m_BorderSphereHighlightRadius: 2.5 + m_PositioningSpheresBounds: {x: 1, y: 1} + m_PositioningSphereRadius: 0.4 + m_UseGazeRotation: 1 + m_MaxGazeRotation: 20 + m_GazeActivateSpeed: 8 + m_InitialSpawnPos: {x: 0, y: 0, z: 0} + m_InitialSpawnRotEulers: {x: 0, y: 0, z: 0} + m_WandAttachAngle: 0 + m_WandAttachYOffset: 0 + m_WandAttachHalfHeight: 1 + m_BeginFixed: 0 + m_CanBeFixedToWand: 1 + m_CanBeDetachedFromWand: 1 + m_PopUpGazeDuration: 0.2 + m_PromoBorders: + - {fileID: 23000010265477920} +--- !u!114 &11478692 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 199434} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6311d8a25dba6a443be8afe87803c545, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowDuration: 0.25 + m_GrabDistance: 0.5 + m_CollisionRadius: 0.95 + m_AllowTwoHandGrab: 0 + m_DestroyOnHide: 0 + m_AllowHideWithToss: 1 + m_DisableDrift: 0 + m_RecordMovements: 0 + m_AllowSnapping: 0 + m_SnapDisabledDelay: 0.2 + m_AllowPinning: 0 + m_AllowDormancy: 1 + m_TossDuration: 0 + m_TintableMeshes: + - {fileID: 23000010265477920} + m_SpawnPlacementOffset: {x: 3.5, y: 0, z: 1.5} + m_IntroAnimSpinAmount: 360 + m_BoxCollider: {fileID: 6531256} + m_Mesh: {fileID: 485948} + m_HighlightMeshXfs: + - {fileID: 415298} + m_ValidSnapRotationStickyAngle: 0 + m_SnapGhostMaterial: {fileID: 0} + m_Border: {fileID: 4000011486688576} + m_GrabFixedMaxFacingAngle: 70 +--- !u!114 &114675876165215544 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 199434} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 739d5b1996234d64992a2ae60c3723e9, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1000011220362354 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4000010460034712} + - component: {fileID: 33000010384743742} + - component: {fileID: 23000011739358534} + - component: {fileID: 65000012576733834} + - component: {fileID: 114000013288942322} + m_Layer: 16 + m_Name: ChangeSnapAngle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000010460034712 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000011220362354} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.415, y: 0.6, z: 0.05} + m_LocalScale: {x: 0.35, y: 0.35, z: 0.35} + m_Children: [] + m_Father: {fileID: 402684} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &33000010384743742 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000011220362354} + m_Mesh: {fileID: 4300000, guid: 5501f437160666942ae970f3648fbeb8, type: 3} +--- !u!23 &23000011739358534 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000011220362354} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 40d29de2bdc11f04dbfa25059165916e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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!65 &65000012576733834 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000011220362354} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 0.1} + m_Center: {x: -0.000000074505806, y: 0.000000022351742, z: 0} +--- !u!114 &114000013288942322 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000011220362354} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0c8ed0bc532a4315a6e5c6bef653e7e1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_DescriptionType: 0 + m_DescriptionYOffset: 0 + m_DescriptionText: Snap Angle + m_DescriptionTextExtra: + m_DescriptionActivateSpeed: 12 + m_DescriptionZScale: 1 + m_ButtonTexture: {fileID: 0} + m_AtlasTexture: 0 + m_ToggleButton: 0 + m_LongPressReleaseButton: 0 + m_ButtonHasPressedAudio: 1 + m_ZAdjustHover: -0.02 + m_ZAdjustClick: 0.05 + m_HoverScale: 1.1 + m_HoverBoxColliderGrow: 0.2 + m_AddOverlay: 0 + m_ShowRotation: 1 + m_RotationSpeedMultiplier: 14.3 + m_Command: 0 + m_Options: + - m_Description: Off + m_Texture: {fileID: 2800000, guid: bcd7d8c1894256240ab73a089d217cb2, type: 3} + - m_Description: 15 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} + - m_Description: 30 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} + - m_Description: 45 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} + - m_Description: 60 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} + - m_Description: 75 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} + - m_Description: 90 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} +--- !u!1 &1000012292180826 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4000011486688576} + - component: {fileID: 33000013181835044} + - component: {fileID: 23000010265477920} + - component: {fileID: 114122489900507968} + m_Layer: 16 + m_Name: Border + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000011486688576 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000012292180826} + 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: 402684} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &33000013181835044 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000012292180826} + m_Mesh: {fileID: 4300000, guid: 16fad2a698203b44bb45a3844e1ad126, type: 3} +--- !u!23 &23000010265477920 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000012292180826} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 3e92ccbfed650604686991e69902e663, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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!114 &114122489900507968 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000012292180826} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1aaefde5afe80784e908d27fcb05a101, type: 3} + m_Name: + m_EditorClassIdentifier: + m_OffsetOverride: -1 +--- !u!1 &1000013998383226 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4000014070374570} + - component: {fileID: 33000011026480406} + - component: {fileID: 23000011541467852} + m_Layer: 16 + m_Name: _Bounds(inactive) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &4000014070374570 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000013998383226} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.5, y: 1.9, z: 2.4} + m_Children: [] + m_Father: {fileID: 485948} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &33000011026480406 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000013998383226} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &23000011541467852 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000013998383226} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 0 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + 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_ReceiveGI: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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!1 &8356322311116548897 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2087480651278533659} + - component: {fileID: 7582724169365605776} + - component: {fileID: 6714851233862427580} + - component: {fileID: 7027566364966948109} + - component: {fileID: 3555360977595175725} + m_Layer: 16 + m_Name: PanelButton_Drafting + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &2087480651278533659 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8356322311116548897} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.08, y: 0.6, z: 0.05} + m_LocalScale: {x: 0.35, y: 0.35, z: 0.35} + m_Children: [] + m_Father: {fileID: 402684} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7582724169365605776 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8356322311116548897} + m_Mesh: {fileID: 4300000, guid: 5501f437160666942ae970f3648fbeb8, type: 3} +--- !u!23 &6714851233862427580 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8356322311116548897} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 40d29de2bdc11f04dbfa25059165916e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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!65 &7027566364966948109 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8356322311116548897} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 0.1} + m_Center: {x: -0.000000074505806, y: 0.000000022351742, z: 0} +--- !u!114 &3555360977595175725 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8356322311116548897} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 943fba418b3347340bc4b20dfc353b17, type: 3} + m_Name: + m_EditorClassIdentifier: + m_DescriptionType: 0 + m_DescriptionYOffset: 0 + m_DescriptionText: Drafting Lines + m_DescriptionTextExtra: + m_DescriptionActivateSpeed: 12 + m_DescriptionZScale: 1 + m_ButtonTexture: {fileID: 0} + m_AtlasTexture: 0 + m_ToggleButton: 0 + m_LongPressReleaseButton: 0 + m_ButtonHasPressedAudio: 1 + m_ZAdjustHover: -0.02 + m_ZAdjustClick: 0.05 + m_HoverScale: 1.1 + m_HoverBoxColliderGrow: 0.2 + m_AddOverlay: 0 + m_ShowRotation: 0 + m_RotationSpeedMultiplier: 14.3 + m_Command: 28 + m_Options: + - m_Description: Visible + m_Texture: {fileID: 2800000, guid: b3961aaf98d6a2d418267b50a97dc1f3, type: 3} + - m_Description: Transparent + m_Texture: {fileID: 2800000, guid: 30958851ea89a7c46bdb214571b82882, type: 3} + - m_Description: Hidden + m_Texture: {fileID: 2800000, guid: ff3938a5f23ea46409dd9389f1a1cd97, type: 3} diff --git a/Assets/Prefabs/Panels/SnapSettingsPanel.prefab.meta b/Assets/Prefabs/Panels/SnapSettingsPanel.prefab.meta new file mode 100644 index 0000000000..d33e84f244 --- /dev/null +++ b/Assets/Prefabs/Panels/SnapSettingsPanel.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: de22d465caf3f20419b98ce5290a7e57 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/UIComponents/OptionButton_SnapSettings.prefab b/Assets/Prefabs/UIComponents/OptionButton_SnapSettings.prefab new file mode 100644 index 0000000000..808c6f511f --- /dev/null +++ b/Assets/Prefabs/UIComponents/OptionButton_SnapSettings.prefab @@ -0,0 +1,126 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4969199155606796208 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5992996673163279405} + - component: {fileID: 2177386554913372379} + - component: {fileID: 2318400624827387770} + - component: {fileID: 2454767444388280470} + - component: {fileID: 7249833820915077527} + m_Layer: 16 + m_Name: OptionButton_SnapSettings + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5992996673163279405 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4969199155606796208} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.22, y: -0.3, z: 0.05} + m_LocalScale: {x: 0.35, y: 0.35, z: 0.35} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &2177386554913372379 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4969199155606796208} + m_Mesh: {fileID: 4300000, guid: 5501f437160666942ae970f3648fbeb8, type: 3} +--- !u!23 &2318400624827387770 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4969199155606796208} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 40d29de2bdc11f04dbfa25059165916e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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!114 &2454767444388280470 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4969199155606796208} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 03222d9718beeb748bf9e9be379fea39, type: 3} + m_Name: + m_EditorClassIdentifier: + m_DescriptionType: 0 + m_DescriptionYOffset: 0 + m_DescriptionText: Snap Settings + m_DescriptionTextExtra: + m_DescriptionActivateSpeed: 12 + m_DescriptionZScale: 1 + m_ButtonTexture: {fileID: 2800000, guid: 5ee9246293effe049a954f45d5983441, type: 3} + m_AtlasTexture: 1 + m_ToggleButton: 1 + m_LongPressReleaseButton: 0 + m_ButtonHasPressedAudio: 0 + m_ZAdjustHover: -0.02 + m_ZAdjustClick: 0.05 + m_HoverScale: 1.1 + m_HoverBoxColliderGrow: 0.2 + m_AddOverlay: 0 + m_Type: 8000 + m_AlwaysSpawn: 0 +--- !u!65 &7249833820915077527 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4969199155606796208} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 0.1} + m_Center: {x: 0, y: 0, z: 0} diff --git a/Assets/Prefabs/UIComponents/OptionButton_SnapSettings.prefab.meta b/Assets/Prefabs/UIComponents/OptionButton_SnapSettings.prefab.meta new file mode 100644 index 0000000000..f8d14d6ab2 --- /dev/null +++ b/Assets/Prefabs/UIComponents/OptionButton_SnapSettings.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3a98611722d498f4c93e269bfc1ba325 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index c22f1ddc86..789764e5a8 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -667,13 +667,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 3 m_fontSizeBase: 3 m_fontWeight: 400 @@ -681,6 +680,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 257 m_characterSpacing: 0 m_wordSpacing: 0 @@ -691,10 +692,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -702,42 +701,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 0} - characterCount: 12 - spriteCount: 0 - spaceCount: 2 - wordCount: 3 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 12781057} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!222 &12781055 CanvasRenderer: m_ObjectHideFlags: 2 @@ -1258,7 +1238,6 @@ GameObject: m_Component: - component: {fileID: 815137833} - component: {fileID: 53960734} - - component: {fileID: 53960733} - component: {fileID: 53960732} - component: {fileID: 53960731} m_Layer: 18 @@ -1319,13 +1298,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 1.93 m_fontSizeBase: 1.93 m_fontWeight: 400 @@ -1333,7 +1311,9 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_textAlignment: 257 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 m_lineSpacing: 0 @@ -1343,10 +1323,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -1354,51 +1332,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: -1.8046212, w: -0.33301544} - m_textInfo: - textComponent: {fileID: 53960732} - characterCount: 18 - spriteCount: 0 - spaceCount: 4 - wordCount: 4 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 53960734} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 ---- !u!33 &53960733 -MeshFilter: - m_ObjectHideFlags: 2 - m_CorrespondingSourceObject: {fileID: 3316878, guid: f636b2bdcf1c7f5498e324d362ac1ba8, - type: 3} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 53960730} - m_Mesh: {fileID: 0} + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!23 &53960734 MeshRenderer: m_ObjectHideFlags: 0 @@ -2693,13 +2643,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 2 m_fontSizeBase: 2 m_fontWeight: 400 @@ -2707,6 +2656,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 513 m_characterSpacing: 0 m_wordSpacing: 0 @@ -2717,10 +2668,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -2728,42 +2677,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 129869458} - characterCount: 4 - spriteCount: 0 - spaceCount: 1 - wordCount: 2 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 103787546} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1 &130210064 GameObject: m_ObjectHideFlags: 0 @@ -2826,13 +2756,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 3 m_fontSizeBase: 3 m_fontWeight: 400 @@ -2840,6 +2769,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 257 m_characterSpacing: 0 m_wordSpacing: 0 @@ -2850,10 +2781,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -2861,42 +2790,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 0} - characterCount: 8 - spriteCount: 0 - spaceCount: 0 - wordCount: 1 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 130210068} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!222 &130210066 CanvasRenderer: m_ObjectHideFlags: 2 @@ -5400,13 +5310,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 3 m_fontSizeBase: 3 m_fontWeight: 400 @@ -5414,6 +5323,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 257 m_characterSpacing: 0 m_wordSpacing: 0 @@ -5424,10 +5335,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -5435,42 +5344,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 0} - characterCount: 9 - spriteCount: 0 - spaceCount: 1 - wordCount: 1 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 271027829} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!222 &271027827 CanvasRenderer: m_ObjectHideFlags: 2 @@ -7234,13 +7124,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 1.5 m_fontSizeBase: 1.5 m_fontWeight: 400 @@ -7248,6 +7137,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 32 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 1025 m_characterSpacing: 0 m_wordSpacing: 0 @@ -7258,10 +7149,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -7269,42 +7158,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: -0.013912916, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 413759583} - characterCount: 20 - spriteCount: 0 - spaceCount: 2 - wordCount: 3 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 512959152} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1001 &420987293 PrefabInstance: m_ObjectHideFlags: 0 @@ -8245,13 +8115,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 1.5 m_fontSizeBase: 1.5 m_fontWeight: 400 @@ -8259,6 +8128,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 32 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 1026 m_characterSpacing: 0 m_wordSpacing: 0 @@ -8269,10 +8140,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -8280,42 +8149,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: -0.013912916, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 0} - characterCount: 12 - spriteCount: 0 - spaceCount: 0 - wordCount: 1 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 1843353005} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1 &512959151 GameObject: m_ObjectHideFlags: 0 @@ -8623,13 +8473,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 1.5 m_fontSizeBase: 1.5 m_fontWeight: 400 @@ -8637,6 +8486,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 257 m_characterSpacing: 0 m_wordSpacing: 0 @@ -8647,10 +8498,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -8658,42 +8507,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0.3169704, y: 0, z: -0.43391293, w: 0} - m_textInfo: - textComponent: {fileID: 581738634} - characterCount: 0 - spriteCount: 0 - spaceCount: 0 - wordCount: 0 - linkCount: 0 - lineCount: 0 - pageCount: 0 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 1877187485} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1001 &584147934 PrefabInstance: m_ObjectHideFlags: 0 @@ -8996,7 +8826,6 @@ GameObject: m_Component: - component: {fileID: 586145411} - component: {fileID: 1454494319} - - component: {fileID: 613080584} - component: {fileID: 1498237885} - component: {fileID: 613080583} m_Layer: 18 @@ -9014,15 +8843,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 613080582} m_CullTransparentMesh: 0 ---- !u!33 &613080584 -MeshFilter: - m_ObjectHideFlags: 2 - m_CorrespondingSourceObject: {fileID: 3316878, guid: f636b2bdcf1c7f5498e324d362ac1ba8, - type: 3} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 613080582} - m_Mesh: {fileID: 0} --- !u!1 &617891837 GameObject: m_ObjectHideFlags: 0 @@ -11804,13 +11624,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 1.4 m_fontSizeBase: 1.4 m_fontWeight: 400 @@ -11818,6 +11637,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 257 m_characterSpacing: 0 m_wordSpacing: 0 @@ -11828,10 +11649,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -11839,42 +11658,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 0} - characterCount: 15 - spriteCount: 0 - spaceCount: 2 - wordCount: 3 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 825726041} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!222 &825726039 CanvasRenderer: m_ObjectHideFlags: 2 @@ -15920,13 +15720,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 36 m_fontSizeBase: 36 m_fontWeight: 400 @@ -15934,6 +15733,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 1028 m_characterSpacing: 0 m_wordSpacing: 0 @@ -15944,10 +15745,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -15955,40 +15754,18 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 1295357952} - characterCount: 3 - spriteCount: 0 - spaceCount: 0 - wordCount: 2 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!222 &1295357953 @@ -16278,7 +16055,6 @@ GameObject: m_Component: - component: {fileID: 83051504} - component: {fileID: 1311996754} - - component: {fileID: 1311996753} - component: {fileID: 1311996752} - component: {fileID: 1311996751} m_Layer: 18 @@ -16339,13 +16115,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 1.93 m_fontSizeBase: 1.93 m_fontWeight: 400 @@ -16353,7 +16128,9 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_textAlignment: 257 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 m_lineSpacing: 0 @@ -16363,10 +16140,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -16374,51 +16149,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 1311996752} - characterCount: 18 - spriteCount: 0 - spaceCount: 4 - wordCount: 4 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 1311996754} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 ---- !u!33 &1311996753 -MeshFilter: - m_ObjectHideFlags: 2 - m_CorrespondingSourceObject: {fileID: 3316878, guid: f636b2bdcf1c7f5498e324d362ac1ba8, - type: 3} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1311996750} - m_Mesh: {fileID: 0} + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!23 &1311996754 MeshRenderer: m_ObjectHideFlags: 0 @@ -18903,13 +18650,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 5.2 m_fontSizeBase: 5.2 m_fontWeight: 400 @@ -18917,7 +18663,9 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_textAlignment: 257 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 m_lineSpacing: 0 @@ -18927,10 +18675,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -18938,42 +18684,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: -2.382012, w: -0.6436424} - m_textInfo: - textComponent: {fileID: 1498237885} - characterCount: 10 - spriteCount: 0 - spaceCount: 1 - wordCount: 1 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 1454494319} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1 &1498770772 GameObject: m_ObjectHideFlags: 0 @@ -19657,13 +19384,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 1 m_fontSizeBase: 1 m_fontWeight: 400 @@ -19671,6 +19397,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 33 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 1025 m_characterSpacing: 0 m_wordSpacing: 0 @@ -19681,10 +19409,8 @@ MonoBehaviour: m_enableWordWrapping: 0 m_wordWrappingRatios: 0.4 m_overflowMode: 3 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -19692,42 +19418,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: -0.013912916, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 1577979162} - characterCount: 0 - spriteCount: 0 - spaceCount: 0 - wordCount: 0 - linkCount: 0 - lineCount: 0 - pageCount: 0 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 745882611} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1 &1578975888 GameObject: m_ObjectHideFlags: 0 @@ -20620,13 +20327,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 2.5 m_fontSizeBase: 2.5 m_fontWeight: 400 @@ -20634,6 +20340,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 257 m_characterSpacing: 0 m_wordSpacing: 0 @@ -20644,10 +20352,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -20655,42 +20361,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 0} - characterCount: 5 - spriteCount: 0 - spaceCount: 0 - wordCount: 1 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 1277487074} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1 &1637135394 GameObject: m_ObjectHideFlags: 0 @@ -27886,6 +27573,14 @@ MonoBehaviour: m_ModeGvr: 0 m_Basic: 0 m_Advanced: 1 + - m_PanelPrefab: {fileID: 199434, guid: de22d465caf3f20419b98ce5290a7e57, type: 3} + m_ModeVr: 1 + m_ModeVrExperimental: 1 + m_ModeMono: 1 + m_ModeQuest: 0 + m_ModeGvr: 0 + m_Basic: 0 + m_Advanced: 1 m_WandPanelsRotationFeedbackInterval: 20 m_WandPanelsRotationScalar: 200 m_WandPanelsRotationVelocityScalar: 7500 @@ -28273,13 +27968,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 5.2 m_fontSizeBase: 5.2 m_fontWeight: 400 @@ -28287,7 +27981,9 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_textAlignment: 257 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 m_lineSpacing: 0 @@ -28297,10 +27993,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -28308,42 +28002,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 1808834036} - characterCount: 7 - spriteCount: 0 - spaceCount: 1 - wordCount: 1 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 448780583} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1 &1810551365 stripped GameObject: m_CorrespondingSourceObject: {fileID: 100000, guid: d6b0c4fb3312a2b478110813b1ed3d69, @@ -28423,7 +28098,7 @@ MonoBehaviour: m_AllowHideWithToss: 1 m_DisableDrift: 1 m_RecordMovements: 1 - m_AllowSnapping: 0 + m_AllowSnapping: 1 m_SnapDisabledDelay: 0.2 m_AllowPinning: 0 m_AllowDormancy: 0 @@ -29552,7 +29227,6 @@ GameObject: m_Component: - component: {fileID: 1808834035} - component: {fileID: 448780583} - - component: {fileID: 1904300009} - component: {fileID: 1808834036} - component: {fileID: 1904300008} m_Layer: 18 @@ -29570,15 +29244,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1904300007} m_CullTransparentMesh: 0 ---- !u!33 &1904300009 -MeshFilter: - m_ObjectHideFlags: 2 - m_CorrespondingSourceObject: {fileID: 3316878, guid: f636b2bdcf1c7f5498e324d362ac1ba8, - type: 3} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1904300007} - m_Mesh: {fileID: 0} --- !u!1 &1910856519 GameObject: m_ObjectHideFlags: 0 @@ -29947,6 +29612,52 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4444ce35d262aa648ad0c425a559b931, type: 3} m_Name: m_EditorClassIdentifier: + currentOverlayType: 2 + isDynamic: 0 + isProtectedContent: 0 + srcRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + srcRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + invertTextureRects: 0 + overrideTextureRectMatrix: 0 + overridePerLayerColorScaleAndOffset: 0 + colorScale: {x: 1, y: 1, z: 1, w: 1} + colorOffset: {x: 0, y: 0, z: 0, w: 0} + useExpensiveSuperSample: 0 + hidden: 0 + isExternalSurface: 0 + externalSurfaceWidth: 0 + externalSurfaceHeight: 0 + compositionDepth: 0 + noDepthBufferTesting: 0 + layerTextureFormat: 0 + currentOverlayShape: 0 + textures: + - {fileID: 0} + - {fileID: 0} + isAlphaPremultiplied: 0 + _previewInEditor: 0 --- !u!114 &1915877483 MonoBehaviour: m_ObjectHideFlags: 0 @@ -29959,6 +29670,52 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4444ce35d262aa648ad0c425a559b931, type: 3} m_Name: m_EditorClassIdentifier: + currentOverlayType: 2 + isDynamic: 0 + isProtectedContent: 0 + srcRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + srcRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + invertTextureRects: 0 + overrideTextureRectMatrix: 0 + overridePerLayerColorScaleAndOffset: 0 + colorScale: {x: 1, y: 1, z: 1, w: 1} + colorOffset: {x: 0, y: 0, z: 0, w: 0} + useExpensiveSuperSample: 0 + hidden: 0 + isExternalSurface: 0 + externalSurfaceWidth: 0 + externalSurfaceHeight: 0 + compositionDepth: 0 + noDepthBufferTesting: 0 + layerTextureFormat: 0 + currentOverlayShape: 0 + textures: + - {fileID: 0} + - {fileID: 0} + isAlphaPremultiplied: 0 + _previewInEditor: 0 --- !u!114 &1915877484 MonoBehaviour: m_ObjectHideFlags: 0 @@ -29971,6 +29728,52 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4444ce35d262aa648ad0c425a559b931, type: 3} m_Name: m_EditorClassIdentifier: + currentOverlayType: 2 + isDynamic: 0 + isProtectedContent: 0 + srcRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + srcRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + invertTextureRects: 0 + overrideTextureRectMatrix: 0 + overridePerLayerColorScaleAndOffset: 0 + colorScale: {x: 1, y: 1, z: 1, w: 1} + colorOffset: {x: 0, y: 0, z: 0, w: 0} + useExpensiveSuperSample: 0 + hidden: 0 + isExternalSurface: 0 + externalSurfaceWidth: 0 + externalSurfaceHeight: 0 + compositionDepth: 0 + noDepthBufferTesting: 0 + layerTextureFormat: 0 + currentOverlayShape: 0 + textures: + - {fileID: 0} + - {fileID: 0} + isAlphaPremultiplied: 0 + _previewInEditor: 0 --- !u!4 &1915877485 Transform: m_ObjectHideFlags: 0 @@ -29997,6 +29800,52 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4444ce35d262aa648ad0c425a559b931, type: 3} m_Name: m_EditorClassIdentifier: + currentOverlayType: 2 + isDynamic: 0 + isProtectedContent: 0 + srcRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + srcRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + invertTextureRects: 0 + overrideTextureRectMatrix: 0 + overridePerLayerColorScaleAndOffset: 0 + colorScale: {x: 1, y: 1, z: 1, w: 1} + colorOffset: {x: 0, y: 0, z: 0, w: 0} + useExpensiveSuperSample: 0 + hidden: 0 + isExternalSurface: 0 + externalSurfaceWidth: 0 + externalSurfaceHeight: 0 + compositionDepth: 0 + noDepthBufferTesting: 0 + layerTextureFormat: 0 + currentOverlayShape: 0 + textures: + - {fileID: 0} + - {fileID: 0} + isAlphaPremultiplied: 0 + _previewInEditor: 0 --- !u!114 &1915877487 MonoBehaviour: m_ObjectHideFlags: 0 @@ -30009,6 +29858,52 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4444ce35d262aa648ad0c425a559b931, type: 3} m_Name: m_EditorClassIdentifier: + currentOverlayType: 2 + isDynamic: 0 + isProtectedContent: 0 + srcRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + srcRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + invertTextureRects: 0 + overrideTextureRectMatrix: 0 + overridePerLayerColorScaleAndOffset: 0 + colorScale: {x: 1, y: 1, z: 1, w: 1} + colorOffset: {x: 0, y: 0, z: 0, w: 0} + useExpensiveSuperSample: 0 + hidden: 0 + isExternalSurface: 0 + externalSurfaceWidth: 0 + externalSurfaceHeight: 0 + compositionDepth: 0 + noDepthBufferTesting: 0 + layerTextureFormat: 0 + currentOverlayShape: 0 + textures: + - {fileID: 0} + - {fileID: 0} + isAlphaPremultiplied: 0 + _previewInEditor: 0 --- !u!114 &1915877488 MonoBehaviour: m_ObjectHideFlags: 0 @@ -30021,6 +29916,52 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4444ce35d262aa648ad0c425a559b931, type: 3} m_Name: m_EditorClassIdentifier: + currentOverlayType: 2 + isDynamic: 0 + isProtectedContent: 0 + srcRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + srcRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectLeft: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + destRectRight: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + invertTextureRects: 0 + overrideTextureRectMatrix: 0 + overridePerLayerColorScaleAndOffset: 0 + colorScale: {x: 1, y: 1, z: 1, w: 1} + colorOffset: {x: 0, y: 0, z: 0, w: 0} + useExpensiveSuperSample: 0 + hidden: 0 + isExternalSurface: 0 + externalSurfaceWidth: 0 + externalSurfaceHeight: 0 + compositionDepth: 0 + noDepthBufferTesting: 0 + layerTextureFormat: 0 + currentOverlayShape: 0 + textures: + - {fileID: 0} + - {fileID: 0} + isAlphaPremultiplied: 0 + _previewInEditor: 0 --- !u!1001 &1916224247 PrefabInstance: m_ObjectHideFlags: 0 @@ -31198,13 +31139,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 0.75 m_fontSizeBase: 0.75 m_fontWeight: 400 @@ -31212,6 +31152,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 257 m_characterSpacing: 0 m_wordSpacing: 0 @@ -31222,10 +31164,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: 0 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -31233,42 +31173,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0.3169704, y: 0, z: -0.4266512, w: 0} - m_textInfo: - textComponent: {fileID: 2040347685} - characterCount: 0 - spriteCount: 0 - spaceCount: 0 - wordCount: 0 - linkCount: 0 - lineCount: 0 - pageCount: 0 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 261597284} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1001 &2052658242 PrefabInstance: m_ObjectHideFlags: 0 @@ -32160,13 +32081,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: 0 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 1.25 m_fontSizeBase: 1.25 m_fontWeight: 400 @@ -32174,6 +32094,8 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 1 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 m_textAlignment: 1026 m_characterSpacing: 5.45 m_wordSpacing: 0 @@ -32184,10 +32106,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -32195,42 +32115,23 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 0 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 2129205351} - characterCount: 7 - spriteCount: 0 - spaceCount: 0 - wordCount: 3 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 m_renderer: {fileID: 1317145831} - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_maskType: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 --- !u!1001 &2135251106 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/GUI/MultistateButton.cs b/Assets/Scripts/GUI/MultistateButton.cs index 33b2b3362b..10a1c446cd 100644 --- a/Assets/Scripts/GUI/MultistateButton.cs +++ b/Assets/Scripts/GUI/MultistateButton.cs @@ -35,8 +35,8 @@ public struct Option [SerializeField] private SketchControlsScript.GlobalCommands m_Command; [SerializeField] protected Option[] m_Options; - private int m_CurrentOptionIdx; - private GameObject m_OptionContainer; + protected int m_CurrentOptionIdx; + protected GameObject m_OptionContainer; private GameObject[] m_Sides; private Renderer[] m_SideRenderers; private Color? m_MaterialTint; @@ -45,7 +45,7 @@ public struct Option private float m_TargetRotation; // Degrees private bool m_IsRotating; - private int NumOptions + protected int NumOptions { get { @@ -62,7 +62,7 @@ private Option CurrentOption } // Degrees between each option icon. - private float OptionAngleDeltaDegrees + protected virtual float OptionAngleDeltaDegrees { get { diff --git a/Assets/Scripts/GUI/SnapAngleButton.cs b/Assets/Scripts/GUI/SnapAngleButton.cs new file mode 100644 index 0000000000..c111129a04 --- /dev/null +++ b/Assets/Scripts/GUI/SnapAngleButton.cs @@ -0,0 +1,27 @@ +namespace TiltBrush +{ + class SnapAngleButton : MultistateButton + { + + protected override float OptionAngleDeltaDegrees + { + get + { + return 60; // Looks weird if the angle is too shallow + } + } + + protected virtual void OnStart() + { + CreateOptionSides(); + ForceSelectedOption(SelectionManager.m_Instance.CurrentSnapIndex); + } + + override protected void OnButtonPressed() + { + SetSelectedOption((m_CurrentOptionIdx + 1) % NumOptions); + SelectionManager.m_Instance.IncrementSnappingAngle(); + } + + } +} diff --git a/Assets/Scripts/GUI/SnapAngleButton.cs.meta b/Assets/Scripts/GUI/SnapAngleButton.cs.meta new file mode 100644 index 0000000000..2c3de8ccf1 --- /dev/null +++ b/Assets/Scripts/GUI/SnapAngleButton.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0c8ed0bc532a4315a6e5c6bef653e7e1 +timeCreated: 1620837659 \ No newline at end of file diff --git a/Assets/Scripts/GUI/SnapSettingsPanel.cs b/Assets/Scripts/GUI/SnapSettingsPanel.cs new file mode 100644 index 0000000000..f1cbeffb54 --- /dev/null +++ b/Assets/Scripts/GUI/SnapSettingsPanel.cs @@ -0,0 +1,27 @@ +// Copyright 2020 The Tilt Brush Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using UnityEngine; + +namespace TiltBrush +{ + + + + public class SnapSettingsPanel : BasePanel + { + + } +} // namespace TiltBrush diff --git a/Assets/Scripts/GUI/SnapSettingsPanel.cs.meta b/Assets/Scripts/GUI/SnapSettingsPanel.cs.meta new file mode 100644 index 0000000000..c0651f5aba --- /dev/null +++ b/Assets/Scripts/GUI/SnapSettingsPanel.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e1917707763d45dd81f3f1b0d6270f31 +timeCreated: 1620747879 \ No newline at end of file diff --git a/Assets/Scripts/SelectionManager.cs b/Assets/Scripts/SelectionManager.cs index 76eb91e64c..03de755789 100644 --- a/Assets/Scripts/SelectionManager.cs +++ b/Assets/Scripts/SelectionManager.cs @@ -68,9 +68,9 @@ public class SelectionManager : MonoBehaviour private bool m_IsGrabbingGroup; private BaseTool.ToolType m_ToolTypeBeforeGrabbingGroup; - [NonSerialized] public float m_snappingAngle = 45; // TODO access control - private float[] angleSnaps; - private int currentSnap; + private float m_snappingAngle; + private float[] m_AngleSnaps; + private int m_CurrentSnapIndex; // As opposed to 'add to selection'. When this is true, strokes picked up // by the selection tool will be removed from selected strokes. When false, they'll be added @@ -261,6 +261,8 @@ public TrTransform SelectionTransform } public bool IsAnimatingTossFromGrabbingGroup => m_IsAnimatingTossFromGrabbingGroup; + public int CurrentSnapIndex => m_CurrentSnapIndex; + public float SnappingAngle => m_snappingAngle; /// Returns the active strokes in the given group. public IEnumerable StrokesInGroup(SketchGroupTag group) @@ -384,7 +386,7 @@ void Awake() m_Instance = this; m_SelectedStrokes = new HashSet(); m_SelectedWidgets = new HashSet(); - angleSnaps = new[] {0f, 15f, 30f, 45f, 60f, 75f, 90f}; + m_AngleSnaps = new[] {0f, 15f, 30f, 45f, 60f, 75f, 90f}; } public void CacheSelectionTool(SelectionTool tool) @@ -937,12 +939,13 @@ Bounds GetBoundsOfSelectedWidgets_SelectionCanvasSpace() public void IncrementSnappingAngle() { - currentSnap++; - currentSnap %= angleSnaps.Length; - m_snappingAngle = angleSnaps[currentSnap]; - // TODO - // GetComponentInChildren().text = m_snappingAngle.ToString(); - + m_CurrentSnapIndex = CurrentSnapIndex + 1; + m_CurrentSnapIndex = CurrentSnapIndex % m_AngleSnaps.Length; + SetSnappingAngle(CurrentSnapIndex); + } + public void SetSnappingAngle(int snapIndex) + { + m_snappingAngle = m_AngleSnaps[snapIndex]; } } diff --git a/Assets/Scripts/SketchControlsScript.cs b/Assets/Scripts/SketchControlsScript.cs index 0152dc708e..a2640dfffb 100644 --- a/Assets/Scripts/SketchControlsScript.cs +++ b/Assets/Scripts/SketchControlsScript.cs @@ -140,6 +140,7 @@ public enum GlobalCommands LoadWaitOnDownload, SignOutConfirm, ReadOnlyNotice, + ChangeSnapAngle = 8000 } public enum ControlsType diff --git a/Assets/Scripts/Tools/SelectionTool.cs b/Assets/Scripts/Tools/SelectionTool.cs index 62cc1d161e..d266f8cd64 100644 --- a/Assets/Scripts/Tools/SelectionTool.cs +++ b/Assets/Scripts/Tools/SelectionTool.cs @@ -122,13 +122,6 @@ override public void OnUpdateDetection() } else { - if (InputManager.m_Instance.GetCommandDown(InputManager.SketchCommands.DuplicateSelection)) - { - // TODO UI - Debug.Log($"{SelectionManager.m_Instance.m_snappingAngle}"); - SelectionManager.m_Instance.IncrementSnappingAngle(); - Debug.Log($"{SelectionManager.m_Instance.m_snappingAngle}"); - } // Toggle selection/deselection if we have a selection, or if we're currently on deselect. bool bShouldRemoveFromSelection = SelectionManager.m_Instance.ShouldRemoveFromSelection(); if (SelectionManager.m_Instance.HasSelection || bShouldRemoveFromSelection) diff --git a/Assets/Scripts/Widgets/SelectionWidget.cs b/Assets/Scripts/Widgets/SelectionWidget.cs index 8476b0d0f6..ce05af2dd8 100644 --- a/Assets/Scripts/Widgets/SelectionWidget.cs +++ b/Assets/Scripts/Widgets/SelectionWidget.cs @@ -14,7 +14,6 @@ using System.Collections.Generic; using UnityEngine; -using UnityEngine.SceneManagement; namespace TiltBrush { @@ -121,7 +120,7 @@ override public float GetSignedWidgetSize() private Quaternion QuantizeAngle(Quaternion rotation) { - var snapAngle = SelectionManager.m_Instance.m_snappingAngle; + var snapAngle = SelectionManager.m_Instance.SnappingAngle; float round(float val) {return Mathf.Round(val / snapAngle) * snapAngle;} Vector3 euler = rotation.eulerAngles; @@ -131,7 +130,7 @@ private Quaternion QuantizeAngle(Quaternion rotation) protected override bool AllowSnapping() { - return true; + return SelectionManager.m_Instance.CurrentSnapIndex != 0; } protected override TrTransform GetSnappedTransform(TrTransform xf_GS) From 6940d3446a407022a5553aa345b737f91255c9cd Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Wed, 12 May 2021 19:15:21 +0100 Subject: [PATCH 017/769] Remove unused button [CI BUILD] --- .../Prefabs/Panels/SnapSettingsPanel.prefab | 139 +----------------- 1 file changed, 3 insertions(+), 136 deletions(-) diff --git a/Assets/Prefabs/Panels/SnapSettingsPanel.prefab b/Assets/Prefabs/Panels/SnapSettingsPanel.prefab index 3bf8b5f46d..5c2d619282 100644 --- a/Assets/Prefabs/Panels/SnapSettingsPanel.prefab +++ b/Assets/Prefabs/Panels/SnapSettingsPanel.prefab @@ -29,7 +29,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 0.01} m_Children: [] m_Father: {fileID: 402684} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!33 &3364774 MeshFilter: @@ -67,7 +67,6 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 4000010460034712} - - {fileID: 2087480651278533659} - {fileID: 4000011486688576} - {fileID: 499404} - {fileID: 415298} @@ -147,7 +146,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 402684} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!65 &6547610 BoxCollider: @@ -473,7 +472,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 402684} - m_RootOrder: 2 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!33 &33000013181835044 MeshFilter: @@ -614,135 +613,3 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!1 &8356322311116548897 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2087480651278533659} - - component: {fileID: 7582724169365605776} - - component: {fileID: 6714851233862427580} - - component: {fileID: 7027566364966948109} - - component: {fileID: 3555360977595175725} - m_Layer: 16 - m_Name: PanelButton_Drafting - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!4 &2087480651278533659 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8356322311116548897} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.08, y: 0.6, z: 0.05} - m_LocalScale: {x: 0.35, y: 0.35, z: 0.35} - m_Children: [] - m_Father: {fileID: 402684} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &7582724169365605776 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8356322311116548897} - m_Mesh: {fileID: 4300000, guid: 5501f437160666942ae970f3648fbeb8, type: 3} ---- !u!23 &6714851233862427580 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8356322311116548897} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: 40d29de2bdc11f04dbfa25059165916e, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - 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!65 &7027566364966948109 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8356322311116548897} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 0.1} - m_Center: {x: -0.000000074505806, y: 0.000000022351742, z: 0} ---- !u!114 &3555360977595175725 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8356322311116548897} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 943fba418b3347340bc4b20dfc353b17, type: 3} - m_Name: - m_EditorClassIdentifier: - m_DescriptionType: 0 - m_DescriptionYOffset: 0 - m_DescriptionText: Drafting Lines - m_DescriptionTextExtra: - m_DescriptionActivateSpeed: 12 - m_DescriptionZScale: 1 - m_ButtonTexture: {fileID: 0} - m_AtlasTexture: 0 - m_ToggleButton: 0 - m_LongPressReleaseButton: 0 - m_ButtonHasPressedAudio: 1 - m_ZAdjustHover: -0.02 - m_ZAdjustClick: 0.05 - m_HoverScale: 1.1 - m_HoverBoxColliderGrow: 0.2 - m_AddOverlay: 0 - m_ShowRotation: 0 - m_RotationSpeedMultiplier: 14.3 - m_Command: 28 - m_Options: - - m_Description: Visible - m_Texture: {fileID: 2800000, guid: b3961aaf98d6a2d418267b50a97dc1f3, type: 3} - - m_Description: Transparent - m_Texture: {fileID: 2800000, guid: 30958851ea89a7c46bdb214571b82882, type: 3} - - m_Description: Hidden - m_Texture: {fileID: 2800000, guid: ff3938a5f23ea46409dd9389f1a1cd97, type: 3} From e4a6b00391f4889d6982e27b48bf9bea248690b3 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Wed, 12 May 2021 23:15:23 +0100 Subject: [PATCH 018/769] [CI BUILD] [CI BUILD] --- Assets/Scripts/GUI/SnapAngleButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Scripts/GUI/SnapAngleButton.cs b/Assets/Scripts/GUI/SnapAngleButton.cs index c111129a04..fbc7050128 100644 --- a/Assets/Scripts/GUI/SnapAngleButton.cs +++ b/Assets/Scripts/GUI/SnapAngleButton.cs @@ -7,7 +7,7 @@ protected override float OptionAngleDeltaDegrees { get { - return 60; // Looks weird if the angle is too shallow + return 60; // Looks weird if the angle is too shallow so fake it } } From ca2e60b308f8fc56125579af362bcb1487974f28 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Thu, 13 May 2021 09:45:43 +0100 Subject: [PATCH 019/769] [CI BUILD] [CI BUILD] --- Assets/Scripts/GUI/SnapSettingsPanel.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Assets/Scripts/GUI/SnapSettingsPanel.cs b/Assets/Scripts/GUI/SnapSettingsPanel.cs index f1cbeffb54..7df1cfdd0d 100644 --- a/Assets/Scripts/GUI/SnapSettingsPanel.cs +++ b/Assets/Scripts/GUI/SnapSettingsPanel.cs @@ -17,8 +17,6 @@ namespace TiltBrush { - - public class SnapSettingsPanel : BasePanel { From f662233c63d5c3f223cf7f9a4162f2a584f81ede Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Thu, 13 May 2021 09:56:43 +0100 Subject: [PATCH 020/769] Missed this in a merge [CI BUILD] --- .github/workflows/build.yml | 91 +++++++++++++++++++++++++++---------- 1 file changed, 66 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85078d6673..ac5bd4dcb1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,17 +6,17 @@ on: # yamllint disable-line rule:truthy pull_request: {} push: branches: - - "*" + - "**" tags: - "v*" env: - UNITY_VERSION: "2019.4.24f1" + UNITY_VERSION: "2019.4.25f1" UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} # If UNITY_SERIAL is not set, then use a hardcoded license. Otherwise, don't set this, so the game-ci actions will use EMAIL/PASS/SERIAL - UNITY_LICENSE: ${{ fromJSON('["\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \nGYC1YpQHTB2q5CllgJhlpihJuAk=WE8iCxEU2CEWYaVo4EiFJzCmftuq994dQk7wPenZcQ0VZhJ7eXYLkxbJSXGCPbYv+Bphz0T0mhEy\nq2fV05Yfp1xiKryawbiA7kk7wIY6qTo35Oex+jEg5DX1V2Rf3uUeXfareHagnHTt43+slTCN1gNd\nbPHZhHetWWYBECMCkt95ISJg8R2eIxT2MeeHoey2Xr4+Y0MEJE57cmj2hYcd1rg5S6sbnovBlav4\nS5GdvS8ZufejTvuYrvhLMA+BBnJ2g1elqMaYJZu5nV1J2cTI/Xaipvp265CM5lykzRVrQAHxz5zt\n9M6hFRxnhRGamyTPOtxcCwG9Cl4xYKS1TyhEww==", null]')[secrets.UNITY_SERIAL != null] }} + UNITY_LICENSE: ${{ fromJSON('["\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \nxCBKYap0JQVBqX22jba4k5Da5t0=n8eYH6Exi6mpw6onE5blxgQY1bAb+NLrsblMlFLUTPVTGw5KmugyVHedyZiI47D3nZVK/FpGaVxJ\n2xcNBr8yR1lfQrakloAZhvlCTiNi/O8N+6aHGZgyi/5+2SLqj0E/ZB+bVlTaSioLy/cF6iOt0d0T\nvW+VEdhht9iWrKKeNBakcXGccX5tQhJFaTR8aYevp0t0TMz3cfGPhs5qDivufqoFl34Y6qa8HjAC\n+OvrlD0TIgMyev+czK0KMIRsT/euOoyOHupXb93BuiMWceRIqf4mYvPKJbhx15Zy3uxHbsF6lV8q\nGah5JCb8iGRTDmG2JzMg6pXCjiznPFNk4Tkl7Q==", null]')[secrets.UNITY_SERIAL != null] }} jobs: configuration: @@ -37,8 +37,8 @@ jobs: stamp: ${{ steps.version.outputs.stamp }} prerelease: ${{ steps.version.outputs.prerelease }} changelog: ${{ steps.changelog.outputs.changelog }} - btbgithub: ${{ steps.github.outputs.btbgithub }} basename: ${{ steps.github.outputs.basename }} + description: ${{ steps.github.outputs.description}} steps: - name: Checkout repository uses: actions/checkout@v2 @@ -59,7 +59,7 @@ jobs: echo "Formal version: $MAJOR_MINOR.$PATCH_VERSION" echo "::set-output name=prerelease::false" else - echo "Prerelease version $MAJOR_MINOR.PATCH_VERSION $STAMP" + echo "Prerelease version $MAJOR_MINOR.$PATCH_VERSION $STAMP" echo "::set-output name=prerelease::true" fi VERSION=$(echo "$MAJOR_MINOR.$PATCH_VERSION" | sed -e 's/^v//') @@ -67,30 +67,45 @@ jobs: echo "::set-output name=stamp::$STAMP" - name: Calculate Changelog id: changelog + env: + PRERELEASE: ${{ steps.version.outputs.prerelease }} run: | - if [ $(git describe --tags --abbrev=0) == $(git describe --tags) ] + if [ "$PRERELEASE" == "true" ] then PREV=$(git describe --tags --abbrev=0 HEAD^) else - PREV=$(git describe --tags --abbrev=0) + PREV=$(git describe --tags --match "v[0-9]*.[0-9]*" --abbrev=0 HEAD^) fi CHANGELOG=$(git log --pretty=oneline $PREV..HEAD) CHANGELOG="${CHANGELOG//'%'/'%25'}" CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" echo "::set-output name=changelog::$CHANGELOG" - - name: Set github suffix if relevant + - name: Set custom app name and package name, if relevant id: github + env: + PRERELEASE: ${{ steps.version.outputs.prerelease }} run: | - MAJOR_MINOR=$(git describe --tags --abbrev=0 --match "v[0-9]*.[0-9]*" ${{ github.event.pull_request.head.sha }}) - PATCH_VERSION=$(git describe --tags --match "v[0-9]*.[0-9]*" ${{ github.event.pull_request.head.sha }} | cut -d'-' -f2) - if [ $PATCH_VERSION == $MAJOR_MINOR ] + # For a PR action (i.e., syncronize / open), the value of github.ref will be refs/pull/1234/merge + # For a push action, it will be either refs/heads/foo_branch_name OR refs/tags/v1234. + # We want to use the base name for pushes of tags or to main, the PR number for PRs, and the branch name for named branches. + if [[ "$PRERELEASE" == "false" || ${{ github.ref }} == refs/heads/main ]] then - echo "::set-output name=btbgithub::" echo "::set-output name=basename::OpenBrush" + echo "::set-output name=description::" else - echo "::set-output name=btbgithub::-btb-github" - echo "::set-output name=basename::OpenBrush-github" + if [[ ${{ github.ref }} == refs/pull/* ]] + then + DESCRIPTION="PR#$(echo ${{ github.ref }} | sed -e 's#refs/pull/##' -e 's#/merge##')" + elif [[ ${{ github.ref }} == refs/heads/* ]] + then + DESCRIPTION="$(echo ${{ github.ref }} | sed -e 's#refs/heads/##')" + else + DESCRIPTION="Unknown" + fi + echo "::set-output name=description::-btb-description ${DESCRIPTION}" + IDENTIFIER=$(echo ${DESCRIPTION} | sed -e 's/[#_-]//g') + echo "::set-output name=basename::OpenBrush-${IDENTIFIER}" fi build: name: ${{ matrix.name }} @@ -104,14 +119,21 @@ jobs: - name: Windows SteamVR targetPlatform: StandaloneWindows64 vrsdk: SteamVR + - name: Windows Rift + targetPlatform: StandaloneWindows64 + vrsdk: Oculus - name: Windows SteamVR Experimental targetPlatform: StandaloneWindows64 vrsdk: SteamVR extraoptions: -btb-experimental - - name: Windows Monoscopic + - name: Windows Rift Experimental + targetPlatform: StandaloneWindows64 + vrsdk: Oculus + extraoptions: -btb-experimental + - name: Windows Monoscopic Experimental targetPlatform: StandaloneWindows64 vrsdk: Monoscopic - extraoptions: + extraoptions: -btb-experimental - name: Linux SteamVR targetPlatform: StandaloneLinux64 vrsdk: SteamVR @@ -119,13 +141,14 @@ jobs: targetPlatform: StandaloneLinux64 vrsdk: SteamVR extraoptions: -btb-experimental - - name: Linux Monoscopic + - name: Linux Monoscopic Experimental targetPlatform: StandaloneLinux64 vrsdk: Monoscopic - extraoptions: - - name: OSX Monoscopic + extraoptions: -btb-experimental + - name: OSX Monoscopic Experimental targetPlatform: StandaloneOSX # SteamVR was removed in Mar 2020 vrsdk: Monoscopic + extraoptions: -btb-experimental - name: Oculus Quest targetPlatform: Android vrsdk: Oculus @@ -145,9 +168,9 @@ jobs: - name: Install Oculus unity package if: matrix.vrsdk == 'Oculus' run: | - # version 23.1 + # version 27.0 # Code courtesy of Jonathan Perret, released freely. Download the package and manually extract it to Assets/Oculus. We only need VR and Platform. - wget -q https://securecdn.oculus.com/binaries/download/?id=3884880558189851 -O package.tmp + wget -q https://securecdn.oculus.com/binaries/download/?id=4231499270194643 -O package.tmp mkdir tmp tar -C tmp -xzf package.tmp find tmp -type f | xargs chmod a-x @@ -232,7 +255,7 @@ jobs: env: BASENAME: ${{ needs.configuration.outputs.basename}} run: - echo "filename=com.Icosa.$(echo $BASENAME | sed -e 's/-//g').apk" >> $GITHUB_ENV + echo "filename=com.Icosa.$BASENAME.apk" >> $GITHUB_ENV - name: Set build stamp if: ${{ needs.configuration.outputs.stamp }} @@ -283,7 +306,7 @@ jobs: allowDirtyBuild: true # Because of the OVR Update, the build tree might be dirty unityVersion: ${{ env.UNITY_VERSION }} targetPlatform: ${{ matrix.targetPlatform }} - customParameters: -btb-target ${{ matrix.targetPlatform }} -btb-display ${{ matrix.vrsdk }} -btb-out /github/workspace/build/${{ matrix.targetPlatform }}-${{ matrix.vrsdk }}/${{ env.filename }} ${{ needs.configuration.outputs.btbgithub }} ${{ env.stamp }} ${{ matrix.extraoptions }} + customParameters: -btb-target ${{ matrix.targetPlatform }} -btb-display ${{ matrix.vrsdk }} -btb-out /github/workspace/build/${{ matrix.targetPlatform }}-${{ matrix.vrsdk }}/${{ env.filename }} ${{ needs.configuration.outputs.description}} ${{ env.stamp }} ${{ matrix.extraoptions }} versioning: Custom version: ${{ needs.configuration.outputs.version }} buildMethod: BuildTiltBrush.CommandLine @@ -336,6 +359,18 @@ jobs: name: Windows SteamVR Experimental path: build_windows_steamvr_experimental + - name: Download Build Artifacts (Windows Rift) + uses: actions/download-artifact@v2 + with: + name: Windows Rift + path: build_windows_rift + + - name: Download Build Artifacts (Windows Rift Experimental) + uses: actions/download-artifact@v2 + with: + name: Windows Rift Experimental + path: build_windows_rift_experimental + - name: Download Build Artifacts (Linux SteamVR) uses: actions/download-artifact@v2 with: @@ -369,17 +404,23 @@ jobs: mv build_oculus_quest_experimental/*/com.Icosa.OpenBrush*apk releases/OpenBrush_Quest_Experimental_$VERSION.apk mv build_windows_steamvr/StandaloneWindows64-SteamVR/ releases/OpenBrush_Desktop_$VERSION/ mv build_windows_steamvr_experimental/StandaloneWindows64-SteamVR/ releases/OpenBrush_Desktop_Experimental_$VERSION/ + mv build_windows_rift/StandaloneWindows64-Oculus/ releases/OpenBrush_Rift_$VERSION/ + mv build_windows_rift_experimental/StandaloneWindows64-Oculus/ releases/OpenBrush_Rift_Experimental_$VERSION/ mv build_linux_steamvr/StandaloneLinux64-SteamVR/ releases/OpenBrush_Linux_$VERSION/ mv build_linux_steamvr_experimental/StandaloneLinux64-SteamVR/ releases/OpenBrush_Linux_Experimental_$VERSION/ cd releases zip -r OpenBrush_Desktop_$VERSION.zip OpenBrush_Desktop_$VERSION/ zip -r OpenBrush_Desktop_Experimental_$VERSION.zip OpenBrush_Desktop_Experimental_$VERSION/ - chmod a+x OpenBrush_Linux_$VERSION/OpenBrush || chmod a+x OpenBrush_Linux_$VERSION/OpenBrush-github + zip -r OpenBrush_Rift_$VERSION.zip OpenBrush_Rift_$VERSION/ + zip -r OpenBrush_Rift_Experimental_$VERSION.zip OpenBrush_Rift_Experimental_$VERSION/ + chmod a+x OpenBrush_Linux_$VERSION/OpenBrush* tar cvfz OpenBrush_Linux_$VERSION.tgz OpenBrush_Linux_$VERSION/ - chmod a+x OpenBrush_Linux_Experimental_$VERSION/OpenBrush || chmod a+x OpenBrush_Linux_Experimental_$VERSION/OpenBrush-github + chmod a+x OpenBrush_Linux_Experimental_$VERSION/OpenBrush* tar cvfz OpenBrush_Linux_Experimental_$VERSION.tgz OpenBrush_Linux_Experimental_$VERSION/ rm -rf OpenBrush_Desktop_$VERSION rm -rf OpenBrush_Desktop_Experimental_$VERSION + rm -rf OpenBrush_Rift_$VERSION + rm -rf OpenBrush_Rift_Experimental_$VERSION rm -rf OpenBrush_Linux_$VERSION rm -rf OpenBrush_Linux_Experimental_$VERSION - name: Publish From a096cd387e16eb8c455f0abcca4395922a21cc18 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Thu, 13 May 2021 12:53:38 +0100 Subject: [PATCH 021/769] Fix 403s and add a crude first pass at converting existing GlobalCommands to endpoints where appropriate. [CI BUILD] --- Assets/Prefabs/HttpServer.prefab | 13 - Assets/Scenes/Main.unity | 3 +- Assets/Scripts/API/ApiEndpointAttribute.cs | 40 +- Assets/Scripts/API/ApiManager.cs | 17 +- Assets/Scripts/API/GlobalCommandsApi.cs | 476 +++++++++++++++++++ Assets/Scripts/API/GlobalCommandsApi.cs.meta | 3 + Assets/Scripts/Sharing/HttpServer.cs | 4 +- 7 files changed, 526 insertions(+), 30 deletions(-) create mode 100644 Assets/Scripts/API/GlobalCommandsApi.cs create mode 100644 Assets/Scripts/API/GlobalCommandsApi.cs.meta diff --git a/Assets/Prefabs/HttpServer.prefab b/Assets/Prefabs/HttpServer.prefab index 53af8361c5..c51314b1f2 100644 --- a/Assets/Prefabs/HttpServer.prefab +++ b/Assets/Prefabs/HttpServer.prefab @@ -153,7 +153,6 @@ GameObject: - component: {fileID: 4492044767078796625} - component: {fileID: 4492044767078796462} - component: {fileID: 4003205861538169308} - - component: {fileID: 5713667951292597152} m_Layer: 0 m_Name: HttpServer m_TagString: Untagged @@ -202,18 +201,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 3129917865c64490b8b93df59ca75fb6, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!114 &5713667951292597152 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4492044767078796463} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 3915bbb84fd81584aa2afe132e221ad9, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!1001 &8659939412555803041 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 52b10851ab..324e344667 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -32412,7 +32412,8 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - m_RemovedComponents: [] + m_RemovedComponents: + - {fileID: 5713667951292597152, guid: 382dabebd59956d499aefb54b02f804d, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 382dabebd59956d499aefb54b02f804d, type: 3} --- !u!4 &5080288855832605660 Transform: diff --git a/Assets/Scripts/API/ApiEndpointAttribute.cs b/Assets/Scripts/API/ApiEndpointAttribute.cs index 2331600c76..4fb2bf9589 100644 --- a/Assets/Scripts/API/ApiEndpointAttribute.cs +++ b/Assets/Scripts/API/ApiEndpointAttribute.cs @@ -1,5 +1,6 @@ using System; using System.ComponentModel; +using System.Linq; using System.Reflection; using UnityEngine; @@ -31,32 +32,47 @@ public object[] DecodeParams(string commandValue) { var parameters = new object[parameterInfo.Length]; - // TODO multiple parameters. - // Do we need them? - // for (var i = 0; i < parameterInfo.Length; i++) - // { - int i = 0; + string[] tokens = commandValue.Split(','); + int tokenIndex = 0; + for (var i = 0; i < parameterInfo.Length; i++) + { ParameterInfo paramType = parameterInfo[i]; - object paramValue; + object paramValue = null; if (paramType.ParameterType == typeof(string)) { - paramValue = commandValue; + if (parameterInfo.Length == 1 && i == 0) + { + // Special case methods with one string param + // This allows string params to include commas if they are the only parameter + paramValue = commandValue; + } + else + { + paramValue = tokens[tokenIndex++]; + } } else if (paramType.ParameterType == typeof(float)) { - paramValue = float.Parse(commandValue); + paramValue = float.Parse(tokens[tokenIndex++]); + } + else if (paramType.ParameterType == typeof(int)) + { + paramValue = int.Parse(tokens[tokenIndex++]); } else if (paramType.ParameterType == typeof(Vector3)) { - string[] temp = commandValue.Split(','); - paramValue = new Vector3(float.Parse(temp[0]), float.Parse(temp[1]), float.Parse(temp[2])); + paramValue = new Vector3( + float.Parse(tokens[tokenIndex++]), + float.Parse(tokens[tokenIndex++]), + float.Parse(tokens[tokenIndex++]) + ); } else { - paramValue = TypeDescriptor.GetConverter(paramType).ConvertFromString(commandValue); + paramValue = TypeDescriptor.GetConverter(paramType).ConvertFromString(tokens[tokenIndex++]); } parameters[i] = paramValue; - // } + } return parameters; } } diff --git a/Assets/Scripts/API/ApiManager.cs b/Assets/Scripts/API/ApiManager.cs index 437509ba03..22984bd01b 100644 --- a/Assets/Scripts/API/ApiManager.cs +++ b/Assets/Scripts/API/ApiManager.cs @@ -63,6 +63,7 @@ private void Populate() Debug.LogWarning($"No instance found for ApiEndpoint on: {type}"); } } + if (valid) { apiEndpoint.type = type; @@ -81,6 +82,7 @@ private void Populate() } public bool InvokeEndpoint(KeyValuePair command) { + Debug.Log($"Invoking: {command}"); if (endpoints.ContainsKey(command.Key)) { var endpoint = endpoints[command.Key]; @@ -99,12 +101,20 @@ string ApiCommandCallback(HttpListenerRequest request) { KeyValuePair command; + Debug.Log($"Received {request.Url.Query}"); // Handle GET foreach (string pair in request.Url.Query.TrimStart('?').Split('&')) { - var kv = pair.Split(new[]{'='}, 2); - command = new KeyValuePair(kv[0], kv[1]); + string[] kv = pair.Split(new[]{'='}, 2); + if (kv.Length == 1) + { + command = new KeyValuePair(kv[0], ""); + } + else + { + command = new KeyValuePair(kv[0], kv[1]); + } m_RequestedCommandQueue.Enqueue(command); } @@ -123,6 +133,7 @@ string ApiCommandCallback(HttpListenerRequest request) var kv = pair.Split(new[]{'='}, 2); command = new KeyValuePair(kv[0], kv[1]); m_RequestedCommandQueue.Enqueue(command); + Debug.Log($"Queued {command}"); } } } @@ -137,10 +148,12 @@ private bool HandleApiCommand() try { command = (KeyValuePair)m_RequestedCommandQueue.Dequeue(); + Debug.Log($"Dequeued {command}"); } catch (InvalidOperationException) { return false; + Debug.Log($"Dequeue failed"); } return Instance.InvokeEndpoint(command); diff --git a/Assets/Scripts/API/GlobalCommandsApi.cs b/Assets/Scripts/API/GlobalCommandsApi.cs new file mode 100644 index 0000000000..ee2ae0eb6a --- /dev/null +++ b/Assets/Scripts/API/GlobalCommandsApi.cs @@ -0,0 +1,476 @@ +using UnityEngine; + +namespace TiltBrush +{ + public static class GlobalCommandsApi + { + [ApiEndpoint("save")] + public static void Save(int saveIndex) + { + var rEnum = SketchControlsScript.GlobalCommands.Save; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, saveIndex); + } + + [ApiEndpoint("save.new")] + public static void SaveNew(bool generateBoundingBoxSaveIcon) + { + var rEnum = SketchControlsScript.GlobalCommands.SaveNew; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, generateBoundingBoxSaveIcon?1:-1); + } + + // TODO + // [ApiEndpoint("upload")] + // public static void SaveAndUpload() + // { + // var rEnum = SketchControlsScript.GlobalCommands.SaveAndUpload; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + // } + + [ApiEndpoint("export.all")] + public static void ExportAll() + { + var rEnum = SketchControlsScript.GlobalCommands.ExportAll; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("drafting.visible")] + public static void DraftingVisible() + { + var rEnum = SketchControlsScript.GlobalCommands.DraftingVisibility; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, 0); + } + [ApiEndpoint("drafting.transparent")] + public static void DraftingTransparent() + { + var rEnum = SketchControlsScript.GlobalCommands.DraftingVisibility; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, 1); + } + [ApiEndpoint("drafting.hidden")] + public static void DraftingHidden() + { + var rEnum = SketchControlsScript.GlobalCommands.DraftingVisibility; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, 2); + } + + [ApiEndpoint("load.user")] + public static void LoadUser(int iParam1) + { + var rEnum = SketchControlsScript.GlobalCommands.Load; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, 0); + } + + [ApiEndpoint("load.curated")] + public static void LoadCurated(int iParam1) + { + var rEnum = SketchControlsScript.GlobalCommands.Load; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, 1); + } + + [ApiEndpoint("load.liked")] + public static void LoadLiked(int iParam1) + { + var rEnum = SketchControlsScript.GlobalCommands.Load; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, 2); + } + + [ApiEndpoint("load.liked")] + public static void LoadDrive(int iParam1) + { + var rEnum = SketchControlsScript.GlobalCommands.Load; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, 3); + } + + [ApiEndpoint("load.named")] + public static void LoadNamedFile(string sParam) + { + var rEnum = SketchControlsScript.GlobalCommands.LoadNamedFile; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, -1, -1, sParam); + } + + [ApiEndpoint("new")] + public static void NewSketch() + { + var rEnum = SketchControlsScript.GlobalCommands.NewSketch; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("symmetry.mirror")] + public static void SymmetryPlane() + { + var rEnum = SketchControlsScript.GlobalCommands.SymmetryPlane; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("symmetry.doublemirror")] + public static void SymmetryFour() + { + var rEnum = SketchControlsScript.GlobalCommands.SymmetryFour; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + // TODO on and off explicitly + [ApiEndpoint("straightedge.toggle")] + public static void StraightEdge() + { + var rEnum = SketchControlsScript.GlobalCommands.StraightEdge; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + // TODO on and off explicitly + [ApiEndpoint("autoorient.toggle")] + public static void AutoOrient() + { + var rEnum = SketchControlsScript.GlobalCommands.AutoOrient; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("undo")] + public static void Undo() + { + var rEnum = SketchControlsScript.GlobalCommands.Undo; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("redo")] + public static void Redo() + { + var rEnum = SketchControlsScript.GlobalCommands.Redo; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("panels.reset")] + public static void ResetAllPanels() + { + var rEnum = SketchControlsScript.GlobalCommands.ResetAllPanels; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + // TODO Test this + [ApiEndpoint("sketch.origin")] + public static void SketchOrigin() + { + var rEnum = SketchControlsScript.GlobalCommands.SketchOrigin; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("viewonly")] + public static void ViewOnly() + { + var rEnum = SketchControlsScript.GlobalCommands.ViewOnly; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + // TODO Is this any use? + // [ApiEndpoint("save.gallery")] + // public static void SaveGallery() + // { + // var rEnum = SketchControlsScript.GlobalCommands.SaveGallery; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + // } + + [ApiEndpoint("dropcam")] + public static void DropCam() + { + var rEnum = SketchControlsScript.GlobalCommands.DropCam; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("autosimplify.toggle")] + public static void ToggleAutosimplification() + { + var rEnum = SketchControlsScript.GlobalCommands.ToggleAutosimplification; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("export")] + public static void ExportRaw() + { + var rEnum = SketchControlsScript.GlobalCommands.ExportRaw; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + // TODO Do we need API commands to open panels? + // [ApiEndpoint("camera.options")] + // public static void CameraOptions() + // { + // var rEnum = SketchControlsScript.GlobalCommands.CameraOptions; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + // } + + [ApiEndpoint("sketch.openfolder")] + public static void ShowSketchFolder(int iParam1) + { + var rEnum = SketchControlsScript.GlobalCommands.ShowSketchFolder; + // TODO 0 is User folder. Do we need to support the other SketchSetTypes? + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, 0); + } + + // TODO Why no "enabled" counterpart? + [ApiEndpoint("stencils.disabled")] + public static void StencilsDisabled() + { + var rEnum = SketchControlsScript.GlobalCommands.StencilsDisabled; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + // [ApiEndpoint("straightedge.meter")] + // public static void StraightEdgeMeterDisplay() + // { + // var rEnum = SketchControlsScript.GlobalCommands.StraightEdgeMeterDisplay; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + // } + + // [ApiEndpoint("sketchbook")] + // public static void Sketchbook() + // { + // var rEnum = SketchControlsScript.GlobalCommands.Sketchbook; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + // } + + // Does this even work? + [ApiEndpoint("straightedge.shape")] + public static void StraightEdgeShape(int iParam1) + { + var rEnum = SketchControlsScript.GlobalCommands.StraightEdgeShape; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1); + } + + // TODO Dangerous! + // [ApiEndpoint("sketch.delete")] + // public static void DeleteSketch(int iParam1, int iParam2) + // { + // var rEnum = SketchControlsScript.GlobalCommands.DeleteSketch; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, iParam2); + // } + + [ApiEndpoint("disco")] + public static void Disco() + { + var rEnum = SketchControlsScript.GlobalCommands.Disco; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + // [ApiEndpoint("view.online.gallery")] + // public static void ViewOnlineGallery() + // { + // var rEnum = SketchControlsScript.GlobalCommands.ViewOnlineGallery; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + // } + + // [ApiEndpoint("cancel.upload")] + // public static void CancelUpload() + // { + // var rEnum = SketchControlsScript.GlobalCommands.CancelUpload; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + // } + + // [ApiEndpoint("view.last.upload")] + // public static void ViewLastUpload() + // { + // var rEnum = SketchControlsScript.GlobalCommands.ViewLastUpload; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + // } + + // [ApiEndpoint("show.google.drive")] + // public static void ShowGoogleDrive() + // { + // var rEnum = SketchControlsScript.GlobalCommands.ShowGoogleDrive; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + // } + + [ApiEndpoint("googledrivesync.toggle")] + public static void GoogleDriveSync() + { + var rEnum = SketchControlsScript.GlobalCommands.GoogleDriveSync; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + // TODO Test this + // [ApiEndpoint("google.drive.sync.folder")] + // public static void GoogleDriveSync_Folder(int iParam1) + // { + // var rEnum = SketchControlsScript.GlobalCommands.GoogleDriveSync_Folder; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1); + // } + + [ApiEndpoint("selection.duplicate")] + public static void Duplicate() + { + var rEnum = SketchControlsScript.GlobalCommands.Duplicate; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + // TODO explicit group/ungroup + [ApiEndpoint("selection.group")] + public static void ToggleGroupStrokesAndWidgets() + { + var rEnum = SketchControlsScript.GlobalCommands.ToggleGroupStrokesAndWidgets; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + // TODO Test this and maybe choose a better command name + [ApiEndpoint("export.selected")] + public static void SaveModel() + { + var rEnum = SketchControlsScript.GlobalCommands.SaveModel; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + // TODO Set the list in App.Config.m_FilePatternsToExport + // [ApiEndpoint("export.listed")] + // public static void ExportListed() + // { + // var rEnum = SketchControlsScript.GlobalCommands.ExportListed; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + // } + + [ApiEndpoint("camerapath.render")] + public static void RenderCameraPath() + { + var rEnum = SketchControlsScript.GlobalCommands.RenderCameraPath; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("profiling.toggle")] + public static void ToggleProfiling() + { + var rEnum = SketchControlsScript.GlobalCommands.ToggleProfiling; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("autoprofile")] + public static void DoAutoProfile() + { + var rEnum = SketchControlsScript.GlobalCommands.DoAutoProfile; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("settings.toggle")] + public static void ToggleSettings() + { + var rEnum = SketchControlsScript.GlobalCommands.ToggleSettings; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("mirror.summon")] + public static void SummonMirror() + { + var rEnum = SketchControlsScript.GlobalCommands.SummonMirror; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("selection.invert")] + public static void InvertSelection() + { + var rEnum = SketchControlsScript.GlobalCommands.InvertSelection; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("select.all")] + public static void SelectAll() + { + var rEnum = SketchControlsScript.GlobalCommands.SelectAll; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("selection.flip")] + public static void FlipSelection() + { + var rEnum = SketchControlsScript.GlobalCommands.FlipSelection; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("brushlab.toggle")] + public static void ToggleBrushLab() + { + var rEnum = SketchControlsScript.GlobalCommands.ToggleBrushLab; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("postprocessing.toggle")] + public static void ToggleCameraPostEffects() + { + var rEnum = SketchControlsScript.GlobalCommands.ToggleCameraPostEffects; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("watermark.toggle")] + public static void ToggleWatermark() + { + var rEnum = SketchControlsScript.GlobalCommands.ToggleWatermark; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("load.confirm.complex.high")] + public static void LoadConfirmComplexHigh(int iParam1, int iParam2) + { + var rEnum = SketchControlsScript.GlobalCommands.LoadConfirmComplexHigh; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, iParam2); + } + + [ApiEndpoint("load.confirm.complex")] + public static void LoadConfirmComplex(int iParam1, int iParam2) + { + var rEnum = SketchControlsScript.GlobalCommands.LoadConfirmComplex; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, iParam2); + } + + [ApiEndpoint("load.confirm.unsaved")] + public static void LoadConfirmUnsaved(int iParam1, int iParam2) + { + var rEnum = SketchControlsScript.GlobalCommands.LoadConfirmUnsaved; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, iParam2); + } + + [ApiEndpoint("load.wait.on.download")] + public static void LoadWaitOnDownload(int iParam1, int iParam2) + { + var rEnum = SketchControlsScript.GlobalCommands.LoadWaitOnDownload; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, iParam2); + } + + [ApiEndpoint("show.quest.side.loading")] + public static void ShowQuestSideLoading() + { + var rEnum = SketchControlsScript.GlobalCommands.ShowQuestSideLoading; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("unload.reference.image.catalog")] + public static void UnloadReferenceImageCatalog() + { + var rEnum = SketchControlsScript.GlobalCommands.UnloadReferenceImageCatalog; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("toggle.camera.path.visuals")] + public static void ToggleCameraPathVisuals() + { + var rEnum = SketchControlsScript.GlobalCommands.ToggleCameraPathVisuals; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("toggle.camera.path.preview")] + public static void ToggleCameraPathPreview() + { + var rEnum = SketchControlsScript.GlobalCommands.ToggleCameraPathPreview; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("delete.camera.path")] + public static void DeleteCameraPath() + { + var rEnum = SketchControlsScript.GlobalCommands.DeleteCameraPath; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + + [ApiEndpoint("record.camera.path")] + public static void RecordCameraPath() + { + var rEnum = SketchControlsScript.GlobalCommands.RecordCameraPath; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } + } +} + + diff --git a/Assets/Scripts/API/GlobalCommandsApi.cs.meta b/Assets/Scripts/API/GlobalCommandsApi.cs.meta new file mode 100644 index 0000000000..d24c2623af --- /dev/null +++ b/Assets/Scripts/API/GlobalCommandsApi.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ac3a60d5b7ae4979a0c3fbb70a316a53 +timeCreated: 1620584814 \ No newline at end of file diff --git a/Assets/Scripts/Sharing/HttpServer.cs b/Assets/Scripts/Sharing/HttpServer.cs index 5d2135bb3a..3438f90a1e 100644 --- a/Assets/Scripts/Sharing/HttpServer.cs +++ b/Assets/Scripts/Sharing/HttpServer.cs @@ -61,10 +61,10 @@ void Awake() bool allowExternalApiCalls = true; #else bool allowExternalApiCalls = false; -#endif +#endif try { - if (!ctx.Request.IsLocal || allowExternalApiCalls) + if (!ctx.Request.IsLocal && !allowExternalApiCalls) { // Return 403: Forbidden if the originator was non-local. ctx.Response.StatusCode = (int)HttpStatusCode.Forbidden; From 49ec9bf1a91a37065da2c1cdda9ccbe054e455d8 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Thu, 13 May 2021 16:33:05 +0100 Subject: [PATCH 022/769] Disable some potentially useless or obscure global commands. Add an API listing command. --- Assets/Scripts/API/ApiManager.cs | 38 +++++++-- Assets/Scripts/API/GlobalCommandsApi.cs | 108 ++++++++++++------------ 2 files changed, 87 insertions(+), 59 deletions(-) diff --git a/Assets/Scripts/API/ApiManager.cs b/Assets/Scripts/API/ApiManager.cs index 22984bd01b..6a06499061 100644 --- a/Assets/Scripts/API/ApiManager.cs +++ b/Assets/Scripts/API/ApiManager.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Net; using System.Reflection; +using System.Text; using TiltBrush; using UnityEngine; @@ -82,7 +83,6 @@ private void Populate() } public bool InvokeEndpoint(KeyValuePair command) { - Debug.Log($"Invoking: {command}"); if (endpoints.ContainsKey(command.Key)) { var endpoint = endpoints[command.Key]; @@ -97,11 +97,42 @@ public bool InvokeEndpoint(KeyValuePair command) return false; } + [ContextMenu("List Api Commands")] + string ListApiCommands() + { + var builder = new StringBuilder(); + if (!Application.isPlaying) + { + Debug.LogError("Please run in play mode"); + return ""; + } + else + { + foreach (var endpoint in endpoints.Keys) + { + var paramInfoText = new List(); + foreach (var param in endpoints[endpoint].parameterInfo) + { + string typeName = param.ParameterType.Name + .Replace("Single", "float") + .Replace("Int32", "int") + .Replace("String", "string"); + paramInfoText.Add($"{typeName} {param.Name}"); + } + var paramInfo = String.Join(", ", paramInfoText); + paramInfo = (paramInfo == "") ? "" : $": {paramInfo}"; // No colon if no params + builder.AppendLine($"{endpoint}{paramInfo}"); + } + var output = builder.ToString(); + Debug.Log(output); + return output; + } + } + string ApiCommandCallback(HttpListenerRequest request) { KeyValuePair command; - Debug.Log($"Received {request.Url.Query}"); // Handle GET foreach (string pair in request.Url.Query.TrimStart('?').Split('&')) @@ -133,7 +164,6 @@ string ApiCommandCallback(HttpListenerRequest request) var kv = pair.Split(new[]{'='}, 2); command = new KeyValuePair(kv[0], kv[1]); m_RequestedCommandQueue.Enqueue(command); - Debug.Log($"Queued {command}"); } } } @@ -148,12 +178,10 @@ private bool HandleApiCommand() try { command = (KeyValuePair)m_RequestedCommandQueue.Dequeue(); - Debug.Log($"Dequeued {command}"); } catch (InvalidOperationException) { return false; - Debug.Log($"Dequeue failed"); } return Instance.InvokeEndpoint(command); diff --git a/Assets/Scripts/API/GlobalCommandsApi.cs b/Assets/Scripts/API/GlobalCommandsApi.cs index ee2ae0eb6a..370af0f1b4 100644 --- a/Assets/Scripts/API/GlobalCommandsApi.cs +++ b/Assets/Scripts/API/GlobalCommandsApi.cs @@ -53,38 +53,38 @@ public static void DraftingHidden() } [ApiEndpoint("load.user")] - public static void LoadUser(int iParam1) + public static void LoadUser(int index) { var rEnum = SketchControlsScript.GlobalCommands.Load; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, 0); + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, index, 0); } [ApiEndpoint("load.curated")] - public static void LoadCurated(int iParam1) + public static void LoadCurated(int index) { var rEnum = SketchControlsScript.GlobalCommands.Load; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, 1); + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, index, 1); } [ApiEndpoint("load.liked")] - public static void LoadLiked(int iParam1) + public static void LoadLiked(int index) { var rEnum = SketchControlsScript.GlobalCommands.Load; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, 2); + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, index, 2); } [ApiEndpoint("load.liked")] - public static void LoadDrive(int iParam1) + public static void LoadDrive(int index) { var rEnum = SketchControlsScript.GlobalCommands.Load; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, 3); + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, index, 3); } [ApiEndpoint("load.named")] - public static void LoadNamedFile(string sParam) + public static void LoadNamedFile(string pathName) { var rEnum = SketchControlsScript.GlobalCommands.LoadNamedFile; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, -1, -1, sParam); + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, -1, -1, pathName); } [ApiEndpoint("new")] @@ -198,11 +198,11 @@ public static void ExportRaw() // } [ApiEndpoint("sketch.openfolder")] - public static void ShowSketchFolder(int iParam1) + public static void ShowSketchFolder(int index) { var rEnum = SketchControlsScript.GlobalCommands.ShowSketchFolder; // TODO 0 is User folder. Do we need to support the other SketchSetTypes? - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, 0); + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, index, 0); } // TODO Why no "enabled" counterpart? @@ -229,10 +229,10 @@ public static void StencilsDisabled() // Does this even work? [ApiEndpoint("straightedge.shape")] - public static void StraightEdgeShape(int iParam1) + public static void StraightEdgeShape(bool enable) { var rEnum = SketchControlsScript.GlobalCommands.StraightEdgeShape; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1); + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, enable?1:0); } // TODO Dangerous! @@ -401,70 +401,70 @@ public static void ToggleWatermark() SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("load.confirm.complex.high")] - public static void LoadConfirmComplexHigh(int iParam1, int iParam2) - { - var rEnum = SketchControlsScript.GlobalCommands.LoadConfirmComplexHigh; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, iParam2); - } + // [ApiEndpoint("load.confirm.complex.high")] + // public static void LoadConfirmComplexHigh(int iParam1, int iParam2) + // { + // var rEnum = SketchControlsScript.GlobalCommands.LoadConfirmComplexHigh; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, iParam2); + // } - [ApiEndpoint("load.confirm.complex")] - public static void LoadConfirmComplex(int iParam1, int iParam2) - { - var rEnum = SketchControlsScript.GlobalCommands.LoadConfirmComplex; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, iParam2); - } + // [ApiEndpoint("load.confirm.complex")] + // public static void LoadConfirmComplex(int iParam1, int iParam2) + // { + // var rEnum = SketchControlsScript.GlobalCommands.LoadConfirmComplex; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, iParam2); + // } - [ApiEndpoint("load.confirm.unsaved")] - public static void LoadConfirmUnsaved(int iParam1, int iParam2) - { - var rEnum = SketchControlsScript.GlobalCommands.LoadConfirmUnsaved; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, iParam2); - } + // [ApiEndpoint("load.confirm.unsaved")] + // public static void LoadConfirmUnsaved(int iParam1, int iParam2) + // { + // var rEnum = SketchControlsScript.GlobalCommands.LoadConfirmUnsaved; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, iParam2); + // } - [ApiEndpoint("load.wait.on.download")] - public static void LoadWaitOnDownload(int iParam1, int iParam2) - { - var rEnum = SketchControlsScript.GlobalCommands.LoadWaitOnDownload; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, iParam2); - } + // [ApiEndpoint("load.wait.on.download")] + // public static void LoadWaitOnDownload(int iParam1, int iParam2) + // { + // var rEnum = SketchControlsScript.GlobalCommands.LoadWaitOnDownload; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, iParam2); + // } - [ApiEndpoint("show.quest.side.loading")] - public static void ShowQuestSideLoading() - { - var rEnum = SketchControlsScript.GlobalCommands.ShowQuestSideLoading; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); - } + // [ApiEndpoint("show.quest.side.loading")] + // public static void ShowQuestSideLoading() + // { + // var rEnum = SketchControlsScript.GlobalCommands.ShowQuestSideLoading; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + // } - [ApiEndpoint("unload.reference.image.catalog")] - public static void UnloadReferenceImageCatalog() - { - var rEnum = SketchControlsScript.GlobalCommands.UnloadReferenceImageCatalog; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); - } + // [ApiEndpoint("unload.reference.image.catalog")] + // public static void UnloadReferenceImageCatalog() + // { + // var rEnum = SketchControlsScript.GlobalCommands.UnloadReferenceImageCatalog; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + // } - [ApiEndpoint("toggle.camera.path.visuals")] + [ApiEndpoint("camerapath.togglevisuals")] public static void ToggleCameraPathVisuals() { var rEnum = SketchControlsScript.GlobalCommands.ToggleCameraPathVisuals; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("toggle.camera.path.preview")] + [ApiEndpoint("camerapath.togglepreview")] public static void ToggleCameraPathPreview() { var rEnum = SketchControlsScript.GlobalCommands.ToggleCameraPathPreview; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("delete.camera.path")] + [ApiEndpoint("camerapath.delete")] public static void DeleteCameraPath() { var rEnum = SketchControlsScript.GlobalCommands.DeleteCameraPath; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("record.camera.path")] + [ApiEndpoint("camerapath.record")] public static void RecordCameraPath() { var rEnum = SketchControlsScript.GlobalCommands.RecordCameraPath; From bc953bb1bbc8935ced0c948764a8b3c25b4e34dd Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Fri, 14 May 2021 08:11:23 +0100 Subject: [PATCH 023/769] Serve html files from a user directory to solve CORS issues. Fix a few bugs with the html examples. [CI BUILD] --- Assets/Scripts/API/ApiEndpointAttribute.cs | 6 ++- Assets/Scripts/API/ApiManager.cs | 49 ++++++++++++++++++---- Assets/Scripts/API/ApiMethods.cs | 4 +- Support/API Examples/JSON to Stroke.html | 4 +- Support/API Examples/Repeated Form.html | 44 +++++++++++++++++++ Support/API Examples/SVG Path.html | 4 +- Support/API Examples/Simple Form.html | 4 +- 7 files changed, 96 insertions(+), 19 deletions(-) create mode 100644 Support/API Examples/Repeated Form.html diff --git a/Assets/Scripts/API/ApiEndpointAttribute.cs b/Assets/Scripts/API/ApiEndpointAttribute.cs index 4fb2bf9589..d5e48fc18d 100644 --- a/Assets/Scripts/API/ApiEndpointAttribute.cs +++ b/Assets/Scripts/API/ApiEndpointAttribute.cs @@ -32,12 +32,14 @@ public object[] DecodeParams(string commandValue) { var parameters = new object[parameterInfo.Length]; - string[] tokens = commandValue.Split(','); + string[] tokens = commandValue.Split(',').Select(x=>x.Trim()).ToArray(); + int tokenIndex = 0; for (var i = 0; i < parameterInfo.Length; i++) { ParameterInfo paramType = parameterInfo[i]; - object paramValue = null; + object paramValue; + if (paramType.ParameterType == typeof(string)) { if (parameterInfo.Length == 1 && i == 0) diff --git a/Assets/Scripts/API/ApiManager.cs b/Assets/Scripts/API/ApiManager.cs index 6a06499061..22fb31d7ad 100644 --- a/Assets/Scripts/API/ApiManager.cs +++ b/Assets/Scripts/API/ApiManager.cs @@ -9,10 +9,12 @@ using System.Text; using TiltBrush; using UnityEngine; +using UnityEngine.Networking; public class ApiManager : MonoBehaviour { private const string ROOT_API_PATH = "/api/v1"; + private const string SCRIPTS_PATH = "/scripts"; private Queue m_RequestedCommandQueue = Queue.Synchronized(new Queue()); private static ApiManager m_Instance; @@ -20,6 +22,7 @@ public class ApiManager : MonoBehaviour [NonSerialized] public Vector3 BrushPosition; [NonSerialized] public Vector3 BrushBearing = Vector3.forward; + private Dictionary m_Scripts; public static ApiManager Instance { @@ -29,9 +32,32 @@ public static ApiManager Instance void Awake() { m_Instance = this; - Populate(); + PopulateApi(); + PopulateScripts(); } - private void Populate() + + private void PopulateScripts() + { + m_Scripts = new Dictionary(); + var scriptsDir = Path.Combine(App.UserPath(), "Scripts"); + if (Directory.Exists(scriptsDir)) + { + var info = new DirectoryInfo(scriptsDir); + FileInfo[] fileInfo = info.GetFiles(); + foreach (FileInfo file in fileInfo) + { + if (file.Extension==".html" || file.Extension==".htm") + { + var f = file.OpenText(); + var filename = file.Name; + m_Scripts[filename] = f.ReadToEnd(); + App.HttpServer.AddHttpHandler($"{SCRIPTS_PATH}/{filename}", ScriptsCallback); + } + } + } + } + + private void PopulateApi() { endpoints = new Dictionary(); var types = AppDomain.CurrentDomain.GetAssemblies() @@ -81,6 +107,7 @@ private void Populate() } App.HttpServer.AddHttpHandler(ROOT_API_PATH, ApiCommandCallback); } + public bool InvokeEndpoint(KeyValuePair command) { if (endpoints.ContainsKey(command.Key)) @@ -124,11 +151,15 @@ string ListApiCommands() builder.AppendLine($"{endpoint}{paramInfo}"); } var output = builder.ToString(); - Debug.Log(output); return output; } } + private string ScriptsCallback(HttpListenerRequest request) + { + return m_Scripts[request.Url.Segments.Last()]; + } + string ApiCommandCallback(HttpListenerRequest request) { @@ -138,15 +169,15 @@ string ApiCommandCallback(HttpListenerRequest request) foreach (string pair in request.Url.Query.TrimStart('?').Split('&')) { string[] kv = pair.Split(new[]{'='}, 2); - if (kv.Length == 1) + if (kv.Length == 1 && kv[0]!="") { - command = new KeyValuePair(kv[0], ""); + m_RequestedCommandQueue.Enqueue(new KeyValuePair(kv[0], "")); } - else + else if (kv.Length == 2) { - command = new KeyValuePair(kv[0], kv[1]); + m_RequestedCommandQueue.Enqueue(new KeyValuePair(kv[0], UnityWebRequest.UnEscapeURL(kv[1]))); + Debug.Log($"{kv[1]} > {UnityWebRequest.UnEscapeURL(kv[1])}"); } - m_RequestedCommandQueue.Enqueue(command); } // Handle POST @@ -158,7 +189,7 @@ string ApiCommandCallback(HttpListenerRequest request) using (var reader = new StreamReader(body, request.ContentEncoding)) { var formdata = Uri.UnescapeDataString(reader.ReadToEnd()); - var pairs = formdata.Split('&'); + var pairs = formdata.Replace("+", " ").Split('&'); foreach (var pair in pairs) { var kv = pair.Split(new[]{'='}, 2); diff --git a/Assets/Scripts/API/ApiMethods.cs b/Assets/Scripts/API/ApiMethods.cs index 4f6fc83dba..9364fb900a 100644 --- a/Assets/Scripts/API/ApiMethods.cs +++ b/Assets/Scripts/API/ApiMethods.cs @@ -45,11 +45,11 @@ public static void Text(string text) } [ApiEndpoint("draw.svg")] - public static void SvgPath(string pathString) + public static void SvgPath(string svgPathString) { var origin = ApiManager.Instance.BrushPosition; SVGData svgData = new SVGData(); - svgData.Path(pathString); + svgData.Path(svgPathString); SVGPolyline svgPolyline = new SVGPolyline(); svgPolyline.Fill(svgData); DrawStrokes.PathsToStrokes(svgPolyline.Polyline, origin, 0.01f, true); diff --git a/Support/API Examples/JSON to Stroke.html b/Support/API Examples/JSON to Stroke.html index 058d633d78..696becd6d7 100644 --- a/Support/API Examples/JSON to Stroke.html +++ b/Support/API Examples/JSON to Stroke.html @@ -4,8 +4,8 @@
-
- diff --git a/Support/API Examples/Repeated Form.html b/Support/API Examples/Repeated Form.html new file mode 100644 index 0000000000..cfc9378832 --- /dev/null +++ b/Support/API Examples/Repeated Form.html @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Support/API Examples/SVG Path.html b/Support/API Examples/SVG Path.html index 9392554747..01d951f104 100644 --- a/Support/API Examples/SVG Path.html +++ b/Support/API Examples/SVG Path.html @@ -4,8 +4,8 @@ -
- diff --git a/Support/API Examples/Simple Form.html b/Support/API Examples/Simple Form.html index a65f42a547..9e8627e102 100644 --- a/Support/API Examples/Simple Form.html +++ b/Support/API Examples/Simple Form.html @@ -3,8 +3,8 @@ - - + +
From 21fca3c0b358a9c0ec451b12c281175afe3274fb Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Fri, 14 May 2021 09:47:44 +0100 Subject: [PATCH 024/769] Help and commands list via API [CI BUILD] --- Assets/Scripts/API/ApiManager.cs | 81 ++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 20 deletions(-) diff --git a/Assets/Scripts/API/ApiManager.cs b/Assets/Scripts/API/ApiManager.cs index 22fb31d7ad..a4793f0671 100644 --- a/Assets/Scripts/API/ApiManager.cs +++ b/Assets/Scripts/API/ApiManager.cs @@ -32,10 +32,43 @@ public static ApiManager Instance void Awake() { m_Instance = this; + App.HttpServer.AddHttpHandler($"/help", InfoCallback); + App.HttpServer.AddHttpHandler($"/help/commands", InfoCallback); PopulateApi(); PopulateScripts(); } + private string InfoCallback(HttpListenerRequest request) + { + string html; + switch (request.Url.Segments.Last()) + { + case "commands": + var builder = new StringBuilder(""); + builder.AppendLine("

Open Brush API Commands

"); + builder.AppendLine("

To run commands a request to this url with http://localhost:40074/api/v1?

"); + builder.AppendLine("

Commands are querystring parameters: commandname=parameters

"); + builder.AppendLine("

Separate multiple commands with &

"); + builder.AppendLine("

Example: http://localhost:40074/api/v1?brush.turn.y=45&brush.draw=1

"); + builder.AppendLine("
"); + var commands = ListApiCommands(); + foreach (var k in commands.Keys) + { + builder.AppendLine($"
{k}
{commands[k]}
"); + } + builder.AppendLine("
"); + html = builder.ToString(); + break; + case "help": + default: + html = @"

Open Brush API Help

+

Try /help/commands

+"; + break; + } + return html; + } + private void PopulateScripts() { m_Scripts = new Dictionary(); @@ -123,36 +156,44 @@ public bool InvokeEndpoint(KeyValuePair command) } return false; } - - [ContextMenu("List Api Commands")] - string ListApiCommands() + [ContextMenu("Log Api Commands")] + public void LogCommandsList() { - var builder = new StringBuilder(); if (!Application.isPlaying) { Debug.LogError("Please run in play mode"); - return ""; } else { - foreach (var endpoint in endpoints.Keys) + var builder = new StringBuilder(); + var commands = ListApiCommands(); + foreach (var k in commands.Keys) { - var paramInfoText = new List(); - foreach (var param in endpoints[endpoint].parameterInfo) - { - string typeName = param.ParameterType.Name - .Replace("Single", "float") - .Replace("Int32", "int") - .Replace("String", "string"); - paramInfoText.Add($"{typeName} {param.Name}"); - } - var paramInfo = String.Join(", ", paramInfoText); - paramInfo = (paramInfo == "") ? "" : $": {paramInfo}"; // No colon if no params - builder.AppendLine($"{endpoint}{paramInfo}"); + builder.AppendLine($"{k}{commands[k]}"); + } + Debug.Log(builder); + } + } + + Dictionary ListApiCommands() + { + var commands = new Dictionary(); + foreach (var endpoint in endpoints.Keys) + { + var paramInfoText = new List(); + foreach (var param in endpoints[endpoint].parameterInfo) + { + string typeName = param.ParameterType.Name + .Replace("Single", "float") + .Replace("Int32", "int") + .Replace("String", "string"); + paramInfoText.Add($"{typeName} {param.Name}"); } - var output = builder.ToString(); - return output; + var paramInfo = String.Join(", ", paramInfoText); + paramInfo = (paramInfo == "") ? "" : $": {paramInfo}"; // No colon if no params + commands[endpoint] = paramInfo; } + return commands; } private string ScriptsCallback(HttpListenerRequest request) From 8b61a14e539f587d4d482e88caac235352a758cb Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Fri, 14 May 2021 14:16:09 +0100 Subject: [PATCH 025/769] CORS headers, small fixes and tweaks --- Assets/Scripts/API/ApiManager.cs | 2 -- Assets/Scripts/API/ApiMethods.cs | 11 +++++++++-- Assets/Scripts/API/DrawStrokes.cs | 1 + Assets/Scripts/Sharing/HttpServer.cs | 5 +++++ Support/API Examples/JSON to Stroke.html | 10 +++++++--- 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Assets/Scripts/API/ApiManager.cs b/Assets/Scripts/API/ApiManager.cs index a4793f0671..a1080c517b 100644 --- a/Assets/Scripts/API/ApiManager.cs +++ b/Assets/Scripts/API/ApiManager.cs @@ -171,7 +171,6 @@ public void LogCommandsList() { builder.AppendLine($"{k}{commands[k]}"); } - Debug.Log(builder); } } @@ -217,7 +216,6 @@ string ApiCommandCallback(HttpListenerRequest request) else if (kv.Length == 2) { m_RequestedCommandQueue.Enqueue(new KeyValuePair(kv[0], UnityWebRequest.UnEscapeURL(kv[1]))); - Debug.Log($"{kv[1]} > {UnityWebRequest.UnEscapeURL(kv[1])}"); } } diff --git a/Assets/Scripts/API/ApiMethods.cs b/Assets/Scripts/API/ApiMethods.cs index 9364fb900a..ef23b792b6 100644 --- a/Assets/Scripts/API/ApiMethods.cs +++ b/Assets/Scripts/API/ApiMethods.cs @@ -70,8 +70,15 @@ public static void Brush(string brushId) if (brushDescriptor == null) { - brushId = brushId.ToLower(); - brushDescriptor = BrushCatalog.m_Instance.AllBrushes.First(x => x.name.ToLower() == brushId); + brushId = brushId.ToLower().Trim().Replace(" ", ""); + try + { + brushDescriptor = BrushCatalog.m_Instance.AllBrushes.First(x => x.name.ToLower() == brushId); + } + catch (InvalidOperationException e) + { + Debug.LogError($"No brush found called: {brushId}"); + } } if (brushDescriptor != null) diff --git a/Assets/Scripts/API/DrawStrokes.cs b/Assets/Scripts/API/DrawStrokes.cs index 3ed59f7ae0..97e4309896 100644 --- a/Assets/Scripts/API/DrawStrokes.cs +++ b/Assets/Scripts/API/DrawStrokes.cs @@ -13,6 +13,7 @@ public static void PathsToStrokes(List>> floatPaths, Vector3 or var path = new List(); foreach (List position in positionList) { + if (position.Count < 3) {position.Add(0);} path.Add(new Vector3(position[0], position[1], position[2])); } paths.Add(path); diff --git a/Assets/Scripts/Sharing/HttpServer.cs b/Assets/Scripts/Sharing/HttpServer.cs index 3438f90a1e..6091a8d549 100644 --- a/Assets/Scripts/Sharing/HttpServer.cs +++ b/Assets/Scripts/Sharing/HttpServer.cs @@ -62,6 +62,11 @@ void Awake() #else bool allowExternalApiCalls = false; #endif + // CORS headers + // TODO Tie this in with the option to accept non-localhost requests + ctx.Response.Headers.Add("Access-Control-Allow-Origin", "*"); + ctx.Response.Headers.Add("Access-Control-Allow-Methods", "POST, GET"); + try { if (!ctx.Request.IsLocal && !allowExternalApiCalls) diff --git a/Support/API Examples/JSON to Stroke.html b/Support/API Examples/JSON to Stroke.html index 696becd6d7..35ff241368 100644 --- a/Support/API Examples/JSON to Stroke.html +++ b/Support/API Examples/JSON to Stroke.html @@ -4,10 +4,14 @@
-
- +
From d41508bf02ceaaa7e328cae9133dbde0776494b3 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Sun, 16 May 2021 17:36:23 +0100 Subject: [PATCH 026/769] Example scripts and accompanying API changes --- Assets/Resources/ScriptExamples.meta | 8 + Assets/Resources/ScriptExamples/example.html | 44 + .../ScriptExamples/example.html.meta | 7 + .../Resources/ScriptExamples/parametric.html | 1134 +++++++++++++++++ .../ScriptExamples/parametric.html.meta | 7 + Assets/Scripts/API/ApiManager.cs | 139 +- Assets/Scripts/API/ApiMethods.cs | 26 +- Assets/Scripts/API/GlobalCommandsApi.cs | 34 +- Assets/Scripts/Sharing/HttpServer.cs | 5 + 9 files changed, 1355 insertions(+), 49 deletions(-) create mode 100644 Assets/Resources/ScriptExamples.meta create mode 100644 Assets/Resources/ScriptExamples/example.html create mode 100644 Assets/Resources/ScriptExamples/example.html.meta create mode 100644 Assets/Resources/ScriptExamples/parametric.html create mode 100644 Assets/Resources/ScriptExamples/parametric.html.meta diff --git a/Assets/Resources/ScriptExamples.meta b/Assets/Resources/ScriptExamples.meta new file mode 100644 index 0000000000..1181d05f32 --- /dev/null +++ b/Assets/Resources/ScriptExamples.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0e1b139856adec046ba4c4a959208c0e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/ScriptExamples/example.html b/Assets/Resources/ScriptExamples/example.html new file mode 100644 index 0000000000..23143e3d10 --- /dev/null +++ b/Assets/Resources/ScriptExamples/example.html @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Assets/Resources/ScriptExamples/example.html.meta b/Assets/Resources/ScriptExamples/example.html.meta new file mode 100644 index 0000000000..bb0e4d0dfe --- /dev/null +++ b/Assets/Resources/ScriptExamples/example.html.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1329493df3f0ce64aa59ee7733744146 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/ScriptExamples/parametric.html b/Assets/Resources/ScriptExamples/parametric.html new file mode 100644 index 0000000000..4088b655fd --- /dev/null +++ b/Assets/Resources/ScriptExamples/parametric.html @@ -0,0 +1,1134 @@ + + + + + +

Brush

+
+
+
+
+
+ +

Formula

+
+ +
+ +
+ +
+ +
+
+
+ + +
+
+
+

+ + + +

+ + + + + + \ No newline at end of file diff --git a/Assets/Resources/ScriptExamples/parametric.html.meta b/Assets/Resources/ScriptExamples/parametric.html.meta new file mode 100644 index 0000000000..a071fd6a21 --- /dev/null +++ b/Assets/Resources/ScriptExamples/parametric.html.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ba502c06e0bfbfa47a8c756d4299f030 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/API/ApiManager.cs b/Assets/Scripts/API/ApiManager.cs index a1080c517b..eed3e2d0ec 100644 --- a/Assets/Scripts/API/ApiManager.cs +++ b/Assets/Scripts/API/ApiManager.cs @@ -1,21 +1,25 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Collections.Specialized; using System.IO; using System.Linq; using System.Net; using System.Reflection; using System.Text; +using Newtonsoft.Json; using TiltBrush; using UnityEngine; using UnityEngine.Networking; + public class ApiManager : MonoBehaviour { - private const string ROOT_API_PATH = "/api/v1"; - private const string SCRIPTS_PATH = "/scripts"; + private const string ROOT_API_URL = "/api/v1"; + private const string BASE_SCRIPTS_URL = "/scripts"; + private const string BASE_EXAMPLE_SCRIPTS_URL = "/examples"; + private FileWatcher m_FileWatcher; + private string m_UserScriptsPath; private Queue m_RequestedCommandQueue = Queue.Synchronized(new Queue()); private static ApiManager m_Instance; private Dictionary endpoints; @@ -32,64 +36,129 @@ public static ApiManager Instance void Awake() { m_Instance = this; + m_UserScriptsPath = Path.Combine(App.UserPath(), "Scripts"); App.HttpServer.AddHttpHandler($"/help", InfoCallback); App.HttpServer.AddHttpHandler($"/help/commands", InfoCallback); + App.HttpServer.AddHttpHandler($"/help/brushes", InfoCallback); PopulateApi(); - PopulateScripts(); + m_Scripts = new Dictionary(); + PopulateExampleScripts(); + PopulateUserScripts(); + if (Directory.Exists(m_UserScriptsPath)) + { + m_FileWatcher = new FileWatcher(m_UserScriptsPath, "*.html"); + m_FileWatcher.NotifyFilter = NotifyFilters.LastWrite; + m_FileWatcher.FileChanged += OnScriptsDirectoryChanged; + m_FileWatcher.FileCreated += OnScriptsDirectoryChanged; + // m_FileWatcher.FileDeleted += OnScriptsDirectoryChanged; TODO + m_FileWatcher.EnableRaisingEvents = true; + } + } + private void OnScriptsDirectoryChanged(object sender, FileSystemEventArgs e) + { + var fileinfo = new FileInfo(e.FullPath); + RegisterUserScript(fileinfo); } private string InfoCallback(HttpListenerRequest request) { string html; + StringBuilder builder; switch (request.Url.Segments.Last()) { case "commands": - var builder = new StringBuilder(""); - builder.AppendLine("

Open Brush API Commands

"); - builder.AppendLine("

To run commands a request to this url with http://localhost:40074/api/v1?

"); - builder.AppendLine("

Commands are querystring parameters: commandname=parameters

"); - builder.AppendLine("

Separate multiple commands with &

"); - builder.AppendLine("

Example: http://localhost:40074/api/v1?brush.turn.y=45&brush.draw=1

"); - builder.AppendLine("
"); var commands = ListApiCommands(); - foreach (var k in commands.Keys) + if (request.Url.Query.Contains("raw")) + { + html = String.Join("\n", commands.Keys); + } + else { - builder.AppendLine($"
{k}
{commands[k]}
"); + builder = new StringBuilder(""); + builder.AppendLine("

Open Brush API Commands

"); + builder.AppendLine("

To run commands a request to this url with http://localhost:40074/api/v1?

"); + builder.AppendLine("

Commands are querystring parameters: commandname=parameters

"); + builder.AppendLine("

Separate multiple commands with &

"); + builder.AppendLine("

Example: http://localhost:40074/api/v1?brush.turn.y=45&brush.draw=1

"); + builder.AppendLine("
"); + foreach (var k in commands.Keys) + { + builder.AppendLine($"
{k}
{commands[k]}
"); + } + builder.AppendLine("
"); + html = builder.ToString(); + } + break; + case "brushes": + var brushes = BrushCatalog.m_Instance.AllBrushes.Where(x=>x.m_Description!=""); + if (request.Url.Query.Contains("raw")) + { + html = String.Join("\n", brushes.Select(x=>x.m_Description)); + } + else + { + builder = new StringBuilder(""); + builder.AppendLine("

Open Brush Brushes

"); + builder.AppendLine("
    "); + foreach (var b in brushes) + { + builder.AppendLine($"
  • {b.m_Description}
  • "); + } + builder.AppendLine("
"); + html = builder.ToString(); } - builder.AppendLine("
"); - html = builder.ToString(); break; case "help": default: html = @"

Open Brush API Help

-

Try /help/commands

+ "; break; } return html; } - private void PopulateScripts() + private void PopulateExampleScripts() { - m_Scripts = new Dictionary(); - var scriptsDir = Path.Combine(App.UserPath(), "Scripts"); - if (Directory.Exists(scriptsDir)) + var exampleScripts = Resources.LoadAll("ScriptExamples", typeof(TextAsset)); + foreach (TextAsset htmlFile in exampleScripts) { - var info = new DirectoryInfo(scriptsDir); - FileInfo[] fileInfo = info.GetFiles(); - foreach (FileInfo file in fileInfo) + string filename = $"{BASE_EXAMPLE_SCRIPTS_URL}/{htmlFile.name}.html"; + m_Scripts[filename] = htmlFile.ToString(); + App.HttpServer.AddHttpHandler(filename, ScriptsCallback); + } + } + + private void PopulateUserScripts() + { + if (Directory.Exists(m_UserScriptsPath)) + { + var dirInfo = new DirectoryInfo(m_UserScriptsPath); + FileInfo[] AllFileInfo = dirInfo.GetFiles(); + foreach (FileInfo fileinfo in AllFileInfo) { - if (file.Extension==".html" || file.Extension==".htm") - { - var f = file.OpenText(); - var filename = file.Name; - m_Scripts[filename] = f.ReadToEnd(); - App.HttpServer.AddHttpHandler($"{SCRIPTS_PATH}/{filename}", ScriptsCallback); - } + RegisterUserScript(fileinfo); } } } - + private void RegisterUserScript(FileInfo file) + { + if (file.Extension==".html" || file.Extension==".htm") + { + var f = file.OpenText(); + string filename = $"{BASE_SCRIPTS_URL}/{file.Name}"; + m_Scripts[filename] = f.ReadToEnd(); + f.Close(); + if (!App.HttpServer.HttpHandlerExists(filename)) + { + App.HttpServer.AddHttpHandler(filename, ScriptsCallback); + } + } + } + private void PopulateApi() { endpoints = new Dictionary(); @@ -138,7 +207,7 @@ private void PopulateApi() } } } - App.HttpServer.AddHttpHandler(ROOT_API_PATH, ApiCommandCallback); + App.HttpServer.AddHttpHandler(ROOT_API_URL, ApiCommandCallback); } public bool InvokeEndpoint(KeyValuePair command) @@ -197,7 +266,11 @@ Dictionary ListApiCommands() private string ScriptsCallback(HttpListenerRequest request) { - return m_Scripts[request.Url.Segments.Last()]; + var html = m_Scripts[request.RawUrl]; + string[] brushNameList = BrushCatalog.m_Instance.AllBrushes.Where(x => x.m_Description != "").Select(x => x.m_Description).ToArray(); + string brushesJson = JsonConvert.SerializeObject(brushNameList); + html = html.Replace("{{brushesJson}}", brushesJson); + return html; } string ApiCommandCallback(HttpListenerRequest request) diff --git a/Assets/Scripts/API/ApiMethods.cs b/Assets/Scripts/API/ApiMethods.cs index ef23b792b6..690abd8461 100644 --- a/Assets/Scripts/API/ApiMethods.cs +++ b/Assets/Scripts/API/ApiMethods.cs @@ -34,6 +34,21 @@ public static void Draw(string jsonString) DrawStrokes.PathsToStrokes(jsonData, origin); } + [ApiEndpoint("showfolder.exports")] + public static void OpenExportFolder() + { + // Launch external window and tell the user we did so + // TODO This call is windows only + if (Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsEditor) + { + OutputWindowScript.m_Instance.CreateInfoCardAtController( + InputManager.ControllerName.Brush, + "Folder opened on desktop", fPopScalar: 0.5f + ); + System.Diagnostics.Process.Start("explorer.exe", "/select," + App.UserExportPath()); + } + } + [ApiEndpoint("draw.text")] public static void Text(string text) { @@ -54,7 +69,7 @@ public static void SvgPath(string svgPathString) svgPolyline.Fill(svgData); DrawStrokes.PathsToStrokes(svgPolyline.Polyline, origin, 0.01f, true); } - + [ApiEndpoint("brush.type")] public static void Brush(string brushId) { @@ -80,7 +95,7 @@ public static void Brush(string brushId) Debug.LogError($"No brush found called: {brushId}"); } } - + if (brushDescriptor != null) { PointerManager.m_Instance.SetBrushForAllPointers(brushDescriptor); @@ -96,7 +111,12 @@ public static void ShiftColor(Vector3 hsv) { float h, s, v; Color.RGBToHSV(App.BrushColor.CurrentColor, out h, out s, out v); - App.BrushColor.CurrentColor = Color.HSVToRGB(h + hsv.x, s + hsv.y, v + hsv.z); + App.BrushColor.CurrentColor = Color.HSVToRGB( + (h + hsv.x) % 1f, + (s + hsv.y) % 1f, + (v + hsv.z) % 1f + ); + Debug.Log($"{(h + hsv.x) % 1f},{(s + hsv.y) % 1f},{(v + hsv.z) % 1f}={App.BrushColor.CurrentColor}"); } [ApiEndpoint("brush.color")] diff --git a/Assets/Scripts/API/GlobalCommandsApi.cs b/Assets/Scripts/API/GlobalCommandsApi.cs index 370af0f1b4..27e082757b 100644 --- a/Assets/Scripts/API/GlobalCommandsApi.cs +++ b/Assets/Scripts/API/GlobalCommandsApi.cs @@ -4,27 +4,35 @@ namespace TiltBrush { public static class GlobalCommandsApi { - [ApiEndpoint("save")] - public static void Save(int saveIndex) + // // Dangerous + // [ApiEndpoint("save.slot")] + // public static void Save(int slot) + // { + // var rEnum = SketchControlsScript.GlobalCommands.Save; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, slot); + // } + + [ApiEndpoint("save.overwrite")] + public static void SaveOverwrite() { var rEnum = SketchControlsScript.GlobalCommands.Save; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, saveIndex); + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, -1, -1); } - [ApiEndpoint("save.new")] - public static void SaveNew(bool generateBoundingBoxSaveIcon) + [ApiEndpoint("save")] + public static void SaveNew() { var rEnum = SketchControlsScript.GlobalCommands.SaveNew; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, generateBoundingBoxSaveIcon?1:-1); + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, 1); } // TODO - // [ApiEndpoint("upload")] - // public static void SaveAndUpload() - // { - // var rEnum = SketchControlsScript.GlobalCommands.SaveAndUpload; - // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); - // } + [ApiEndpoint("upload")] + public static void SaveAndUpload() + { + var rEnum = SketchControlsScript.GlobalCommands.SaveAndUpload; + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + } [ApiEndpoint("export.all")] public static void ExportAll() @@ -197,7 +205,7 @@ public static void ExportRaw() // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); // } - [ApiEndpoint("sketch.openfolder")] + [ApiEndpoint("showfolder.sketch")] public static void ShowSketchFolder(int index) { var rEnum = SketchControlsScript.GlobalCommands.ShowSketchFolder; diff --git a/Assets/Scripts/Sharing/HttpServer.cs b/Assets/Scripts/Sharing/HttpServer.cs index 6091a8d549..55a6d9163f 100644 --- a/Assets/Scripts/Sharing/HttpServer.cs +++ b/Assets/Scripts/Sharing/HttpServer.cs @@ -161,5 +161,10 @@ public void RemoveHttpHandler(string path) { m_HttpRequestHandlers.Remove(path); } + + public bool HttpHandlerExists(string path) + { + return m_HttpRequestHandlers.ContainsKey(path); + } } } // namespace TiltBrush From 93425589c021534e9a8176bedf43ebe5fbe6c1e6 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Mon, 17 May 2021 22:30:04 +0100 Subject: [PATCH 027/769] Add example 3d building script. Fix brush lister. Rename some api endpoints. --- .../Resources/ScriptExamples/buildings.html | 171 +++++++++++++ .../ScriptExamples/buildings.html.meta | 7 + .../Resources/ScriptExamples/parametric.html | 233 ++++++++++-------- Assets/Scripts/API/ApiManager.cs | 8 +- Assets/Scripts/API/ApiMethods.cs | 42 ++-- 5 files changed, 338 insertions(+), 123 deletions(-) create mode 100644 Assets/Resources/ScriptExamples/buildings.html create mode 100644 Assets/Resources/ScriptExamples/buildings.html.meta diff --git a/Assets/Resources/ScriptExamples/buildings.html b/Assets/Resources/ScriptExamples/buildings.html new file mode 100644 index 0000000000..78da9a31ef --- /dev/null +++ b/Assets/Resources/ScriptExamples/buildings.html @@ -0,0 +1,171 @@ + + + + + + + + + +
+
+

Brush

+ +
+
+ +

Map

+
+
+

Drawing

+
+
+
+
+ +
+

+ + + +

+ +
+
+ + + + + \ No newline at end of file diff --git a/Assets/Resources/ScriptExamples/buildings.html.meta b/Assets/Resources/ScriptExamples/buildings.html.meta new file mode 100644 index 0000000000..47055f8926 --- /dev/null +++ b/Assets/Resources/ScriptExamples/buildings.html.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 490d1b6543d58144f855c60bfed77e05 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/ScriptExamples/parametric.html b/Assets/Resources/ScriptExamples/parametric.html index 4088b655fd..f0a11460dc 100644 --- a/Assets/Resources/ScriptExamples/parametric.html +++ b/Assets/Resources/ScriptExamples/parametric.html @@ -1,38 +1,51 @@ - + + + + + -

Brush

-
-
-
-
-
+
+
+

Brush

+ +
-

Formula

-
- -
- -
- -
+
+ +
-
-
-
+
+
- -
-
-
-

- - - -

- +

Formula

+
+ +
+ + +
+ +
+ +
+
+
+ + +
+
+
+

+ + + +

+ +
+
+ + + \ No newline at end of file diff --git a/Assets/Resources/ScriptExamples/simple_form_with_repeats.html.meta b/Assets/Resources/ScriptExamples/simple_form_with_repeats.html.meta new file mode 100644 index 0000000000..ad0d8c6e9c --- /dev/null +++ b/Assets/Resources/ScriptExamples/simple_form_with_repeats.html.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 777ca0974f9511244959ce8596007381 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/ScriptExamples/example.html b/Assets/Resources/ScriptExamples/simple_javascript.html similarity index 93% rename from Assets/Resources/ScriptExamples/example.html rename to Assets/Resources/ScriptExamples/simple_javascript.html index 23143e3d10..ed7e6c59fe 100644 --- a/Assets/Resources/ScriptExamples/example.html +++ b/Assets/Resources/ScriptExamples/simple_javascript.html @@ -23,10 +23,10 @@ for (var i=0; i + + + + +
+
+
+
+
+ + +
+ + \ No newline at end of file diff --git a/Assets/Resources/ScriptExamples/simple_path_form.html.meta b/Assets/Resources/ScriptExamples/simple_path_form.html.meta new file mode 100644 index 0000000000..cb2229e051 --- /dev/null +++ b/Assets/Resources/ScriptExamples/simple_path_form.html.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3bd26713b4086e34581d8d80fe8c17b7 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/ScriptExamples/simple_svg_path_form.html b/Assets/Resources/ScriptExamples/simple_svg_path_form.html new file mode 100644 index 0000000000..637380f4f3 --- /dev/null +++ b/Assets/Resources/ScriptExamples/simple_svg_path_form.html @@ -0,0 +1,12 @@ + + + +
+ + +
+ + \ No newline at end of file diff --git a/Assets/Resources/ScriptExamples/simple_svg_path_form.html.meta b/Assets/Resources/ScriptExamples/simple_svg_path_form.html.meta new file mode 100644 index 0000000000..cbd590830f --- /dev/null +++ b/Assets/Resources/ScriptExamples/simple_svg_path_form.html.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dc18817be312a10499eae75b65c21106 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/API/ApiEndpointAttribute.cs b/Assets/Scripts/API/ApiEndpointAttribute.cs index d5e48fc18d..cb467799cd 100644 --- a/Assets/Scripts/API/ApiEndpointAttribute.cs +++ b/Assets/Scripts/API/ApiEndpointAttribute.cs @@ -7,20 +7,27 @@ [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] public class ApiEndpoint : Attribute { - private string endpoint; public Type type; public MethodInfo methodInfo; public object instance; public ParameterInfo[] parameterInfo; - public ApiEndpoint(string endpoint) + private string m_Endpoint; + private string m_Description; + + public ApiEndpoint(string endpoint, string description) { - this.endpoint = endpoint; + this.m_Endpoint = endpoint; + this.m_Description = description; } public virtual string Endpoint { - get {return endpoint;} + get {return m_Endpoint;} + } + public string Description + { + get {return m_Description;} } public void Invoke(System.Object[] parameters) diff --git a/Assets/Scripts/API/ApiManager.cs b/Assets/Scripts/API/ApiManager.cs index 145ec43726..6dba694258 100644 --- a/Assets/Scripts/API/ApiManager.cs +++ b/Assets/Scripts/API/ApiManager.cs @@ -74,10 +74,10 @@ private string InfoCallback(HttpListenerRequest request) switch (request.Url.Segments.Last()) { case "commands": - var commands = ListApiCommands(); + var commandList = ListApiCommands(); if (request.Url.Query.Contains("raw")) { - html = String.Join("\n", commands.Keys); + html = String.Join("\n", commandList.Keys); } else { @@ -87,9 +87,14 @@ private string InfoCallback(HttpListenerRequest request) builder.AppendLine("

Separate multiple commands with &

"); builder.AppendLine("

Example: http://localhost:40074/api/v1?brush.turn.y=45&brush.draw=1

"); builder.AppendLine("
"); - foreach (var k in commands.Keys) + foreach (var key in commandList.Keys) { - builder.AppendLine($"
{k}
{commands[k]}
"); + string paramList = commandList[key].Item1; + if (paramList != "") + { + paramList = $"({paramList})"; + } + builder.AppendLine($"
{key} {paramList}
{commandList[key].Item2}
"); } builder.AppendLine("
"); html = String.Format(BASE_HTML, builder); @@ -246,14 +251,14 @@ public void LogCommandsList() var commands = ListApiCommands(); foreach (var k in commands.Keys) { - builder.AppendLine($"{k}{commands[k]}"); + builder.AppendLine($"{k} ({commands[k].Item2}): {commands[k].Item2}"); } } } - Dictionary ListApiCommands() + Dictionary ListApiCommands() { - var commands = new Dictionary(); + var commandList = new Dictionary(); foreach (var endpoint in endpoints.Keys) { var paramInfoText = new List(); @@ -265,11 +270,10 @@ Dictionary ListApiCommands() .Replace("String", "string"); paramInfoText.Add($"{typeName} {param.Name}"); } - var paramInfo = String.Join(", ", paramInfoText); - paramInfo = (paramInfo == "") ? "" : $": {paramInfo}"; // No colon if no params - commands[endpoint] = paramInfo; + string paramInfo = String.Join(", ", paramInfoText); + commandList[endpoint] = (paramInfo, endpoints[endpoint].Description); } - return commands; + return commandList; } private string UserScriptsCallback(HttpListenerRequest request) diff --git a/Assets/Scripts/API/ApiMethods.cs b/Assets/Scripts/API/ApiMethods.cs index 4a60573563..227b6d3150 100644 --- a/Assets/Scripts/API/ApiMethods.cs +++ b/Assets/Scripts/API/ApiMethods.cs @@ -7,7 +7,6 @@ namespace TiltBrush { - // ReSharper disable once UnusedType.Global public static class ApiMethods { @@ -26,7 +25,7 @@ private static void ChangeCameraBearing(float angle, Vector3 axis) App.Scene.Pose = lookPose; } - [ApiEndpoint("draw.path")] + [ApiEndpoint("draw.path", "Draws a series of lines at the current brush position [[[x1,y1,z1],[x2,y2,z2], etc...]]. Does not move the brush position")] public static void Draw(string jsonString) { var origin = ApiManager.Instance.BrushPosition; @@ -34,13 +33,13 @@ public static void Draw(string jsonString) DrawStrokes.PathsToStrokes(jsonData, origin); } - [ApiEndpoint("showfolder.scripts")] + [ApiEndpoint("showfolder.scripts", "Opens the user's Scripts folder on the desktop")] public static void OpenUserScriptsFolder() { OpenUserFolder(ApiManager.Instance.UserScriptsPath()); } - [ApiEndpoint("showfolder.exports")] + [ApiEndpoint("showfolder.exports", "Opens the user's Exports folder on the desktop")] public static void OpenExportFolder() { OpenUserFolder(App.UserExportPath()); @@ -60,7 +59,7 @@ private static void OpenUserFolder(string path) } } - [ApiEndpoint("draw.text")] + [ApiEndpoint("draw.text", "Draws the characters supplied at the current brush position")] public static void Text(string text) { var origin = ApiManager.Instance.BrushPosition; @@ -70,7 +69,7 @@ public static void Text(string text) DrawStrokes.PathsToStrokes(polyline2d, origin); } - [ApiEndpoint("draw.svg")] + [ApiEndpoint("draw.svg", "Draws the path supplied as an SVG Path string at the current brush position")] public static void SvgPath(string svgPathString) { var origin = ApiManager.Instance.BrushPosition; @@ -81,13 +80,13 @@ public static void SvgPath(string svgPathString) DrawStrokes.PathsToStrokes(svgPolyline.Polyline, origin, 0.01f, true); } - [ApiEndpoint("brush.type")] - public static void Brush(string brushId) + [ApiEndpoint("brush.type", "Changes the brush. brushType can either be the brush name or it's guid. brushes are listed in the localhost:40074/help screen")] + public static void Brush(string brushType) { BrushDescriptor brushDescriptor = null; try { - var guid = new Guid(brushId); + var guid = new Guid(brushType); brushDescriptor = BrushCatalog.m_Instance.GetBrush(guid); } catch (FormatException e) @@ -96,14 +95,14 @@ public static void Brush(string brushId) if (brushDescriptor == null) { - brushId = brushId.ToLower().Trim().Replace(" ", ""); + brushType = brushType.ToLower().Trim().Replace(" ", ""); try { - brushDescriptor = BrushCatalog.m_Instance.AllBrushes.First(x => x.name.ToLower() == brushId); + brushDescriptor = BrushCatalog.m_Instance.AllBrushes.First(x => x.name.ToLower() == brushType); } catch (InvalidOperationException e) { - Debug.LogError($"No brush found called: {brushId}"); + Debug.LogError($"No brush found called: {brushType}"); } } @@ -113,11 +112,11 @@ public static void Brush(string brushId) } else { - Debug.LogError($"No brush found with the name or guid: {brushId}"); + Debug.LogError($"No brush found with the name or guid: {brushType}"); } } - [ApiEndpoint("brush.addhsv")] + [ApiEndpoint("color.add.hsv", "Adds the supplied values to the current color. Values are hue, saturation and value")] public static void AddColorHSV(Vector3 hsv) { float h, s, v; @@ -129,67 +128,100 @@ public static void AddColorHSV(Vector3 hsv) ); } - [ApiEndpoint("brush.addrgb")] + [ApiEndpoint("color.add.rgb", "Adds the supplied values to the current color. Values are red green and blue")] public static void AddColorRGB(Vector3 rgb) { App.BrushColor.CurrentColor += new Color(rgb.x, rgb.y, rgb.z); } - [ApiEndpoint("brush.rgb")] + [ApiEndpoint("color.set.rgb", "Sets the current color. Values are hue, saturation and value")] public static void SetColorRGB(Vector3 rgb) { App.BrushColor.CurrentColor = new Color(rgb.x, rgb.y, rgb.z); } - [ApiEndpoint("brush.hsv")] + [ApiEndpoint("color.set.hsv", "Sets the current color. Values are red, green and blue")] public static void SetColorHSV(Vector3 hsv) { App.BrushColor.CurrentColor = Color.HSVToRGB(hsv.x, hsv.y, hsv.z); } - - [ApiEndpoint("brush.htmlcolor")] - public static void SetColorHTML(string colorString) + + [ApiEndpoint("color.set.html", "Sets the current color. colorString can either be a hex value or a css color name.")] + public static void SetColorHTML(string color) { - Color color; - if (ColorUtility.TryParseHtmlString(colorString, out color) || - ColorUtility.TryParseHtmlString($"#{colorString}", out color)) + + Color currentColor; + string colorString; + + colorString = color; + if (CssColors.NamesToHex.ContainsKey(color)) colorString = CssColors.NamesToHex[color]; + if (!color.StartsWith("#")) colorString = $"#{color}"; + + if (ColorUtility.TryParseHtmlString($"#{color}", out currentColor)) + { + App.BrushColor.CurrentColor = currentColor; + } + else { - App.BrushColor.CurrentColor = color; + Debug.LogError("Invalid color: {color}"); } } - [ApiEndpoint("brush.size")] + [ApiEndpoint("brush.size.set", "Sets the current brush size")] public static void BrushSizeSet(float size) { PointerManager.m_Instance.MainPointer.BrushSize01 = size; } - [ApiEndpoint("brush.addsize")] - public static void BrushSizeAdd(float size) + [ApiEndpoint("brush.size.add", "Changes the current brush size by 'amount'")] + public static void BrushSizeAdd(float amount) { - PointerManager.m_Instance.MainPointer.BrushSize01 += size; + PointerManager.m_Instance.MainPointer.BrushSize01 += amount; } - [ApiEndpoint("camera.teleport")] - public static void TeleportCamera(Vector3 translation) + [ApiEndpoint("camera.move.to", "Moves the spectator or non-VR camera to the given position")] + public static void MoveCameraTo(Vector3 position) { - TrTransform pose = App.Scene.Pose; - pose.translation -= translation; - float BoundsRadius = SceneSettings.m_Instance.HardBoundsRadiusMeters_SS; - pose = SketchControlsScript.MakeValidScenePose(pose, BoundsRadius); - App.Scene.Pose = pose; + if (App.Config.m_SdkMode == SdkMode.Monoscopic) + { + TrTransform pose = App.Scene.Pose; + pose.translation = position; + float BoundsRadius = SceneSettings.m_Instance.HardBoundsRadiusMeters_SS; + pose = SketchControlsScript.MakeValidScenePose(pose, BoundsRadius); + App.Scene.Pose = pose; + } + else + { + var cam = SketchControlsScript.m_Instance.GetDropCampWidget(); + cam.transform.position = position; + } + } + + [ApiEndpoint("camera.move.by", "Moves the spectator or non-VR camera by the given amount")] + public static void MoveCameraBy(Vector3 amount) + { + if (App.Config.m_SdkMode == SdkMode.Monoscopic) + { + TrTransform pose = App.Scene.Pose; + pose.translation -= amount; + float BoundsRadius = SceneSettings.m_Instance.HardBoundsRadiusMeters_SS; + pose = SketchControlsScript.MakeValidScenePose(pose, BoundsRadius); + App.Scene.Pose = pose; + } + else + { + var cam = SketchControlsScript.m_Instance.GetDropCampWidget(); + cam.transform.position += amount; + } } - [ApiEndpoint("camera.turn")] - [ApiEndpoint("camera.turn.y")] - [ApiEndpoint("camera.yaw")] + [ApiEndpoint("camera.turn.y", "Turns the spectator or non-VR camera left or right.")] public static void Yaw(float angle) { ChangeCameraBearing(angle, Vector3.up); } - [ApiEndpoint("camera.pitch")] - [ApiEndpoint("camera.turn.x")] + [ApiEndpoint("camera.turn.x", "Changes the angle of the spectator or non-VR camera up or down.")] public static void Pitch(float angle) { ChangeCameraBearing(angle, Vector3.left); @@ -197,14 +229,14 @@ public static void Pitch(float angle) // TODO doesn't actually make any difference at the moment // As we don't store orientation - only bearing. - [ApiEndpoint("camera.roll")] - [ApiEndpoint("camera.turn.z")] - public static void Roll(float angle) - { - ChangeCameraBearing(angle, Vector3.forward); - } + // [ApiEndpoint("camera.turn.z", "")] + // public static void Roll(float angle) + // { + // ChangeCameraBearing(angle, Vector3.forward); + // } - [ApiEndpoint("camera.lookat")] + // TODO This should be lookat "position" + [ApiEndpoint("camera.lookat", "Points the spectator or non-VR camera to look in the specified direction. Angles are given in x,y,z degrees")] public static void CameraDirection(Vector3 direction) { TrTransform lookPose = App.Scene.Pose; @@ -213,19 +245,19 @@ public static void CameraDirection(Vector3 direction) App.Scene.Pose = lookPose; } - [ApiEndpoint("brush.moveto")] + [ApiEndpoint("brush.move.to", "Moves the brush to the given coordinates")] public static void BrushMoveTo(Vector3 position) { ApiManager.Instance.BrushPosition = position; } - [ApiEndpoint("brush.moveby")] + [ApiEndpoint("brush.move.by", "Moves the brush by the given amount")] public static void BrushMoveBy(Vector3 offset) { ApiManager.Instance.BrushPosition += offset; } - [ApiEndpoint("brush.move")] + [ApiEndpoint("brush.move", "Moves the brush forward by 'distance' without drawing a line")] public static void BrushMove(float distance) { var currentPosition = ApiManager.Instance.BrushPosition; @@ -234,7 +266,7 @@ public static void BrushMove(float distance) ApiManager.Instance.BrushPosition = newPosition; } - [ApiEndpoint("brush.draw")] + [ApiEndpoint("brush.draw", "Moves the brush forward by 'distance' and draws a line")] public static void BrushDraw(float distance) { var directionVector = ApiManager.Instance.BrushBearing; @@ -248,29 +280,25 @@ public static void BrushDraw(float distance) ApiManager.Instance.BrushPosition += end; } - [ApiEndpoint("brush.turn")] - [ApiEndpoint("brush.turn.y")] - [ApiEndpoint("brush.yaw")] + [ApiEndpoint("brush.turn.y", "Changes the brush direction to the left or right. Angle is measured in degrees")] public static void BrushYaw(float angle) { ChangeBrushBearing(angle, Vector3.up); } - [ApiEndpoint("brush.pitch")] - [ApiEndpoint("brush.turn.x")] + [ApiEndpoint("brush.turn.x", "Changes the brush direction up or down. Angle is measured in degrees")] public static void BrushPitch(float angle) { ChangeBrushBearing(angle, Vector3.left); } - [ApiEndpoint("brush.roll")] - [ApiEndpoint("brush.turn.z")] + [ApiEndpoint("brush.turn.z", "Rotates the brush clockwise or anticlockwise. Angle is measured in degrees")] public static void BrushRoll(float angle) { ChangeBrushBearing(angle, Vector3.forward); } - [ApiEndpoint("brush.lookat")] + [ApiEndpoint("brush.lookat", "Changes the brush direction to look at the specified point")] public static void BrushLookAt(Vector3 direction) { ApiManager.Instance.BrushBearing = direction.normalized; diff --git a/Assets/Scripts/API/CssColors.cs b/Assets/Scripts/API/CssColors.cs new file mode 100644 index 0000000000..bda5326fb9 --- /dev/null +++ b/Assets/Scripts/API/CssColors.cs @@ -0,0 +1,158 @@ +using System.Collections.Generic; +namespace TiltBrush +{ + public static class CssColors + { + public static Dictionary NamesToHex = new Dictionary + { + { "black", "#000000" }, + { "silver", "#c0c0c0" }, + { "gray", "#808080" }, + { "white", "#ffffff" }, + { "maroon", "#800000" }, + { "red", "#ff0000" }, + { "purple", "#800080" }, + { "fuchsia", "#ff00ff" }, + { "green", "#008000" }, + { "lime", "#00ff00" }, + { "olive", "#808000" }, + { "yellow", "#ffff00" }, + { "navy", "#000080" }, + { "blue", "#0000ff" }, + { "teal", "#008080" }, + { "aqua", "#00ffff" }, + { "orange", "#ffa500" }, + { "aliceblue", "#f0f8ff" }, + { "antiquewhite", "#faebd7" }, + { "aquamarine", "#7fffd4" }, + { "azure", "#f0ffff" }, + { "beige", "#f5f5dc" }, + { "bisque", "#ffe4c4" }, + { "blanchedalmond", "#ffebcd" }, + { "blueviolet", "#8a2be2" }, + { "brown", "#a52a2a" }, + { "burlywood", "#deb887" }, + { "cadetblue", "#5f9ea0" }, + { "chartreuse", "#7fff00" }, + { "chocolate", "#d2691e" }, + { "coral", "#ff7f50" }, + { "cornflowerblue", "#6495ed" }, + { "cornsilk", "#fff8dc" }, + { "crimson", "#dc143c" }, + { "cyan", "#00ffff" }, + { "darkblue", "#00008b" }, + { "darkcyan", "#008b8b" }, + { "darkgoldenrod", "#b8860b" }, + { "darkgray", "#a9a9a9" }, + { "darkgreen", "#006400" }, + { "darkgrey", "#a9a9a9" }, + { "darkkhaki", "#bdb76b" }, + { "darkmagenta", "#8b008b" }, + { "darkolivegreen", "#556b2f" }, + { "darkorange", "#ff8c00" }, + { "darkorchid", "#9932cc" }, + { "darkred", "#8b0000" }, + { "darksalmon", "#e9967a" }, + { "darkseagreen", "#8fbc8f" }, + { "darkslateblue", "#483d8b" }, + { "darkslategray", "#2f4f4f" }, + { "darkslategrey", "#2f4f4f" }, + { "darkturquoise", "#00ced1" }, + { "darkviolet", "#9400d3" }, + { "deeppink", "#ff1493" }, + { "deepskyblue", "#00bfff" }, + { "dimgray", "#696969" }, + { "dimgrey", "#696969" }, + { "dodgerblue", "#1e90ff" }, + { "firebrick", "#b22222" }, + { "floralwhite", "#fffaf0" }, + { "forestgreen", "#228b22" }, + { "gainsboro", "#dcdcdc" }, + { "ghostwhite", "#f8f8ff" }, + { "gold", "#ffd700" }, + { "goldenrod", "#daa520" }, + { "greenyellow", "#adff2f" }, + { "grey", "#808080" }, + { "honeydew", "#f0fff0" }, + { "hotpink", "#ff69b4" }, + { "indianred", "#cd5c5c" }, + { "indigo", "#4b0082" }, + { "ivory", "#fffff0" }, + { "khaki", "#f0e68c" }, + { "lavender", "#e6e6fa" }, + { "lavenderblush", "#fff0f5" }, + { "lawngreen", "#7cfc00" }, + { "lemonchiffon", "#fffacd" }, + { "lightblue", "#add8e6" }, + { "lightcoral", "#f08080" }, + { "lightcyan", "#e0ffff" }, + { "lightgoldenrodyellow", "#fafad2" }, + { "lightgray", "#d3d3d3" }, + { "lightgreen", "#90ee90" }, + { "lightgrey", "#d3d3d3" }, + { "lightpink", "#ffb6c1" }, + { "lightsalmon", "#ffa07a" }, + { "lightseagreen", "#20b2aa" }, + { "lightskyblue", "#87cefa" }, + { "lightslategray", "#778899" }, + { "lightslategrey", "#778899" }, + { "lightsteelblue", "#b0c4de" }, + { "lightyellow", "#ffffe0" }, + { "limegreen", "#32cd32" }, + { "linen", "#faf0e6" }, + { "magenta", "#ff00ff" }, + { "mediumaquamarine", "#66cdaa" }, + { "mediumblue", "#0000cd" }, + { "mediumorchid", "#ba55d3" }, + { "mediumpurple", "#9370db" }, + { "mediumseagreen", "#3cb371" }, + { "mediumslateblue", "#7b68ee" }, + { "mediumspringgreen", "#00fa9a" }, + { "mediumturquoise", "#48d1cc" }, + { "mediumvioletred", "#c71585" }, + { "midnightblue", "#191970" }, + { "mintcream", "#f5fffa" }, + { "mistyrose", "#ffe4e1" }, + { "moccasin", "#ffe4b5" }, + { "navajowhite", "#ffdead" }, + { "oldlace", "#fdf5e6" }, + { "olivedrab", "#6b8e23" }, + { "orangered", "#ff4500" }, + { "orchid", "#da70d6" }, + { "palegoldenrod", "#eee8aa" }, + { "palegreen", "#98fb98" }, + { "paleturquoise", "#afeeee" }, + { "palevioletred", "#db7093" }, + { "papayawhip", "#ffefd5" }, + { "peachpuff", "#ffdab9" }, + { "peru", "#cd853f" }, + { "pink", "#ffc0cb" }, + { "plum", "#dda0dd" }, + { "powderblue", "#b0e0e6" }, + { "rosybrown", "#bc8f8f" }, + { "royalblue", "#4169e1" }, + { "saddlebrown", "#8b4513" }, + { "salmon", "#fa8072" }, + { "sandybrown", "#f4a460" }, + { "seagreen", "#2e8b57" }, + { "seashell", "#fff5ee" }, + { "sienna", "#a0522d" }, + { "skyblue", "#87ceeb" }, + { "slateblue", "#6a5acd" }, + { "slategray", "#708090" }, + { "slategrey", "#708090" }, + { "snow", "#fffafa" }, + { "springgreen", "#00ff7f" }, + { "steelblue", "#4682b4" }, + { "tan", "#d2b48c" }, + { "thistle", "#d8bfd8" }, + { "tomato", "#ff6347" }, + { "turquoise", "#40e0d0" }, + { "violet", "#ee82ee" }, + { "wheat", "#f5deb3" }, + { "whitesmoke", "#f5f5f5" }, + { "yellowgreen", "#9acd32" }, + { "rebeccapurple", "#663399" } + }; + } +} diff --git a/Assets/Scripts/API/CssColors.cs.meta b/Assets/Scripts/API/CssColors.cs.meta new file mode 100644 index 0000000000..f67a715968 --- /dev/null +++ b/Assets/Scripts/API/CssColors.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bfa373453fbf40c7aa28b494c2a8a788 +timeCreated: 1621684890 \ No newline at end of file diff --git a/Assets/Scripts/API/GlobalCommandsApi.cs b/Assets/Scripts/API/GlobalCommandsApi.cs index 27e082757b..aa6f2097f1 100644 --- a/Assets/Scripts/API/GlobalCommandsApi.cs +++ b/Assets/Scripts/API/GlobalCommandsApi.cs @@ -12,14 +12,14 @@ public static class GlobalCommandsApi // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, slot); // } - [ApiEndpoint("save.overwrite")] + [ApiEndpoint("save.overwrite", "Save the current scene overwriting the last save if it exists")] public static void SaveOverwrite() { var rEnum = SketchControlsScript.GlobalCommands.Save; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, -1, -1); } - [ApiEndpoint("save")] + [ApiEndpoint("save", "Saves the current scene in a new slot")] public static void SaveNew() { var rEnum = SketchControlsScript.GlobalCommands.SaveNew; @@ -27,89 +27,89 @@ public static void SaveNew() } // TODO - [ApiEndpoint("upload")] - public static void SaveAndUpload() - { - var rEnum = SketchControlsScript.GlobalCommands.SaveAndUpload; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); - } + // [ApiEndpoint("upload", "Saves the current scene and uploads it to Poly/Icosa")] + // public static void SaveAndUpload() + // { + // var rEnum = SketchControlsScript.GlobalCommands.SaveAndUpload; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + // } - [ApiEndpoint("export.all")] + [ApiEndpoint("export.all", "Exports all the scenes in the users's sketch folder")] public static void ExportAll() { var rEnum = SketchControlsScript.GlobalCommands.ExportAll; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("drafting.visible")] + [ApiEndpoint("drafting.visible", "Shows all strokes made with the drafting brush fully opaque")] public static void DraftingVisible() { var rEnum = SketchControlsScript.GlobalCommands.DraftingVisibility; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, 0); } - [ApiEndpoint("drafting.transparent")] + [ApiEndpoint("drafting.transparent", "Shows all strokes made with the drafting brush semi-transparent")] public static void DraftingTransparent() { var rEnum = SketchControlsScript.GlobalCommands.DraftingVisibility; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, 1); } - [ApiEndpoint("drafting.hidden")] + [ApiEndpoint("drafting.hidden", "Hides all strokes made with the drafting brush")] public static void DraftingHidden() { var rEnum = SketchControlsScript.GlobalCommands.DraftingVisibility; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, 2); } - [ApiEndpoint("load.user")] - public static void LoadUser(int index) + [ApiEndpoint("load.user", "Loads the sketch in the given slot number from the user's sketch folder")] + public static void LoadUser(int slot) { var rEnum = SketchControlsScript.GlobalCommands.Load; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, index, 0); + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, slot, 0); } - [ApiEndpoint("load.curated")] - public static void LoadCurated(int index) + [ApiEndpoint("load.curated", "Loads the sketch in the given slot number from the curated sketch list")] + public static void LoadCurated(int slot) { var rEnum = SketchControlsScript.GlobalCommands.Load; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, index, 1); + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, slot, 1); } - [ApiEndpoint("load.liked")] - public static void LoadLiked(int index) + [ApiEndpoint("load.liked", "Loads the sketch in the given slot number from the user's liked sketches")] + public static void LoadLiked(int slot) { var rEnum = SketchControlsScript.GlobalCommands.Load; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, index, 2); + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, slot, 2); } - [ApiEndpoint("load.liked")] - public static void LoadDrive(int index) + [ApiEndpoint("load.drive", "Loads the sketch in the given slot number from the user's Google Drive")] + public static void LoadDrive(int slot) { var rEnum = SketchControlsScript.GlobalCommands.Load; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, index, 3); + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, slot, 3); } - [ApiEndpoint("load.named")] - public static void LoadNamedFile(string pathName) + [ApiEndpoint("load.named", "Loads the sketch from the given directory")] + public static void LoadNamedFile(string directory) { var rEnum = SketchControlsScript.GlobalCommands.LoadNamedFile; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, -1, -1, pathName); + SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, -1, -1, directory); } - [ApiEndpoint("new")] + [ApiEndpoint("new", "Clears the current sketch")] public static void NewSketch() { var rEnum = SketchControlsScript.GlobalCommands.NewSketch; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("symmetry.mirror")] + [ApiEndpoint("symmetry.mirror", "Sets the symmetry mode to 'mirror'")] public static void SymmetryPlane() { var rEnum = SketchControlsScript.GlobalCommands.SymmetryPlane; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("symmetry.doublemirror")] + [ApiEndpoint("symmetry.doublemirror", "Sets the symmetry mode to 'double mirror'")] public static void SymmetryFour() { var rEnum = SketchControlsScript.GlobalCommands.SymmetryFour; @@ -117,7 +117,7 @@ public static void SymmetryFour() } // TODO on and off explicitly - [ApiEndpoint("straightedge.toggle")] + [ApiEndpoint("straightedge.toggle", "Toggles the straight edge tool on or off")] public static void StraightEdge() { var rEnum = SketchControlsScript.GlobalCommands.StraightEdge; @@ -125,28 +125,28 @@ public static void StraightEdge() } // TODO on and off explicitly - [ApiEndpoint("autoorient.toggle")] + [ApiEndpoint("autoorient.toggle", "Toggles autoorientate on or off")] public static void AutoOrient() { var rEnum = SketchControlsScript.GlobalCommands.AutoOrient; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("undo")] + [ApiEndpoint("undo", "Undoes the last action")] public static void Undo() { var rEnum = SketchControlsScript.GlobalCommands.Undo; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("redo")] + [ApiEndpoint("redo", "Redo the last action")] public static void Redo() { var rEnum = SketchControlsScript.GlobalCommands.Redo; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("panels.reset")] + [ApiEndpoint("panels.reset", "Reset the position of all panels")] public static void ResetAllPanels() { var rEnum = SketchControlsScript.GlobalCommands.ResetAllPanels; @@ -154,14 +154,14 @@ public static void ResetAllPanels() } // TODO Test this - [ApiEndpoint("sketch.origin")] + [ApiEndpoint("sketch.origin", "Enables the sketch origin tool")] public static void SketchOrigin() { var rEnum = SketchControlsScript.GlobalCommands.SketchOrigin; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("viewonly")] + [ApiEndpoint("viewonly.toggle", "Toggles 'view only' mode on or off")] public static void ViewOnly() { var rEnum = SketchControlsScript.GlobalCommands.ViewOnly; @@ -176,21 +176,21 @@ public static void ViewOnly() // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); // } - [ApiEndpoint("dropcam")] + [ApiEndpoint("dropcam.toggle", "Toggles the Drop Cam widget on or off")] public static void DropCam() { var rEnum = SketchControlsScript.GlobalCommands.DropCam; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("autosimplify.toggle")] + [ApiEndpoint("autosimplify.toggle", "Toggles 'auto-simplify' mode on or off")] public static void ToggleAutosimplification() { var rEnum = SketchControlsScript.GlobalCommands.ToggleAutosimplification; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("export")] + [ApiEndpoint("export", "Exports the current sketch to the user's Exports folder")] public static void ExportRaw() { var rEnum = SketchControlsScript.GlobalCommands.ExportRaw; @@ -205,7 +205,7 @@ public static void ExportRaw() // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); // } - [ApiEndpoint("showfolder.sketch")] + [ApiEndpoint("showfolder.sketch", "Opens the user's Sketches folder on the desktop")] public static void ShowSketchFolder(int index) { var rEnum = SketchControlsScript.GlobalCommands.ShowSketchFolder; @@ -214,7 +214,7 @@ public static void ShowSketchFolder(int index) } // TODO Why no "enabled" counterpart? - [ApiEndpoint("stencils.disabled")] + [ApiEndpoint("stencils.disabled", "Disables all stencils")] public static void StencilsDisabled() { var rEnum = SketchControlsScript.GlobalCommands.StencilsDisabled; @@ -235,13 +235,13 @@ public static void StencilsDisabled() // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); // } - // Does this even work? - [ApiEndpoint("straightedge.shape")] - public static void StraightEdgeShape(bool enable) - { - var rEnum = SketchControlsScript.GlobalCommands.StraightEdgeShape; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, enable?1:0); - } + // TODO Does this even work? + // [ApiEndpoint("straightedge.shape")] + // public static void StraightEdgeShape(bool enable) + // { + // var rEnum = SketchControlsScript.GlobalCommands.StraightEdgeShape; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, enable?1:0); + // } // TODO Dangerous! // [ApiEndpoint("sketch.delete")] @@ -251,7 +251,7 @@ public static void StraightEdgeShape(bool enable) // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1, iParam2); // } - [ApiEndpoint("disco")] + [ApiEndpoint("disco", "Starts a party")] public static void Disco() { var rEnum = SketchControlsScript.GlobalCommands.Disco; @@ -286,12 +286,13 @@ public static void Disco() // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); // } - [ApiEndpoint("googledrivesync.toggle")] - public static void GoogleDriveSync() - { - var rEnum = SketchControlsScript.GlobalCommands.GoogleDriveSync; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); - } + // TODO Does this work? + // [ApiEndpoint("googledrivesync.toggle", "Toggles syncing to Google Drive")] + // public static void GoogleDriveSync() + // { + // var rEnum = SketchControlsScript.GlobalCommands.GoogleDriveSync; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + // } // TODO Test this // [ApiEndpoint("google.drive.sync.folder")] @@ -301,7 +302,8 @@ public static void GoogleDriveSync() // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum, iParam1); // } - [ApiEndpoint("selection.duplicate")] + // TODO Test this + [ApiEndpoint("selection.duplicate", "Create a duplicate of the current selection")] public static void Duplicate() { var rEnum = SketchControlsScript.GlobalCommands.Duplicate; @@ -309,7 +311,7 @@ public static void Duplicate() } // TODO explicit group/ungroup - [ApiEndpoint("selection.group")] + [ApiEndpoint("selection.group", "Groups the current selection")] public static void ToggleGroupStrokesAndWidgets() { var rEnum = SketchControlsScript.GlobalCommands.ToggleGroupStrokesAndWidgets; @@ -317,7 +319,7 @@ public static void ToggleGroupStrokesAndWidgets() } // TODO Test this and maybe choose a better command name - [ApiEndpoint("export.selected")] + [ApiEndpoint("export.selected", "Exports the selected strokes to the user's Media Library")] public static void SaveModel() { var rEnum = SketchControlsScript.GlobalCommands.SaveModel; @@ -332,77 +334,81 @@ public static void SaveModel() // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); // } - [ApiEndpoint("camerapath.render")] + // TDOO Test + [ApiEndpoint("camerapath.render", "Renders the current camera path to a video")] public static void RenderCameraPath() { var rEnum = SketchControlsScript.GlobalCommands.RenderCameraPath; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("profiling.toggle")] + [ApiEndpoint("profiling.toggle", "Toggles profiling mode on or off")] public static void ToggleProfiling() { var rEnum = SketchControlsScript.GlobalCommands.ToggleProfiling; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("autoprofile")] - public static void DoAutoProfile() - { - var rEnum = SketchControlsScript.GlobalCommands.DoAutoProfile; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); - } + // // TODO Do we need this? + // [ApiEndpoint("autoprofile", "Runs autoprofile")] + // public static void DoAutoProfile() + // { + // var rEnum = SketchControlsScript.GlobalCommands.DoAutoProfile; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + // } - [ApiEndpoint("settings.toggle")] + // TODO Do we want panel toggles? + [ApiEndpoint("settings.toggle", "Toggles the settings panel on or off")] public static void ToggleSettings() { var rEnum = SketchControlsScript.GlobalCommands.ToggleSettings; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("mirror.summon")] + [ApiEndpoint("mirror.summon", "Summons the mirror origin to the user's position")] public static void SummonMirror() { var rEnum = SketchControlsScript.GlobalCommands.SummonMirror; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("selection.invert")] + [ApiEndpoint("selection.invert", "Inverts the current selection")] public static void InvertSelection() { var rEnum = SketchControlsScript.GlobalCommands.InvertSelection; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("select.all")] + [ApiEndpoint("select.all", "Selects all strokes and widgets in the scene")] public static void SelectAll() { var rEnum = SketchControlsScript.GlobalCommands.SelectAll; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("selection.flip")] + [ApiEndpoint("selection.flip", "Mirrors the current selection")] public static void FlipSelection() { var rEnum = SketchControlsScript.GlobalCommands.FlipSelection; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("brushlab.toggle")] - public static void ToggleBrushLab() - { - var rEnum = SketchControlsScript.GlobalCommands.ToggleBrushLab; - SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); - } + // TODO What does this do? + // [ApiEndpoint("brushlab.toggle")] + // public static void ToggleBrushLab() + // { + // var rEnum = SketchControlsScript.GlobalCommands.ToggleBrushLab; + // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); + // } - [ApiEndpoint("postprocessing.toggle")] + [ApiEndpoint("postprocessing.toggle", "Toggles post-processing effects on or off")] public static void ToggleCameraPostEffects() { var rEnum = SketchControlsScript.GlobalCommands.ToggleCameraPostEffects; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("watermark.toggle")] + [ApiEndpoint("watermark.toggle", "Toggles the watermark on or off")] public static void ToggleWatermark() { var rEnum = SketchControlsScript.GlobalCommands.ToggleWatermark; @@ -451,28 +457,28 @@ public static void ToggleWatermark() // SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); // } - [ApiEndpoint("camerapath.togglevisuals")] + [ApiEndpoint("camerapath.togglevisuals", "Toggles the camera path visuals on or off")] public static void ToggleCameraPathVisuals() { var rEnum = SketchControlsScript.GlobalCommands.ToggleCameraPathVisuals; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("camerapath.togglepreview")] + [ApiEndpoint("camerapath.togglepreview", "Toggles the camera path preview on or off")] public static void ToggleCameraPathPreview() { var rEnum = SketchControlsScript.GlobalCommands.ToggleCameraPathPreview; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("camerapath.delete")] + [ApiEndpoint("camerapath.delete", "Deletes the current camera path")] public static void DeleteCameraPath() { var rEnum = SketchControlsScript.GlobalCommands.DeleteCameraPath; SketchControlsScript.m_Instance.IssueGlobalCommand(rEnum); } - [ApiEndpoint("camerapath.record")] + [ApiEndpoint("camerapath.record", "Starts recording a camera path")] public static void RecordCameraPath() { var rEnum = SketchControlsScript.GlobalCommands.RecordCameraPath; From ad3b9d7ddbe1f77103af37c0f996b34a50b91596 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Sat, 22 May 2021 17:04:58 +0100 Subject: [PATCH 031/769] Remove example scripts from Support folder [CI BUILD] --- Support/API Examples/JSON to Stroke.html | 18 ---------- Support/API Examples/Repeated Form.html | 44 ------------------------ Support/API Examples/SVG Path.html | 14 -------- Support/API Examples/Simple Form.html | 11 ------ 4 files changed, 87 deletions(-) delete mode 100644 Support/API Examples/JSON to Stroke.html delete mode 100644 Support/API Examples/Repeated Form.html delete mode 100644 Support/API Examples/SVG Path.html delete mode 100644 Support/API Examples/Simple Form.html diff --git a/Support/API Examples/JSON to Stroke.html b/Support/API Examples/JSON to Stroke.html deleted file mode 100644 index 35ff241368..0000000000 --- a/Support/API Examples/JSON to Stroke.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
-
-
-
-
- - -
- - \ No newline at end of file diff --git a/Support/API Examples/Repeated Form.html b/Support/API Examples/Repeated Form.html deleted file mode 100644 index cfc9378832..0000000000 --- a/Support/API Examples/Repeated Form.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Support/API Examples/SVG Path.html b/Support/API Examples/SVG Path.html deleted file mode 100644 index 01d951f104..0000000000 --- a/Support/API Examples/SVG Path.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - -
-
- - -
- - \ No newline at end of file diff --git a/Support/API Examples/Simple Form.html b/Support/API Examples/Simple Form.html deleted file mode 100644 index 9e8627e102..0000000000 --- a/Support/API Examples/Simple Form.html +++ /dev/null @@ -1,11 +0,0 @@ - - - -
- - - - -
- - \ No newline at end of file From 463240a4fe5a419b6724150ac3fc18d58d8dc661 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Sun, 23 May 2021 23:08:43 +0100 Subject: [PATCH 032/769] Bugfix and another example script --- Assets/Resources/ScriptExamples/barcode.html | 33 +++++++++++++++++++ .../ScriptExamples/barcode.html.meta | 7 ++++ Assets/Scripts/API/ApiMethods.cs | 17 ++++------ 3 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 Assets/Resources/ScriptExamples/barcode.html create mode 100644 Assets/Resources/ScriptExamples/barcode.html.meta diff --git a/Assets/Resources/ScriptExamples/barcode.html b/Assets/Resources/ScriptExamples/barcode.html new file mode 100644 index 0000000000..b4723afedf --- /dev/null +++ b/Assets/Resources/ScriptExamples/barcode.html @@ -0,0 +1,33 @@ + + + + + \ No newline at end of file diff --git a/Assets/Resources/ScriptExamples/barcode.html.meta b/Assets/Resources/ScriptExamples/barcode.html.meta new file mode 100644 index 0000000000..2f52bb2223 --- /dev/null +++ b/Assets/Resources/ScriptExamples/barcode.html.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 691e8db77228a6747b13c446541d0b7e +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/API/ApiMethods.cs b/Assets/Scripts/API/ApiMethods.cs index 227b6d3150..0373133ef3 100644 --- a/Assets/Scripts/API/ApiMethods.cs +++ b/Assets/Scripts/API/ApiMethods.cs @@ -149,21 +149,16 @@ public static void SetColorHSV(Vector3 hsv) [ApiEndpoint("color.set.html", "Sets the current color. colorString can either be a hex value or a css color name.")] public static void SetColorHTML(string color) { - - Color currentColor; - string colorString; - - colorString = color; - if (CssColors.NamesToHex.ContainsKey(color)) colorString = CssColors.NamesToHex[color]; - if (!color.StartsWith("#")) colorString = $"#{color}"; - - if (ColorUtility.TryParseHtmlString($"#{color}", out currentColor)) + Color c; + if (CssColors.NamesToHex.ContainsKey(color)) color = CssColors.NamesToHex[color]; + if (!color.StartsWith("#")) color = $"#{color}"; + if (ColorUtility.TryParseHtmlString(color, out c)) { - App.BrushColor.CurrentColor = currentColor; + App.BrushColor.CurrentColor = c; } else { - Debug.LogError("Invalid color: {color}"); + Debug.LogError($"Invalid color: {color}"); } } From 3d4dd4165eae9adfc3f194b5be352e0eb3fa18db Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Tue, 25 May 2021 17:19:17 +0100 Subject: [PATCH 033/769] It's kinda bearable now. UI still needs work and we don't have the "ghosting" effect of the existing widget snapping --- Assets/Scripts/GUI/SnapAngleButton.cs | 13 ++++++------ Assets/Scripts/SelectionManager.cs | 7 ++++--- Assets/Scripts/Widgets/GrabWidget.cs | 2 +- Assets/Scripts/Widgets/SelectionWidget.cs | 24 +++++++++++++++++++++-- 4 files changed, 34 insertions(+), 12 deletions(-) diff --git a/Assets/Scripts/GUI/SnapAngleButton.cs b/Assets/Scripts/GUI/SnapAngleButton.cs index fbc7050128..6d300d4e87 100644 --- a/Assets/Scripts/GUI/SnapAngleButton.cs +++ b/Assets/Scripts/GUI/SnapAngleButton.cs @@ -1,4 +1,5 @@ -namespace TiltBrush +using UnityEngine; +namespace TiltBrush { class SnapAngleButton : MultistateButton { @@ -7,20 +8,20 @@ protected override float OptionAngleDeltaDegrees { get { - return 60; // Looks weird if the angle is too shallow so fake it + return 120; // Button looks weird if the angle is too shallow so fake it } } - - protected virtual void OnStart() + + protected override void OnStart() { CreateOptionSides(); ForceSelectedOption(SelectionManager.m_Instance.CurrentSnapIndex); } - override protected void OnButtonPressed() + protected override void OnButtonPressed() { SetSelectedOption((m_CurrentOptionIdx + 1) % NumOptions); - SelectionManager.m_Instance.IncrementSnappingAngle(); + SelectionManager.m_Instance.SetSnappingAngle(m_CurrentOptionIdx); } } diff --git a/Assets/Scripts/SelectionManager.cs b/Assets/Scripts/SelectionManager.cs index 03de755789..55a052ffd4 100644 --- a/Assets/Scripts/SelectionManager.cs +++ b/Assets/Scripts/SelectionManager.cs @@ -939,12 +939,13 @@ Bounds GetBoundsOfSelectedWidgets_SelectionCanvasSpace() public void IncrementSnappingAngle() { - m_CurrentSnapIndex = CurrentSnapIndex + 1; - m_CurrentSnapIndex = CurrentSnapIndex % m_AngleSnaps.Length; - SetSnappingAngle(CurrentSnapIndex); + m_CurrentSnapIndex++; + m_CurrentSnapIndex = m_CurrentSnapIndex % m_AngleSnaps.Length; + SetSnappingAngle(m_CurrentSnapIndex); } public void SetSnappingAngle(int snapIndex) { + m_CurrentSnapIndex = snapIndex; m_snappingAngle = m_AngleSnaps[snapIndex]; } } diff --git a/Assets/Scripts/Widgets/GrabWidget.cs b/Assets/Scripts/Widgets/GrabWidget.cs index 45b16ef7db..d70d4b6600 100644 --- a/Assets/Scripts/Widgets/GrabWidget.cs +++ b/Assets/Scripts/Widgets/GrabWidget.cs @@ -215,7 +215,7 @@ void ForceSnapDisabled() m_SnapEnabledTimeStamp = 0.0f; } - protected bool SnapEnabled + protected virtual bool SnapEnabled { get { diff --git a/Assets/Scripts/Widgets/SelectionWidget.cs b/Assets/Scripts/Widgets/SelectionWidget.cs index ce05af2dd8..aa13096446 100644 --- a/Assets/Scripts/Widgets/SelectionWidget.cs +++ b/Assets/Scripts/Widgets/SelectionWidget.cs @@ -25,6 +25,7 @@ public class SelectionWidget : GrabWidget [SerializeField] private CanvasScript m_SelectionCanvas; private TrTransform m_xfOriginal_SS = TrTransform.identity; + private Quaternion m_PrevSnapRotation; private Bounds? m_SelectionBounds_CS; private InputManager.ControllerName? m_CurrentIntersectionController; @@ -133,12 +134,31 @@ protected override bool AllowSnapping() return SelectionManager.m_Instance.CurrentSnapIndex != 0; } - protected override TrTransform GetSnappedTransform(TrTransform xf_GS) + protected override void InitiateSnapping() { + base.InitiateSnapping(); + m_PrevSnapRotation = Quaternion.identity; + } + protected override TrTransform GetSnappedTransform(TrTransform xf_GS) + { TrTransform outXf_GS = xf_GS; + Quaternion nearestSnapRotation = QuantizeAngle(xf_GS.rotation); + + float snapAngle = SelectionManager.m_Instance.SnappingAngle; + float stickiness = m_ValidSnapRotationStickyAngle / 90f; + float stickyAngle = snapAngle * stickiness; - outXf_GS.rotation = App.Scene.Pose.rotation * QuantizeAngle(xf_GS.rotation); + if (nearestSnapRotation != m_PrevSnapRotation) + { + float a = Quaternion.Angle(xf_GS.rotation, App.Scene.Pose.rotation * m_PrevSnapRotation); + if (a > stickyAngle) + { + m_PrevSnapRotation = nearestSnapRotation; + } + } + + outXf_GS.rotation = App.Scene.Pose.rotation * m_PrevSnapRotation; Quaternion qDelta = outXf_GS.rotation * Quaternion.Inverse(xf_GS.rotation); Vector3 grabSpot = InputManager.m_Instance.GetControllerPosition(m_InteractingController); From 67a8540f88724845a31220c5a6bf3ccd44b365a6 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Wed, 26 May 2021 09:59:22 +0100 Subject: [PATCH 034/769] Kind of wobbly semi-working position snapping [CI BUILD] --- .../Prefabs/Panels/SnapSettingsPanel.prefab | 365 ++++++++++++------ Assets/Scripts/GUI/SnapAngleButton.cs | 28 -- Assets/Scripts/GUI/SnapAngleButton.cs.meta | 3 - Assets/Scripts/GUI/SnapSettingsButton.cs | 56 +++ Assets/Scripts/GUI/SnapSettingsButton.cs.meta | 3 + Assets/Scripts/SelectionManager.cs | 26 +- Assets/Scripts/Widgets/SelectionWidget.cs | 56 ++- 7 files changed, 367 insertions(+), 170 deletions(-) delete mode 100644 Assets/Scripts/GUI/SnapAngleButton.cs delete mode 100644 Assets/Scripts/GUI/SnapAngleButton.cs.meta create mode 100644 Assets/Scripts/GUI/SnapSettingsButton.cs create mode 100644 Assets/Scripts/GUI/SnapSettingsButton.cs.meta diff --git a/Assets/Prefabs/Panels/SnapSettingsPanel.prefab b/Assets/Prefabs/Panels/SnapSettingsPanel.prefab index 5c2d619282..7d7f648444 100644 --- a/Assets/Prefabs/Panels/SnapSettingsPanel.prefab +++ b/Assets/Prefabs/Panels/SnapSettingsPanel.prefab @@ -29,7 +29,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 0.01} m_Children: [] m_Father: {fileID: 402684} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!33 &3364774 MeshFilter: @@ -66,7 +66,8 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 4000010460034712} + - {fileID: 1798291561020739511} + - {fileID: 8017746296849009521} - {fileID: 4000011486688576} - {fileID: 499404} - {fileID: 415298} @@ -146,7 +147,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 402684} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!65 &6547610 BoxCollider: @@ -301,7 +302,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 739d5b1996234d64992a2ae60c3723e9, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!1 &1000011220362354 +--- !u!1 &1000012292180826 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -309,47 +310,46 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 4000010460034712} - - component: {fileID: 33000010384743742} - - component: {fileID: 23000011739358534} - - component: {fileID: 65000012576733834} - - component: {fileID: 114000013288942322} + - component: {fileID: 4000011486688576} + - component: {fileID: 33000013181835044} + - component: {fileID: 23000010265477920} + - component: {fileID: 114122489900507968} m_Layer: 16 - m_Name: ChangeSnapAngle + m_Name: Border m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &4000010460034712 +--- !u!4 &4000011486688576 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1000011220362354} + m_GameObject: {fileID: 1000012292180826} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.415, y: 0.6, z: 0.05} - m_LocalScale: {x: 0.35, y: 0.35, z: 0.35} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 402684} - m_RootOrder: 0 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &33000010384743742 +--- !u!33 &33000013181835044 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1000011220362354} - m_Mesh: {fileID: 4300000, guid: 5501f437160666942ae970f3648fbeb8, type: 3} ---- !u!23 &23000011739358534 + m_GameObject: {fileID: 1000012292180826} + m_Mesh: {fileID: 4300000, guid: 16fad2a698203b44bb45a3844e1ad126, type: 3} +--- !u!23 &23000010265477920 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1000011220362354} + m_GameObject: {fileID: 1000012292180826} m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 @@ -361,7 +361,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 40d29de2bdc11f04dbfa25059165916e, type: 2} + - {fileID: 2100000, guid: 3e92ccbfed650604686991e69902e663, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -382,66 +382,99 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!65 &65000012576733834 -BoxCollider: +--- !u!114 &114122489900507968 +MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1000011220362354} - m_Material: {fileID: 0} - m_IsTrigger: 0 + m_GameObject: {fileID: 1000012292180826} m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 0.1} - m_Center: {x: -0.000000074505806, y: 0.000000022351742, z: 0} ---- !u!114 &114000013288942322 -MonoBehaviour: + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1aaefde5afe80784e908d27fcb05a101, type: 3} + m_Name: + m_EditorClassIdentifier: + m_OffsetOverride: -1 +--- !u!1 &1000013998383226 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4000014070374570} + - component: {fileID: 33000011026480406} + - component: {fileID: 23000011541467852} + m_Layer: 16 + m_Name: _Bounds(inactive) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &4000014070374570 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000013998383226} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.5, y: 1.9, z: 2.4} + m_Children: [] + m_Father: {fileID: 485948} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &33000011026480406 +MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1000011220362354} + m_GameObject: {fileID: 1000013998383226} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &23000011541467852 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000013998383226} m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0c8ed0bc532a4315a6e5c6bef653e7e1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_DescriptionType: 0 - m_DescriptionYOffset: 0 - m_DescriptionText: Snap Angle - m_DescriptionTextExtra: - m_DescriptionActivateSpeed: 12 - m_DescriptionZScale: 1 - m_ButtonTexture: {fileID: 0} - m_AtlasTexture: 0 - m_ToggleButton: 0 - m_LongPressReleaseButton: 0 - m_ButtonHasPressedAudio: 1 - m_ZAdjustHover: -0.02 - m_ZAdjustClick: 0.05 - m_HoverScale: 1.1 - m_HoverBoxColliderGrow: 0.2 - m_AddOverlay: 0 - m_ShowRotation: 1 - m_RotationSpeedMultiplier: 14.3 - m_Command: 0 - m_Options: - - m_Description: Off - m_Texture: {fileID: 2800000, guid: bcd7d8c1894256240ab73a089d217cb2, type: 3} - - m_Description: 15 - m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} - - m_Description: 30 - m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} - - m_Description: 45 - m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} - - m_Description: 60 - m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} - - m_Description: 75 - m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} - - m_Description: 90 - m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} ---- !u!1 &1000012292180826 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 0 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + 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_ReceiveGI: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + 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!1 &80409638576894910 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -449,46 +482,47 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 4000011486688576} - - component: {fileID: 33000013181835044} - - component: {fileID: 23000010265477920} - - component: {fileID: 114122489900507968} + - component: {fileID: 1798291561020739511} + - component: {fileID: 5596165672658968655} + - component: {fileID: 3557061887800810907} + - component: {fileID: 6575849715173740422} + - component: {fileID: 1840553773833534728} m_Layer: 16 - m_Name: Border + m_Name: ChangeSnapAngle m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &4000011486688576 +--- !u!4 &1798291561020739511 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1000012292180826} + m_GameObject: {fileID: 80409638576894910} 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_LocalPosition: {x: -0.415, y: 0.6, z: 0.05} + m_LocalScale: {x: 0.35, y: 0.35, z: 0.35} m_Children: [] m_Father: {fileID: 402684} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &33000013181835044 +--- !u!33 &5596165672658968655 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1000012292180826} - m_Mesh: {fileID: 4300000, guid: 16fad2a698203b44bb45a3844e1ad126, type: 3} ---- !u!23 &23000010265477920 + m_GameObject: {fileID: 80409638576894910} + m_Mesh: {fileID: 4300000, guid: 5501f437160666942ae970f3648fbeb8, type: 3} +--- !u!23 &3557061887800810907 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1000012292180826} + m_GameObject: {fileID: 80409638576894910} m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 @@ -500,7 +534,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 3e92ccbfed650604686991e69902e663, type: 2} + - {fileID: 2100000, guid: 40d29de2bdc11f04dbfa25059165916e, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -521,20 +555,67 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!114 &114122489900507968 +--- !u!65 &6575849715173740422 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 80409638576894910} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 0.1} + m_Center: {x: -0.000000074505806, y: 0.000000022351742, z: 0} +--- !u!114 &1840553773833534728 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1000012292180826} + m_GameObject: {fileID: 80409638576894910} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1aaefde5afe80784e908d27fcb05a101, type: 3} + m_Script: {fileID: 11500000, guid: 6b355573aff342a999e2625a502d2c4d, type: 3} m_Name: m_EditorClassIdentifier: - m_OffsetOverride: -1 ---- !u!1 &1000013998383226 + m_DescriptionType: 0 + m_DescriptionYOffset: 0 + m_DescriptionText: Snap Angle + m_DescriptionTextExtra: + m_DescriptionActivateSpeed: 12 + m_DescriptionZScale: 1 + m_ButtonTexture: {fileID: 0} + m_AtlasTexture: 0 + m_ToggleButton: 0 + m_LongPressReleaseButton: 0 + m_ButtonHasPressedAudio: 1 + m_ZAdjustHover: -0.02 + m_ZAdjustClick: 0.05 + m_HoverScale: 1.1 + m_HoverBoxColliderGrow: 0.2 + m_AddOverlay: 0 + m_ShowRotation: 1 + m_RotationSpeedMultiplier: 14.3 + m_Command: 0 + m_Options: + - m_Description: Off + m_Texture: {fileID: 2800000, guid: bcd7d8c1894256240ab73a089d217cb2, type: 3} + - m_Description: 15 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} + - m_Description: 30 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} + - m_Description: 45 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} + - m_Description: 60 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} + - m_Description: 75 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} + - m_Description: 90 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} + SettingType: 0 +--- !u!1 &4760301089406437960 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -542,57 +623,59 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 4000014070374570} - - component: {fileID: 33000011026480406} - - component: {fileID: 23000011541467852} + - component: {fileID: 8017746296849009521} + - component: {fileID: 5743623064989555339} + - component: {fileID: 7634416871141557246} + - component: {fileID: 7160979865543332570} + - component: {fileID: 4021416706056454020} m_Layer: 16 - m_Name: _Bounds(inactive) + m_Name: ChangeSnapGrid m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!4 &4000014070374570 + m_IsActive: 1 +--- !u!4 &8017746296849009521 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1000013998383226} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.5, y: 1.9, z: 2.4} + m_GameObject: {fileID: 4760301089406437960} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.415, y: 0.09, z: 0.05} + m_LocalScale: {x: 0.35, y: 0.35, z: 0.35} m_Children: [] - m_Father: {fileID: 485948} - m_RootOrder: 0 + m_Father: {fileID: 402684} + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &33000011026480406 +--- !u!33 &5743623064989555339 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1000013998383226} - m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} ---- !u!23 &23000011541467852 + m_GameObject: {fileID: 4760301089406437960} + m_Mesh: {fileID: 4300000, guid: 5501f437160666942ae970f3648fbeb8, type: 3} +--- !u!23 &7634416871141557246 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1000013998383226} + m_GameObject: {fileID: 4760301089406437960} m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 m_DynamicOccludee: 1 - m_MotionVectors: 0 + m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: 40d29de2bdc11f04dbfa25059165916e, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -601,7 +684,7 @@ MeshRenderer: m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 m_ReceiveGI: 1 - m_PreserveUVs: 1 + m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 m_StitchLightmapSeams: 0 @@ -613,3 +696,61 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 +--- !u!65 &7160979865543332570 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4760301089406437960} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 0.1} + m_Center: {x: -0.000000074505806, y: 0.000000022351742, z: 0} +--- !u!114 &4021416706056454020 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4760301089406437960} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6b355573aff342a999e2625a502d2c4d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_DescriptionType: 0 + m_DescriptionYOffset: 0 + m_DescriptionText: Snap Grid Size + m_DescriptionTextExtra: + m_DescriptionActivateSpeed: 12 + m_DescriptionZScale: 1 + m_ButtonTexture: {fileID: 0} + m_AtlasTexture: 0 + m_ToggleButton: 0 + m_LongPressReleaseButton: 0 + m_ButtonHasPressedAudio: 1 + m_ZAdjustHover: -0.02 + m_ZAdjustClick: 0.05 + m_HoverScale: 1.1 + m_HoverBoxColliderGrow: 0.2 + m_AddOverlay: 0 + m_ShowRotation: 1 + m_RotationSpeedMultiplier: 14.3 + m_Command: 0 + m_Options: + - m_Description: Off + m_Texture: {fileID: 2800000, guid: bcd7d8c1894256240ab73a089d217cb2, type: 3} + - m_Description: 1 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} + - m_Description: 5 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} + - m_Description: 10 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} + - m_Description: 25 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} + - m_Description: 50 + m_Texture: {fileID: 2800000, guid: c0d6e5dae8ebd284399fe8a50337bbc4, type: 3} + SettingType: 1 diff --git a/Assets/Scripts/GUI/SnapAngleButton.cs b/Assets/Scripts/GUI/SnapAngleButton.cs deleted file mode 100644 index 6d300d4e87..0000000000 --- a/Assets/Scripts/GUI/SnapAngleButton.cs +++ /dev/null @@ -1,28 +0,0 @@ -using UnityEngine; -namespace TiltBrush -{ - class SnapAngleButton : MultistateButton - { - - protected override float OptionAngleDeltaDegrees - { - get - { - return 120; // Button looks weird if the angle is too shallow so fake it - } - } - - protected override void OnStart() - { - CreateOptionSides(); - ForceSelectedOption(SelectionManager.m_Instance.CurrentSnapIndex); - } - - protected override void OnButtonPressed() - { - SetSelectedOption((m_CurrentOptionIdx + 1) % NumOptions); - SelectionManager.m_Instance.SetSnappingAngle(m_CurrentOptionIdx); - } - - } -} diff --git a/Assets/Scripts/GUI/SnapAngleButton.cs.meta b/Assets/Scripts/GUI/SnapAngleButton.cs.meta deleted file mode 100644 index 2c3de8ccf1..0000000000 --- a/Assets/Scripts/GUI/SnapAngleButton.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 0c8ed0bc532a4315a6e5c6bef653e7e1 -timeCreated: 1620837659 \ No newline at end of file diff --git a/Assets/Scripts/GUI/SnapSettingsButton.cs b/Assets/Scripts/GUI/SnapSettingsButton.cs new file mode 100644 index 0000000000..066c021bcf --- /dev/null +++ b/Assets/Scripts/GUI/SnapSettingsButton.cs @@ -0,0 +1,56 @@ +using System; +using UnityEngine; +namespace TiltBrush +{ + class SnapSettingsButton : MultistateButton + { + + [Serializable] + public enum SettingTypes + { + Angle, + GridSize + } + + public SettingTypes SettingType; + + protected override float OptionAngleDeltaDegrees + { + get + { + return 120; // Button looks weird if the angle is too shallow so fake it + } + } + + protected override void OnStart() + { + CreateOptionSides(); + int optionIndex = -1; + switch (SettingType) + { + case SettingTypes.Angle: + optionIndex = SelectionManager.m_Instance.CurrentSnapAngleIndex; + break; + case SettingTypes.GridSize: + optionIndex = SelectionManager.m_Instance.CurrentSnapGridIndex; + break; + } + ForceSelectedOption(optionIndex); + } + + protected override void OnButtonPressed() + { + SetSelectedOption((m_CurrentOptionIdx + 1) % NumOptions); + switch (SettingType) + { + case SettingTypes.Angle: + SelectionManager.m_Instance.SetSnappingAngle(m_CurrentOptionIdx); + break; + case SettingTypes.GridSize: + SelectionManager.m_Instance.SetSnappingGridSize(m_CurrentOptionIdx); + break; + } + } + + } +} diff --git a/Assets/Scripts/GUI/SnapSettingsButton.cs.meta b/Assets/Scripts/GUI/SnapSettingsButton.cs.meta new file mode 100644 index 0000000000..acf1c70ef9 --- /dev/null +++ b/Assets/Scripts/GUI/SnapSettingsButton.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6b355573aff342a999e2625a502d2c4d +timeCreated: 1621961875 \ No newline at end of file diff --git a/Assets/Scripts/SelectionManager.cs b/Assets/Scripts/SelectionManager.cs index 55a052ffd4..8a9f5b6294 100644 --- a/Assets/Scripts/SelectionManager.cs +++ b/Assets/Scripts/SelectionManager.cs @@ -69,8 +69,11 @@ public class SelectionManager : MonoBehaviour private BaseTool.ToolType m_ToolTypeBeforeGrabbingGroup; private float m_snappingAngle; + private float m_snappingGridSize; private float[] m_AngleSnaps; - private int m_CurrentSnapIndex; + private float[] m_GridSnaps; + private int m_CurrentSnapAngleIndex; + private int m_CurrentSnapGridIndex; // As opposed to 'add to selection'. When this is true, strokes picked up // by the selection tool will be removed from selected strokes. When false, they'll be added @@ -261,8 +264,10 @@ public TrTransform SelectionTransform } public bool IsAnimatingTossFromGrabbingGroup => m_IsAnimatingTossFromGrabbingGroup; - public int CurrentSnapIndex => m_CurrentSnapIndex; + public int CurrentSnapAngleIndex => m_CurrentSnapAngleIndex; + public int CurrentSnapGridIndex => m_CurrentSnapGridIndex; public float SnappingAngle => m_snappingAngle; + public float SnappingGridSize => m_snappingGridSize; /// Returns the active strokes in the given group. public IEnumerable StrokesInGroup(SketchGroupTag group) @@ -387,6 +392,7 @@ void Awake() m_SelectedStrokes = new HashSet(); m_SelectedWidgets = new HashSet(); m_AngleSnaps = new[] {0f, 15f, 30f, 45f, 60f, 75f, 90f}; + m_GridSnaps = new[] {0f, 1f, 5f, 10f, 25f, 50f}; } public void CacheSelectionTool(SelectionTool tool) @@ -937,17 +943,19 @@ Bounds GetBoundsOfSelectedWidgets_SelectionCanvasSpace() return totalBounds_CS; } - public void IncrementSnappingAngle() - { - m_CurrentSnapIndex++; - m_CurrentSnapIndex = m_CurrentSnapIndex % m_AngleSnaps.Length; - SetSnappingAngle(m_CurrentSnapIndex); - } public void SetSnappingAngle(int snapIndex) { - m_CurrentSnapIndex = snapIndex; + m_CurrentSnapAngleIndex = snapIndex; m_snappingAngle = m_AngleSnaps[snapIndex]; } + + public void SetSnappingGridSize(int snapIndex) + { + m_CurrentSnapGridIndex = snapIndex; + m_snappingGridSize = m_GridSnaps[snapIndex]; + } + + } } // namespace TiltBrush diff --git a/Assets/Scripts/Widgets/SelectionWidget.cs b/Assets/Scripts/Widgets/SelectionWidget.cs index aa13096446..8df440e037 100644 --- a/Assets/Scripts/Widgets/SelectionWidget.cs +++ b/Assets/Scripts/Widgets/SelectionWidget.cs @@ -128,10 +128,20 @@ private Quaternion QuantizeAngle(Quaternion rotation) euler = new Vector3(round(euler.x), round(euler.y), round(euler.z)); return Quaternion.Euler(euler); } + + private Vector3 QuantizePosition(Vector3 pos) + { + float gridSize = SelectionManager.m_Instance.SnappingGridSize; + float round(float val) {return Mathf.Round(val / gridSize) * gridSize;} + return new Vector3(round(pos.x), round(pos.y), round(pos.z)); + } protected override bool AllowSnapping() { - return SelectionManager.m_Instance.CurrentSnapIndex != 0; + return ( + SelectionManager.m_Instance.CurrentSnapAngleIndex != 0 || + SelectionManager.m_Instance.CurrentSnapGridIndex != 0 + ); } protected override void InitiateSnapping() @@ -143,30 +153,40 @@ protected override void InitiateSnapping() protected override TrTransform GetSnappedTransform(TrTransform xf_GS) { TrTransform outXf_GS = xf_GS; - Quaternion nearestSnapRotation = QuantizeAngle(xf_GS.rotation); - - float snapAngle = SelectionManager.m_Instance.SnappingAngle; - float stickiness = m_ValidSnapRotationStickyAngle / 90f; - float stickyAngle = snapAngle * stickiness; - if (nearestSnapRotation != m_PrevSnapRotation) + if (SelectionManager.m_Instance.CurrentSnapAngleIndex != 0) { - float a = Quaternion.Angle(xf_GS.rotation, App.Scene.Pose.rotation * m_PrevSnapRotation); - if (a > stickyAngle) + Quaternion nearestSnapRotation = QuantizeAngle(xf_GS.rotation); + + float snapAngle = SelectionManager.m_Instance.SnappingAngle; + float stickiness = m_ValidSnapRotationStickyAngle / 90f; + float stickyAngle = snapAngle * stickiness; + + if (nearestSnapRotation != m_PrevSnapRotation) { - m_PrevSnapRotation = nearestSnapRotation; + float a = Quaternion.Angle(xf_GS.rotation, App.Scene.Pose.rotation * m_PrevSnapRotation); + if (a > stickyAngle) + { + m_PrevSnapRotation = nearestSnapRotation; + } } - } - outXf_GS.rotation = App.Scene.Pose.rotation * m_PrevSnapRotation; + outXf_GS.rotation = App.Scene.Pose.rotation * m_PrevSnapRotation; - Quaternion qDelta = outXf_GS.rotation * Quaternion.Inverse(xf_GS.rotation); - Vector3 grabSpot = InputManager.m_Instance.GetControllerPosition(m_InteractingController); - Vector3 grabToCenter = xf_GS.translation - grabSpot; - outXf_GS.translation = grabSpot + qDelta * grabToCenter; - - return outXf_GS; + Quaternion qDelta = outXf_GS.rotation * Quaternion.Inverse(xf_GS.rotation); + Vector3 grabSpot = InputManager.m_Instance.GetControllerPosition(m_InteractingController); + Vector3 grabToCenter = xf_GS.translation - grabSpot; + outXf_GS.translation = grabSpot + qDelta * grabToCenter; + } + if (SelectionManager.m_Instance.CurrentSnapGridIndex != 0) + { + var outXf_CS = outXf_GS.TransformBy(App.Scene.Pose.inverse); + outXf_CS.translation = QuantizePosition(outXf_CS.translation); + outXf_GS = outXf_CS.TransformBy(App.Scene.Pose); + } + + return outXf_GS; } override protected void SetWidgetSizeInternal(float fSize) From f24c435edc24e74eefddc715eae9a88981fa9dc0 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Thu, 27 May 2021 16:38:29 +0100 Subject: [PATCH 035/769] Bug fixes. A few new brush commands and two new scripts [CI BUILD] --- .../Resources/ScriptExamples/buildings.html | 2 +- .../ScriptExamples/koch snowflake.html | 115 ++++++++++++++++++ .../ScriptExamples/koch snowflake.html.meta | 7 ++ .../Resources/ScriptExamples/parametric.html | 3 +- .../simple_form_with_repeats.html | 2 +- .../ScriptExamples/simple_javascript.html | 2 +- .../ScriptExamples/simple_path_form.html | 2 +- .../ScriptExamples/turtle graphics.html | 65 ++++++++++ .../ScriptExamples/turtle graphics.html.meta | 7 ++ Assets/Scripts/API/ApiManager.cs | 9 +- Assets/Scripts/API/ApiMethods.cs | 61 +++++++++- 11 files changed, 260 insertions(+), 15 deletions(-) create mode 100644 Assets/Resources/ScriptExamples/koch snowflake.html create mode 100644 Assets/Resources/ScriptExamples/koch snowflake.html.meta create mode 100644 Assets/Resources/ScriptExamples/turtle graphics.html create mode 100644 Assets/Resources/ScriptExamples/turtle graphics.html.meta diff --git a/Assets/Resources/ScriptExamples/buildings.html b/Assets/Resources/ScriptExamples/buildings.html index 07bd437494..2af666eb90 100644 --- a/Assets/Resources/ScriptExamples/buildings.html +++ b/Assets/Resources/ScriptExamples/buildings.html @@ -120,7 +120,7 @@

Drawing

var floorHeight = parseFloat(document.getElementById('floorHeight').value); sendCommands([ - 'brush.size=' + document.getElementById('brush.size').value, + 'brush.size.set=' + document.getElementById('brush.size').value, 'brush.type=' + document.getElementById('brush.type').value, 'color.set.html=' + document.getElementById('brush.color').value, ]); diff --git a/Assets/Resources/ScriptExamples/koch snowflake.html b/Assets/Resources/ScriptExamples/koch snowflake.html new file mode 100644 index 0000000000..7d774bb6d3 --- /dev/null +++ b/Assets/Resources/ScriptExamples/koch snowflake.html @@ -0,0 +1,115 @@ + + + + +
+
+
+ + + +

+ + +

Thanks to Shoseki for the script

+ + + + + \ No newline at end of file diff --git a/Assets/Resources/ScriptExamples/koch snowflake.html.meta b/Assets/Resources/ScriptExamples/koch snowflake.html.meta new file mode 100644 index 0000000000..a52d00bf4e --- /dev/null +++ b/Assets/Resources/ScriptExamples/koch snowflake.html.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c722a3fa078168d47a3526ba6f3841e3 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/ScriptExamples/parametric.html b/Assets/Resources/ScriptExamples/parametric.html index 0d16c57f29..7256bbc554 100644 --- a/Assets/Resources/ScriptExamples/parametric.html +++ b/Assets/Resources/ScriptExamples/parametric.html @@ -56,7 +56,6 @@

Formula

xmlHttp.send(null); } - // noqa var brushes = {{brushesJson}}; var menu = document.getElementById("brush.type"); for (var brush of brushes) { @@ -107,7 +106,7 @@

Formula

var vinc = (vmax - vmin) / vsteps; sendCommands([ - 'brush.size=' + document.getElementById('brush.size').value, + 'brush.size.set=' + document.getElementById('brush.size').value, 'brush.type=' + document.getElementById('brush.type').value, ]); diff --git a/Assets/Resources/ScriptExamples/simple_form_with_repeats.html b/Assets/Resources/ScriptExamples/simple_form_with_repeats.html index d1aa0330f2..49b5ac99f3 100644 --- a/Assets/Resources/ScriptExamples/simple_form_with_repeats.html +++ b/Assets/Resources/ScriptExamples/simple_form_with_repeats.html @@ -13,7 +13,7 @@ sendCommands([ 'color.set.html=red', - 'brush.size=0.25', + 'brush.size.set=0.25', 'brush.type=fire', ]); diff --git a/Assets/Resources/ScriptExamples/simple_javascript.html b/Assets/Resources/ScriptExamples/simple_javascript.html index ed7e6c59fe..db57e243a8 100644 --- a/Assets/Resources/ScriptExamples/simple_javascript.html +++ b/Assets/Resources/ScriptExamples/simple_javascript.html @@ -13,7 +13,7 @@ sendCommands([ 'brush.color=red', - 'brush.size=0.5', + 'brush.size.set=0.5', 'brush.type=comet', ]); diff --git a/Assets/Resources/ScriptExamples/simple_path_form.html b/Assets/Resources/ScriptExamples/simple_path_form.html index 04c363eb60..1cf7341dc0 100644 --- a/Assets/Resources/ScriptExamples/simple_path_form.html +++ b/Assets/Resources/ScriptExamples/simple_path_form.html @@ -6,7 +6,7 @@


-
+