diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..01bb486 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +/[Ll]ibrary/ +/[Tt]emp/ +/[Oo]bj/ +/[Ll]ogs/ +/[Uu]ser[Ss]ettings/ +/[Bb]uilds/ +/[Mm]emoryCaptures/ +/[Rr]ecordings/ +.directory +.vs/ +.idea/ +*.csproj +*.sln +*.slnx diff --git a/Assets/DomeShift.meta b/Assets/DomeShift.meta new file mode 100644 index 0000000..0df1530 --- /dev/null +++ b/Assets/DomeShift.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 12ca7abfa82cf71e8a6822df40c3dac8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/DomeShift/DomeArchitecture.cs b/Assets/DomeShift/DomeArchitecture.cs new file mode 100644 index 0000000..36f5146 --- /dev/null +++ b/Assets/DomeShift/DomeArchitecture.cs @@ -0,0 +1,610 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering; + +namespace DomeShift +{ + internal sealed class DomeArchitecture + { + private const float Deck = 0.02f; + private const float CorridorHalfWidth = 1.86f; + private const float CornerLimit = 68f; + + private readonly Transform shell; + + private DomeArchitecture(Transform shell) + { + this.shell = shell; + } + + public static DomeArchitecture Create(Transform parent, DomeEnvironment profile) + { + Transform foundation = Group(parent, "Foundation and galleries"); + Transform shell = Group(parent, "Glass superstructure"); + var builder = new Builder(profile); + builder.BuildFoundation(foundation); + builder.BuildShell(shell); + return new DomeArchitecture(shell); + } + + public void SetCutaway(bool cutaway) + { + shell.gameObject.SetActive(!cutaway); + } + + private static Transform Group(Transform parent, string name) + { + var node = new GameObject(name); + node.transform.SetParent(parent, false); + return node.transform; + } + + private sealed class Builder + { + private readonly DomeEnvironment profile; + private readonly float heightScale; + private readonly int bays; + private readonly Material concrete; + private readonly Material sandstone; + private readonly Material steel; + private readonly Material aluminum; + private readonly Material mullions; + private readonly Material floor; + private readonly Material floorEdge; + private readonly Material amber; + private readonly Material glass; + private static readonly float[,] Eaves = + { + { 4.70f, 5.05f, 4.60f }, + { 5.10f, 4.95f, 4.75f }, + { 5.75f, 5.10f, 4.90f } + }; + + public Builder(DomeEnvironment profile) + { + this.profile = profile; + heightScale = profile.RoofHeight / 13f; + bays = Mathf.Clamp(profile.RoofBays, 2, 20); + concrete = Material("Cream concrete", "#AFA998", 0f, 0.16f); + sandstone = Material("Sandstone retaining wall", "#AA8B69", 0f, 0.11f); + steel = Material("Slate steel", "#516566", 0.12f, 0.27f); + aluminum = Material("Warm aluminum frame", "#DDDCC5", 0.22f, 0.33f); + mullions = Material("Light gray mullions", "#ABB7AA", 0.12f, 0.27f); + floor = Material("Gallery concrete", "#AAB2A1", 0f, 0.19f); + floorEdge = Material("Gallery edge", "#D2CFB7", 0f, 0.2f); + amber = Material("Amber wayfinding paint", "#CC9B50", 0f, 0.22f); + if (profile.Glazing) + glass = GlassMaterial(); + } + + public void BuildFoundation(Transform parent) + { + var retaining = new Geometry(); + var slab = new Geometry(); + var steelwork = new Geometry(); + var walkway = new Geometry(); + var edges = new Geometry(); + var paint = new Geometry(); + + Vector2[] outline = Outline(43f, 32f, CornerLimit); + retaining.Prism(Outline(47.6f, 36.8f, 75f), -1.35f, -0.87f); + retaining.Prism(Outline(45.6f, 34.7f, 71.9f), -0.87f, -0.62f); + slab.Prism(outline, -0.62f, -0.07f); + slab.Box(new Vector3(0f, -0.41f, -34.4f), new Vector3(8.4f, 0.68f, 5.3f), Quaternion.identity); + + // Continuous gallery decking on both axes, interrupted only at the crossings. + foreach (float x in new[] { -14f, 14f }) + Gallery(walkway, edges, paint, new Vector2(x, -31.7f), new Vector2(x, 31.7f)); + + foreach (float z in new[] { -10.5f, 10.5f }) + { + Gallery(walkway, edges, paint, new Vector2(-42.8f, z), new Vector2(-14f - CorridorHalfWidth, z)); + Gallery(walkway, edges, paint, new Vector2(-14f + CorridorHalfWidth, z), new Vector2(14f - CorridorHalfWidth, z)); + Gallery(walkway, edges, paint, new Vector2(14f + CorridorHalfWidth, z), new Vector2(42.8f, z)); + } + + Gallery(walkway, edges, paint, new Vector2(0f, -37f), new Vector2(0f, -10.5f - CorridorHalfWidth)); + + for (int side = 0; side < outline.Length; side++) + { + Vector2 a = outline[side]; + Vector2 b = outline[(side + 1) % outline.Length]; + if (side == 0) + { + BuildSill(slab, steelwork, a, new Vector2(-4.25f, a.y)); + BuildSill(slab, steelwork, new Vector2(4.25f, b.y), b); + } + else + BuildSill(slab, steelwork, a, b); + } + + AddEntryBase(slab, steelwork, paint); + foreach (float x in new[] { -39.2f, -14f, 14f, 39.2f }) + { + float z = Mathf.Min(31.95f, CornerLimit - Mathf.Abs(x)); + slab.Box(new Vector3(x, 0.64f, z), new Vector3(0.85f, 1.45f, 0.74f), Quaternion.identity); + steelwork.Box(new Vector3(x, 1.38f, z), new Vector3(0.98f, 0.13f, 0.86f), Quaternion.identity); + } + + retaining.Apply(parent, sandstone, "Stepped desert plinth", profile); + slab.Apply(parent, concrete, "Concrete slab and facade sills", profile); + steelwork.Apply(parent, steel, "Foundation bands", profile); + walkway.Apply(parent, floor, "Crossing galleries", profile); + edges.Apply(parent, floorEdge, "Gallery borders", profile); + paint.Apply(parent, amber, "Service markings", profile); + } + + public void BuildShell(Transform parent) + { + var structure = new Geometry(); + var detail = new Geometry(); + var panes = new Geometry(); + var cladding = new Geometry(); + + // The tall rainforest pyramid is terraced. The adjoining houses use lower hip and ridge roofs. + BuildRoof(structure, detail, panes, -42.9f, -14f, 10.5f, 31.9f, Eaves[2, 0], 13f, 0.16f, 0.08f, true); + BuildRoof(structure, detail, panes, -14f, 14f, 10.5f, 31.9f, Eaves[2, 1], 10.6f, 0.49f, 0.06f); + BuildRoof(structure, detail, panes, 14f, 42.9f, 10.5f, 31.9f, Eaves[2, 2], 9.6f, 0.10f, 0.21f); + + BuildRoof(structure, detail, panes, -42.9f, -14f, -10.5f, 10.5f, Eaves[1, 0], 9.4f, 0.58f, 0.045f); + BuildRoof(structure, detail, panes, -14f, 14f, -10.5f, 10.5f, Eaves[1, 1], 10.35f, 0.18f, 0.08f); + BuildRoof(structure, detail, panes, 14f, 42.9f, -10.5f, 10.5f, Eaves[1, 2], 8.55f, 0.56f, 0.05f); + + BuildRoof(structure, detail, panes, -42.9f, -14f, -31.9f, -10.5f, Eaves[0, 0], 8.4f, 0.03f, 0.56f); + BuildRoof(structure, detail, panes, -14f, 14f, -31.9f, -10.5f, Eaves[0, 1], 8.85f, 0.06f, 0.48f); + BuildRoof(structure, detail, panes, 14f, 42.9f, -31.9f, -10.5f, Eaves[0, 2], 7.95f, 0.48f, 0.045f); + + AddRoofSeams(detail, panes); + AddFacade(structure, detail, panes); + AddEntrySuperstructure(structure, detail, panes, cladding); + + cladding.Apply(parent, concrete, "Airlock canopy", profile); + structure.Apply(parent, aluminum, "Spaceframe and columns", profile); + detail.Apply(parent, mullions, "Pane muntins and wall braces", profile); + if (glass != null) + panes.Apply(parent, glass, "Sage glass panels", profile, false); + } + + private static void Gallery(Geometry walkway, Geometry edges, Geometry paint, Vector2 start, Vector2 end) + { + Vector2 tangent = (end - start).normalized; + Vector2 side = new Vector2(-tangent.y, tangent.x); + Vector3 a = World(start, Deck); + Vector3 b = World(end, Deck); + walkway.Beam(a, b, CorridorHalfWidth * 2f, 0.08f); + + foreach (float sign in new[] { -1f, 1f }) + { + Vector2 border = side * ((CorridorHalfWidth - 0.12f) * sign); + edges.Beam(World(start + border, Deck + 0.045f), World(end + border, Deck + 0.045f), 0.09f, 0.035f); + } + + float length = Vector2.Distance(start, end); + for (float distance = 1.5f; distance < length - 1.3f; distance += 3.6f) + { + Vector2 center = start + tangent * distance; + paint.Beam(World(center - tangent * 0.54f, Deck + 0.046f), World(center + tangent * 0.54f, Deck + 0.046f), + 0.085f, 0.018f); + } + } + + private static void BuildSill(Geometry slab, Geometry steelwork, Vector2 start, Vector2 end) + { + slab.Beam(World(start, 0.25f), World(end, 0.25f), 0.53f, 0.62f); + steelwork.Beam(World(start, 0.58f), World(end, 0.58f), 0.56f, 0.10f); + steelwork.Beam(World(start, -0.22f), World(end, -0.22f), 0.58f, 0.09f); + } + + private static void AddEntryBase(Geometry slab, Geometry steelwork, Geometry paint) + { + foreach (float sign in new[] { -1f, 1f }) + { + float x = 4.12f * sign; + BuildSill(slab, steelwork, new Vector2(x, -37.25f), new Vector2(x, -31.9f)); + steelwork.Box(new Vector3(sign * 3.6f, 0.62f, -36.5f), new Vector3(0.42f, 1.25f, 0.42f), Quaternion.identity); + paint.Box(new Vector3(sign * 3.6f, 1.21f, -36.5f), new Vector3(0.44f, 0.17f, 0.44f), Quaternion.identity); + } + + for (int i = -3; i <= 3; i++) + { + paint.Box(new Vector3(i * 0.48f, Deck + 0.052f, -36.45f), new Vector3(0.18f, 0.02f, 0.58f), + Quaternion.Euler(0f, -34f, 0f)); + } + } + + private void BuildRoof(Geometry structure, Geometry detail, Geometry panes, float left, float right, float front, + float back, float eave, float crown, float crownX, float crownZ, bool terraced = false) + { + Vector2[] rim = ClipCorners(new[] + { + new Vector2(left, front), new Vector2(right, front), new Vector2(right, back), new Vector2(left, back) + }); + var center = new Vector2((left + right) * 0.5f, (front + back) * 0.5f); + Vector3[] lower = ScaledRing(rim, center, 1f, 1f, eave * heightScale); + Vector3[] upper = ScaledRing(rim, center, crownX, crownZ, crown * heightScale); + + if (terraced) + { + float deckHeight = Mathf.Lerp(eave, crown, 0.52f) * heightScale; + Vector3[] shoulder = ScaledRing(rim, center, 0.73f, 0.74f, deckHeight); + Vector3[] step = ScaledRing(rim, center, 0.61f, 0.62f, deckHeight + 0.14f); + AddRoofTier(structure, detail, panes, lower, shoulder, 3); + AddRoofTier(structure, detail, panes, shoulder, step, 1); + AddRoofTier(structure, detail, panes, step, upper, 3); + } + else + AddRoofTier(structure, detail, panes, lower, upper, 4); + + if (glass != null) + { + for (int i = 1; i < upper.Length - 1; i++) + panes.Triangle(upper[0], upper[i], upper[i + 1], true); + } + } + + private void AddRoofTier(Geometry structure, Geometry detail, Geometry panes, Vector3[] lower, Vector3[] upper, int rows) + { + int count = lower.Length; + for (int side = 0; side < count; side++) + { + int next = (side + 1) % count; + float width = Vector3.Distance(lower[side], lower[next]); + int columns = Mathf.Max(1, Mathf.RoundToInt(bays * width / 28f)); + Vector3 bottomLeft = lower[side]; + Vector3 bottomRight = lower[next]; + Vector3 topLeft = upper[side]; + Vector3 topRight = upper[next]; + + structure.Beam(bottomLeft, topLeft, 0.24f, 0.24f); + structure.Beam(bottomLeft, bottomRight, 0.26f, 0.23f); + structure.Beam(topLeft, topRight, 0.19f, 0.16f); + + for (int row = 0; row < rows; row++) + { + float low = (float)row / rows; + float high = (float)(row + 1) / rows; + Vector3 a = Vector3.Lerp(bottomLeft, topLeft, low); + Vector3 b = Vector3.Lerp(bottomRight, topRight, low); + Vector3 c = Vector3.Lerp(bottomRight, topRight, high); + Vector3 d = Vector3.Lerp(bottomLeft, topLeft, high); + if (row > 0) + detail.Beam(a, b, 0.13f, 0.115f); + + for (int column = 0; column < columns; column++) + { + float from = (float)column / columns; + float to = (float)(column + 1) / columns; + Vector3 p = Vector3.Lerp(a, b, from); + Vector3 q = Vector3.Lerp(a, b, to); + Vector3 r = Vector3.Lerp(d, c, to); + Vector3 s = Vector3.Lerp(d, c, from); + if (column > 0) + detail.Beam(p, s, 0.105f, 0.102f); + + if ((row + column) % 2 == 0) + detail.Beam(p, r, 0.075f, 0.076f); + else + detail.Beam(q, s, 0.075f, 0.076f); + if (glass != null) + panes.Quad(p, q, r, s, true); + } + } + } + } + + private void AddFacade(Geometry structure, Geometry detail, Geometry panes) + { + Vector2[] outline = Outline(42.9f, 31.9f, CornerLimit); + for (int side = 0; side < outline.Length; side++) + { + Vector2 start = outline[side]; + Vector2 end = outline[(side + 1) % outline.Length]; + if (side == 0) + { + Wall(structure, detail, panes, start, new Vector2(-14f, start.y), Eaves[0, 0]); + Wall(structure, detail, panes, new Vector2(-14f, start.y), new Vector2(-4.17f, end.y), Eaves[0, 1]); + Wall(structure, detail, panes, new Vector2(-4.17f, start.y), new Vector2(4.17f, end.y), Eaves[0, 1], 3.95f * heightScale); + Wall(structure, detail, panes, new Vector2(4.17f, start.y), new Vector2(14f, end.y), Eaves[0, 1]); + Wall(structure, detail, panes, new Vector2(14f, start.y), end, Eaves[0, 2]); + } + else if (side == 2 || side == 6) + { + float x = start.x; + float zSign = Mathf.Sign(end.y - start.y); + Vector2 first = new Vector2(x, -10.5f * zSign); + Vector2 second = new Vector2(x, 10.5f * zSign); + int column = side == 2 ? 2 : 0; + int firstRow = side == 2 ? 0 : 2; + Wall(structure, detail, panes, start, first, Eaves[firstRow, column]); + Wall(structure, detail, panes, first, second, Eaves[1, column]); + Wall(structure, detail, panes, second, end, Eaves[2 - firstRow, column]); + } + else if (side == 4) + { + Wall(structure, detail, panes, start, new Vector2(14f, start.y), Eaves[2, 2]); + Wall(structure, detail, panes, new Vector2(14f, start.y), new Vector2(-14f, end.y), Eaves[2, 1]); + Wall(structure, detail, panes, new Vector2(-14f, end.y), end, Eaves[2, 0]); + } + else + { + float doorHeight = Eaves[side == 1 || side == 7 ? 0 : 2, side < 4 ? 2 : 0]; + Wall(structure, detail, panes, start, end, doorHeight); + } + } + } + + private void AddRoofSeams(Geometry detail, Geometry panes) + { + float[] x = { -42.9f, -14f, 14f, 42.9f }; + float[] z = { -31.9f, -10.5f, 10.5f, 31.9f }; + for (int row = 0; row < 3; row++) + { + for (int column = 0; column < 3; column++) + { + float eave = Eaves[row, column]; + if (column < 2) + Seam(detail, panes, new Vector2(x[column + 1], z[row]), new Vector2(x[column + 1], z[row + 1]), eave, Eaves[row, column + 1]); + if (row < 2) + Seam(detail, panes, new Vector2(x[column], z[row + 1]), new Vector2(x[column + 1], z[row + 1]), eave, Eaves[row + 1, column]); + } + } + } + + private void Seam(Geometry detail, Geometry panes, Vector2 start, Vector2 end, float left, float right) + { + float low = Mathf.Min(left, right) * heightScale; + float high = Mathf.Max(left, right) * heightScale; + int segments = Mathf.Max(1, Mathf.RoundToInt(bays * Vector2.Distance(start, end) / 28f)); + for (int i = 1; i < segments; i++) + { + Vector2 point = Vector2.Lerp(start, end, (float)i / segments); + detail.Beam(World(point, low), World(point, high), 0.12f, 0.12f); + } + + if (glass != null) + panes.Quad(World(start, low), World(end, low), World(end, high), World(start, high), true); + } + + private void Wall(Geometry structure, Geometry detail, Geometry panes, Vector2 start, Vector2 end, float height, float sill = 0.60f) + { + float top = height * heightScale; + float middle = Mathf.Lerp(sill, top, 0.53f); + int count = Mathf.Max(1, Mathf.RoundToInt(bays * Vector2.Distance(start, end) / 28f)); + structure.Beam(World(start, top), World(end, top), 0.27f, 0.24f); + detail.Beam(World(start, middle), World(end, middle), 0.135f, 0.14f); + for (int i = 0; i < count; i++) + { + Vector2 a = Vector2.Lerp(start, end, (float)i / count); + Vector2 b = Vector2.Lerp(start, end, (float)(i + 1) / count); + Vector3 p = World(a, sill); + Vector3 q = World(b, sill); + Vector3 r = World(b, top); + Vector3 s = World(a, top); + structure.Beam(p, s, 0.22f, 0.26f); + if (i % 2 == 0) + detail.Beam(p, r, 0.088f, 0.09f); + else + detail.Beam(q, s, 0.088f, 0.09f); + if (glass != null) + panes.Quad(p, q, r, s, true); + } + } + + private void AddEntrySuperstructure(Geometry structure, Geometry detail, Geometry panes, Geometry cladding) + { + float height = 3.95f * heightScale; + cladding.Box(new Vector3(0f, height + 0.13f, -34.55f), new Vector3(8.74f, 0.36f, 5.52f), Quaternion.identity); + foreach (float side in new[] { -1f, 1f }) + { + float x = 4.12f * side; + Wall(structure, detail, panes, new Vector2(x, -37.18f), new Vector2(x, -31.95f), 3.95f); + structure.Beam(new Vector3(x, 0.6f, -37.18f), new Vector3(x, height, -37.18f), 0.34f, 0.34f); + } + + structure.Beam(new Vector3(-4.21f, height - 0.26f, -37.22f), new Vector3(4.21f, height - 0.26f, -37.22f), + 0.36f, 0.43f); + cladding.Box(new Vector3(0f, height + 0.41f, -37.12f), new Vector3(7.2f, 0.30f, 0.42f), Quaternion.identity); + } + + private Material Material(string name, string hex, float metallic, float smoothness) + { + var material = new Material(Shader.Find("Standard")) { name = name }; + ColorUtility.TryParseHtmlString(hex, out Color color); + material.color = color; + material.SetFloat("_Metallic", metallic); + material.SetFloat("_Glossiness", smoothness); + profile.Own(material); + return material; + } + + private Material GlassMaterial() + { + Shader shader = Resources.Load("DomeGlass"); + var material = new Material(shader) { name = "Sage glazing" }; + ColorUtility.TryParseHtmlString("#96C7BF", out Color color); + color.a = Mathf.Clamp01(profile.GlazingOpacity); + material.color = color; + profile.Own(material); + return material; + } + } + + private static Vector2[] Outline(float x, float z, float corner) + { + float innerX = corner - z; + float innerZ = corner - x; + return new[] + { + new Vector2(-innerX, -z), new Vector2(innerX, -z), new Vector2(x, -innerZ), new Vector2(x, innerZ), + new Vector2(innerX, z), new Vector2(-innerX, z), new Vector2(-x, innerZ), new Vector2(-x, -innerZ) + }; + } + + private static Vector2[] ClipCorners(Vector2[] points) + { + foreach (Vector2 inward in new[] { Vector2.one, new Vector2(1f, -1f), new Vector2(-1f, 1f), -Vector2.one }) + { + var clipped = new List(points.Length + 1); + Vector2 previous = points[points.Length - 1]; + float previousDistance = CornerLimit - Vector2.Dot(inward, previous); + foreach (Vector2 current in points) + { + float currentDistance = CornerLimit - Vector2.Dot(inward, current); + if ((previousDistance < 0f) != (currentDistance < 0f)) + { + float t = previousDistance / (previousDistance - currentDistance); + clipped.Add(Vector2.LerpUnclamped(previous, current, t)); + } + + if (currentDistance >= 0f) + clipped.Add(current); + + previous = current; + previousDistance = currentDistance; + } + + points = clipped.ToArray(); + } + + return points; + } + + private static Vector3[] ScaledRing(Vector2[] points, Vector2 center, float scaleX, float scaleZ, float height) + { + var ring = new Vector3[points.Length]; + for (int i = 0; i < points.Length; i++) + { + Vector2 offset = points[i] - center; + ring[i] = World(center + new Vector2(offset.x * scaleX, offset.y * scaleZ), height); + } + + return ring; + } + + private static Vector3 World(Vector2 point, float height) + { + return new Vector3(point.x, height, point.y); + } + + private sealed class Geometry + { + private readonly List vertices = new List(); + private readonly List normals = new List(); + private readonly List triangles = new List(); + + public void Beam(Vector3 a, Vector3 b, float width, float depth) + { + Vector3 span = b - a; + if (span.sqrMagnitude < 0.00001f) + return; + + Vector3 up = Mathf.Abs(Vector3.Dot(span.normalized, Vector3.up)) > 0.95f ? Vector3.forward : Vector3.up; + Box((a + b) * 0.5f, new Vector3(width, depth, span.magnitude), Quaternion.LookRotation(span, up)); + } + + public void Box(Vector3 center, Vector3 size, Quaternion rotation) + { + Vector3 x = rotation * new Vector3(size.x * 0.5f, 0f, 0f); + Vector3 y = rotation * new Vector3(0f, size.y * 0.5f, 0f); + Vector3 z = rotation * new Vector3(0f, 0f, size.z * 0.5f); + Vector3 a = center - x - y - z; + Vector3 b = center + x - y - z; + Vector3 c = center + x - y + z; + Vector3 d = center - x - y + z; + Vector3 e = a + 2f * y; + Vector3 f = b + 2f * y; + Vector3 g = c + 2f * y; + Vector3 h = d + 2f * y; + + Quad(a, b, c, d); + Quad(e, h, g, f); + Quad(a, e, f, b); + Quad(b, f, g, c); + Quad(c, g, h, d); + Quad(d, h, e, a); + } + + public void Prism(Vector2[] outline, float bottom, float top) + { + for (int side = 0; side < outline.Length; side++) + { + Vector2 a = outline[side]; + Vector2 b = outline[(side + 1) % outline.Length]; + Quad(World(a, bottom), World(a, top), World(b, top), World(b, bottom)); + } + + for (int i = 1; i < outline.Length - 1; i++) + { + Triangle(World(outline[0], top), World(outline[i + 1], top), World(outline[i], top)); + Triangle(World(outline[0], bottom), World(outline[i], bottom), World(outline[i + 1], bottom)); + } + } + + public void Quad(Vector3 a, Vector3 b, Vector3 c, Vector3 d, bool doubleSided = false) + { + AddQuad(a, b, c, d); + if (doubleSided) + AddQuad(d, c, b, a); + } + + private void AddQuad(Vector3 a, Vector3 b, Vector3 c, Vector3 d) + { + Vector3 normal = Vector3.Cross(b - a, c - a).normalized; + int index = vertices.Count; + AddVertex(a, normal); + AddVertex(b, normal); + AddVertex(c, normal); + AddVertex(d, normal); + AddIndices(index, index + 1, index + 2); + AddIndices(index, index + 2, index + 3); + } + + public void Triangle(Vector3 a, Vector3 b, Vector3 c, bool doubleSided = false) + { + Vector3 normal = Vector3.Cross(b - a, c - a).normalized; + int index = vertices.Count; + AddVertex(a, normal); + AddVertex(b, normal); + AddVertex(c, normal); + AddIndices(index, index + 1, index + 2); + if (doubleSided) + Triangle(c, b, a); + } + + private void AddVertex(Vector3 point, Vector3 normal) + { + vertices.Add(point); + normals.Add(normal); + } + + private void AddIndices(int a, int b, int c) + { + triangles.Add(a); + triangles.Add(b); + triangles.Add(c); + } + + public void Apply(Transform parent, Material material, string name, DomeEnvironment profile, bool shadow = true) + { + if (vertices.Count == 0) + return; + + Mesh mesh = new Mesh { name = name }; + if (vertices.Count > 65535) + mesh.indexFormat = IndexFormat.UInt32; + mesh.SetVertices(vertices); + mesh.SetNormals(normals); + mesh.SetTriangles(triangles, 0); + mesh.RecalculateBounds(); + profile.Own(mesh); + + GameObject node = Group(parent, name).gameObject; + node.AddComponent().sharedMesh = mesh; + var renderer = node.AddComponent(); + renderer.sharedMaterial = material; + renderer.shadowCastingMode = shadow ? ShadowCastingMode.On : ShadowCastingMode.Off; + renderer.receiveShadows = shadow; + } + } + } +} diff --git a/Assets/DomeShift/DomeArchitecture.cs.meta b/Assets/DomeShift/DomeArchitecture.cs.meta new file mode 100644 index 0000000..80d2344 --- /dev/null +++ b/Assets/DomeShift/DomeArchitecture.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: dc39efca54c12dc3d9292d7aab752b3a \ No newline at end of file diff --git a/Assets/DomeShift/DomeAudio.cs b/Assets/DomeShift/DomeAudio.cs new file mode 100644 index 0000000..a2fd02e --- /dev/null +++ b/Assets/DomeShift/DomeAudio.cs @@ -0,0 +1,171 @@ +using UnityEngine; + +namespace DomeShift +{ + [DisallowMultipleComponent] + internal sealed class DomeAudio : MonoBehaviour + { + public enum Cue { Start, Pickup, Repair, Denied, Won, Lost } + + private const int SampleRate = 24000; + private const float FullTurn = 2f * Mathf.PI; + private readonly AudioClip[] cues = new AudioClip[6]; + private AudioSource effects; + private AudioSource ambience; + private bool muted; + + public bool Muted + { + get => muted; + set + { + muted = value; + if (effects != null) effects.mute = muted; + if (ambience != null) ambience.mute = muted; + } + } + + private void Awake() + { + effects = CreateSource(0.65f); + ambience = CreateSource(0.25f); + + cues[(int)Cue.Start] = MakeCue("Shift start", + new Tone(0f, 0.25f, 261.63f, 0.35f), + new Tone(0.12f, 0.30f, 392f, 0.32f), + new Tone(0.24f, 0.48f, 523.25f, 0.29f)); + cues[(int)Cue.Pickup] = MakeCue("Supply pickup", + new Tone(0f, 0.11f, 392f, 0.35f, 0.025f), + new Tone(0.055f, 0.18f, 587.33f, 0.30f)); + cues[(int)Cue.Repair] = MakeCue("Station repaired", + new Tone(0f, 0.18f, 293.66f, 0.32f, 0.035f), + new Tone(0.09f, 0.23f, 440f, 0.31f), + new Tone(0.18f, 0.39f, 587.33f, 0.29f), + new Tone(0.18f, 0.33f, 739.99f, 0.12f)); + cues[(int)Cue.Denied] = MakeCue("Access denied", + new Tone(0f, 0.095f, 146.83f, 0.37f, 0.03f), + new Tone(0.095f, 0.17f, 110f, 0.35f)); + cues[(int)Cue.Won] = MakeCue("Airlock released", + new Tone(0f, 0.24f, 329.63f, 0.30f), + new Tone(0.13f, 0.23f, 440f, 0.31f), + new Tone(0.26f, 0.37f, 554.37f, 0.28f), + new Tone(0.39f, 0.59f, 659.25f, 0.26f), + new Tone(0.39f, 0.58f, 440f, 0.15f)); + cues[(int)Cue.Lost] = MakeCue("Shift timeout", + new Tone(0f, 0.26f, 246.94f, 0.31f), + new Tone(0.15f, 0.30f, 185f, 0.29f), + new Tone(0.30f, 0.61f, 123.47f, 0.34f)); + + ambience.clip = MakeAmbience(); + ambience.loop = true; + ambience.Play(); + } + + public void Play(Cue cue) + { + if (muted || effects == null) return; + + effects.clip = cues[(int)cue]; + effects.Play(); + } + + private AudioSource CreateSource(float volume) + { + var source = gameObject.AddComponent(); + source.playOnAwake = false; + source.spatialBlend = 0f; + source.volume = volume; + source.mute = muted; + return source; + } + + private static AudioClip MakeCue(string name, params Tone[] tones) + { + float length = 0f; + foreach (var tone in tones) + length = Mathf.Max(length, tone.Start + tone.Duration); + + var samples = new float[Mathf.CeilToInt(length * SampleRate)]; + var random = new System.Random(47); + foreach (var tone in tones) + { + int offset = Mathf.RoundToInt(tone.Start * SampleRate); + int sampleCount = Mathf.Min(samples.Length - offset, Mathf.FloorToInt(tone.Duration * SampleRate)); + float filteredNoise = 0f; + for (int i = 0; i < sampleCount; i++) + { + float seconds = i / (float)SampleRate; + float phase = FullTurn * tone.Frequency * seconds; + float attack = Mathf.Clamp01(seconds / 0.012f); + float release = Mathf.Clamp01((tone.Duration - seconds) / 0.065f); + float decay = Mathf.Exp(-3f * seconds / tone.Duration); + float wave = 0.76f * Mathf.Sin(phase) + 0.19f * Mathf.Sin(phase * 2f) + + 0.05f * Mathf.Sin(phase * 3f); + filteredNoise += ((float)(random.NextDouble() * 2.0 - 1.0) - filteredNoise) * 0.16f; + float onset = filteredNoise * tone.Click * Mathf.Exp(-65f * seconds); + samples[offset + i] += (wave * tone.Volume + onset) * attack * release * decay; + } + } + + return CreateClip(name, samples); + } + + private static AudioClip MakeAmbience() + { + const int loopSeconds = 4; + var samples = new float[SampleRate * loopSeconds]; + var random = new System.Random(103); + float wind = 0f; + for (int i = 0; i < samples.Length; i++) + { + float seconds = i / (float)SampleRate; + float loopPhase = FullTurn * seconds / loopSeconds; + float fan = 0.08f * Mathf.Sin(loopPhase * 176f) + 0.025f * Mathf.Sin(loopPhase * 352f); + float cycle = 0.72f + 0.28f * Mathf.Cos(loopPhase); + wind += ((float)(random.NextDouble() * 2.0 - 1.0) - wind) * 0.04f; + float edge = Mathf.Clamp01(Mathf.Min(seconds, loopSeconds - seconds) / 0.12f); + samples[i] = fan * cycle + wind * 0.115f * edge; + } + + return CreateClip("Dome ventilation", samples); + } + + private static AudioClip CreateClip(string name, float[] samples) + { + var clip = AudioClip.Create(name, samples.Length, 1, SampleRate, false); + clip.SetData(samples, 0); + return clip; + } + + private void OnDestroy() + { + if (effects != null) effects.Stop(); + foreach (var clip in cues) + { + if (clip != null) Destroy(clip); + } + + if (ambience == null) return; + ambience.Stop(); + if (ambience.clip != null) Destroy(ambience.clip); + } + + private readonly struct Tone + { + public readonly float Start; + public readonly float Duration; + public readonly float Frequency; + public readonly float Volume; + public readonly float Click; + + public Tone(float start, float duration, float frequency, float volume, float click = 0f) + { + Start = start; + Duration = duration; + Frequency = frequency; + Volume = volume; + Click = click; + } + } + } +} diff --git a/Assets/DomeShift/DomeAudio.cs.meta b/Assets/DomeShift/DomeAudio.cs.meta new file mode 100644 index 0000000..6b1f850 --- /dev/null +++ b/Assets/DomeShift/DomeAudio.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 41f4daa495fb9d55c84672cb0122f895 \ No newline at end of file diff --git a/Assets/DomeShift/DomeBiomes.cs b/Assets/DomeShift/DomeBiomes.cs new file mode 100644 index 0000000..186bee0 --- /dev/null +++ b/Assets/DomeShift/DomeBiomes.cs @@ -0,0 +1,915 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering; + +namespace DomeShift +{ + internal sealed class DomeBiomes + { + private static readonly Vector2[] ServicePoints = + { + new(23f, -17f), new(-3f, 13f), new(-27f, -15f), + new(24f, -9f), new(18f, 11f), new(-7f, -3f), + new(0f, -29f), new(0f, -23f) + }; + + private static readonly Rect Lagoon = Rect.MinMaxRect(-11.8f, 15.5f, 11.8f, 29.5f); + private static readonly Rect Wetland = Rect.MinMaxRect(16.5f, 15.3f, 40.4f, 29.7f); + private static readonly Rect[] WalkDecks = + { + Rect.MinMaxRect(-12.25f, 14.1f, 12.25f, 16.8f), + Rect.MinMaxRect(1.0f, 15.5f, 4.1f, 30.1f), + Rect.MinMaxRect(-2.1f, 23.8f, 7.1f, 26.0f), + Rect.MinMaxRect(25.8f, 13.75f, 28.6f, 30.4f), + Rect.MinMaxRect(15.9f, 21.55f, 40.95f, 24.2f) + }; + + private static readonly Shape Cube = MakeBox(); + private static readonly Shape Prism = MakeLathe(new[] { -0.5f, 0.5f }, new[] { 0.5f, 0.5f }, 8, true); + private static readonly Shape Cone = MakeLathe(new[] { -0.5f, 0.5f }, new[] { 0.5f, 0f }, 7, true); + private static readonly Shape Crown = MakeLathe( + new[] { -0.5f, -0.32f, 0f, 0.32f, 0.5f }, new[] { 0f, 0.38f, 0.5f, 0.38f, 0f }, 8, false); + + private readonly List terrains = new(); + private readonly List barriers = new(); + private readonly List trunks = new(); + private readonly Dictionary surfaces = new(); + private readonly DomeEnvironment profile; + private readonly Transform root; + private readonly Shader shader; + private System.Random random; + + private DomeBiomes(Transform parent, DomeEnvironment profile) + { + this.profile = profile; + shader = Shader.Find("Standard"); + root = new GameObject("Biome terrain and furnishings").transform; + root.SetParent(parent, false); + + Rainforest(); + Ocean(); + Mangroves(); + Savanna(); + Orchard(); + Scrub(); + Desert(); + Farm(); + Habitat(); + Technosphere(); + + foreach (Surface surface in surfaces.Values) + surface.Build(root, profile); + } + + public static DomeBiomes Create(Transform parent, DomeEnvironment profile) => new(parent, profile); + + public bool CanWalk(Vector2 point) + { + if (!WithinOutline(point) || (IsWater(point) && !IsDeck(point))) + return false; + + foreach (Rect barrier in barriers) + if (barrier.Contains(point)) + return false; + + foreach (Trunk trunk in trunks) + if ((point - trunk.Center).sqrMagnitude < trunk.RadiusSquared) + return false; + + return true; + } + + public float SurfaceY(Vector2 point) + { + if (IsDeck(point)) + return 0.23f; + + foreach (Terrain terrain in terrains) + if (terrain.Bounds.Contains(point)) + return TerrainHeight(terrain, point); + + return 0f; + } + + private void Rainforest() + { + Rect bounds = Rect.MinMaxRect(-42f, 12f, -15.1f, 31f); + Begin(DomeRegion.Rainforest, bounds, 0.76f, "#4A6446", "#466049", "#546B45"); + Trail(new Vector2(-41.4f, 20.7f), new Vector2(-15.6f, 20.7f), "#747D56", 25); + Trail(new Vector2(-29f, 12.2f), new Vector2(-29f, 29.9f), "#747D56", 18); + Scatter(DomeRegion.Rainforest, bounds, 28, 2.15f, 2f, p => + { + float height = Range(3.8f, 7.1f); + Tree(p, height, Range(1.4f, 2.15f), "#485743", "#346B46", "#3F8051", "#57945B"); + for (int i = 0; i < 2; i++) + { + Vector2 fern = p + new Vector2(Range(-1.45f, 1.45f), Range(-1.1f, 1.1f)); + if (WithinOutline(fern)) + Rosette(fern, Range(0.55f, 1.08f), "#609A62", "#80A957"); + } + }); + Scatter(DomeRegion.Rainforest, bounds, 50, 1.05f, 1.2f, + p => Rosette(p, Range(0.48f, 1.04f), "#4F8652", "#8EB16D")); + Vector2[] boulders = { new(-39f, 16.3f), new(-31.6f, 27.2f), new(-20.5f, 25.6f) }; + foreach (Vector2 p in boulders) + Rock(p, 1.25f, "#6F8061", "#829171", true); + } + + private void Ocean() + { + Rect bounds = Rect.MinMaxRect(-13.1f, 12f, 13.1f, 31.05f); + Begin(DomeRegion.Ocean, bounds, 0f, "#CAB78B", "#D5C398", "#BFB083"); + Water(Lagoon, "#4AAEAC", "#238EB1", "#267EAA"); + AddBoardwalk(WalkDecks[0], true); + AddBoardwalk(WalkDecks[1], false); + AddBoardwalk(WalkDecks[2], true); + CrossRails(WalkDecks[1], false, 17f, 23.6f); + CrossRails(WalkDecks[1], false, 26.1f, 29.2f); + + Vector2[] palms = { new(-11.9f, 13.2f), new(10.1f, 13.05f), new(-10.2f, 30.33f), new(8.2f, 30.35f) }; + int palmsToPlace = Count(DomeRegion.Ocean, palms.Length, palms.Length); + for (int i = 0; i < palmsToPlace; i++) + Palm(palms[i], Range(3.9f, 5.1f)); + + for (int i = 0; i < Count(DomeRegion.Ocean, 28, 60); i++) + { + Vector2 reef = new(Range(-11.3f, 11.3f), Range(17.1f, 29.1f)); + if (IsDeck(reef)) + continue; + + string coral = i % 3 == 0 ? "#DD836E" : i % 3 == 1 ? "#BC77A0" : "#D5AA79"; + Add(Crown, "#63BCB4", At(reef, 0.215f), new Vector3(1.4f, 0.12f, 1.08f), Spin()); + for (int n = 0; n < 3; n++) + { + Vector3 a = At(reef, 0.22f); + Vector3 b = a + new Vector3(Range(-0.21f, 0.21f), Range(0.17f, 0.55f), Range(-0.3f, 0.3f)); + Bar(Prism, coral, a, b, 0.115f); + } + } + } + + private void Mangroves() + { + Rect bounds = Rect.MinMaxRect(15.1f, 12f, 42f, 31.05f); + Begin(DomeRegion.MangroveWetlands, bounds, 0f, "#859262", "#909266", "#819068"); + Water(Wetland, "#739D83", "#468B83", "#377F7C"); + AddBoardwalk(WalkDecks[3], false); + AddBoardwalk(WalkDecks[4], true); + CrossRails(WalkDecks[3], false, 15.5f, 21.5f); + CrossRails(WalkDecks[3], false, 24.3f, 29.4f); + + Scatter(DomeRegion.MangroveWetlands, Rect.MinMaxRect(17.35f, 16.4f, 39.4f, 29f), 19, 2.1f, 1.35f, p => + { + float size = Range(0.76f, 1.28f); + Add(Crown, "#78966D", At(p, 0.22f), new Vector3(1.5f, 0.19f, 1.29f) * size, Spin()); + Vector3 trunk = At(p, size * 0.97f); + for (int i = 0; i < 5; i++) + { + float angle = i * Mathf.PI * 0.4f; + Vector3 foot = At(p + new Vector2(Mathf.Cos(angle), Mathf.Sin(angle)) * size * 0.75f, 0.17f); + Bar(Prism, "#775B4D", foot, trunk, size * 0.17f); + } + Tree(p, size * 3.2f, size * 1.22f, "#6C5143", "#5D845B", "#709762", "#84A865", 0.27f); + }); + Scatter(DomeRegion.MangroveWetlands, bounds, 25, 1f, 1f, + p => Rosette(p, Range(0.42f, 1.02f), "#65875A", "#9BAC62")); + } + + private void Savanna() + { + Rect bounds = Rect.MinMaxRect(-42f, -9f, -15.1f, 9f); + Begin(DomeRegion.Savanna, bounds, 0.54f, "#A49E5C", "#AB9D61", "#B3A468"); + Trail(new Vector2(-40.8f, 0f), new Vector2(-15.6f, 0f), "#BAAC74", 24); + Trail(new Vector2(-28.7f, -8.7f), new Vector2(-28.7f, 8.6f), "#BAAC74", 17); + Scatter(DomeRegion.Savanna, bounds, 11, 3.4f, 1.7f, p => + { + float y = SurfaceY(p); + float h = Range(2.65f, 4.35f); + Vector3 fork = At(p, y + h * 0.69f); + Bar(Prism, "#776447", At(p, y), fork, 0.34f); + for (int i = -1; i <= 1; i++) + { + Vector3 top = fork + new Vector3(i * 1.08f, h * 0.28f, i * 0.23f); + Bar(Prism, "#776447", fork, top, 0.19f); + Add(Crown, i == 0 ? "#79924E" : "#8CA054", top, new Vector3(2.2f, 0.69f, 1.85f), Spin()); + } + AvoidTrunk(p, 0.3f); + }); + Scatter(DomeRegion.Savanna, bounds, 88, 0.43f, 1.13f, + p => Tuft(p, Range(0.34f, 0.83f), "#A1A059", "#C8BE74")); + Rock(new Vector2(-36.8f, 4.55f), 1.44f, "#817B61", "#959175", true); + Rock(new Vector2(-19.1f, -5.55f), 0.94f, "#817B61", "#959175", true); + } + + private void Orchard() + { + Rect bounds = Rect.MinMaxRect(-13.1f, -9f, 13.1f, 9f); + Begin(DomeRegion.Orchard, bounds, 0.22f, "#718B59", "#7A925D", "#829863"); + Trail(new Vector2(-12.65f, 0f), new Vector2(12.65f, 0f), "#B6AB80", 24); + Trail(new Vector2(0f, -8.65f), new Vector2(0f, 8.65f), "#B6AB80", 16); + for (int row = -1; row <= 1; row += 2) + for (int column = -2; column <= 2; column++) + { + Vector2 p = new(column * 4.8f, row * 4.95f); + if (column == 0 || NearService(p, 3.3f)) + continue; + + float density = Density(DomeRegion.Orchard); + if (random.NextDouble() >= Math.Min(1f, density)) + continue; + + float y = SurfaceY(p); + Add(Crown, "#648155", At(p, y + 0.01f), new Vector3(2.7f, 0.078f, 2.47f), Spin()); + Tree(p, 2.7f, 1.04f, "#6F5A43", "#638E4E", "#78A359", "#87AC52"); + for (int i = 0; i < 5; i++) + { + float angle = 1.2566f * i; + Vector2 offset = new(Mathf.Cos(angle) * 0.68f, Mathf.Sin(angle) * 0.68f); + Add(Crown, row < 0 ? "#DA9860" : "#D37F59", At(p + offset, y + Range(2.34f, 2.72f)), + Vector3.one * Range(0.19f, 0.27f), Spin()); + } + } + Scatter(DomeRegion.Orchard, bounds, 18, 0.8f, 0.9f, + p => Rosette(p, Range(0.4f, 0.63f), "#718F54", "#99AC60")); + } + + private void Scrub() + { + Rect bounds = Rect.MinMaxRect(15.1f, 1.2f, 42f, 9f); + Begin(DomeRegion.ThornScrub, bounds, 0.37f, "#A7A078", "#AD9F78", "#9F9B71"); + Trail(new Vector2(15.5f, 4.45f), new Vector2(41.5f, 4.45f), "#C0AF88", 19); + Scatter(DomeRegion.ThornScrub, bounds, 28, 1.45f, 1.15f, p => + { + float y = SurfaceY(p); + float s = Range(0.5f, 1.06f); + for (int i = 0; i < 5; i++) + { + Vector3 a = At(p, y + 0.04f); + Vector3 b = a + new Vector3(Range(-0.55f, 0.55f), Range(0.39f, 1.08f), Range(-0.5f, 0.5f)) * s; + Bar(Prism, "#86785F", a, b, 0.064f * s); + Add(Crown, i % 2 == 0 ? "#83945F" : "#9DA475", b, new Vector3(0.49f, 0.23f, 0.48f) * s, Spin()); + } + if (s > 0.87f) + AvoidTrunk(p, 0.44f); + }, cross: false); + } + + private void Desert() + { + Rect bounds = Rect.MinMaxRect(15.1f, -9f, 42f, -1.2f); + Begin(DomeRegion.FogDesert, bounds, 0.9f, "#CCA475", "#D7B184", "#DDB989"); + Scatter(DomeRegion.FogDesert, bounds, 12, 1.6f, 1.15f, p => + { + if (random.NextDouble() < 0.48) + Rock(p, Range(0.52f, 1.05f), "#A78263", "#BC986D", true); + else + Rosette(p, Range(0.65f, 1.05f), "#638C74", "#84A18A"); + }, cross: false); + Vector2[] cacti = { new(18.35f, -4.6f), new(30.1f, -6.85f), new(38.7f, -3.55f) }; + for (int i = 0; i < Count(DomeRegion.FogDesert, cacti.Length, cacti.Length); i++) + { + Vector2 p = cacti[i]; + float y = SurfaceY(p); + float height = Range(1.45f, 2.45f); + Add(Prism, "#6D946D", At(p, y + height / 2f), new Vector3(0.52f, height, 0.48f), Spin()); + Add(Crown, "#87A275", At(p, y + height), new Vector3(0.49f, 0.55f, 0.47f), Spin()); + for (int side = -1; side <= 1; side += 2) + { + float limb = side < 0 ? 0.44f : 0.68f; + Vector3 joint = At(p, y + height * limb); + Vector3 bend = joint + new Vector3(side * 0.46f, 0.08f, 0f); + Bar(Prism, "#729873", joint, bend, 0.25f); + Bar(Prism, "#729873", bend, bend + Vector3.up * 0.49f, 0.22f); + } + AvoidTrunk(p, 0.31f); + } + } + + private void Farm() + { + Rect bounds = Rect.MinMaxRect(-42f, -31f, -15.1f, -13f); + Begin(DomeRegion.Agriculture, bounds, 0f, "#7F8665", "#8A8C69", "#8F936E"); + Trail(new Vector2(-40.7f, -22.4f), new Vector2(-15.7f, -22.4f), "#A49D7C", 25); + Trail(new Vector2(-27f, -30.2f), new Vector2(-27f, -13.3f), "#A49D7C", 17); + for (int column = 0; column < 6; column++) + { + float x = -39.0f + 3.55f * column + (column > 2 ? 4.80f : 0f); + CropBed(x, -18.85f, 5.65f, column); + if (WithinOutline(new Vector2(x, -29.8f))) + CropBed(x, -26.85f, 5.65f, column + 1); + } + } + + private void Habitat() + { + Rect bounds = Rect.MinMaxRect(-13.1f, -31f, 13.1f, -13f); + Begin(DomeRegion.HumanHabitat, bounds, 0f, "#858F79", "#8D9680", "#909685"); + Trail(new Vector2(-12.5f, -22.4f), new Vector2(12.5f, -22.4f), "#C6B994", 25); + Trail(new Vector2(0f, -30.5f), new Vector2(0f, -13.3f), "#C6B994", 17); + Pod(new Vector2(-7.3f, -18.4f), 6.2f, 4.15f, "#D9C795", "#B8B79B", "#446A70"); + Pod(new Vector2(7.35f, -18.35f), 6.2f, 4.1f, "#BAC4AF", "#9DAE9C", "#496F77"); + Pod(new Vector2(-7.25f, -26.6f), 5.75f, 4.05f, "#D1C198", "#B4B49A", "#4D6A70"); + Pod(new Vector2(7.45f, -26.7f), 5.6f, 3.8f, "#C7C1A0", "#AAB19B", "#526E72"); + Vector2[] planters = + { + new(-11.5f, -21.6f), new(11.6f, -21.4f), new(-5.5f, -14.25f), new(5.5f, -14.25f), + new(-11.55f, -25.85f), new(11.55f, -25.85f), new(-10.65f, -30.1f) + }; + int planterCount = Count(DomeRegion.HumanHabitat, 4, planters.Length); + for (int i = 0; i < planterCount; i++) + { + Vector2 p = planters[i]; + Add(Prism, "#A6A28A", At(p, 0.35f), new Vector3(1.25f, 0.6f, 1.25f), Quaternion.identity); + Add(Crown, "#7E9E6A", At(p, 0.86f), new Vector3(1.3f, 0.81f, 1.3f), Spin()); + AvoidTrunk(p, 0.57f); + } + } + + private void Technosphere() + { + Rect bounds = Rect.MinMaxRect(15.1f, -31f, 42f, -13f); + Begin(DomeRegion.Technosphere, bounds, 0f, "#637B7A", "#6D8581", "#718783"); + Trail(new Vector2(15.75f, -22.3f), new Vector2(41f, -22.3f), "#93A298", 25); + Trail(new Vector2(23f, -30.35f), new Vector2(23f, -13.2f), "#93A298", 16); + Lung(new Vector2(33.4f, -23.45f)); + + Vector2[] tanks = + { + new(29.7f, -16.45f), new(33.35f, -16.45f), new(36.95f, -16.4f), + new(18.3f, -27.25f), new(18.0f, -17.55f), new(26.45f, -28.7f) + }; + int tankCount = Mathf.Clamp(Mathf.RoundToInt(4 * profile.DensityFor(DomeRegion.Technosphere)), 1, tanks.Length); + for (int i = 0; i < tankCount; i++) + { + Vector2 p = tanks[i]; + Add(Prism, "#415B5D", At(p, 0.28f), new Vector3(2.84f, 0.46f, 2.76f), Quaternion.identity); + Add(Prism, "#9EB3A7", At(p, 1.34f), new Vector3(2.35f, 2.13f, 2.35f), Quaternion.identity); + Add(Crown, "#BAC6AB", At(p, 2.25f), new Vector3(2.33f, 1.12f, 2.33f), Quaternion.identity); + Add(Prism, "#617C79", At(p, 0.74f), new Vector3(2.42f, 0.24f, 2.42f), Quaternion.identity); + Add(Prism, "#688786", At(p, 1.75f), new Vector3(2.42f, 0.13f, 2.42f), Quaternion.identity); + AvoidTrunk(p, 1.39f); + } + + Vector3 pipe = new(29.7f, 0.36f, -14.98f); + Bar(Prism, "#A79B78", pipe, new Vector3(37.65f, 0.36f, -14.98f), 0.29f); + } + + private void CropBed(float x, float z, float length, int variety) + { + Vector2 p = new(x, z); + Add(Cube, "#9D876A", At(p, 0.26f), new Vector3(1.86f, 0.43f, length), Quaternion.identity); + Add(Cube, "#6C5944", At(p, 0.491f), new Vector3(1.64f, 0.08f, length - 0.17f), Quaternion.identity); + float density = Density(DomeRegion.Agriculture); + int plants = Mathf.Clamp(Mathf.RoundToInt(10 * density), 0, 20); + for (int i = 0; i < plants; i++) + { + float along = ((i + 0.5f) / plants - 0.5f) * (length - 0.24f); + float halfHeight = Range(0.24f, 0.415f); + Vector2 plant = new(x + (i % 2 == 0 ? -0.25f : 0.25f), z + along); + Add(Crown, variety % 2 == 0 ? "#658F4E" : "#7E9F52", At(plant, 0.53f + 0.6f * halfHeight), + new Vector3(0.94f, halfHeight * 1.35f, 0.63f), Spin()); + Add(Crown, variety % 2 == 0 ? "#AACC6A" : "#A51946", At(plant, 0.53f + halfHeight), + new Vector3(0.42f, halfHeight * 0.83f, 0.40f), Spin()); + } + + Block(p, 1.04f, length * 0.5f + 0.12f); + } + + private void Pod(Vector2 p, float width, float depth, string shell, string roof, string glass) + { + Add(Cube, "#596967", At(p, 0.22f), new Vector3(width + 0.4f, 0.34f, depth + 0.42f), Quaternion.identity); + Add(Cube, shell, At(p, 1.36f), new Vector3(width, 2.28f, depth), Quaternion.identity); + Add(Cube, roof, At(p, 2.64f), new Vector3(width + 0.28f, 0.38f, depth + 0.28f), Quaternion.identity); + Add(Cube, glass, At(p + new Vector2(0f, -depth * 0.5f - 0.03f), 1.66f), + new Vector3(width - 0.93f, 0.92f, 0.14f), Quaternion.identity); + Add(Cube, "#708C89", At(p + new Vector2(0f, -depth * 0.5f - 0.115f), 1.86f), + new Vector3(width - 1.08f, 0.075f, 0.045f), Quaternion.identity); + Add(Cube, "#718880", At(p, 2.88f), new Vector3(width * 0.55f, 0.26f, depth * 0.56f), Quaternion.identity); + for (int i = -1; i <= 1; i++) + Add(Cube, shell, At(p + new Vector2(i * width * 0.21f, -depth * 0.5f - 0.125f), 1.64f), + new Vector3(0.1f, 1.12f, 0.097f), Quaternion.identity); + Block(p, width / 2f + 0.16f, depth / 2f + 0.17f); + } + + private void Lung(Vector2 p) + { + Add(Prism, "#4C6667", At(p, 0.27f), new Vector3(9.6f, 0.43f, 8.45f), Quaternion.identity); + Add(Prism, "#9CADAA", At(p, 0.72f), new Vector3(8.9f, 0.91f, 7.8f), Quaternion.identity); + Add(Prism, "#557275", At(p, 1.09f), new Vector3(9.1f, 0.29f, 8f), Quaternion.identity); + Add(Crown, "#B4C5B2", At(p, 1.25f), new Vector3(8.49f, 3.8f, 7.48f), Quaternion.identity); + Add(Crown, "#C9D4B8", At(p, 2.19f), new Vector3(5.55f, 2.23f, 4.98f), Quaternion.Euler(0f, 22.5f, 0f)); + for (int i = 0; i < 8; i++) + { + float angle = i * Mathf.PI / 4f; + Vector3 clamp = At(p, 1.1f) + new Vector3(Mathf.Cos(angle) * 4.36f, 0f, Mathf.Sin(angle) * 3.8f); + Add(Cube, "#617C7A", clamp, new Vector3(0.39f, 0.79f, 0.5f), Quaternion.Euler(0f, -i * 45f, 0f)); + Add(Cube, "#D4BE82", clamp - Vector3.up * 0.12f, new Vector3(0.48f, 0.10f, 0.53f), Quaternion.Euler(0f, -i * 45f, 0f)); + } + + Block(p, 4.45f, 3.94f); + } + + private void Begin(DomeRegion region, Rect bounds, float relief, string baseColor, string low, string high) + { + unchecked + { + random = new System.Random(profile.Seed * 104729 + ((int)region + 1) * 524287); + } + + float amplitude = Mathf.Clamp(profile.TerrainRelief, 0f, 2f) * relief; + Terrain terrain = new(bounds, amplitude, Range(0f, Mathf.PI * 2f), region == DomeRegion.FogDesert); + terrains.Add(terrain); + int columns = Mathf.CeilToInt(bounds.width / 1.55f); + int rows = Mathf.CeilToInt(bounds.height / 1.55f); + for (int column = 0; column < columns; column++) + for (int row = 0; row < rows; row++) + { + float x1 = Mathf.Lerp(bounds.xMin, bounds.xMax, (float)column / columns); + float x2 = Mathf.Lerp(bounds.xMin, bounds.xMax, (column + 1f) / columns); + float z1 = Mathf.Lerp(bounds.yMin, bounds.yMax, (float)row / rows); + float z2 = Mathf.Lerp(bounds.yMin, bounds.yMax, (row + 1f) / rows); + Rect cell = Rect.MinMaxRect(x1, z1, x2, z2); + Vector2 center = cell.center; + float color = Mathf.Sin(center.x * 0.68f + terrain.Phase) * Mathf.Cos(center.y * 0.55f - terrain.Phase); + Face(cell, color > 0.43f ? high : color < -0.4f ? low : baseColor, + p => TerrainHeight(terrain, p)); + } + } + + private static float TerrainHeight(Terrain terrain, Vector2 p) + { + Rect box = terrain.Bounds; + float edge = Mathf.Min( + Mathf.Min(p.x - box.xMin, box.xMax - p.x), + Mathf.Min(p.y - box.yMin, box.yMax - p.y)); + float edgeFade = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(edge / 2.1f)); + float waves = terrain.Dunes + ? 0.49f + 0.39f * Mathf.Sin(p.x * 0.64f + p.y * 0.47f + terrain.Phase) + : 0.39f + 0.27f * Mathf.Sin(p.x * 0.3f + terrain.Phase) * Mathf.Cos(p.y * 0.32f); + float nearestSquared = float.PositiveInfinity; + foreach (Vector2 service in ServicePoints) + nearestSquared = Mathf.Min(nearestSquared, (p - service).sqrMagnitude); + float blend = (Mathf.Sqrt(nearestSquared) - 2.4f) / 2.2f; + float serviceFade = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(blend)); + return 0.035f + edgeFade * terrain.Relief * waves * serviceFade; + } + + private static bool WithinOutline(Vector2 p) + { + float x = Mathf.Abs(p.x); + float z = Mathf.Abs(p.y); + return x <= 43f && z <= 32f && x + z <= 68f; + } + + private static bool NearService(Vector2 p, float distance) + { + foreach (Vector2 station in ServicePoints) + if ((p - station).sqrMagnitude < distance * distance) + return true; + + return false; + } + + private static bool IsWater(Vector2 p) => Lagoon.Contains(p) || Wetland.Contains(p); + + private static bool IsDeck(Vector2 p) + { + foreach (Rect deck in WalkDecks) + if (deck.Contains(p)) + return true; + + return false; + } + + private void Water(Rect bounds, string shallow, string middle, string deep) + { + int columns = Mathf.CeilToInt(bounds.width / 1.43f); + int rows = Mathf.CeilToInt(bounds.height / 1.3f); + for (int x = 0; x < columns; x++) + for (int z = 0; z < rows; z++) + { + Rect cell = Rect.MinMaxRect( + Mathf.Lerp(bounds.xMin, bounds.xMax, (float)x / columns), + Mathf.Lerp(bounds.yMin, bounds.yMax, (float)z / rows), + Mathf.Lerp(bounds.xMin, bounds.xMax, (x + 1f) / columns), + Mathf.Lerp(bounds.yMin, bounds.yMax, (z + 1f) / rows)); + bool edge = x < 2 || z < 2 || x >= columns - 2 || z >= rows - 2; + float stripe = Mathf.Sin(cell.center.x * 0.86f + cell.center.y * 0.79f); + string tint = edge ? (stripe < -0.55f ? middle : shallow) : (stripe > 0.38f ? middle : deep); + Face(cell, tint, _ => 0.172f); + if (!IsDeck(cell.center) && WithinOutline(cell.center) && random.NextDouble() < 0.26) + { + Add(Cube, shallow, At(cell.center, 0.181f), + new Vector3(Range(0.27f, 1.21f), 0.016f, 0.052f), Quaternion.Euler(0f, 15f, 0f)); + } + } + } + + private void AddBoardwalk(Rect rect, bool across) + { + Add(Cube, "#746753", At(rect.center, 0.123f), new Vector3(rect.width, 0.205f, rect.height), Quaternion.identity); + float length = across ? rect.width : rect.height; + int count = Mathf.RoundToInt(length / 0.57f); + float stride = length / count; + for (int i = 0; i < count; i++) + { + float off = (i + 0.5f) * stride - length / 2f; + Vector2 at = rect.center + (across ? Vector2.right : Vector2.up) * off; + Vector3 size = across + ? new Vector3(stride - 0.035f, 0.065f, rect.height - 0.08f) + : new Vector3(rect.width - 0.08f, 0.065f, stride - 0.035f); + Add(Cube, i % 4 == 0 ? "#C4AC7E" : "#AF9871", At(at, 0.1975f), size, Quaternion.identity); + } + } + + private void CrossRails(Rect deck, bool across, float from, float to) + { + float low = across ? deck.yMin : deck.xMin; + float high = across ? deck.yMax : deck.xMax; + for (int side = -1; side <= 1; side += 2) + { + float at = side < 0 ? low + 0.12f : high - 0.12f; + Vector2 start = across ? new Vector2(from, at) : new Vector2(at, from); + Vector2 end = across ? new Vector2(to, at) : new Vector2(at, to); + Bar(Cube, "#B7AB87", At(start, 0.97f), At(end, 0.97f), 0.095f); + for (int i = 0; i < 4; i++) + { + Vector2 p = Vector2.Lerp(start, end, i / 3f); + Add(Cube, "#9D9276", At(p, 0.58f), new Vector3(0.14f, 0.78f, 0.14f), Quaternion.identity); + } + } + } + + private void Trail(Vector2 start, Vector2 end, string tint, int count) + { + bool across = Mathf.Abs(end.x - start.x) > Mathf.Abs(end.y - start.y); + for (int i = 0; i < count; i++) + { + Vector2 at = Vector2.Lerp(start, end, (i + 0.5f) / count); + if (!WithinOutline(at) || IsWater(at)) + continue; + + at += (across ? Vector2.up : Vector2.right) * Range(-0.16f, 0.16f); + Add(Crown, tint, At(at, SurfaceY(at) + 0.015f), + new Vector3(across ? 1.34f : 0.87f, 0.045f, across ? 0.89f : 1.3f), Spin()); + } + } + + private void Tree(Vector2 p, float height, float width, string bark, string dark, string middle, + string bright, float rootHeight = 0f) + { + float y = SurfaceY(p) + rootHeight; + Vector3 basePoint = At(p, y); + Vector3 fork = basePoint + Vector3.up * (height * 0.65f); + Bar(Prism, bark, basePoint, fork, Mathf.Clamp(width * 0.226f, 0.2f, 0.53f)); + Quaternion rotation = Spin(); + for (int i = 0; i < 4; i++) + { + float angle = i * Mathf.PI / 2f; + Vector3 limb = rotation * new Vector3(Mathf.Sin(angle) * width * 0.43f, + height * Range(0.13f, 0.29f), Mathf.Cos(angle) * width * 0.43f); + Vector3 top = fork + limb; + Bar(Prism, bark, fork, top, width * 0.115f); + Add(Crown, i == 0 ? dark : middle, top, new Vector3(width * 1.53f, width * 0.92f, width * 1.45f), Spin()); + } + + Add(Crown, bright, fork + Vector3.up * (height * 0.35f), + new Vector3(width * 1.52f, width * 0.94f, width * 1.48f), Spin()); + AvoidTrunk(p, width * 0.19f + 0.16f); + } + + private void Palm(Vector2 p, float height) + { + Vector3 a = At(p, SurfaceY(p)); + Vector3 b = a + new Vector3(0.21f, height * 0.61f, 0.11f); + Vector3 c = a + new Vector3(-0.17f, height, 0.15f); + Bar(Prism, "#8C7857", a, b, 0.28f); + Bar(Prism, "#A88C66", b, c, 0.23f); + for (int i = 0; i < 7; i++) + { + float angle = i * 2f * Mathf.PI / 7f; + Vector3 direction = new(Mathf.Sin(angle), 0f, Mathf.Cos(angle)); + Vector3 crown = c + direction * 0.64f + Vector3.up * 0.38f; + Vector3 tip = c + direction * Range(1.65f, 2.4f) - Vector3.up * 0.11f; + Bar(Crown, i % 2 == 0 ? "#5D995E" : "#73A369", c, crown, 0.55f); + Bar(Crown, i % 2 == 0 ? "#69A361" : "#80AC66", crown, tip, 0.48f); + } + + AvoidTrunk(p, 0.32f); + } + + private void Rosette(Vector2 p, float scale, string dark, string bright) + { + float y = SurfaceY(p); + float rotation = Range(0f, 1.4f); + for (int i = 0; i < 5; i++) + { + float angle = 1.2566f * i + rotation; + Vector3 axis = new(Mathf.Sin(angle) * scale * 0.57f, scale * Range(0.31f, 0.68f), + Mathf.Cos(angle) * scale * 0.57f); + Vector3 at = At(p, y + 0.034f) + axis * 0.55f; + Add(Crown, i % 2 == 0 ? dark : bright, at, new Vector3(scale * 0.31f, axis.magnitude * 1.24f, scale * 0.12f), + Quaternion.FromToRotation(Vector3.up, axis)); + } + } + + private void Tuft(Vector2 p, float scale, string dark, string bright) + { + Vector3 start = At(p, SurfaceY(p)); + for (int i = 0; i < 4; i++) + { + Vector3 end = start + new Vector3(Range(-0.38f, 0.38f), Range(0.38f, 1.04f), Range(-0.31f, 0.31f)) * scale; + Bar(Cone, i % 2 == 0 ? dark : bright, start, end, 0.12f * scale); + } + } + + private void Rock(Vector2 p, float size, string dark, string bright, bool solid) + { + float y = SurfaceY(p); + Add(Crown, dark, At(p, y + size * 0.23f), new Vector3(size * 1.27f, size * 0.85f, size), Spin()); + Add(Crown, bright, At(p + new Vector2(size * 0.31f, -size * 0.18f), y + size * 0.3f), + new Vector3(size * 0.8f, size * 0.69f, size * 0.79f), Spin()); + if (solid) + AvoidTrunk(p, size * 0.59f + 0.17f); + } + + private void Scatter(DomeRegion region, Rect bounds, int normal, float spacing, float edge, + Action render, bool cross = true) + { + int count = Count(region, normal, normal * 3); + List used = new(count); + for (int attempts = 0; used.Count < count && attempts < count * 16; attempts++) + { + Vector2 p = new(Range(bounds.xMin + edge, bounds.xMax - edge), Range(bounds.yMin + edge, bounds.yMax - edge)); + if (!WithinOutline(p + new Vector2(Mathf.Sign(p.x), Mathf.Sign(p.y)) * 0.85f) || + NearService(p, 2.9f) || IsDeck(p)) + continue; + + if (cross && (Mathf.Abs(p.x - bounds.center.x) < 1.48f || Mathf.Abs(p.y - bounds.center.y) < 1.45f)) + continue; + + bool fits = true; + foreach (Vector2 prior in used) + { + if ((p - prior).sqrMagnitude < spacing * spacing) + { + fits = false; + break; + } + } + if (!fits) + continue; + + used.Add(p); + render(p); + } + } + + private float Density(DomeRegion region) => Mathf.Clamp(profile.VegetationDensity * profile.DensityFor(region), 0f, 3f); + + private int Count(DomeRegion region, int normal, int max) => + Mathf.Clamp(Mathf.RoundToInt(normal * Density(region)), 0, max); + + private float Range(float min, float max) => Mathf.Lerp(min, max, (float)random.NextDouble()); + + private Quaternion Spin() => Quaternion.Euler(0f, Range(0f, 360f), 0f); + + private static Vector3 At(Vector2 point, float y) => new(point.x, y, point.y); + + private void Block(Vector2 p, float x, float z) => barriers.Add(new Rect(p.x - x, p.y - z, x * 2f, z * 2f)); + + private void AvoidTrunk(Vector2 p, float radius) => trunks.Add(new Trunk(p, radius * radius)); + + private Surface GetSurface(string hex) + { + if (surfaces.TryGetValue(hex, out Surface color)) + return color; + + color = new Surface(hex, shader); + surfaces.Add(hex, color); + return color; + } + + private void Add(Shape shape, string hex, Vector3 position, Vector3 size, Quaternion rotation) => + GetSurface(hex).Add(shape, position, size, rotation); + + private void Bar(Shape shape, string hex, Vector3 start, Vector3 end, float diameter) + { + Vector3 axis = end - start; + Add(shape, hex, (start + end) * 0.5f, new Vector3(diameter, axis.magnitude, diameter), + Quaternion.FromToRotation(Vector3.up, axis)); + } + + private void Face(Rect rect, string hex, Func height) + { + Vector2 a = new(rect.xMin, rect.yMin); + Vector2 b = new(rect.xMin, rect.yMax); + Vector2 c = new(rect.xMax, rect.yMax); + Vector2 d = new(rect.xMax, rect.yMin); + if (WithinOutline(a) && WithinOutline(b) && WithinOutline(c) && WithinOutline(d)) + { + GetSurface(hex).Quad(At(a, height(a)), At(b, height(b)), At(c, height(c)), At(d, height(d))); + return; + } + + List outline = new() { a, b, c, d }; + for (int x = -1; x <= 1; x += 2) + for (int z = -1; z <= 1; z += 2) + outline = CutCorner(outline, new Vector2(x, z)); + + for (int i = 1; i < outline.Count - 1; i++) + GetSurface(hex).Triangle(At(outline[0], height(outline[0])), + At(outline[i], height(outline[i])), At(outline[i + 1], height(outline[i + 1]))); + } + + private static List CutCorner(List outline, Vector2 normal) + { + List clipped = new(); + if (outline.Count == 0) + return clipped; + + Vector2 previous = outline[^1]; + float prevDistance = Vector2.Dot(previous, normal) - 68f; + foreach (Vector2 point in outline) + { + float distance = Vector2.Dot(point, normal) - 68f; + if ((distance <= 0f) != (prevDistance <= 0f)) + clipped.Add(Vector2.Lerp(previous, point, prevDistance / (prevDistance - distance))); + if (distance <= 0f) + clipped.Add(point); + + previous = point; + prevDistance = distance; + } + + return clipped; + } + + private static Shape MakeBox() + { + Vector3 a = new(-0.5f, -0.5f, -0.5f); + Vector3 b = new(-0.5f, -0.5f, 0.5f); + Vector3 c = new(0.5f, -0.5f, 0.5f); + Vector3 d = new(0.5f, -0.5f, -0.5f); + Vector3 e = a + Vector3.up; + Vector3 f = b + Vector3.up; + Vector3 g = c + Vector3.up; + Vector3 h = d + Vector3.up; + return new Shape(new[] { e, f, g, h, d, c, b, a, a, b, f, e, b, c, g, f, c, d, h, g, d, a, e, h }, + new[] { 0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, + 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23 }); + } + + private static Shape MakeLathe(float[] heights, float[] radii, int sides, bool caps) + { + List vertices = new(); + List indices = new(); + Vector3 AtRing(int ring, int junction) + { + float angle = junction * Mathf.PI * 2 / sides; + return new Vector3(Mathf.Cos(angle) * radii[ring], heights[ring], Mathf.Sin(angle) * radii[ring]); + } + + for (int side = 0; side < sides; side++) + { + for (int ring = 0; ring < heights.Length - 1; ring++) + { + int index = vertices.Count; + vertices.Add(AtRing(ring, side)); + vertices.Add(AtRing(ring + 1, side)); + vertices.Add(AtRing(ring + 1, side + 1)); + vertices.Add(AtRing(ring, side + 1)); + indices.AddRange(new[] { index, index + 1, index + 2, index, index + 2, index + 3 }); + } + + if (!caps) + continue; + + int last = heights.Length - 1; + int firstVert = vertices.Count; + vertices.Add(new Vector3(0f, heights[0], 0f)); + vertices.Add(AtRing(0, side)); + vertices.Add(AtRing(0, side + 1)); + vertices.Add(new Vector3(0f, heights[last], 0f)); + vertices.Add(AtRing(last, side + 1)); + vertices.Add(AtRing(last, side)); + indices.AddRange(new[] { firstVert, firstVert + 1, firstVert + 2, firstVert + 3, firstVert + 4, firstVert + 5 }); + } + + return new Shape(vertices.ToArray(), indices.ToArray()); + } + + private readonly struct Terrain + { + public readonly Rect Bounds; + public readonly float Relief; + public readonly float Phase; + public readonly bool Dunes; + + public Terrain(Rect bounds, float relief, float phase, bool dunes) + { + Bounds = bounds; + Relief = relief; + Phase = phase; + Dunes = dunes; + } + } + + private readonly struct Trunk + { + public readonly Vector2 Center; + public readonly float RadiusSquared; + + public Trunk(Vector2 center, float radiusSquared) + { + Center = center; + RadiusSquared = radiusSquared; + } + } + + private readonly struct Shape + { + public readonly Vector3[] Vertices; + public readonly int[] Indices; + + public Shape(Vector3[] vertices, int[] indices) + { + Vertices = vertices; + Indices = indices; + } + } + + private sealed class Surface + { + private readonly List vertices = new(); + private readonly List indices = new(); + private readonly string hex; + private readonly Shader shader; + + public Surface(string hex, Shader shader) + { + this.hex = hex; + this.shader = shader; + } + + public void Add(Shape shape, Vector3 position, Vector3 scale, Quaternion rotation) + { + int first = vertices.Count; + foreach (Vector3 vertex in shape.Vertices) + vertices.Add(position + rotation * Vector3.Scale(vertex, scale)); + foreach (int index in shape.Indices) + indices.Add(first + index); + } + + public void Quad(Vector3 a, Vector3 b, Vector3 c, Vector3 d) + { + int first = vertices.Count; + vertices.Add(a); + vertices.Add(b); + vertices.Add(c); + vertices.Add(d); + indices.Add(first); + indices.Add(first + 1); + indices.Add(first + 2); + indices.Add(first); + indices.Add(first + 2); + indices.Add(first + 3); + } + + public void Triangle(Vector3 a, Vector3 b, Vector3 c) + { + int first = vertices.Count; + vertices.Add(a); + vertices.Add(b); + vertices.Add(c); + indices.Add(first); + indices.Add(first + 1); + indices.Add(first + 2); + } + + public void Build(Transform parent, DomeEnvironment profile) + { + Mesh mesh = new() { name = "Biome " + hex }; + if (vertices.Count > ushort.MaxValue) + mesh.indexFormat = IndexFormat.UInt32; + + mesh.SetVertices(vertices); + mesh.SetTriangles(indices, 0); + mesh.RecalculateNormals(); + mesh.RecalculateBounds(); + profile.Own(mesh); + + ColorUtility.TryParseHtmlString(hex, out Color color); + Material material = new(shader) { name = mesh.name, color = color }; + material.SetFloat("_Glossiness", 0.18f); + profile.Own(material); + + GameObject part = new(mesh.name); + part.transform.SetParent(parent, false); + part.AddComponent().sharedMesh = mesh; + part.AddComponent().sharedMaterial = material; + } + } + } +} diff --git a/Assets/DomeShift/DomeBiomes.cs.meta b/Assets/DomeShift/DomeBiomes.cs.meta new file mode 100644 index 0000000..d3f238f --- /dev/null +++ b/Assets/DomeShift/DomeBiomes.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: af8da8bfaf3c6175fb7f1646e037f555 \ No newline at end of file diff --git a/Assets/DomeShift/DomeEnvironment.cs b/Assets/DomeShift/DomeEnvironment.cs new file mode 100644 index 0000000..207a2bc --- /dev/null +++ b/Assets/DomeShift/DomeEnvironment.cs @@ -0,0 +1,294 @@ +using System.Collections.Generic; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace DomeShift +{ + public enum DomeRegion + { + Rainforest, + Ocean, + MangroveWetlands, + Savanna, + Orchard, + ThornScrub, + FogDesert, + Agriculture, + HumanHabitat, + Technosphere + } + + [DisallowMultipleComponent] + [ExecuteAlways] + public sealed class DomeEnvironment : MonoBehaviour + { + private const string GeneratedName = "Generated Bio-Dome"; + internal const float HalfWidth = 43f; + internal const float HalfDepth = 32f; + + internal static readonly Vector2 Spawn = new(0f, -23f); + private static readonly Vector2[] Sites = + { + new(23f, -17f), new(-3f, 13f), new(-27f, -15f), + new(24f, -9f), new(18f, 11f), new(-7f, -3f), new(0f, -29f) + }; + + [Header("Footprint and roof")] + [SerializeField, Range(68f, 126f)] private float width = 86f; + [SerializeField, Range(52f, 96f)] private float depth = 64f; + [SerializeField, Range(10f, 22f)] private float roofHeight = 13f; + [SerializeField, Range(4, 12)] private int roofBays = 7; + [SerializeField] private bool glazing = true; + [SerializeField, Range(0.06f, 0.4f)] private float glazingOpacity = 0.16f; + + [Header("Landscape")] + [SerializeField] private int seed = 1996; + [SerializeField, Range(0.3f, 1.5f)] private float vegetationDensity = 1f; + [SerializeField, Range(0f, 1.6f)] private float terrainRelief = 1f; + + [Header("Region density")] + [SerializeField, Range(0.35f, 1.55f)] private float rainforest = 1f; + [SerializeField, Range(0.35f, 1.55f)] private float tropicalLagoon = 1f; + [SerializeField, Range(0.35f, 1.55f)] private float mangroveWetlands = 1f; + [SerializeField, Range(0.35f, 1.55f)] private float savanna = 1f; + [SerializeField, Range(0.35f, 1.55f)] private float orchard = 1f; + [SerializeField, Range(0.35f, 1.55f)] private float thornScrub = 1f; + [SerializeField, Range(0.35f, 1.55f)] private float greatDesert = 1f; + [SerializeField, Range(0.35f, 1.55f)] private float farm = 1f; + [SerializeField, Range(0.35f, 1.55f)] private float humanHabitat = 1f; + [SerializeField, Range(0.35f, 1.55f)] private float technosphere = 1f; + + [Header("Editor preview")] + [SerializeField] private bool showScenePreview = true; + [SerializeField] private bool sceneCutaway; + + private readonly List owned = new(); + private Transform generated; + private DomeArchitecture architecture; + private DomeBiomes biomes; + + public float Width => width; + public float Depth => depth; + public float RoofHeight => roofHeight; + public int RoofBays => roofBays; + public bool Glazing => glazing; + public float GlazingOpacity => glazingOpacity; + public int Seed => seed; + public float VegetationDensity => vegetationDensity; + public float TerrainRelief => terrainRelief; + + public float DensityFor(DomeRegion region) => region switch + { + DomeRegion.Rainforest => rainforest, + DomeRegion.Ocean => tropicalLagoon, + DomeRegion.MangroveWetlands => mangroveWetlands, + DomeRegion.Savanna => savanna, + DomeRegion.Orchard => orchard, + DomeRegion.ThornScrub => thornScrub, + DomeRegion.FogDesert => greatDesert, + DomeRegion.Agriculture => farm, + DomeRegion.HumanHabitat => humanHabitat, + DomeRegion.Technosphere => technosphere, + _ => 1f + }; + + public static string RegionName(DomeRegion region) => region switch + { + DomeRegion.Rainforest => "Rainforest", + DomeRegion.Ocean => "Tropical Lagoon", + DomeRegion.MangroveWetlands => "Mangrove Wetlands", + DomeRegion.Savanna => "Savanna", + DomeRegion.Orchard => "Orchard", + DomeRegion.ThornScrub => "Thorn Scrub", + DomeRegion.FogDesert => "Great Desert", + DomeRegion.Agriculture => "Farm", + DomeRegion.HumanHabitat => "Human Habitat", + DomeRegion.Technosphere => "Technosphere", + _ => "" + }; + + internal static DomeRegion RegionAt(Vector2 p) + { + const float division = 14f; + if (p.y >= 10.5f) + { + if (p.x < -division) return DomeRegion.Rainforest; + return p.x > division ? DomeRegion.MangroveWetlands : DomeRegion.Ocean; + } + + if (p.y <= -11f) + { + if (p.x < -division) return DomeRegion.Agriculture; + return p.x > division ? DomeRegion.Technosphere : DomeRegion.HumanHabitat; + } + + if (p.x < -division) return DomeRegion.Savanna; + if (p.x <= division) return DomeRegion.Orchard; + return p.y > 0f ? DomeRegion.ThornScrub : DomeRegion.FogDesert; + } + + internal static Vector2 MapCoordinates(Vector2 p) + { + return new Vector2(Mathf.InverseLerp(-HalfWidth, HalfWidth, p.x), Mathf.InverseLerp(-HalfDepth, HalfDepth, p.y)); + } + + internal static Vector2 Site(int index) => Sites[index]; + + public T Own(T asset) where T : Object + { + asset.hideFlags = HideFlags.DontSaveInEditor | HideFlags.DontSaveInBuild; + owned.Add(asset); + return asset; + } + + internal Transform BuildForGame() + { +#if UNITY_EDITOR + EditorApplication.delayCall -= RebuildEditorPreview; +#endif + return Build(false); + } + + internal bool CanWalk(Vector2 point) + { + return Mathf.Abs(point.x) <= HalfWidth - 0.8f + && Mathf.Abs(point.y) <= HalfDepth - 0.8f + && Mathf.Abs(point.x) + Mathf.Abs(point.y) <= 67.1f + && biomes.CanWalk(point); + } + + internal float SurfaceY(Vector2 point) => biomes.SurfaceY(point); + internal void SetCutaway(bool cutaway) => architecture.SetCutaway(cutaway); + + private Transform Build(bool preview) + { + Clear(); + GameObject root = new(GeneratedName); + if (preview) + root.hideFlags = HideFlags.DontSaveInEditor | HideFlags.DontSaveInBuild | HideFlags.NotEditable; + + generated = root.transform; + generated.SetParent(transform, false); + generated.localScale = new Vector3(Width / (HalfWidth * 2f), 1f, Depth / (HalfDepth * 2f)); + architecture = DomeArchitecture.Create(generated, this); + biomes = DomeBiomes.Create(generated, this); + + if (preview) + { + architecture.SetCutaway(sceneCutaway); + GameObject lightObject = new("Preview sunlight"); + lightObject.transform.SetParent(generated, false); + lightObject.transform.localRotation = Quaternion.Euler(49f, -33f, 0f); + Light light = lightObject.AddComponent(); + light.type = LightType.Directional; + light.color = new Color32(255, 236, 205, 255); + light.intensity = 1.05f; + light.shadows = LightShadows.Soft; + } + + return generated; + } + + private void Clear() + { + Transform previous = generated != null ? generated : transform.Find(GeneratedName); + if (previous != null) + { + if (Application.IsPlaying(gameObject)) + { + previous.gameObject.SetActive(false); + Destroy(previous.gameObject); + } + else + DestroyImmediate(previous.gameObject); + } + + foreach (Object asset in owned) + { + if (asset == null) continue; + if (Application.IsPlaying(gameObject)) + Destroy(asset); + else + DestroyImmediate(asset); + } + + owned.Clear(); + generated = null; + } + + private void OnDestroy() + { +#if UNITY_EDITOR + EditorApplication.delayCall -= RebuildEditorPreview; +#endif + Clear(); + } + +#if UNITY_EDITOR + private void OnEnable() + { + QueueEditorPreview(); + } + + private void OnValidate() + { + QueueEditorPreview(); + } + + private void OnDisable() + { + EditorApplication.delayCall -= RebuildEditorPreview; + if (!Application.IsPlaying(gameObject)) + Clear(); + } + + private void QueueEditorPreview() + { + EditorApplication.delayCall -= RebuildEditorPreview; + if (!Application.isBatchMode && !EditorApplication.isPlayingOrWillChangePlaymode) + EditorApplication.delayCall += RebuildEditorPreview; + } + + internal void RebuildEditorPreview() + { + EditorApplication.delayCall -= RebuildEditorPreview; + if (this == null || Application.isBatchMode || EditorApplication.isPlayingOrWillChangePlaymode + || BuildPipeline.isBuildingPlayer || !gameObject.scene.IsValid() || EditorUtility.IsPersistent(this)) + return; + + if (showScenePreview && isActiveAndEnabled) + Build(true); + else + Clear(); + + SceneView.RepaintAll(); + } +#endif + } + +#if UNITY_EDITOR + [CustomEditor(typeof(DomeEnvironment))] + internal sealed class DomeEnvironmentInspector : Editor + { + public override void OnInspectorGUI() + { + DrawDefaultInspector(); + DomeEnvironment environment = (DomeEnvironment)target; + using (new EditorGUI.DisabledScope(EditorApplication.isPlayingOrWillChangePlaymode)) + { + if (GUILayout.Button("Rebuild scene preview")) + environment.RebuildEditorPreview(); + + if (GUILayout.Button("Frame the Bio-Dome") && SceneView.lastActiveSceneView != null) + { + Bounds bounds = new(environment.transform.position + Vector3.up * (environment.RoofHeight / 2f), + new Vector3(environment.Width + 8f, environment.RoofHeight, environment.Depth + 8f)); + SceneView.lastActiveSceneView.Frame(bounds, false); + } + } + } + } +#endif +} diff --git a/Assets/DomeShift/DomeEnvironment.cs.meta b/Assets/DomeShift/DomeEnvironment.cs.meta new file mode 100644 index 0000000..286564f --- /dev/null +++ b/Assets/DomeShift/DomeEnvironment.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a1cd053bdf36416a8c366d714d731aea diff --git a/Assets/DomeShift/DomeGame.cs b/Assets/DomeShift/DomeGame.cs new file mode 100644 index 0000000..1640588 --- /dev/null +++ b/Assets/DomeShift/DomeGame.cs @@ -0,0 +1,571 @@ +using UnityEngine; + +namespace DomeShift +{ + public enum GamePhase + { + Title, + Playing, + Paused, + Won, + Lost + } + + public enum PlayableCharacter + { + Bud, + Doyle + } + + [DisallowMultipleComponent] + [RequireComponent(typeof(DomeEnvironment))] + public sealed class DomeGame : MonoBehaviour + { + private const int AllRepaired = 0b111; + private const int Airlock = 6; + private const float WalkSpeed = 8.2f; + private const string MuteKey = "DomeShift.Muted"; + + private static readonly string[] StationNames = { "Generator", "Cooling", "Hydroponics" }; + private static readonly string[] PartNames = { "Fuse", "Mesh filter", "Seed pack" }; + private static readonly string[] Repairs = + { + "Power's back. Good news for everything that was blinking.", + "Cooling's back. The tomatoes can stop sweating.", + "Hydroponics is online. The basil has withdrawn its complaint." + }; + private static readonly Color[] PartColors = + { + new Color32(255, 186, 92, 255), + new Color32(106, 215, 247, 255), + new Color32(164, 228, 128, 255) + }; + + private static readonly float[] PointRanges = { 2.6f, 2.6f, 2.6f, 1.9f, 1.9f, 1.9f, 2.05f }; + private static readonly float[] MarkerHeights = { 2.35f, 2.75f, 2.35f, 1.65f, 1.65f, 1.65f, 2.6f }; + + // Footprints include clearance for the worker's shoulders. + private static readonly Rect[] Obstacles = + { + Footprint(0, 0.48f, 1.17f, 0.65f), + Footprint(1, 0.53f, 1.10f, 0.81f), + Footprint(2, 0.62f, 1.35f, 0.67f), + Footprint(3, 0f, 0.44f, 0.44f), + Footprint(4, 0f, 0.44f, 0.44f), + Footprint(5, 0f, 0.44f, 0.44f) + }; + + private DomeEnvironment environment; + private Transform environmentRoot; + private DomeWorld world; + private DomeHud hud; + private DomeAudio audioBus; + private Camera domeCamera; + private GUIStyle markerStyle; + private Vector2 playerPosition; + private Vector2Int windowSize = new(1920, 1080); + private float worldTime; + private float displayTransitionUntil = -1f; + private int nearby = -1; + + public GamePhase Phase { get; private set; } = GamePhase.Title; + public PlayableCharacter Character { get; private set; } = PlayableCharacter.Bud; + public bool Exploring { get; private set; } + public bool MapOpen { get; private set; } + public bool Cutaway { get; private set; } + public bool Overview { get; private set; } + public DomeRegion CurrentRegion => DomeEnvironment.RegionAt(playerPosition); + public Vector2 MapPosition => DomeEnvironment.MapCoordinates(playerPosition); + public float RoundLength => 150f; + public float TimeLeft { get; private set; } + public int RepairedMask { get; private set; } + public int Carried { get; private set; } = -1; + public bool Muted => audioBus.Muted; + public bool Fullscreen => Screen.fullScreen; + public bool CanToggleFullscreen => !Application.isEditor; + public string Dispatch { get; private set; } = ""; + public Vector2 MapPoint(int index) => DomeEnvironment.MapCoordinates(DomeEnvironment.Site(index)); + + public string Prompt + { + get + { + if (nearby == -1) + return RepairedMask == AllRepaired ? "Head to the airlock" : ""; + + if (nearby == Airlock) + return RepairedMask == AllRepaired ? "E Cycle the airlock" : "Airlock sealed until repairs are complete"; + + if (nearby < PartNames.Length) + { + if (IsRepaired(nearby)) + return $"{StationNames[nearby]} is online"; + + return Carried == nearby ? $"E Install {PartNames[nearby].ToLowerInvariant()}" : $"{StationNames[nearby]} needs a {PartNames[nearby].ToLowerInvariant()}"; + } + + int part = nearby - PartNames.Length; + return Carried == -1 ? $"E Pick up {PartNames[part].ToLowerInvariant()}" : $"E Swap for {PartNames[part].ToLowerInvariant()}"; + } + } + + private void Awake() + { + environment = GetComponent(); + environmentRoot = environment.BuildForGame(); + world = DomeWorld.Create(environmentRoot, environment); + world.SetCharacter(Character); + hud = new DomeHud(); + audioBus = gameObject.AddComponent(); + audioBus.Muted = PlayerPrefs.GetInt(MuteKey, 0) == 1; + + GameObject cameraObject = new("Dome Camera"); + cameraObject.transform.SetParent(transform, false); + cameraObject.tag = "MainCamera"; + domeCamera = cameraObject.AddComponent(); + cameraObject.AddComponent(); + domeCamera.clearFlags = CameraClearFlags.SolidColor; + domeCamera.backgroundColor = new Color32(30, 51, 58, 255); + domeCamera.orthographic = true; + domeCamera.nearClipPlane = 0.1f; + domeCamera.farClipPlane = 400f; + domeCamera.allowMSAA = true; + + TimeLeft = RoundLength; + SetPlayerPosition(DomeEnvironment.Spawn); + FrameDome(); + world.Tick(Vector2.zero, Carried, RepairedMask, 0f); + } + + private void Update() + { + if (Input.GetKeyDown(KeyCode.M)) + ToggleMute(); + if (Input.GetKeyDown(KeyCode.F11)) + ToggleFullscreen(); + + bool enter = Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter); + bool escape = Input.GetKeyDown(KeyCode.Escape); + + switch (Phase) + { + case GamePhase.Title: + UpdateTitle(enter); + break; + case GamePhase.Playing: + if (escape) + Pause(); + else + PlayFrame(); + break; + case GamePhase.Paused: + if (Exploring && Input.GetKeyDown(KeyCode.B)) + ChooseCharacter(); + else if (escape || enter) + Resume(); + break; + case GamePhase.Won: + case GamePhase.Lost: + if (Input.GetKeyDown(KeyCode.B)) + ChooseCharacter(); + else if (enter || Input.GetKeyDown(KeyCode.R)) + Restart(); + break; + } + + FrameDome(); + } + + private void OnApplicationFocus(bool hasFocus) + { + if (!hasFocus && Phase == GamePhase.Playing && Time.unscaledTime >= displayTransitionUntil) + Pause(); + } + + private void OnGUI() + { + if (Phase == GamePhase.Playing && !MapOpen && !(Exploring && Overview) && Event.current.type == EventType.Repaint) + DrawMarkers(); + + hud.Draw(this); + } + + public void StartShift() + { + EnterDome(false); + } + + public void StartExplore() + { + EnterDome(true); + } + + private void EnterDome(bool explore) + { + ResetRun(); + Exploring = explore; + Overview = false; + SetCutaway(true); + Dispatch = explore + ? $"{Character}, wander the dome at your own pace. Press Tab for the map." + : $"{Character}, match the spares on the stands to the station colors."; + Phase = GamePhase.Playing; + audioBus.Play(DomeAudio.Cue.Start); + } + + public void SelectCharacter(PlayableCharacter character) + { + if (Phase != GamePhase.Title || Character == character || + (character != PlayableCharacter.Bud && character != PlayableCharacter.Doyle)) + return; + + Character = character; + world.SetCharacter(Character); + } + + public void ChooseCharacter() + { + if (Phase != GamePhase.Won && Phase != GamePhase.Lost && !(Phase == GamePhase.Paused && Exploring)) + return; + + ResetRun(); + Exploring = false; + Overview = false; + SetCutaway(false); + Phase = GamePhase.Title; + } + + public void Restart() + { + EnterDome(Exploring); + } + + public void Resume() + { + if (Phase == GamePhase.Paused) + Phase = GamePhase.Playing; + } + + public void ToggleMute() + { + audioBus.Muted = !audioBus.Muted; + PlayerPrefs.SetInt(MuteKey, audioBus.Muted ? 1 : 0); + PlayerPrefs.Save(); + } + + public void ToggleFullscreen() + { + if (!CanToggleFullscreen) + return; + + Resolution desktop = Screen.currentResolution; + displayTransitionUntil = Time.unscaledTime + 0.75f; + if (Fullscreen) + { + Screen.SetResolution(Mathf.Min(windowSize.x, desktop.width), Mathf.Min(windowSize.y, desktop.height), + FullScreenMode.Windowed); + return; + } + + windowSize = new Vector2Int(Screen.width, Screen.height); + Screen.SetResolution(desktop.width, desktop.height, FullScreenMode.FullScreenWindow); + } + + public void ToggleMap() + { + MapOpen = !MapOpen; + } + + public void ToggleRoof() + { + SetCutaway(!Cutaway); + if (!Cutaway) + Overview = true; + } + + public void ToggleOverview() + { + Overview = !Overview; + if (!Overview) + SetCutaway(true); + } + + private void SetCutaway(bool cutaway) + { + Cutaway = cutaway; + environment.SetCutaway(cutaway); + } + + private void Pause() + { + Phase = GamePhase.Paused; + world.Tick(Vector2.zero, Carried, RepairedMask, worldTime); + } + + private void ResetRun() + { + TimeLeft = RoundLength; + RepairedMask = 0; + Carried = -1; + nearby = -1; + worldTime = 0f; + MapOpen = false; + Dispatch = ""; + SetPlayerPosition(DomeEnvironment.Spawn); + world.Tick(Vector2.zero, Carried, RepairedMask, worldTime); + } + + private void UpdateTitle(bool enter) + { + if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKeyDown(KeyCode.Alpha1) || Input.GetKeyDown(KeyCode.Keypad1)) + SelectCharacter(PlayableCharacter.Bud); + else if (Input.GetKeyDown(KeyCode.RightArrow) || Input.GetKeyDown(KeyCode.Alpha2) || Input.GetKeyDown(KeyCode.Keypad2)) + SelectCharacter(PlayableCharacter.Doyle); + + if (Input.GetKeyDown(KeyCode.X)) + StartExplore(); + else if (enter) + StartShift(); + else + AnimateWorld(Vector2.zero); + } + + private void PlayFrame() + { + if (Input.GetKeyDown(KeyCode.Tab)) ToggleMap(); + if (Input.GetKeyDown(KeyCode.V)) ToggleRoof(); + if (Input.GetKeyDown(KeyCode.C)) ToggleOverview(); + + if (!Exploring) + TimeLeft = Mathf.Max(0f, TimeLeft - Time.deltaTime); + if (!Exploring && TimeLeft <= 0f) + { + Phase = GamePhase.Lost; + Dispatch = "The safety timer locked out the dome."; + world.Tick(Vector2.zero, Carried, RepairedMask, worldTime); + audioBus.Play(DomeAudio.Cue.Lost); + return; + } + + Vector2 input = new( + Axis(KeyCode.D, KeyCode.RightArrow, KeyCode.A, KeyCode.LeftArrow), + Axis(KeyCode.W, KeyCode.UpArrow, KeyCode.S, KeyCode.DownArrow)); + Vector2 positionBefore = playerPosition; + Move(Vector2.ClampMagnitude(input, 1f) * (WalkSpeed * Mathf.Min(Time.deltaTime, 0.08f))); + + nearby = ClosestPoint(); + if (Input.GetKeyDown(KeyCode.E)) + { + Interact(); + nearby = ClosestPoint(); + } + + Vector2 displacement = playerPosition - positionBefore; + AnimateWorld(Phase == GamePhase.Playing ? displacement.normalized : Vector2.zero); + } + + private static int Axis(KeyCode positive, KeyCode positiveArrow, KeyCode negative, KeyCode negativeArrow) + { + int forward = Input.GetKey(positive) || Input.GetKey(positiveArrow) ? 1 : 0; + int backward = Input.GetKey(negative) || Input.GetKey(negativeArrow) ? 1 : 0; + return forward - backward; + } + + private void AnimateWorld(Vector2 motion) + { + worldTime += Time.deltaTime; + world.Tick(motion, Carried, RepairedMask, worldTime); + } + + private void Move(Vector2 movement) + { + Vector2 horizontal = new(playerPosition.x + movement.x, playerPosition.y); + if (CanWalk(horizontal)) + SetPlayerPosition(horizontal); + + Vector2 vertical = new(playerPosition.x, playerPosition.y + movement.y); + if (CanWalk(vertical)) + SetPlayerPosition(vertical); + } + + private bool CanWalk(Vector2 position) + { + foreach (Rect obstacle in Obstacles) + { + if (obstacle.Contains(position)) + return false; + } + + return environment.CanWalk(position); + } + + private static Rect Footprint(int index, float zOffset, float halfWidth, float halfDepth) + { + const float clearance = 0.27f; + Vector2 point = DomeEnvironment.Site(index); + return new Rect(point.x - halfWidth - clearance, point.y + zOffset - halfDepth - clearance, + (halfWidth + clearance) * 2f, (halfDepth + clearance) * 2f); + } + + private void SetPlayerPosition(Vector2 position) + { + playerPosition = position; + world.Player.localPosition = new Vector3(position.x, environment.SurfaceY(position), position.y); + } + + private bool IsRepaired(int station) + { + return (RepairedMask & (1 << station)) != 0; + } + + private int ClosestPoint() + { + int closest = -1; + float nearestDistance = float.PositiveInfinity; + for (int i = 0; i < PointRanges.Length; i++) + { + if (i >= PartNames.Length && i < Airlock) + { + int part = i - PartNames.Length; + if (Carried == part || IsRepaired(part)) + continue; + } + + float distance = (playerPosition - DomeEnvironment.Site(i)).sqrMagnitude; + if (distance <= PointRanges[i] * PointRanges[i] && distance < nearestDistance) + { + closest = i; + nearestDistance = distance; + } + } + + return closest; + } + + private void Interact() + { + if (nearby == -1) + return; + + if (nearby == Airlock) + { + if (RepairedMask == AllRepaired) + { + Phase = GamePhase.Won; + Dispatch = "Inez here. Bring that exit survey back blank, like everyone else."; + audioBus.Play(DomeAudio.Cue.Won); + } + else + { + Dispatch = "The airlock needs all three stations online."; + audioBus.Play(DomeAudio.Cue.Denied); + } + + return; + } + + if (nearby >= PartNames.Length) + { + int previous = Carried; + Carried = nearby - PartNames.Length; + Dispatch = previous == -1 + ? $"Take the {PartNames[Carried].ToLowerInvariant()} to {StationNames[Carried]}." + : $"Swapped parts. The {PartNames[previous].ToLowerInvariant()} went back to its stand."; + audioBus.Play(DomeAudio.Cue.Pickup); + return; + } + + if (IsRepaired(nearby)) + return; + + if (Carried != nearby) + { + Dispatch = $"Find the {PartNames[nearby].ToLowerInvariant()} for {StationNames[nearby]}."; + audioBus.Play(DomeAudio.Cue.Denied); + return; + } + + RepairedMask |= 1 << nearby; + Carried = -1; + Dispatch = RepairedMask == AllRepaired + ? "Interlock cleared. Head back to the airlock." + : Repairs[nearby]; + audioBus.Play(DomeAudio.Cue.Repair); + } + + private void FrameDome() + { + bool title = Phase == GamePhase.Title; + float aspect = Mathf.Max(domeCamera.aspect, 0.1f); + if (title || Overview) + { + float shift = title ? Mathf.Min(environment.Width * 0.18f, aspect * 9f) : 0f; + Vector3 center = environmentRoot.position + new Vector3(-shift, environment.RoofHeight * 0.23f, -1f); + float projectedWidth = environment.Width * 0.5f + environment.Depth * 0.09f + 4.5f + shift; + domeCamera.transform.position = center + new Vector3(15f, 67f, -79f); + domeCamera.transform.LookAt(center); + domeCamera.orthographicSize = Mathf.Max(environment.Depth * 0.35f + environment.RoofHeight * 0.62f + 3f, + projectedWidth / aspect); + return; + } + + Vector3 lookAt = world.Player.position + new Vector3(0f, 0.5f, 1.15f); + domeCamera.transform.position = lookAt + new Vector3(0f, 16f, -20f); + domeCamera.transform.LookAt(lookAt); + domeCamera.orthographicSize = Mathf.Max(9.4f, 11.5f / aspect); + } + + private void DrawMarkers() + { + markerStyle ??= new GUIStyle(GUI.skin.label) + { + alignment = TextAnchor.MiddleCenter, + fontStyle = FontStyle.Bold, + clipping = TextClipping.Overflow + }; + float scale = Mathf.Clamp(Screen.height / 720f, 0.75f, 2.1f); + markerStyle.fontSize = Mathf.RoundToInt(12f * scale); + + Color previousColor = GUI.color; + for (int i = 0; i < PointRanges.Length; i++) + { + if (i == Airlock) + { + bool open = RepairedMask == AllRepaired; + DrawMarker(i, open ? "Airlock open" : "Airlock", open ? PartColors[2] : new Color32(178, 196, 204, 255), scale); + } + else if (i < PartNames.Length) + { + DrawMarker(i, StationNames[i], PartColors[i], scale); + } + else + { + int part = i - PartNames.Length; + if (Carried != part && !IsRepaired(part)) + DrawMarker(i, PartNames[part], PartColors[part], scale); + } + } + GUI.color = previousColor; + } + + private void DrawMarker(int index, string label, Color accent, float scale) + { + Vector2 point = DomeEnvironment.Site(index); + Vector3 worldPoint = environmentRoot.TransformPoint(new Vector3(point.x, environment.SurfaceY(point) + MarkerHeights[index], point.y)); + Vector3 projected = domeCamera.WorldToScreenPoint(worldPoint); + if (projected.z <= 0f || projected.x < 2f || projected.x > Screen.width - 2f + || projected.y < 2f || projected.y > Screen.height - 2f) + return; + float width = Mathf.Max(52f, label.Length * 7 + 20f) * scale; + Rect rect = new(projected.x - width * 0.5f, Screen.height - projected.y - 9f * scale, width, 20f * scale); + + bool active = index == nearby; + GUI.color = active ? accent : new Color32(27, 39, 49, 235); + GUI.DrawTexture(rect, Texture2D.whiteTexture); + GUI.color = accent; + GUI.DrawTexture(new Rect(rect.x, rect.y, 3f * scale, rect.height), Texture2D.whiteTexture); + GUI.color = active ? new Color32(27, 39, 49, 255) : new Color32(241, 249, 244, 255); + GUI.Label(rect, label, markerStyle); + } + } +} diff --git a/Assets/DomeShift/DomeGame.cs.meta b/Assets/DomeShift/DomeGame.cs.meta new file mode 100644 index 0000000..0cd4bec --- /dev/null +++ b/Assets/DomeShift/DomeGame.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a70382bb493347e881e04525c8209ddb diff --git a/Assets/DomeShift/DomeHud.cs b/Assets/DomeShift/DomeHud.cs new file mode 100644 index 0000000..c54942f --- /dev/null +++ b/Assets/DomeShift/DomeHud.cs @@ -0,0 +1,695 @@ +using UnityEngine; + +namespace DomeShift +{ + internal sealed class DomeHud + { + private static readonly Color Panel = new Color32(18, 30, 29, 248); + private static readonly Color Inset = new Color32(29, 44, 41, 255); + private static readonly Color Border = new Color32(62, 85, 77, 255); + private static readonly Color Ink = new Color32(240, 243, 222, 255); + private static readonly Color MutedInk = new Color32(173, 196, 181, 255); + private static readonly Color Mint = new Color32(153, 236, 184, 255); + private static readonly Color Amber = new Color32(255, 194, 110, 255); + private static readonly Color Alarm = new Color32(255, 136, 118, 255); + private static readonly Color Shadow = new Color32(8, 13, 14, 84); + private static readonly Color Overlay = new Color32(8, 13, 14, 139); + private static readonly Color DoyleAccent = new Color32(147, 211, 239, 255); + private static readonly Color MapGround = new Color32(18, 32, 32, 255); + private static readonly Color MapCorridor = new Color32(85, 114, 103, 255); + private static readonly Color[] StationColors = + { + Amber, new Color32(124, 221, 240, 255), Mint + }; + + private static readonly string[] Stations = { "Generator", "Cooling", "Hydroponics" }; + private static readonly string[] Supplies = { "Fuse", "Mesh filter", "Seed pack" }; + private static readonly string[] Progress = { "0 / 3", "1 / 3", "2 / 3", "3 / 3" }; + private static readonly MapRegion[] RegionPlans = + { + new(DomeRegion.Rainforest, Rect.MinMaxRect(-42, 12, -15, 31), new Color32(119, 211, 157, 255), true), + new(DomeRegion.Ocean, Rect.MinMaxRect(-13, 12, 13, 31), new Color32(106, 202, 227, 255), true), + new(DomeRegion.MangroveWetlands, Rect.MinMaxRect(15, 12, 42, 31), new Color32(118, 197, 169, 255)), + new(DomeRegion.Savanna, Rect.MinMaxRect(-42, -9, -15, 9), new Color32(222, 198, 121, 255)), + new(DomeRegion.Orchard, Rect.MinMaxRect(-13, -9, 13, 9), new Color32(180, 208, 115, 255)), + new(DomeRegion.ThornScrub, Rect.MinMaxRect(15, 0.35f, 42, 9), new Color32(190, 181, 145, 255)), + new(DomeRegion.FogDesert, Rect.MinMaxRect(15, -9, 42, -0.35f), new Color32(230, 173, 133, 255), true), + new(DomeRegion.Agriculture, Rect.MinMaxRect(-42, -31, -15, -13), new Color32(188, 220, 118, 255), true), + new(DomeRegion.HumanHabitat, Rect.MinMaxRect(-13, -31, 13, -13), new Color32(197, 182, 211, 255)), + new(DomeRegion.Technosphere, Rect.MinMaxRect(15, -31, 42, -13), new Color32(159, 182, 212, 255)) + }; + + private readonly GUIStyle tag = Style(12, FontStyle.Bold); + private readonly GUIStyle tagRight = Style(12, FontStyle.Bold, TextAnchor.MiddleRight); + private readonly GUIStyle body = Style(16, wraps: true); + private readonly GUIStyle item = Style(16, FontStyle.Bold); + private readonly GUIStyle key = Style(12, FontStyle.Bold, TextAnchor.MiddleCenter); + private readonly GUIStyle time = Style(31, FontStyle.Bold, TextAnchor.MiddleRight); + private readonly GUIStyle title = Style(78, FontStyle.Bold); + private readonly GUIStyle headline = Style(42, FontStyle.Bold); + private readonly GUIStyle section = Style(22, FontStyle.Bold); + private readonly GUIStyle longLocation = Style(18, FontStyle.Bold); + private readonly GUIStyle regionLabel = Style(16, FontStyle.Bold, TextAnchor.MiddleCenter); + private readonly GUIStyle longRegionLabel = Style(14, FontStyle.Bold, TextAnchor.MiddleCenter); + private readonly GUIStyle prompt = Style(16, FontStyle.Bold, TextAnchor.MiddleCenter, true); + private readonly GUIStyle fine = Style(13, wraps: true); + + private int lastSeconds = -1; + private string clockText; + + public void Draw(DomeGame game) + { + if (Screen.width < 1 || Screen.height < 1) + return; + + Matrix4x4 originalMatrix = GUI.matrix; + float scale = Mathf.Min(Screen.width / 1100f, Screen.height / 700f); + float width = Screen.width / scale; + float height = Screen.height / scale; + GUI.matrix = Matrix4x4.Scale(new Vector3(scale, scale, 1)); + + try + { + if (game.Phase == GamePhase.Title) + { + DrawTitle(game, width, height); + return; + } + + DrawGameplay(game, width, height); + if (game.Phase == GamePhase.Playing) + { + if (game.MapOpen) + DrawMap(game, width, height); + } + else + DrawShiftCard(game, width, height); + } + finally + { + GUI.matrix = originalMatrix; + } + } + + private void DrawTitle(DomeGame game, float width, float height) + { + Fill(new Rect(0, 0, width, height), new Color32(14, 22, 21, 53)); + Rect card = new Rect(32, (height - 595) * 0.5f, 432, 595); + DrawPanel(card); + Fill(new Rect(card.x, card.y, 5, card.height), Amber); + + float left = card.x + 28; + float top = card.y + 27; + Label(new Rect(left, top, 314, 20), "GREENHOUSE MAINTENANCE", tag, Amber); + DrawBadge(card.xMax - 80, top + 8); + Label(new Rect(left - 3, top + 24, 338, 86), "DOME", title, Ink); + Label(new Rect(left - 3, top + 88, 338, 86), "SHIFT", title, Mint); + Fill(new Rect(left, top + 177, 375, 1), Border); + + Label(new Rect(left, top + 189, 350, 43), + "You came looking for a bathroom. The greenhouse locked you in.", body, Ink); + Label(new Rect(left, top + 232, 371, 57), + "Tour the Rainforest, Tropical Lagoon, Farm and Great Desert, or repair three stations before lockdown.", body, MutedInk); + + Label(new Rect(left, top + 299, 215, 19), "CHOOSE A CHARACTER", tag, Amber); + Label(new Rect(left + 206, top + 299, 169, 19), "LEFT / RIGHT ARROWS", tagRight, MutedInk); + DrawCharacterOption(game, new Rect(left, top + 324, 181, 58), PlayableCharacter.Bud); + DrawCharacterOption(game, new Rect(left + 194, top + 324, 181, 58), PlayableCharacter.Doyle); + + if (ActionButton(new Rect(left, top + 397, 375, 52), "EXPLORE DOME", "X")) + game.StartExplore(); + if (SecondaryButton(new Rect(left, top + 462, 375, 42), "Start timed shift", "ENTER", 63)) + game.StartShift(); + + float controls = top + 524; + DrawBinding(left, controls, 118, "WASD / ARROWS", "Move"); + DrawBinding(left + 175, controls, 30, "E", "Use"); + DrawBinding(left + 266, controls, 46, "ESC", "Pause"); + + if (game.CanToggleFullscreen) + DrawFullscreenButton(game, new Rect(width - 325, 24, 167, 34)); + DrawSoundButton(game, new Rect(width - 150, 24, 126, 34)); + } + + private void DrawGameplay(DomeGame game, float width, float height) + { + if (game.Exploring) + { + Rect location = new Rect(24, 24, 252, 75); + DrawPanel(location); + Fill(new Rect(location.x, location.y, 3, location.height), Mint); + Label(new Rect(location.x + 15, location.y + 12, 218, 18), + game.Character == PlayableCharacter.Bud ? "EXPLORING AS BUD" : "EXPLORING AS DOYLE", tag, Mint); + GUIStyle locationStyle = game.CurrentRegion == DomeRegion.MangroveWetlands ? longLocation : section; + Label(new Rect(location.x + 15, location.y + 34, 224, 27), DomeEnvironment.RegionName(game.CurrentRegion), locationStyle, Ink); + } + else + { + DrawObjectives(new Rect(24, 24, 252, 166), game.RepairedMask); + DrawClock(new Rect(width - 209, 24, 185, 82), game.TimeLeft, game.RoundLength); + } + + if (game.Phase == GamePhase.Playing) + DrawNavigation(game, width); + + float bottom = height - 24; + Rect radio = new Rect(24, bottom - 64, 326, 64); + Rect pocket = new Rect(width - 217, bottom - 64, 193, 64); + if (!string.IsNullOrWhiteSpace(game.Dispatch)) + DrawRadio(radio, game.Dispatch); + if (!game.Exploring || game.Carried >= 0) + DrawPocket(pocket, game.Carried, game.Character); + + float center = width * 0.5f; + if (!string.IsNullOrWhiteSpace(game.Prompt)) + { + Rect cue = new Rect(center - 184, bottom - 64, 368, 36); + DrawPanel(cue); + Fill(new Rect(cue.x, cue.y, 3, cue.height), Amber); + Label(new Rect(cue.x + 9, cue.y, cue.width - 18, cue.height), game.Prompt, prompt, Ink); + } + + Rect controls = new Rect(center - 192, bottom - 24, 384, 24); + Fill(controls, Panel); + Label(controls, "WASD / Arrows Move E Use Esc Pause M Sound", key, MutedInk); + } + + private void DrawNavigation(DomeGame game, float width) + { + float left = (width - 407) * 0.5f; + if (NavigationButton(new Rect(left, 24, 108, 33), "Map", "TAB", 34, game.MapOpen)) + game.ToggleMap(); + if (NavigationButton(new Rect(left + 115, 24, 143, 33), game.Overview ? "Overview cam" : "Follow cam", "C", 24, game.Overview)) + game.ToggleOverview(); + if (NavigationButton(new Rect(left + 265, 24, 142, 33), game.Cutaway ? "Roof cutaway" : "Roof visible", "V", 24, game.Cutaway)) + game.ToggleRoof(); + + if (!game.Exploring) + { + Rect location = new Rect(width * 0.5f - 118, 62, 236, 23); + Fill(location, Panel); + Label(location, DomeEnvironment.RegionName(game.CurrentRegion), key, MutedInk); + } + } + + private void DrawMap(DomeGame game, float width, float height) + { + Rect card = new Rect((width - 720) * 0.5f, (height - 550) * 0.5f, 720, 550); + DrawPanel(card); + Fill(new Rect(card.x, card.y, card.width, 3), Mint); + Label(new Rect(card.x + 22, card.y + 13, 235, 31), "Dome map", section, Ink); + Label(new Rect(card.x + 22, card.y + 43, 370, 19), DomeEnvironment.RegionName(game.CurrentRegion), tag, Mint); + if (NavigationButton(new Rect(card.xMax - 132, card.y + 19, 109, 32), "Close", "TAB", 34, false)) + game.ToggleMap(); + + Rect floor = new Rect(card.x + 80, card.y + 72, 560, 560f * DomeEnvironment.HalfDepth / DomeEnvironment.HalfWidth); + Fill(floor, MapGround); + Stroke(floor, MapCorridor); + foreach (MapRegion region in RegionPlans) + DrawMapRegion(floor, region, region.Region == game.CurrentRegion); + + DrawMapCorridor(floor, -14, true); + DrawMapCorridor(floor, 14, true); + DrawMapCorridor(floor, 10.5f, false); + DrawMapCorridor(floor, -11, false); + + DrawNorthArrow(card.x + 37, floor.y + 7); + if (!game.Exploring) + DrawChallengePins(floor, game); + + Vector2 player = CanvasPoint(floor, game.MapPosition); + DrawPlayerPin(player); + + float legendY = card.yMax - 42; + Fill(new Rect(card.x + 22, legendY - 7, card.width - 44, 1), Border); + DrawPlayerPin(new Vector2(card.x + 28, legendY + 12)); + Label(new Rect(card.x + 42, legendY, 91, 24), "You", fine, MutedInk); + Fill(new Rect(card.x + 103, legendY + 10, 12, 3), Amber); + Label(new Rect(card.x + 121, legendY, 111, 24), "Film tour", fine, MutedInk); + Fill(new Rect(card.x + 212, legendY + 10, 13, 2), MapCorridor); + Label(new Rect(card.x + 233, legendY, 92, 24), "Corridor", fine, MutedInk); + + if (!game.Exploring) + { + DrawMapPin(new Vector2(card.x + 331, legendY + 12), Ink, PinKind.Station); + Label(new Rect(card.x + 346, legendY, 84, 24), "Station", fine, MutedInk); + DrawMapPin(new Vector2(card.x + 438, legendY + 12), Ink, PinKind.Spare); + Label(new Rect(card.x + 451, legendY, 84, 24), "Spare", fine, MutedInk); + DrawMapPin(new Vector2(card.x + 527, legendY + 12), Ink, PinKind.Airlock); + Label(new Rect(card.x + 541, legendY, 133, 24), "Airlock", fine, MutedInk); + } + } + + private void DrawMapRegion(Rect floor, MapRegion region, bool current) + { + Vector2 upperLeft = WorldPoint(floor, region.Bounds.xMin, region.Bounds.yMax); + Vector2 lowerRight = WorldPoint(floor, region.Bounds.xMax, region.Bounds.yMin); + Rect area = Rect.MinMaxRect(upperLeft.x, upperLeft.y, lowerRight.x, lowerRight.y); + Fill(area, Color.Lerp(MapGround, region.Color, current ? 0.32f : 0.19f)); + Stroke(area, current ? Mint : Color.Lerp(MapGround, region.Color, 0.55f)); + + if (region.FilmTour) + Fill(new Rect(area.x + 8, area.y + 8, 12, 3), Amber); + if (current) + Fill(new Rect(area.x, area.y, 3, area.height), Mint); + + bool hasLung = region.Region == DomeRegion.Technosphere; + Rect label = new Rect(area.x + 6, area.center.y - (hasLung ? 23 : 14), area.width - 12, 28); + GUIStyle labelStyle = region.Region == DomeRegion.MangroveWetlands ? longRegionLabel : regionLabel; + Label(label, DomeEnvironment.RegionName(region.Region), labelStyle, Ink); + if (hasLung) + Label(new Rect(area.x + 6, area.center.y + 4, area.width - 12, 22), "Lung chambers", key, MutedInk); + } + + private static void DrawMapCorridor(Rect floor, float coordinate, bool vertical) + { + Vector2 center = vertical ? WorldPoint(floor, coordinate, 0) : WorldPoint(floor, 0, coordinate); + float length = vertical ? floor.height : floor.width; + for (float offset = 8; offset < length - 14; offset += 16) + { + Rect dash = vertical + ? new Rect(center.x - 0.5f, floor.y + offset, 1, 7) + : new Rect(floor.x + offset, center.y - 0.5f, 7, 1); + Fill(dash, MapCorridor); + } + } + + private void DrawNorthArrow(float x, float y) + { + Label(new Rect(x - 9, y, 18, 18), "N", key, MutedInk); + Fill(new Rect(x - 0.5f, y + 22, 1, 19), MutedInk); + Fill(new Rect(x - 2, y + 23, 4, 2), MutedInk); + Fill(new Rect(x - 4, y + 25, 8, 2), MutedInk); + } + + private void DrawChallengePins(Rect floor, DomeGame game) + { + string hovered = null; + Vector2 mouse = Event.current.mousePosition; + for (int index = 0; index < Stations.Length; index++) + { + bool online = (game.RepairedMask & (1 << index)) != 0; + Vector2 station = CanvasPoint(floor, game.MapPoint(index)); + DrawMapPin(station, online ? MutedInk : StationColors[index], PinKind.Station); + if ((mouse - station).sqrMagnitude < 80f) + hovered = Stations[index]; + + if (online || game.Carried == index) + continue; + + Vector2 supply = CanvasPoint(floor, game.MapPoint(index + Stations.Length)); + DrawMapPin(supply, StationColors[index], PinKind.Spare); + if ((mouse - supply).sqrMagnitude < 80f) + hovered = Supplies[index]; + } + + Vector2 exit = CanvasPoint(floor, game.MapPoint(6)); + DrawMapPin(exit, CountRepairs(game.RepairedMask) == 3 ? Mint : Ink, PinKind.Airlock); + if ((mouse - exit).sqrMagnitude < 80f) + hovered = "Airlock"; + + if (hovered != null) + { + Rect tooltip = new Rect(Mathf.Clamp(mouse.x - 67, floor.xMin, floor.xMax - 134), mouse.y - 35, 134, 23); + DrawPanel(tooltip); + Label(tooltip, hovered, key, Ink); + } + } + + private static void DrawMapPin(Vector2 point, Color color, PinKind kind) + { + Rect square = new Rect(point.x - 5, point.y - 5, 10, 10); + Fill(square, MapGround); + if (kind == PinKind.Station) + { + Stroke(square, color); + Fill(new Rect(point.x - 2, point.y - 2, 4, 4), color); + } + else if (kind == PinKind.Spare) + { + Fill(new Rect(point.x - 3, point.y - 3, 6, 6), color); + } + else + { + Fill(new Rect(point.x - 4, point.y - 1, 8, 2), color); + Fill(new Rect(point.x - 1, point.y - 4, 2, 8), color); + } + } + + private static void DrawPlayerPin(Vector2 point) + { + Fill(new Rect(point.x - 7, point.y - 7, 14, 14), MapGround); + Stroke(new Rect(point.x - 6, point.y - 6, 12, 12), Mint); + Fill(new Rect(point.x - 3, point.y - 3, 6, 6), Ink); + } + + private static Vector2 WorldPoint(Rect floor, float x, float z) + { + return CanvasPoint(floor, DomeEnvironment.MapCoordinates(new Vector2(x, z))); + } + + private static Vector2 CanvasPoint(Rect floor, Vector2 normalized) + { + return new Vector2(floor.x + Mathf.Clamp01(normalized.x) * floor.width, + floor.yMax - Mathf.Clamp01(normalized.y) * floor.height); + } + + private enum PinKind + { + Station, + Spare, + Airlock + } + + private readonly struct MapRegion + { + public readonly DomeRegion Region; + public readonly Rect Bounds; + public readonly Color Color; + public readonly bool FilmTour; + + public MapRegion(DomeRegion region, Rect bounds, Color color, bool filmTour = false) + { + Region = region; + Bounds = bounds; + Color = color; + FilmTour = filmTour; + } + } + + private void DrawObjectives(Rect rect, int repairedMask) + { + DrawPanel(rect); + int repaired = CountRepairs(repairedMask); + string currentGoal = repaired == 3 ? "RETURN TO THE AIRLOCK" : "RESTORE THE DOME"; + Color goalColor = repaired == 3 ? Mint : Amber; + Fill(new Rect(rect.x, rect.y, rect.width, 3), goalColor); + Label(new Rect(rect.x + 14, rect.y + 12, 174, 22), currentGoal, tag, goalColor); + Label(new Rect(rect.xMax - 49, rect.y + 12, 35, 22), Progress[repaired], tagRight, MutedInk); + + for (int index = 0; index < Stations.Length; index++) + { + bool online = (repairedMask & (1 << index)) != 0; + Rect row = new Rect(rect.x + 10, rect.y + 42 + index * 38, rect.width - 20, 33); + Fill(row, Inset); + DrawStationIcon(row.x + 9, row.y + 8, index, StationColors[index]); + Label(new Rect(row.x + 33, row.y, 118, row.height), Stations[index], item, Ink); + Label(new Rect(row.xMax - 68, row.y, 59, row.height), online ? "ONLINE" : "OFFLINE", tagRight, online ? Mint : MutedInk); + } + } + + private void DrawClock(Rect rect, float remaining, float duration) + { + DrawPanel(rect); + Color color = remaining <= 15f ? Alarm : Amber; + Label(new Rect(rect.x + 13, rect.y + 13, 81, 17), "SAFETY", tag, MutedInk); + Label(new Rect(rect.x + 13, rect.y + 32, 81, 17), "LOCKOUT IN", tag, MutedInk); + Label(new Rect(rect.xMax - 85, rect.y + 9, 71, 43), TimeText(remaining), time, color); + + Rect meter = new Rect(rect.x + 13, rect.yMax - 20, rect.width - 26, 6); + Fill(meter, Inset); + float ratio = duration > 0 ? Mathf.Clamp01(remaining / duration) : 0; + Fill(new Rect(meter.x, meter.y, meter.width * ratio, meter.height), color); + } + + private void DrawRadio(Rect rect, string message) + { + DrawPanel(rect); + Fill(new Rect(rect.x + 14, rect.y + 15, 6, 6), Mint); + Label(new Rect(rect.x + 27, rect.y + 9, rect.width - 39, 18), "DISPATCH", tag, Mint); + Label(new Rect(rect.x + 14, rect.y + 26, rect.width - 28, 30), message, fine, Ink); + } + + private void DrawPocket(Rect rect, int carried, PlayableCharacter character) + { + DrawPanel(rect); + Label(new Rect(rect.x + 14, rect.y + 9, rect.width - 28, 18), + character == PlayableCharacter.Bud ? "BUD'S TOOL BELT" : "DOYLE'S TOOL BELT", tag, CharacterAccent(character)); + bool occupied = carried >= 0 && carried < Supplies.Length; + if (occupied) + DrawStationIcon(rect.x + 15, rect.y + 35, carried, StationColors[carried]); + Label(new Rect(rect.x + (occupied ? 39 : 14), rect.y + 27, rect.width - 49, 30), + occupied ? Supplies[carried] : "Empty", item, occupied ? Ink : MutedInk); + } + + private void DrawShiftCard(DomeGame game, float width, float height) + { + Fill(new Rect(0, 0, width, height), Overlay); + bool won = game.Phase == GamePhase.Won; + bool paused = game.Phase == GamePhase.Paused; + bool showReturn = !paused || game.Exploring; + float cardHeight = showReturn ? 352 : 294; + Rect card = new Rect((width - 434) * 0.5f, (height - cardHeight) * 0.5f, 434, cardHeight); + DrawPanel(card); + Color accent = won ? Mint : paused ? Amber : Alarm; + Fill(new Rect(card.x, card.y, card.width, 4), accent); + + float left = card.x + 26; + Label(new Rect(left, card.y + 23, 300, 20), paused ? "SHIFT CONTROL" : "SHIFT REPORT", tag, accent); + string heading = paused ? "Taking a break?" : won ? "You made it out." : "Lockdown."; + Label(new Rect(left, card.y + 46, 380, 58), heading, headline, Ink); + + if (paused) + { + string detail = game.Exploring ? DomeEnvironment.RegionName(game.CurrentRegion) : "The shift clock is paused."; + Label(new Rect(left, card.y + 106, 380, 48), detail, body, MutedInk); + } + else + { + DrawStat(new Rect(left, card.y + 113, 187, 63), "STATIONS ONLINE", Progress[CountRepairs(game.RepairedMask)]); + DrawStat(new Rect(left + 195, card.y + 113, 187, 63), "TIME LEFT", TimeText(game.TimeLeft)); + } + + string retry = game.Character == PlayableCharacter.Bud ? "RETRY AS BUD" : "RETRY AS DOYLE"; + if (ActionButton(new Rect(left, card.y + 198, 382, 50), paused ? "RESUME SHIFT" : retry, "ENTER")) + { + if (paused) + game.Resume(); + else + game.Restart(); + } + + if (showReturn && SecondaryButton(new Rect(left, card.y + 261, 382, 42), paused ? "Return to title" : "Change character", "B")) + game.ChooseCharacter(); + + bool showFullscreen = paused && game.CanToggleFullscreen; + Label(new Rect(left, card.yMax - 38, showFullscreen ? 90 : 226, 24), paused ? "ESC Resume" : "R Retry shift", tag, MutedInk); + if (showFullscreen) + DrawFullscreenButton(game, new Rect(left + 94, card.yMax - 39, 154, 25)); + DrawSoundButton(game, new Rect(card.xMax - 151, card.yMax - 39, 125, 25)); + } + + private void DrawCharacterOption(DomeGame game, Rect rect, PlayableCharacter character) + { + bool selected = game.Character == character; + bool bud = character == PlayableCharacter.Bud; + bool hovered = rect.Contains(Event.current.mousePosition); + Color accent = CharacterAccent(character); + Fill(rect, selected || hovered ? Border : Inset); + Stroke(rect, selected ? accent : Border); + if (selected) + Fill(new Rect(rect.x, rect.y, 3, rect.height), accent); + + DrawCharacterPortrait(new Rect(rect.x + 10, rect.y + 8, 42, 42), bud, accent); + Label(new Rect(rect.x + 61, rect.y + 8, 79, 22), bud ? "Bud" : "Doyle", item, Ink); + Label(new Rect(rect.x + 61, rect.y + 29, 80, 17), bud ? "Macintosh" : "Johnson", fine, MutedInk); + DrawKey(new Rect(rect.xMax - 33, rect.y + 17, 24, 24), bud ? "1" : "2", + selected ? accent : Inset, selected ? accent : Border, selected ? Panel : Ink); + if (GUI.Button(rect, GUIContent.none, GUIStyle.none)) + game.SelectCharacter(character); + } + + private static Color CharacterAccent(PlayableCharacter character) + { + return character == PlayableCharacter.Bud ? Amber : DoyleAccent; + } + + private static void DrawCharacterPortrait(Rect rect, bool bud, Color accent) + { + Color hair = bud ? new Color32(72, 48, 44, 255) : new Color32(238, 199, 115, 255); + Color skin = bud ? new Color32(223, 163, 128, 255) : new Color32(247, 188, 156, 255); + float x = rect.x; + float y = rect.y; + Fill(rect, Panel); + Fill(new Rect(x + 6, y + 32, 30, 8), accent); + Fill(new Rect(x + 10, y + 29, 22, 5), accent); + Fill(new Rect(x + 11, y + 8, 20, bud ? 25 : 11), hair); + Fill(new Rect(x + 16, y + 13, 12, 14), skin); + Fill(new Rect(x + 20, y + 27, 5, 5), skin); + Fill(new Rect(x + 14, y + 9, 13, 5), hair); + if (bud) + Fill(new Rect(x + 13, y + 11, 16, 3), new Color32(200, 91, 84, 255)); + else + Fill(new Rect(x + 16, y + 5, 9, 5), hair); + Fill(new Rect(x + 19, y + 17, 2, 2), Panel); + Fill(new Rect(x + 25, y + 17, 2, 2), Panel); + } + + private void DrawStat(Rect rect, string text, string value) + { + Fill(rect, Inset); + Label(new Rect(rect.x + 11, rect.y + 8, rect.width - 22, 18), text, tag, MutedInk); + Label(new Rect(rect.x + 11, rect.y + 29, rect.width - 22, 24), value, item, Ink); + } + + private void DrawSoundButton(DomeGame game, Rect rect) + { + bool hovered = rect.Contains(Event.current.mousePosition); + Fill(rect, hovered ? Border : Inset); + Stroke(rect, Border); + Label(new Rect(rect.x + 4, rect.y, rect.width - 8, rect.height), + game.Muted ? "SOUND OFF M" : "SOUND ON M", key, Ink); + if (GUI.Button(rect, GUIContent.none, GUIStyle.none)) + game.ToggleMute(); + } + + private void DrawFullscreenButton(DomeGame game, Rect rect) + { + if (NavigationButton(rect, game.Fullscreen ? "Windowed" : "Fullscreen", "F11", 33, false)) + game.ToggleFullscreen(); + } + + private bool ActionButton(Rect rect, string text, string binding) + { + bool hovered = rect.Contains(Event.current.mousePosition); + Fill(new Rect(rect.x, rect.y + 3, rect.width, rect.height), Shadow); + Fill(rect, hovered ? Ink : Mint); + Label(new Rect(rect.x + 16, rect.y, rect.width - 102, rect.height), text, item, Panel); + DrawKey(new Rect(rect.xMax - 76, rect.y + 12, 63, rect.height - 24), binding, Panel, Inset, Ink); + return GUI.Button(rect, GUIContent.none, GUIStyle.none); + } + + private bool SecondaryButton(Rect rect, string text, string binding, float bindingWidth = 24) + { + bool hovered = rect.Contains(Event.current.mousePosition); + Fill(rect, hovered ? Border : Inset); + Stroke(rect, Border); + Label(new Rect(rect.x + 16, rect.y, rect.width - bindingWidth - 44, rect.height), text, item, Ink); + DrawKey(new Rect(rect.xMax - bindingWidth - 13, rect.center.y - 12, bindingWidth, 24), binding, Inset, Border, Ink); + return GUI.Button(rect, GUIContent.none, GUIStyle.none); + } + + private bool NavigationButton(Rect rect, string text, string binding, float bindingWidth, bool active) + { + bool hovered = rect.Contains(Event.current.mousePosition); + Fill(rect, hovered ? Border : Panel); + Stroke(rect, active ? Mint : Border); + Label(new Rect(rect.x + 10, rect.y, rect.width - bindingWidth - 20, rect.height), text, fine, active ? Mint : Ink); + DrawKey(new Rect(rect.xMax - bindingWidth - 6, rect.center.y - 10, bindingWidth, 20), binding, Inset, Border, MutedInk); + return GUI.Button(rect, GUIContent.none, GUIStyle.none); + } + + private void DrawBinding(float x, float y, float keyWidth, string binding, string action) + { + DrawKey(new Rect(x, y, keyWidth, 24), binding, Inset, Border, Ink); + Label(new Rect(x + keyWidth + 8, y, 72, 24), action, fine, MutedInk); + } + + private void DrawKey(Rect rect, string text, Color background, Color edge, Color ink) + { + Fill(rect, background); + Stroke(rect, edge); + Label(rect, text, key, ink); + } + + private static void DrawBadge(float x, float y) + { + Stroke(new Rect(x, y, 52, 52), Border); + Fill(new Rect(x + 7, y + 39, 38, 2), Mint); + Fill(new Rect(x + 12, y + 30, 2, 9), Mint); + Fill(new Rect(x + 18, y + 22, 2, 17), Mint); + Fill(new Rect(x + 25, y + 19, 2, 20), Mint); + Fill(new Rect(x + 32, y + 22, 2, 17), Mint); + Fill(new Rect(x + 38, y + 30, 2, 9), Mint); + Fill(new Rect(x + 25, y + 7, 2, 4), Amber); + Fill(new Rect(x + 38, y + 13, 4, 2), Amber); + Fill(new Rect(x + 10, y + 13, 4, 2), Amber); + } + + private static void DrawStationIcon(float x, float y, int index, Color color) + { + if (index == 0) + { + Fill(new Rect(x + 5, y, 7, 4), color); + Stroke(new Rect(x + 3, y + 3, 11, 11), color); + Fill(new Rect(x + 5, y + 14, 7, 3), color); + return; + } + + if (index == 1) + { + Stroke(new Rect(x + 1, y + 1, 16, 15), color); + Fill(new Rect(x + 4, y + 5, 10, 1), color); + Fill(new Rect(x + 4, y + 8, 10, 1), color); + Fill(new Rect(x + 4, y + 11, 10, 1), color); + return; + } + + Fill(new Rect(x + 8, y + 6, 2, 10), color); + Fill(new Rect(x + 3, y + 5, 5, 3), color); + Fill(new Rect(x + 10, y + 2, 5, 3), color); + Fill(new Rect(x + 5, y + 14, 8, 2), color); + } + + private string TimeText(float timeLeft) + { + int seconds = Mathf.Max(0, Mathf.CeilToInt(timeLeft)); + if (seconds != lastSeconds) + { + lastSeconds = seconds; + clockText = $"{seconds / 60}:{seconds % 60:00}"; + } + return clockText; + } + + private static int CountRepairs(int mask) + { + return (mask & 1) + ((mask >> 1) & 1) + ((mask >> 2) & 1); + } + + private static GUIStyle Style(int size, FontStyle weight = FontStyle.Normal, + TextAnchor anchor = TextAnchor.MiddleLeft, bool wraps = false) + { + return new GUIStyle + { + fontSize = size, + fontStyle = weight, + alignment = anchor, + wordWrap = wraps, + clipping = TextClipping.Clip, + normal = { textColor = Color.white } + }; + } + + private static void Label(Rect bounds, string text, GUIStyle style, Color color) + { + Color previous = GUI.contentColor; + GUI.contentColor = color; + GUI.Label(bounds, text, style); + GUI.contentColor = previous; + } + + private static void DrawPanel(Rect rect) + { + Fill(new Rect(rect.x + 3, rect.y + 5, rect.width, rect.height), Shadow); + Fill(rect, Panel); + Stroke(rect, Border); + } + + private static void Stroke(Rect rect, Color color) + { + Fill(new Rect(rect.x, rect.y, rect.width, 1), color); + Fill(new Rect(rect.x, rect.yMax - 1, rect.width, 1), color); + Fill(new Rect(rect.x, rect.y + 1, 1, rect.height - 2), color); + Fill(new Rect(rect.xMax - 1, rect.y + 1, 1, rect.height - 2), color); + } + + private static void Fill(Rect rect, Color color) + { + Color previous = GUI.color; + GUI.color = color; + GUI.DrawTexture(rect, Texture2D.whiteTexture); + GUI.color = previous; + } + } +} diff --git a/Assets/DomeShift/DomeHud.cs.meta b/Assets/DomeShift/DomeHud.cs.meta new file mode 100644 index 0000000..8df6ab9 --- /dev/null +++ b/Assets/DomeShift/DomeHud.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ad31a797bd841c1eba3554661126af64 \ No newline at end of file diff --git a/Assets/DomeShift/DomeWorld.cs b/Assets/DomeShift/DomeWorld.cs new file mode 100644 index 0000000..ba8a847 --- /dev/null +++ b/Assets/DomeShift/DomeWorld.cs @@ -0,0 +1,585 @@ +using UnityEngine; +using UnityEngine.Rendering; + +namespace DomeShift +{ + internal sealed class DomeWorld + { + private readonly DomeEnvironment environment; + private readonly Material[] colors = new Material[3]; + private readonly Material[] glows = new Material[3]; + private readonly Transform[] stationLamps = new Transform[3]; + private readonly MeshRenderer[] stationLampRenderers = new MeshRenderer[3]; + private readonly Transform[] supplyItems = new Transform[3]; + private readonly Transform[] carriedItems = new Transform[3]; + private readonly Transform root; + private readonly Material hull; + private readonly Material trim; + private readonly Material metal; + private readonly Material cream; + private readonly Material bolts; + private readonly Material earth; + private readonly Material leaf; + private readonly Material youngLeaf; + private readonly Material warmLamp; + private readonly Material litLamp; + private readonly Material redLamp; + private Transform body; + private Transform bud; + private Transform doyle; + private Transform leftFoot; + private Transform rightFoot; + private Transform fan; + private Transform coolantDial; + private Transform hatch; + private MeshRenderer exitLamp; + private float stride; + + public Transform Player { get; } + + private DomeWorld(Transform parent, DomeEnvironment environment) + { + this.environment = environment; + root = Group(parent, "Shift equipment and crew", Vector3.zero); + hull = Surface("#10262E"); + trim = Surface("#2A5356", 0.18f, 0.28f); + metal = Surface("#6C9694", 0.32f, 0.35f); + cream = Surface("#DAD6AC", 0.12f, 0.25f); + bolts = Surface("#8C9F89", 0.35f, 0.34f); + earth = Surface("#243625"); + leaf = Surface("#3C7B4D", 0f, 0.36f); + youngLeaf = Surface("#83A849", 0f, 0.42f); + colors[0] = Surface("#DA6A36", 0.16f, 0.28f); + colors[1] = Surface("#429BB0", 0.22f, 0.35f); + colors[2] = Surface("#80AA49", 0.06f, 0.3f); + glows[0] = Surface("#FCA363", emission: 0.35f); + glows[1] = Surface("#95DFEB", emission: 0.35f); + glows[2] = Surface("#CEF176", emission: 0.33f); + warmLamp = Surface("#F6CE87", emission: 0.28f); + litLamp = Surface("#A4FFB9", emission: 0.48f); + redLamp = Surface("#C4503B", emission: 0.13f); + + AddLighting(); + AddGenerator(); + AddCoolant(); + AddHydroponics(); + for (int i = 0; i < supplyItems.Length; i++) + AddSupply(i); + AddExit(); + + Player = Group(root, "Player", Vector3.zero); + Player.localScale = new Vector3(86f / environment.Width, 1f, 64f / environment.Depth); + AddPlayer(); + } + + public static DomeWorld Create(Transform parent, DomeEnvironment environment) + { + return new DomeWorld(parent, environment); + } + + private Vector3 AtSite(int index) + { + Vector2 site = DomeEnvironment.Site(index); + return new Vector3(site.x, environment.SurfaceY(site), site.y); + } + + public void SetCharacter(PlayableCharacter character) + { + bool isDoyle = character == PlayableCharacter.Doyle; + bud.gameObject.SetActive(!isDoyle); + doyle.gameObject.SetActive(isDoyle); + } + + public void Tick(Vector2 motion, int carried, int repairedMask, float elapsed) + { + if (motion.sqrMagnitude > 0.01f) + { + float angle = Mathf.Atan2(motion.x, motion.y) * Mathf.Rad2Deg; + body.localRotation = Quaternion.RotateTowards( + body.localRotation, Quaternion.Euler(0f, angle, 0f), 940f * Time.deltaTime); + stride += Time.deltaTime * 12f; + float swing = Mathf.Sin(stride); + body.localPosition = new Vector3(0f, Mathf.Abs(swing) * 0.076f, 0f); + leftFoot.localPosition = new Vector3(-0.18f, 0.16f, swing * 0.14f); + rightFoot.localPosition = new Vector3(0.18f, 0.16f, -swing * 0.14f); + } + else + { + stride = 0f; + if (elapsed == 0f) + body.localRotation = Quaternion.Euler(0f, 180f, 0f); + body.localPosition = Vector3.zero; + leftFoot.localPosition = new Vector3(-0.18f, 0.16f, 0f); + rightFoot.localPosition = new Vector3(0.18f, 0.16f, 0f); + } + + for (int i = 0; i < stationLamps.Length; i++) + { + bool repaired = (repairedMask & (1 << i)) != 0; + bool showSupply = !repaired && carried != i; + if (supplyItems[i].gameObject.activeSelf != showSupply) + supplyItems[i].gameObject.SetActive(showSupply); + if (carriedItems[i].gameObject.activeSelf != (carried == i)) + carriedItems[i].gameObject.SetActive(carried == i); + supplyItems[i].localPosition = new Vector3(0f, 0.62f + 0.075f * Mathf.Sin(elapsed * 3f + i), 0f); + supplyItems[i].localRotation = Quaternion.Euler(0f, elapsed * 44f, 0f); + stationLamps[i].localScale = Vector3.one * (repaired ? 1f : 0.86f + 0.14f * Mathf.Sin(elapsed * 5f + i)); + stationLampRenderers[i].sharedMaterial = repaired ? litLamp : glows[i]; + } + + fan.localRotation = Quaternion.Euler(0f, 0f, -elapsed * ((repairedMask & 1) != 0 ? 300f : 24f)); + coolantDial.localRotation = Quaternion.Euler(0f, 0f, (repairedMask & 2) != 0 ? -36f : 48f); + bool exitReady = repairedMask == 7; + hatch.localPosition = new Vector3(0f, exitReady ? 1.44f : 0.02f, 0f); + hatch.localScale = new Vector3(1f, exitReady ? 0.08f : 1f, 1f); + exitLamp.sharedMaterial = exitReady ? litLamp : redLamp; + } + + private void AddLighting() + { + RenderSettings.ambientMode = AmbientMode.Trilight; + RenderSettings.ambientSkyColor = Tone("#C6DACF"); + RenderSettings.ambientEquatorColor = Tone("#748A83"); + RenderSettings.ambientGroundColor = Tone("#546960"); + GameObject sunObject = new GameObject("Late shift sunlight"); + sunObject.transform.SetParent(root, false); + sunObject.transform.rotation = Quaternion.Euler(47f, -34f, 0f); + Light sun = sunObject.AddComponent(); + sun.type = LightType.Directional; + sun.color = Tone("#FFE0A8"); + sun.intensity = 1.05f; + sun.shadows = LightShadows.Soft; + sun.shadowStrength = 0.7f; + RenderSettings.sun = sun; + } + + private void AddGenerator() + { + Transform unit = Group(root, "Generator", AtSite(0)); + StationPad(unit, 0); + Box(unit, "Generator chassis", new Vector3(0f, 0.7f, 0.48f), new Vector3(2.32f, 1.08f, 1.26f), hull); + Box(unit, "Generator enamel", new Vector3(0f, 1.22f, 0.48f), new Vector3(2.24f, 0.25f, 1.2f), colors[0]); + Box(unit, "Front service panel", new Vector3(0f, 0.76f, -0.18f), new Vector3(2.05f, 0.79f, 0.11f), trim); + Box(unit, "Identification stripe", new Vector3(0f, 1.1f, -0.27f), new Vector3(1.9f, 0.085f, 0.03f), cream); + Cylinder(unit, "Fan shroud", new Vector3(0.47f, 0.72f, -0.26f), + new Vector3(0.66f, 0.13f, 0.66f), metal).localRotation = Quaternion.Euler(90f, 0f, 0f); + Cylinder(unit, "Fan cavity", new Vector3(0.47f, 0.72f, -0.34f), + new Vector3(0.54f, 0.075f, 0.54f), hull).localRotation = Quaternion.Euler(90f, 0f, 0f); + fan = Group(unit, "Fan rotor", new Vector3(0.47f, 0.72f, -0.387f)); + for (int i = 0; i < 5; i++) + { + Transform spoke = Group(fan, "Rotor spoke", Vector3.zero); + spoke.localRotation = Quaternion.Euler(0f, 0f, i * 72f); + Box(spoke, "Fan blade", new Vector3(0f, 0.13f, 0f), new Vector3(0.079f, 0.2f, 0.027f), cream); + } + Sphere(fan, "Rotor hub", Vector3.zero, new Vector3(0.12f, 0.12f, 0.035f), colors[0]); + + for (int i = 0; i < 4; i++) + Box(unit, "Heat vent", new Vector3(-0.53f, 0.5f + i * 0.115f, -0.247f), + new Vector3(0.7f, 0.042f, 0.03f), hull); + + Cylinder(unit, "Exhaust", new Vector3(-0.72f, 1.46f, 0.79f), new Vector3(0.24f, 0.58f, 0.24f), metal); + Cylinder(unit, "Exhaust cap", new Vector3(-0.72f, 1.76f, 0.79f), new Vector3(0.36f, 0.10f, 0.36f), hull); + Pipe(unit, colors[0], 0.095f, new Vector3(1.14f, 0.8f, 0.5f), new Vector3(1.72f, 0.8f, 0.5f), + new Vector3(1.72f, 0.19f, 0.5f), new Vector3(2.21f, 0.19f, 0.5f)); + AddBeacon(unit, 0, new Vector3(0.75f, 1.36f, 0.6f)); + } + + private void AddCoolant() + { + Transform unit = Group(root, "Coolant", AtSite(1)); + StationPad(unit, 1); + Cylinder(unit, "Reservoir base", new Vector3(0f, 0.22f, 0.53f), new Vector3(2.17f, 0.28f, 1.62f), hull); + for (int side = -1; side <= 1; side += 2) + { + float x = side * 0.46f; + Cylinder(unit, "Coolant tank", new Vector3(x, 0.9f, 0.53f), + new Vector3(0.78f, 1.24f, 0.88f), colors[1]); + Sphere(unit, "Tank dome", new Vector3(x, 1.53f, 0.53f), + new Vector3(0.78f, 0.52f, 0.88f), metal); + Cylinder(unit, "Tank strap", new Vector3(x, 1.15f, 0.53f), + new Vector3(0.84f, 0.13f, 0.94f), cream); + Cylinder(unit, "Tank boot", new Vector3(x, 0.42f, 0.53f), + new Vector3(0.87f, 0.15f, 0.97f), trim); + } + + Box(unit, "Pressure controller", new Vector3(0f, 0.77f, -0.07f), new Vector3(0.78f, 0.65f, 0.44f), trim); + Cylinder(unit, "Pressure dial rim", new Vector3(0f, 0.83f, -0.312f), + new Vector3(0.5f, 0.08f, 0.5f), hull).localRotation = Quaternion.Euler(90f, 0f, 0f); + Cylinder(unit, "Pressure dial face", new Vector3(0f, 0.83f, -0.359f), + new Vector3(0.42f, 0.028f, 0.42f), cream).localRotation = Quaternion.Euler(90f, 0f, 0f); + coolantDial = Group(unit, "Pressure dial needle", new Vector3(0f, 0.83f, -0.38f)); + Box(coolantDial, "Needle", new Vector3(0f, 0.07f, 0f), new Vector3(0.025f, 0.16f, 0.02f), colors[0]); + Sphere(coolantDial, "Pivot", Vector3.zero, new Vector3(0.063f, 0.063f, 0.028f), hull); + + Pipe(unit, metal, 0.105f, new Vector3(-0.93f, 0.44f, 0.58f), new Vector3(-1.69f, 0.44f, 0.58f), + new Vector3(-1.69f, 0.18f, 0.58f), new Vector3(-2.08f, 0.18f, 0.58f)); + AddBeacon(unit, 1, new Vector3(0f, 1.42f, 0.53f)); + } + + private void AddHydroponics() + { + Transform unit = Group(root, "Hydroponics", AtSite(2)); + StationPad(unit, 2); + Planter(unit, new Vector3(0f, 0f, 0.62f), 2.62f, 1.26f, 6); + Box(unit, "Irrigation control", new Vector3(0f, 0.48f, -0.16f), new Vector3(0.9f, 0.44f, 0.32f), hull); + Box(unit, "Irrigation display", new Vector3(0f, 0.55f, -0.333f), new Vector3(0.6f, 0.18f, 0.032f), glows[2]); + Box(unit, "Display detail", new Vector3(-0.095f, 0.55f, -0.352f), new Vector3(0.29f, 0.032f, 0.012f), hull); + AddBeacon(unit, 2, new Vector3(0f, 0.87f, 0.02f)); + + } + + private void Planter(Transform parent, Vector3 at, float width, float depth, int plants) + { + Transform bed = Group(parent, "Grow bed", at); + Box(bed, "Bed base", new Vector3(0f, 0.17f, 0f), new Vector3(width, 0.24f, depth), hull); + Box(bed, "Bed sides", new Vector3(0f, 0.46f, 0f), new Vector3(width, 0.48f, depth), trim); + Box(bed, "Bed lip", new Vector3(0f, 0.68f, 0f), new Vector3(width + 0.08f, 0.1f, depth + 0.08f), metal); + Box(bed, "Growing medium", new Vector3(0f, 0.73f, 0f), new Vector3(width - 0.14f, 0.042f, depth - 0.14f), earth); + for (int i = 0; i < plants; i++) + { + bool longAcross = width > depth; + float row = (i + 0.5f) / plants - 0.5f; + float stagger = (i % 2 == 0 ? 1f : -1f) * 0.17f; + Vector3 plantAt = longAcross + ? new Vector3(row * (width - 0.25f), 0.72f, stagger * depth) + : new Vector3(stagger * width, 0.72f, row * (depth - 0.25f)); + Plant(bed, plantAt, i * 57f, 0.85f + i % 3 * 0.11f); + } + } + + private void Plant(Transform parent, Vector3 at, float spin, float size) + { + Transform plant = Group(parent, "Seedling", at); + plant.localScale = Vector3.one * size; + plant.localRotation = Quaternion.Euler(0f, spin, 0f); + Cylinder(plant, "Stem", new Vector3(0f, 0.21f, 0f), new Vector3(0.044f, 0.42f, 0.044f), youngLeaf); + for (int i = 0; i < 4; i++) + { + Transform node = Group(plant, "Leaf node", new Vector3(0f, 0.19f + 0.043f * i, 0f)); + node.localRotation = Quaternion.Euler(0f, i * 104f, 0f); + Transform blade = Sphere(node, "Waxy leaf", new Vector3(0.145f, 0.08f, 0f), + new Vector3(0.36f, 0.09f, 0.17f), i % 2 == 0 ? leaf : youngLeaf); + blade.localRotation = Quaternion.Euler(0f, 0f, 28f); + } + Sphere(plant, "New growth", new Vector3(0f, 0.44f, 0f), new Vector3(0.13f, 0.21f, 0.15f), youngLeaf); + } + + private void AddSupply(int index) + { + Transform shelf = Group(root, "Parts plinth " + (index + 1), AtSite(index + 3)); + Cylinder(shelf, "Supply floor ring", new Vector3(0f, 0.013f, 0f), new Vector3(1.49f, 0.022f, 1.49f), colors[index]); + Cylinder(shelf, "Supply floor inset", new Vector3(0f, 0.028f, 0f), new Vector3(1.35f, 0.018f, 1.35f), hull); + Cylinder(shelf, "Plinth", new Vector3(0f, 0.21f, 0f), new Vector3(0.83f, 0.35f, 0.83f), trim); + Cylinder(shelf, "Plinth edge", new Vector3(0f, 0.41f, 0f), new Vector3(0.87f, 0.095f, 0.87f), colors[index]); + Cylinder(shelf, "Plinth bed", new Vector3(0f, 0.46f, 0f), new Vector3(0.68f, 0.045f, 0.68f), hull); + Box(shelf, "Plinth status bar", new Vector3(0f, 0.27f, -0.406f), + new Vector3(0.25f, 0.062f, 0.036f), glows[index]); + supplyItems[index] = Group(shelf, "Available spare part", new Vector3(0f, 0.63f, 0f)); + AddPart(supplyItems[index], index); + } + + private void AddPart(Transform part, int index) + { + if (index == 0) + { + Box(part, "Fuse body", new Vector3(0f, 0.16f, 0f), new Vector3(0.34f, 0.32f, 0.26f), colors[0]); + Box(part, "Fuse window", new Vector3(0f, 0.17f, -0.138f), new Vector3(0.17f, 0.14f, 0.03f), glows[0]); + for (int side = -1; side <= 1; side += 2) + Box(part, "Contact", new Vector3(side * 0.113f, 0.38f, 0f), new Vector3(0.072f, 0.16f, 0.13f), cream); + } + else if (index == 1) + { + Cylinder(part, "Filter cartridge", new Vector3(0f, 0.19f, 0f), new Vector3(0.34f, 0.34f, 0.34f), colors[1]); + Cylinder(part, "Filter end", new Vector3(0f, 0.34f, 0f), new Vector3(0.39f, 0.08f, 0.39f), cream); + Cylinder(part, "Filter end", new Vector3(0f, 0.044f, 0f), new Vector3(0.39f, 0.08f, 0.39f), cream); + Cylinder(part, "Filter seal", new Vector3(0f, 0.385f, 0f), new Vector3(0.19f, 0.035f, 0.19f), glows[1]); + } + else + { + Box(part, "Seed pack", new Vector3(0f, 0.2f, 0f), new Vector3(0.34f, 0.4f, 0.19f), colors[2]); + Box(part, "Seed label", new Vector3(0f, 0.23f, -0.1f), new Vector3(0.22f, 0.21f, 0.022f), cream); + Sphere(part, "Seed icon", new Vector3(0f, 0.23f, -0.118f), new Vector3(0.095f, 0.14f, 0.021f), leaf); + } + } + + private void AddExit() + { + Transform threshold = Group(root, "Airlock", AtSite(6)); + Box(threshold, "Airlock floor", new Vector3(0f, 0.034f, 0f), + new Vector3(3.37f, 0.067f, 1.52f), hull); + PaintCrossing(threshold, new Vector3(0f, 0.071f, -0.38f)); + for (int side = -1; side <= 1; side += 2) + { + Box(threshold, "Airlock jamb", new Vector3(side * 1.42f, 0.79f, 0f), + new Vector3(0.43f, 1.55f, 0.5f), metal); + Box(threshold, "Jamb stripe", new Vector3(side * 1.42f, 0.65f, -0.28f), + new Vector3(0.17f, 0.81f, 0.07f), cream); + } + + Box(threshold, "Airlock lintel", new Vector3(0f, 1.63f, 0f), + new Vector3(3.26f, 0.37f, 0.46f), trim); + Box(threshold, "Clearance panel", new Vector3(0f, 1.66f, -0.258f), + new Vector3(0.98f, 0.24f, 0.073f), hull); + exitLamp = Box(threshold, "Airlock light", new Vector3(0f, 1.66f, -0.306f), + new Vector3(0.7f, 0.083f, 0.03f), redLamp).GetComponent(); + hatch = Group(threshold, "Airlock shutter", Vector3.zero); + for (int i = 0; i < 6; i++) + Box(hatch, "Shutter slat", new Vector3(0f, 0.12f + i * 0.228f, 0.08f), + new Vector3(2.39f, 0.205f, 0.1f), i % 2 == 0 ? metal : trim); + Box(hatch, "Shutter handle", new Vector3(0f, 0.38f, -0.01f), + new Vector3(0.55f, 0.085f, 0.15f), cream); + } + + private void AddPlayer() + { + body = Group(Player, "Movement rig", Vector3.zero); + leftFoot = Group(body, "Left boot", new Vector3(-0.18f, 0.16f, 0f)); + rightFoot = Group(body, "Right boot", new Vector3(0.18f, 0.16f, 0f)); + foreach (Transform foot in new[] { leftFoot, rightFoot }) + { + Box(foot, "Sneaker", new Vector3(0f, -0.043f, 0.05f), new Vector3(0.23f, 0.18f, 0.37f), hull); + Box(foot, "Sneaker sole", new Vector3(0f, -0.126f, 0.05f), new Vector3(0.24f, 0.047f, 0.38f), cream); + } + + Material faceDetail = Surface("#453336"); + bud = Group(body, "Bud", Vector3.zero); + AddBud(bud, faceDetail); + doyle = Group(body, "Doyle", Vector3.zero); + AddDoyle(doyle, faceDetail); + SetCharacter(PlayableCharacter.Bud); + + for (int i = 0; i < carriedItems.Length; i++) + { + carriedItems[i] = Group(body, "Held spare part", new Vector3(0.36f, 0.46f, 0.31f)); + carriedItems[i].localScale = Vector3.one * 0.8f; + AddPart(carriedItems[i], i); + carriedItems[i].gameObject.SetActive(false); + } + } + + private void AddBud(Transform avatar, Material faceDetail) + { + Material skin = Surface("#C3855D", smoothness: 0.24f); + Material curls = Surface("#48302C", smoothness: 0.28f); + Material curlTips = Surface("#694539", smoothness: 0.28f); + Material bandana = Surface("#C85B54"); + Material flannel = Surface("#C27642"); + Material plaid = Surface("#743E39"); + Material denim = Surface("#3E5569"); + Vector3 head = new Vector3(0f, 1.17f, 0.026f); + + Capsule(avatar, "Loose jeans", new Vector3(0f, 0.42f, 0f), new Vector3(0.48f, 0.54f, 0.35f), denim); + Sphere(avatar, "Flannel overshirt", new Vector3(0f, 0.73f, 0f), new Vector3(0.57f, 0.62f, 0.43f), flannel); + Box(avatar, "Undershirt", new Vector3(0f, 0.77f, 0.202f), new Vector3(0.16f, 0.40f, 0.04f), cream); + Box(avatar, "Back yoke", new Vector3(0f, 0.79f, -0.195f), new Vector3(0.41f, 0.1f, 0.046f), plaid); + + for (int side = -1; side <= 1; side += 2) + { + Sphere(avatar, "Flannel sleeve", new Vector3(side * 0.315f, 0.69f, 0.025f), + new Vector3(0.195f, 0.38f, 0.24f), flannel); + Box(avatar, "Sleeve cuff", new Vector3(side * 0.339f, 0.55f, 0.031f), + new Vector3(0.16f, 0.103f, 0.18f), plaid); + Sphere(avatar, "Hand", new Vector3(side * 0.34f, 0.486f, 0.071f), + new Vector3(0.139f, 0.153f, 0.155f), skin); + Box(avatar, "Flannel stripe", new Vector3(side * 0.158f, 0.744f, 0.188f), + new Vector3(0.043f, 0.405f, 0.048f), plaid).localRotation = Quaternion.Euler(0f, side * 24f, 0f); + } + + AddFace(avatar, head, new Vector3(0.475f, 0.492f, 0.46f), skin, faceDetail); + Sphere(avatar, "Curly crown", head + new Vector3(0f, 0.18f, -0.061f), + new Vector3(0.515f, 0.365f, 0.434f), curls); + Sphere(avatar, "Long hair", head + new Vector3(0f, -0.046f, -0.144f), + new Vector3(0.534f, 0.617f, 0.331f), curls); + for (int i = 0; i < 7; i++) + { + float angle = i * Mathf.PI / 6f; + Vector3 rim = head + new Vector3(Mathf.Cos(angle) * 0.208f, 0.15f + (i % 2) * 0.037f, -Mathf.Sin(angle) * 0.165f); + Sphere(avatar, "Crown curl", rim, new Vector3(0.182f, 0.218f, 0.196f), i % 3 == 0 ? curlTips : curls); + } + + for (int side = -1; side <= 1; side += 2) + { + for (int i = 0; i < 3; i++) + { + Vector3 curl = head + new Vector3(side * (0.247f + (i % 2) * 0.033f), 0.053f - i * 0.122f, -0.064f - i * 0.013f); + Sphere(avatar, "Side curl", curl, new Vector3(0.203f, 0.23f, 0.223f), i == 1 ? curlTips : curls); + } + } + + Sphere(avatar, "Bandana", head + new Vector3(0f, 0.091f, 0.015f), + new Vector3(0.508f, 0.126f, 0.471f), bandana); + Sphere(avatar, "Bandana knot", head + new Vector3(-0.234f, 0.072f, -0.086f), + new Vector3(0.144f, 0.139f, 0.136f), bandana); + } + + private void AddDoyle(Transform avatar, Material faceDetail) + { + Material skin = Surface("#DEAA7F", smoothness: 0.24f); + Material blonde = Surface("#BA853E"); + Material blondeTips = Surface("#EEC773"); + Material jersey = Surface("#488EB9"); + Material sleeve = Surface("#84CED6"); + Material shorts = Surface("#263E5F"); + Vector3 head = new Vector3(0f, 1.22f, 0.032f); + + Capsule(avatar, "Athletic shorts", new Vector3(0f, 0.425f, 0f), new Vector3(0.52f, 0.48f, 0.37f), shorts); + Sphere(avatar, "Oversized jersey", new Vector3(0f, 0.757f, 0f), + new Vector3(0.642f, 0.647f, 0.465f), jersey); + Sphere(avatar, "Contrast collar", new Vector3(0f, 1.012f, 0.07f), + new Vector3(0.324f, 0.122f, 0.305f), sleeve); + Box(avatar, "Chest stripe", new Vector3(0f, 0.772f, 0.219f), new Vector3(0.345f, 0.079f, 0.041f), sleeve); + Box(avatar, "Back stripe", new Vector3(0f, 0.772f, -0.219f), new Vector3(0.345f, 0.079f, 0.041f), sleeve); + for (int side = -1; side <= 1; side += 2) + { + Sphere(avatar, "Short sleeve", new Vector3(side * 0.319f, 0.809f, 0.018f), + new Vector3(0.25f, 0.33f, 0.26f), sleeve); + Sphere(avatar, "Forearm", new Vector3(side * 0.367f, 0.585f, 0.074f), + new Vector3(0.151f, 0.295f, 0.158f), skin); + } + + AddFace(avatar, head, new Vector3(0.481f, 0.506f, 0.458f), skin, faceDetail); + Sphere(avatar, "Short blond hair", head + new Vector3(0f, 0.155f, -0.057f), + new Vector3(0.494f, 0.367f, 0.409f), blonde); + for (int i = 0; i < 4; i++) + { + Vector3 at = head + new Vector3(-0.153f + 0.087f * i, 0.245f + 0.018f * i, 0.037f); + Sphere(avatar, "Brushed-up fringe", at, new Vector3(0.144f, 0.229f, 0.261f), i == 0 ? blonde : blondeTips) + .localRotation = Quaternion.Euler(-21f, 0f, -18f); + } + } + + private void AddFace(Transform avatar, Vector3 at, Vector3 size, Material skin, Material detail) + { + Sphere(avatar, "Face", at, size, skin); + for (int side = -1; side <= 1; side += 2) + { + Sphere(avatar, "Ear", at + new Vector3(side * 0.228f, -0.013f, 0.013f), + new Vector3(0.10f, 0.147f, 0.106f), skin); + Sphere(avatar, "Eye", at + new Vector3(side * 0.096f, 0.018f, 0.209f), + new Vector3(0.043f, 0.049f, 0.031f), detail); + } + Sphere(avatar, "Nose", at + new Vector3(0f, -0.023f, 0.224f), + new Vector3(0.075f, 0.073f, 0.067f), skin); + Sphere(avatar, "Smile", at + new Vector3(0.018f, -0.102f, 0.207f), + new Vector3(0.138f, 0.035f, 0.028f), detail); + } + + private void AddBeacon(Transform unit, int index, Vector3 at) + { + Cylinder(unit, "Beacon mount", at + Vector3.up * 0.049f, + new Vector3(0.37f, 0.105f, 0.37f), hull); + Transform light = Group(unit, "Status beacon", at + Vector3.up * 0.174f); + stationLamps[index] = light; + stationLampRenderers[index] = Sphere(light, "Indicator", Vector3.zero, + new Vector3(0.25f, 0.23f, 0.25f), glows[index]).GetComponent(); + } + + private void StationPad(Transform parent, int index) + { + Box(parent, "Station foundation", new Vector3(0f, 0.06f, 0.46f), + new Vector3(2.96f, 0.12f, 2.16f), hull); + Box(parent, "Station cut-in", new Vector3(0f, 0.125f, 0.45f), + new Vector3(2.79f, 0.026f, 2.01f), trim); + Box(parent, "Color-coded approach", new Vector3(0f, 0.028f, -0.96f), + new Vector3(2.62f, 0.052f, 0.54f), colors[index]); + for (int i = -2; i <= 2; i++) + { + Transform paint = Box(parent, "Caution hash", new Vector3(i * 0.41f, 0.061f, -0.956f), + new Vector3(0.13f, 0.02f, 0.41f), hull, false); + paint.localRotation = Quaternion.Euler(0f, 29f, 0f); + } + } + + private void PaintCrossing(Transform parent, Vector3 center) + { + for (int i = -2; i <= 2; i++) + { + Transform paint = Box(parent, "Painted crossing", + center + new Vector3(i * 0.29f, 0.018f, 0f), new Vector3(0.09f, 0.021f, 0.47f), cream, false); + paint.localRotation = Quaternion.Euler(0f, 24f, 0f); + } + } + + private static Transform Group(Transform parent, string objectName, Vector3 at) + { + Transform group = new GameObject(objectName).transform; + group.SetParent(parent, false); + group.localPosition = at; + return group; + } + + private static Transform Box(Transform parent, string objectName, Vector3 at, Vector3 size, Material material, bool shadows = true) + { + return Solid(parent, objectName, PrimitiveType.Cube, at, size, material, shadows); + } + + private static Transform Sphere(Transform parent, string objectName, Vector3 at, Vector3 size, Material material) + { + return Solid(parent, objectName, PrimitiveType.Sphere, at, size, material, true); + } + + private static Transform Cylinder(Transform parent, string objectName, Vector3 at, Vector3 size, Material material) + { + return Solid(parent, objectName, PrimitiveType.Cylinder, at, new Vector3(size.x, size.y / 2f, size.z), material, true); + } + + private static Transform Capsule(Transform parent, string objectName, Vector3 at, Vector3 size, Material material) + { + return Solid(parent, objectName, PrimitiveType.Capsule, at, new Vector3(size.x, size.y / 2f, size.z), material, true); + } + + private static Transform Solid(Transform parent, string objectName, PrimitiveType shape, Vector3 at, + Vector3 scale, Material material, bool shadows) + { + GameObject solid = GameObject.CreatePrimitive(shape); + solid.name = objectName; + solid.transform.SetParent(parent, false); + solid.transform.localPosition = at; + solid.transform.localScale = scale; + solid.GetComponent().enabled = false; + Object.Destroy(solid.GetComponent()); + MeshRenderer renderer = solid.GetComponent(); + renderer.sharedMaterial = material; + if (!shadows) + renderer.shadowCastingMode = ShadowCastingMode.Off; + return solid.transform; + } + + private static void Pipe(Transform parent, Material material, float radius, params Vector3[] points) + { + float diameter = radius * 2f; + for (int i = 1; i < points.Length; i++) + { + Vector3 axis = points[i] - points[i - 1]; + Transform pipe = Cylinder(parent, "Pipe", (points[i] + points[i - 1]) * 0.5f, + new Vector3(diameter, axis.magnitude, diameter), material); + pipe.localRotation = Quaternion.FromToRotation(Vector3.up, axis); + Sphere(parent, "Pipe joint", points[i], Vector3.one * diameter, material); + } + } + + private static Color Tone(string hex) + { + ColorUtility.TryParseHtmlString(hex, out Color tone); + return tone; + } + + private Material Surface(string hex, float metallic = 0f, float smoothness = 0.13f, float emission = 0f) + { + Color tone = Tone(hex); + Material material = environment.Own(new Material(Shader.Find("Standard"))); + material.name = "Dome Shift " + hex; + material.color = tone; + material.SetFloat("_Metallic", metallic); + material.SetFloat("_Glossiness", smoothness); + material.enableInstancing = true; + if (emission > 0f) + { + material.EnableKeyword("_EMISSION"); + material.SetColor("_EmissionColor", tone * emission); + } + return material; + } + } +} diff --git a/Assets/DomeShift/DomeWorld.cs.meta b/Assets/DomeShift/DomeWorld.cs.meta new file mode 100644 index 0000000..2100cc8 --- /dev/null +++ b/Assets/DomeShift/DomeWorld.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7603fdfd4bec410eb64ae5da0d18cad7 diff --git a/Assets/DomeShift/Resources.meta b/Assets/DomeShift/Resources.meta new file mode 100644 index 0000000..318e537 --- /dev/null +++ b/Assets/DomeShift/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b384fb4131897df61a1067ca16cbbc88 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/DomeShift/Resources/DomeGlass.shader b/Assets/DomeShift/Resources/DomeGlass.shader new file mode 100644 index 0000000..630ade6 --- /dev/null +++ b/Assets/DomeShift/Resources/DomeGlass.shader @@ -0,0 +1,61 @@ +Shader "DomeShift/Glass" +{ + Properties + { + _Color ("Glazing tint and opacity", Color) = (0.59, 0.78, 0.75, 0.16) + } + + SubShader + { + Tags { "Queue" = "Transparent" "RenderType" = "Transparent" "IgnoreProjector" = "True" } + + Pass + { + Cull Back + ZWrite Off + Blend SrcAlpha OneMinusSrcAlpha + + CGPROGRAM + #pragma vertex Vert + #pragma fragment Frag + #include "UnityCG.cginc" + + fixed4 _Color; + + struct SurfaceVertex + { + float4 position : POSITION; + float3 normal : NORMAL; + }; + + struct GlassVertex + { + float4 position : SV_POSITION; + float3 worldPosition : TEXCOORD0; + half3 worldNormal : TEXCOORD1; + }; + + GlassVertex Vert(SurfaceVertex vertex) + { + GlassVertex result; + result.position = UnityObjectToClipPos(vertex.position); + result.worldPosition = mul(unity_ObjectToWorld, vertex.position).xyz; + result.worldNormal = UnityObjectToWorldNormal(vertex.normal); + return result; + } + + fixed4 Frag(GlassVertex vertex) : SV_Target + { + half3 perspective = normalize(_WorldSpaceCameraPos.xyz - vertex.worldPosition); + half3 sightline = lerp(perspective, UNITY_MATRIX_V[2].xyz, unity_OrthoParams.w); + half grazing = 1.0h - saturate(abs(dot(normalize(vertex.worldNormal), sightline))); + half sheen = grazing * grazing; + fixed3 tint = lerp(_Color.rgb, fixed3(0.9, 0.96, 0.93), sheen * 0.4h); + fixed opacity = saturate(_Color.a * (0.82h + sheen * 0.7h)); + return fixed4(tint, opacity); + } + ENDCG + } + } + Fallback Off +} diff --git a/Assets/DomeShift/Resources/DomeGlass.shader.meta b/Assets/DomeShift/Resources/DomeGlass.shader.meta new file mode 100644 index 0000000..3b968f9 --- /dev/null +++ b/Assets/DomeShift/Resources/DomeGlass.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3d3cbd66b18df15b09abe79aa23338c7 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes.meta b/Assets/Scenes.meta new file mode 100644 index 0000000..f44d6ee --- /dev/null +++ b/Assets/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7dd47bfea674bd401929948436b963dd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/DomeShift.unity b/Assets/Scenes/DomeShift.unity new file mode 100644 index 0000000..83ddc36 --- /dev/null +++ b/Assets/Scenes/DomeShift.unity @@ -0,0 +1,64 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1001} + - component: {fileID: 1002} + - component: {fileID: 1003} + m_Layer: 0 + m_Name: Dome Shift + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1002 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a70382bb493347e881e04525c8209ddb, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1003 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a1cd053bdf36416a8c366d714d731aea, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1001} diff --git a/Assets/Scenes/DomeShift.unity.meta b/Assets/Scenes/DomeShift.unity.meta new file mode 100644 index 0000000..5e5bbbf --- /dev/null +++ b/Assets/Scenes/DomeShift.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0cab24d25f804cb29bffd2058740ad94 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/manifest.json b/Packages/manifest.json new file mode 100644 index 0000000..636576a --- /dev/null +++ b/Packages/manifest.json @@ -0,0 +1,8 @@ +{ + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.ui": "1.0.0" + } +} diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json new file mode 100644 index 0000000..34924d4 --- /dev/null +++ b/Packages/packages-lock.json @@ -0,0 +1,28 @@ +{ + "dependencies": { + "com.unity.modules.audio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.imgui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.ui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + } + } +} diff --git a/ProjectSettings/AudioManager.asset b/ProjectSettings/AudioManager.asset new file mode 100644 index 0000000..50b4625 --- /dev/null +++ b/ProjectSettings/AudioManager.asset @@ -0,0 +1,23 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!11 &1 +AudioManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Volume: 1 + Rolloff Scale: 1 + Doppler Factor: 1 + Default Speaker Mode: 2 + m_SampleRate: 0 + m_DSPBufferSize: 1024 + m_VirtualVoiceCount: 512 + m_RealVoiceCount: 32 + m_EnableOutputSuspension: 1 + m_SpatializerPlugin: + m_AmbisonicDecoderPlugin: + m_DisableAudio: 0 + m_VirtualizeEffects: 1 + m_RequestedDSPBufferSize: 0 + m_AudioFoundation: 0 + m_OutputChannelLayout: 2 + m_OutputSamplingRate: 48000 diff --git a/ProjectSettings/ClusterInputManager.asset b/ProjectSettings/ClusterInputManager.asset new file mode 100644 index 0000000..e7886b2 --- /dev/null +++ b/ProjectSettings/ClusterInputManager.asset @@ -0,0 +1,6 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!236 &1 +ClusterInputManager: + m_ObjectHideFlags: 0 + m_Inputs: [] diff --git a/ProjectSettings/DynamicsManager.asset b/ProjectSettings/DynamicsManager.asset new file mode 100644 index 0000000..39290c5 --- /dev/null +++ b/ProjectSettings/DynamicsManager.asset @@ -0,0 +1,46 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!55 &1 +PhysicsManager: + m_ObjectHideFlags: 0 + serializedVersion: 24 + m_Gravity: {x: 0, y: -9.81, z: 0} + m_DefaultMaterial: {fileID: 0} + m_BounceThreshold: 2 + m_DefaultMaxDepenetrationVelocity: 10 + m_SleepThreshold: 0.005 + m_DefaultContactOffset: 0.01 + m_DefaultSolverIterations: 6 + m_DefaultSolverVelocityIterations: 1 + m_QueriesHitBackfaces: 0 + m_QueriesHitTriggers: 1 + m_EnableAdaptiveForce: 0 + m_ClothInterCollisionDistance: 0.1 + m_ClothInterCollisionStiffness: 0.2 + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffu + m_SimulationMode: 0 + m_ThreadingMode: 0 + m_AutoSyncTransforms: 0 + m_ReuseCollisionCallbacks: 1 + m_InvokeCollisionCallbacks: 1 + m_ClothInterCollisionSettingsToggle: 0 + m_ClothGravity: {x: 0, y: -9.81, z: 0} + m_ContactPairsMode: 0 + m_BroadphaseType: 2 + m_WorldBounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 256, y: 256, z: 256} + m_WorldSubdivisions: 8 + m_FrictionType: 0 + m_EnableEnhancedDeterminism: 0 + m_ImprovedPatchFriction: 0 + m_GenerateOnTriggerStayEvents: 1 + m_SolverType: 0 + m_DefaultMaxAngularSpeed: 50 + m_ScratchBufferChunkCount: 4 + m_CurrentBackendId: 4072204805 + m_FastMotionThreshold: 3.4028235e+38 + m_SceneBuffersReleaseInterval: 0 + m_ReleaseSceneBuffers: 0 + m_LogVerbosity: 3 + m_IncrementalStaticBroadphase: 1 diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset new file mode 100644 index 0000000..3c7d235 --- /dev/null +++ b/ProjectSettings/EditorBuildSettings.asset @@ -0,0 +1,11 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1045 &1 +EditorBuildSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Scenes: + - enabled: 1 + path: Assets/Scenes/DomeShift.unity + guid: 0cab24d25f804cb29bffd2058740ad94 + m_configObjects: {} diff --git a/ProjectSettings/EditorSettings.asset b/ProjectSettings/EditorSettings.asset new file mode 100644 index 0000000..0173d1b --- /dev/null +++ b/ProjectSettings/EditorSettings.asset @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!159 &1 +EditorSettings: + m_ObjectHideFlags: 0 + serializedVersion: 16 + m_SerializationMode: 2 + m_LineEndingsForNewScripts: 1 + m_DefaultBehaviorMode: 0 + m_PrefabRegularEnvironment: {fileID: 0} + m_PrefabUIEnvironment: {fileID: 0} + m_SpritePackerMode: 0 + m_SpritePackerCacheSize: 10 + m_SpritePackerPaddingPower: 1 + m_Bc7TextureCompressor: 0 + m_EtcTextureCompressorBehavior: 1 + m_EtcTextureFastCompressor: 1 + m_EtcTextureNormalCompressor: 2 + m_EtcTextureBestCompressor: 4 + m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp;java;cpp;c;mm;m;h + m_ProjectGenerationRootNamespace: + m_EnableTextureStreamingInEditMode: 1 + m_EnableTextureStreamingInPlayMode: 1 + m_EnableEditorAsyncCPUTextureLoading: 0 + m_AsyncShaderCompilation: 1 + m_BlockShaders: 0 + m_UnlockBlockShaders: 0 + m_PrefabModeAllowAutoSave: 1 + m_EnterPlayModeOptionsEnabled: 1 + m_EnterPlayModeOptions: 0 + m_GameObjectNamingDigits: 1 + m_GameObjectNamingScheme: 0 + m_AssetNamingUsesSpace: 1 + m_InspectorUseIMGUIDefaultInspector: 0 + m_UseLegacyProbeSampleCount: 0 + m_DisableCookiesInLightmapper: 0 + m_ShadowmaskStitching: 1 + m_AssetPipelineMode: 1 + m_RefreshImportMode: 0 + m_CacheServerMode: 0 + m_CacheServerEndpoint: + m_CacheServerNamespacePrefix: default + m_CacheServerEnableDownload: 1 + m_CacheServerEnableUpload: 1 + m_CacheServerEnableTls: 0 + m_CacheServerImportResultCachingEnabled: 0 + m_CacheServerValidationMode: 2 + m_CacheServerDownloadBatchSize: 128 + m_EnableEnlightenBakedGI: 0 + m_ReferencedClipsExactNaming: 1 + m_ForceAssetUnloadAndGCOnSceneLoad: 1 + m_HideBuildProfileClassicPlatforms: 0 + m_UseLegacyHierarchy: 0 diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset new file mode 100644 index 0000000..47fa7da --- /dev/null +++ b/ProjectSettings/GraphicsSettings.asset @@ -0,0 +1,82 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!30 &1 +GraphicsSettings: + m_ObjectHideFlags: 0 + serializedVersion: 16 + m_Deferred: + m_Mode: 1 + m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} + m_DeferredReflections: + m_Mode: 1 + m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} + m_ScreenSpaceShadows: + m_Mode: 1 + m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} + m_DepthNormals: + m_Mode: 1 + m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} + m_MotionVectors: + m_Mode: 1 + m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} + m_LightHalo: + m_Mode: 1 + m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} + m_LensFlare: + m_Mode: 1 + m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} + m_VideoShadersIncludeMode: 2 + m_AlwaysIncludedShaders: + - {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} + m_PreloadedShaders: [] + m_PreloadShadersBatchTimeLimit: -1 + m_GraphicsStateCollection: {fileID: 0} + m_CollectionStartupAction: 0 + m_TraceSavePath: TracedCollection + m_TraceSendToEditor: 1 + m_AdditionalWarmupCollections: [] + m_WarmupAsync: 1 + m_EnableCacheMissTracing: 0 + m_WarmupProgressivelyLimit: -1 + m_CacheMissCollectionPath: CacheMissCollection + m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_CustomRenderPipeline: {fileID: 0} + m_TransparencySortMode: 0 + m_TransparencySortAxis: {x: 0, y: 0, z: 1} + m_DefaultRenderingPath: 1 + m_DefaultMobileRenderingPath: 1 + m_TierSettings: [] + m_LightmapStripping: 0 + m_FogStripping: 0 + m_InstancingStripping: 0 + m_BrgStripping: 0 + m_DefaultLightBaker: 0 + m_LightmapKeepPlain: 1 + m_LightmapKeepDirCombined: 1 + m_LightmapKeepDynamicPlain: 1 + m_LightmapKeepDynamicDirCombined: 1 + m_LightmapKeepShadowMask: 1 + m_LightmapKeepSubtractive: 1 + m_FogKeepLinear: 1 + m_FogKeepExp: 1 + m_FogKeepExp2: 1 + m_AlbedoSwatchInfos: [] + m_RenderPipelineGlobalSettingsMap: {} + m_ShaderBuildSettings: + keywordDeclarationOverrides: [] + numInternalDefines: 0 + defines: [] + compilerSettings: [] + m_LightsUseLinearIntensity: 0 + m_LightsUseColorTemperature: 0 + m_LogWhenShaderIsCompiled: 0 + m_LightProbeOutsideHullStrategy: 1 + m_CameraRelativeLightCulling: 0 + m_CameraRelativeShadowCulling: 0 diff --git a/ProjectSettings/InputManager.asset b/ProjectSettings/InputManager.asset new file mode 100644 index 0000000..8068b20 --- /dev/null +++ b/ProjectSettings/InputManager.asset @@ -0,0 +1,296 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!13 &1 +InputManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Axes: + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: left + positiveButton: right + altNegativeButton: a + altPositiveButton: d + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: down + positiveButton: up + altNegativeButton: s + altPositiveButton: w + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left ctrl + altNegativeButton: + altPositiveButton: mouse 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left alt + altNegativeButton: + altPositiveButton: mouse 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left shift + altNegativeButton: + altPositiveButton: mouse 2 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: space + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse X + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse Y + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse ScrollWheel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 2 + joyNum: 0 + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 1 + type: 2 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 0 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 1 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 2 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 3 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: return + altNegativeButton: + altPositiveButton: joystick button 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: enter + altNegativeButton: + altPositiveButton: space + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Cancel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: escape + altNegativeButton: + altPositiveButton: joystick button 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + m_UsePhysicalKeys: 1 diff --git a/ProjectSettings/MemorySettings.asset b/ProjectSettings/MemorySettings.asset new file mode 100644 index 0000000..e1bbfb1 --- /dev/null +++ b/ProjectSettings/MemorySettings.asset @@ -0,0 +1,37 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!387306366 &1 +MemorySettings: + m_ObjectHideFlags: 0 + m_EditorMemorySettings: + m_MainAllocatorBlockSize: -1 + m_ThreadAllocatorBlockSize: -1 + m_MainAllocatorMimallocEnabled: -1 + m_MainGfxBlockSize: -1 + m_ThreadGfxBlockSize: -1 + m_CacheBlockSize: -1 + m_TypetreeBlockSize: -1 + m_RemapperInitialCapacity: -1 + m_ProfilerBlockSize: -1 + m_ProfilerEditorBlockSize: -1 + m_BucketAllocatorGranularity: -1 + m_BucketAllocatorBucketsCount: -1 + m_BucketAllocatorBlockSize: -1 + m_BucketAllocatorBlockCount: -1 + m_ProfilerBucketAllocatorGranularity: -1 + m_ProfilerBucketAllocatorBucketsCount: -1 + m_ProfilerBucketAllocatorBlockSize: -1 + m_ProfilerBucketAllocatorBlockCount: -1 + m_TempAllocatorSizeMain: -1 + m_JobTempAllocatorBlockSize: -1 + m_BackgroundJobTempAllocatorBlockSize: -1 + m_JobTempAllocatorReducedBlockSize: -1 + m_TempAllocatorSizeGIBakingWorker: -1 + m_TempAllocatorSizeNavMeshWorker: -1 + m_TempAllocatorSizeAudioWorker: -1 + m_TempAllocatorSizeCloudWorker: -1 + m_TempAllocatorSizeGfx: -1 + m_TempAllocatorSizeJobWorker: -1 + m_TempAllocatorSizeBackgroundWorker: -1 + m_TempAllocatorSizePreloadManager: -1 + m_PlatformMemorySettings: [] diff --git a/ProjectSettings/MultiplayerManager.asset b/ProjectSettings/MultiplayerManager.asset new file mode 100644 index 0000000..2a93664 --- /dev/null +++ b/ProjectSettings/MultiplayerManager.asset @@ -0,0 +1,7 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!655991488 &1 +MultiplayerManager: + m_ObjectHideFlags: 0 + m_EnableMultiplayerRoles: 0 + m_StrippingTypes: {} diff --git a/ProjectSettings/NavMeshAreas.asset b/ProjectSettings/NavMeshAreas.asset new file mode 100644 index 0000000..2e2e369 --- /dev/null +++ b/ProjectSettings/NavMeshAreas.asset @@ -0,0 +1,93 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!126 &1 +NavMeshProjectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + areas: + - name: Walkable + cost: 1 + - name: Not Walkable + cost: 1 + - name: Jump + cost: 2 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + m_LastAgentTypeID: -887442657 + m_Settings: + - serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.75 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_SettingNames: + - Humanoid diff --git a/ProjectSettings/Physics2DSettings.asset b/ProjectSettings/Physics2DSettings.asset new file mode 100644 index 0000000..67aaf1c --- /dev/null +++ b/ProjectSettings/Physics2DSettings.asset @@ -0,0 +1,57 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!19 &1 +Physics2DSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_Gravity: {x: 0, y: -9.81} + m_DefaultMaterial: {fileID: 0} + m_VelocityIterations: 8 + m_PositionIterations: 3 + m_BounceThreshold: 1 + m_MaxLinearCorrection: 0.2 + m_MaxAngularCorrection: 8 + m_MaxTranslationSpeed: 100 + m_MaxRotationSpeed: 360 + m_BaumgarteScale: 0.2 + m_BaumgarteTimeOfImpactScale: 0.75 + m_TimeToSleep: 0.5 + m_LinearSleepTolerance: 0.01 + m_AngularSleepTolerance: 2 + m_DefaultContactOffset: 0.01 + m_ContactThreshold: 0 + m_JobOptions: + serializedVersion: 2 + useMultithreading: 0 + useConsistencySorting: 0 + m_InterpolationPosesPerJob: 100 + m_NewContactsPerJob: 30 + m_CollideContactsPerJob: 100 + m_ClearFlagsPerJob: 200 + m_ClearBodyForcesPerJob: 200 + m_SyncDiscreteFixturesPerJob: 50 + m_SyncContinuousFixturesPerJob: 50 + m_FindNearestContactsPerJob: 100 + m_UpdateTriggerContactsPerJob: 100 + m_IslandSolverCostThreshold: 100 + m_IslandSolverBodyCostScale: 1 + m_IslandSolverContactCostScale: 10 + m_IslandSolverJointCostScale: 10 + m_IslandSolverBodiesPerJob: 50 + m_IslandSolverContactsPerJob: 50 + m_SimulationMode: 0 + m_SimulationLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_MaxSubStepCount: 4 + m_MinSubStepFPS: 30 + m_UseSubStepping: 0 + m_UseSubStepContacts: 0 + m_QueriesHitTriggers: 1 + m_QueriesStartInColliders: 1 + m_CallbacksOnDisable: 1 + m_ReuseCollisionCallbacks: 1 + m_AutoSyncTransforms: 0 + m_GizmoOptions: 10 + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffu + m_PhysicsLowLevelSettings: {fileID: 0} diff --git a/ProjectSettings/PhysicsCoreProjectSettings2D.asset b/ProjectSettings/PhysicsCoreProjectSettings2D.asset new file mode 100644 index 0000000..049c745 --- /dev/null +++ b/ProjectSettings/PhysicsCoreProjectSettings2D.asset @@ -0,0 +1,6 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!176606843 &1 +PhysicsCoreProjectSettings2D: + m_ObjectHideFlags: 0 + m_PhysicsCoreSettings: {fileID: 0} diff --git a/ProjectSettings/PresetManager.asset b/ProjectSettings/PresetManager.asset new file mode 100644 index 0000000..67a94da --- /dev/null +++ b/ProjectSettings/PresetManager.asset @@ -0,0 +1,7 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1386491679 &1 +PresetManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_DefaultPresets: {} diff --git a/ProjectSettings/ProjectAuditorSettings.asset b/ProjectSettings/ProjectAuditorSettings.asset new file mode 100644 index 0000000..e0e8931 --- /dev/null +++ b/ProjectSettings/ProjectAuditorSettings.asset @@ -0,0 +1,36 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 53 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 0} + m_Name: + m_EditorClassIdentifier: UnityEditor.ProjectAuditorModule:Unity.ProjectAuditor.Editor:ProjectAuditorSettings + Rules: + rules: [] + DiagnosticParams: + paramsStack: + - PlatformGroup: + m_String: Unknown + m_SerializedParams: + - Key: TextureStreamingMipmapsSizeLimit + Value: 4000 + - Key: SpriteAtlasEmptySpaceLimit + Value: 50 + - Key: StreamingClipThresholdBytes + Value: 218294 + - Key: LongDecompressedClipThresholdBytes + Value: 204800 + - Key: LongCompressedMobileClipThresholdBytes + Value: 204800 + - Key: LoadInBackGroundClipSizeThresholdBytes + Value: 204800 + - Key: StreamingAssetsFolderSizeLimit + Value: 50 + CurrentParamsIndex: 0 diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset new file mode 100644 index 0000000..92dc4aa --- /dev/null +++ b/ProjectSettings/ProjectSettings.asset @@ -0,0 +1,705 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!129 &1 +PlayerSettings: + m_ObjectHideFlags: 0 + serializedVersion: 30 + productGUID: 7af82e0e961d227f789ec3024b0cce94 + AndroidProfiler: 0 + AndroidFilterTouchesWhenObscured: 0 + AndroidEnableSustainedPerformanceMode: 0 + defaultScreenOrientation: 4 + targetDevice: 2 + useOnDemandResources: 0 + accelerometerFrequency: 60 + companyName: Dome Shift + productName: Dome Shift + defaultCursor: {fileID: 0} + cursorHotspot: {x: 0, y: 0} + m_SplashScreenBackgroundColor: {r: 0.12156863, g: 0.12156863, b: 0.1254902, a: 1} + m_ShowUnitySplashScreen: 0 + m_ShowUnitySplashLogo: 1 + m_SplashScreenOverlayOpacity: 1 + m_SplashScreenAnimation: 1 + m_SplashScreenLogoStyle: 1 + m_SplashScreenDrawMode: 0 + m_SplashScreenBackgroundAnimationZoom: 1 + m_SplashScreenLogoAnimationZoom: 1 + m_SplashScreenBackgroundLandscapeAspect: 1 + m_SplashScreenBackgroundPortraitAspect: 1 + m_SplashScreenBackgroundLandscapeUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenBackgroundPortraitUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenLogos: [] + m_VirtualRealitySplashScreen: {fileID: 0} + defaultScreenWidth: 1920 + defaultScreenHeight: 1080 + defaultScreenWidthWeb: 960 + defaultScreenHeightWeb: 600 + m_StereoRenderingPath: 0 + m_ActiveColorSpace: 0 + unsupportedMSAAFallback: 0 + m_SpriteBatchMaxVertexCount: 65535 + m_SpriteBatchVertexThreshold: 300 + m_MTRendering: 1 + mipStripping: 0 + numberOfMipsStripped: 0 + numberOfMipsStrippedPerMipmapLimitGroup: {} + m_StackTraceTypes: 010000000100000001000000010000000100000001000000i + iosShowActivityIndicatorOnLoading: -1 + androidShowActivityIndicatorOnLoading: -1 + iosUseCustomAppBackgroundBehavior: 0 + allowedAutorotateToPortrait: 1 + allowedAutorotateToPortraitUpsideDown: 1 + allowedAutorotateToLandscapeRight: 1 + allowedAutorotateToLandscapeLeft: 1 + useOSAutorotation: 1 + use32BitDisplayBuffer: 1 + preserveFramebufferAlpha: 0 + adjustIOSFPSUsingThermalState: 1 + thermalStateSeriousIOSFPS: 30 + thermalStateCriticalIOSFPS: 15 + disableDepthAndStencilBuffers: 0 + androidStartInFullscreen: 1 + androidRenderOutsideSafeArea: 1 + androidUseSwappy: 1 + androidRequestedVisibleInsets: 0 + androidSystemBarsBehavior: 2 + androidDisplayOptions: 1 + androidBlitType: 0 + androidResizeableActivity: 1 + androidDefaultWindowWidth: 1920 + androidDefaultWindowHeight: 1080 + androidMinimumWindowWidth: 400 + androidMinimumWindowHeight: 300 + androidFullscreenMode: 1 + androidAutoRotationBehavior: 1 + androidPredictiveBackSupport: 1 + androidApplicationEntry: 2 + defaultIsNativeResolution: 1 + macRetinaSupport: 1 + runInBackground: 0 + callOnDisableOnAssetBundleUnload: 1 + muteOtherAudioSources: 0 + Prepare IOS For Recording: 0 + Force IOS Speakers When Recording: 0 + audioSpatialExperience: 0 + deferSystemGesturesMode: 0 + hideHomeButton: 0 + submitAnalytics: 1 + usePlayerLog: 1 + dedicatedServerOptimizations: 1 + bakeCollisionMeshes: 0 + forceSingleInstance: 0 + useFlipModelSwapchain: 1 + resizableWindow: 1 + useMacAppStoreValidation: 0 + macAppStoreCategory: public.app-category.games + gpuSkinning: 0 + meshDeformation: 0 + xboxPIXTextureCapture: 0 + xboxEnableAvatar: 0 + xboxEnableKinect: 0 + xboxEnableKinectAutoTracking: 0 + xboxEnableFitness: 0 + visibleInBackground: 1 + allowFullscreenSwitch: 1 + fullscreenMode: 3 + xboxSpeechDB: 0 + xboxEnableHeadOrientation: 0 + xboxEnableGuest: 0 + xboxEnablePIXSampling: 0 + metalFramebufferOnly: 0 + metalUseMetalDisplayLink: 0 + xboxOneResolution: 0 + xboxOneSResolution: 0 + xboxOneXResolution: 3 + xboxOneMonoLoggingLevel: 0 + xboxOneLoggingLevel: 1 + xboxOneDisableEsram: 0 + xboxOneEnableTypeOptimization: 0 + xboxOnePresentImmediateThreshold: 0 + switchQueueCommandMemory: 1048576 + switchQueueControlMemory: 16384 + switchQueueComputeMemory: 262144 + switchNVNShaderPoolsGranularity: 33554432 + switchNVNDefaultPoolsGranularity: 16777216 + switchNVNOtherPoolsGranularity: 16777216 + switchGpuScratchPoolGranularity: 2097152 + switchAllowGpuScratchShrinking: 0 + switchNVNMaxPublicTextureIDCount: 0 + switchNVNMaxPublicSamplerIDCount: 0 + switchMaxWorkerMultiple: 8 + switchNVNGraphicsFirmwareMemory: 32 + switchGraphicsJobsSyncAfterKick: 1 + vulkanNumSwapchainBuffers: 3 + vulkanEnableSetSRGBWrite: 0 + vulkanEnablePreTransform: 0 + vulkanEnableLateAcquireNextImage: 0 + vulkanEnableCommandBufferRecycling: 1 + loadStoreDebugModeEnabled: 0 + visionOSBundleVersion: 1.0 + tvOSBundleVersion: 1.0 + bundleVersion: 0.1.0 + preloadedAssets: [] + metroInputSource: 0 + wsaTransparentSwapchain: 0 + xboxOneDisableKinectGpuReservation: 1 + xboxOneEnable7thCore: 1 + vrSettings: + enable360StereoCapture: 0 + enableFrameTimingStats: 0 + enableOpenGLProfilerGPURecorders: 1 + allowHDRDisplaySupport: 0 + useHDRDisplay: 0 + hdrBitDepth: 0 + m_ColorGamuts: 00000000i + targetPixelDensity: 0 + resolutionScalingMode: 0 + resetResolutionOnWindowResize: 0 + androidSupportedAspectRatio: 1 + androidMaxAspectRatio: 2.4 + androidMinAspectRatio: 1 + applicationIdentifier: + Standalone: com.domeshift.game + buildNumber: {} + overrideDefaultApplicationIdentifier: 0 + AndroidBundleVersionCode: 1 + AndroidMinSdkVersion: 26 + AndroidTargetSdkVersion: 0 + AndroidPreferredInstallLocation: 1 + AndroidPreferredDataLocation: 1 + aotOptions: + stripEngineCode: 1 + iPhoneStrippingLevel: 0 + iPhoneScriptCallOptimization: 0 + ForceInternetPermission: 0 + ForceSDCardPermission: 0 + CreateWallpaper: 0 + androidSplitApplicationBinary: 0 + keepLoadedShadersAlive: 0 + StripUnusedMeshComponents: 0 + strictShaderVariantMatching: 0 + VertexChannelCompressionMask: 4054 + iPhoneSdkVersion: 988 + iOSSimulatorArchitecture: 0 + iOSTargetOSVersionString: + tvOSSdkVersion: 0 + tvOSSimulatorArchitecture: 0 + tvOSRequireExtendedGameController: 0 + tvOSTargetOSVersionString: + VisionOSSdkVersion: 0 + VisionOSTargetOSVersionString: + xcodeProjectType: 0 + uIPrerenderedIcon: 0 + uIRequiresPersistentWiFi: 0 + uIRequiresFullScreen: 1 + uIStatusBarHidden: 1 + uIExitOnSuspend: 0 + uIStatusBarStyle: 0 + appleTVSplashScreen: {fileID: 0} + appleTVSplashScreen2x: {fileID: 0} + tvOSSmallIconLayers: [] + tvOSSmallIconLayers2x: [] + tvOSLargeIconLayers: [] + tvOSLargeIconLayers2x: [] + tvOSTopShelfImageLayers: [] + tvOSTopShelfImageLayers2x: [] + tvOSTopShelfImageWideLayers: [] + tvOSTopShelfImageWideLayers2x: [] + iOSLaunchScreenType: 0 + iOSLaunchScreenPortrait: {fileID: 0} + iOSLaunchScreenLandscape: {fileID: 0} + iOSLaunchScreenBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreenFillPct: 100 + iOSLaunchScreenSize: 100 + iOSLaunchScreeniPadType: 0 + iOSLaunchScreeniPadImage: {fileID: 0} + iOSLaunchScreeniPadBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreeniPadFillPct: 100 + iOSLaunchScreeniPadSize: 100 + iOSLaunchScreenCustomStoryboardPath: + iOSLaunchScreeniPadCustomStoryboardPath: + iOSDeviceRequirements: [] + iOSURLSchemes: [] + macOSURLSchemes: [] + iOSBackgroundModes: 0 + iOSMetalForceHardShadows: 0 + metalEditorSupport: 1 + metalAPIValidation: 1 + metalCompileShaderBinary: 0 + iOSRenderExtraFrameOnPause: 0 + iosCopyPluginsCodeInsteadOfSymlink: 0 + appleDeveloperTeamID: + iOSManualSigningProvisioningProfileID: + tvOSManualSigningProvisioningProfileID: + VisionOSManualSigningProvisioningProfileID: + iOSManualSigningProvisioningProfileType: 0 + tvOSManualSigningProvisioningProfileType: 0 + VisionOSManualSigningProvisioningProfileType: 0 + appleEnableAutomaticSigning: 0 + iOSRequireARKit: 0 + iOSAutomaticallyDetectAndAddCapabilities: 1 + appleEnableProMotion: 0 + shaderPrecisionModel: 0 + clonedFromGUID: 00000000000000000000000000000000 + templatePackageId: + templateDefaultScene: + useCustomMainManifest: 0 + useCustomLauncherManifest: 0 + useCustomMainGradleTemplate: 0 + useCustomLauncherGradleManifest: 0 + useCustomBaseGradleTemplate: 0 + useCustomGradlePropertiesTemplate: 0 + useCustomGradleSettingsTemplate: 0 + useCustomProguardFile: 0 + AndroidTargetArchitectures: 2 + AndroidSplashScreenScale: 0 + androidSplashScreen: {fileID: 0} + AndroidKeystoreName: + AndroidKeyaliasName: + AndroidEnableArmv9SecurityFeatures: 0 + AndroidEnableArm64MTE: 0 + AndroidBuildApkPerCpuArchitecture: 0 + AndroidTVCompatibility: 0 + AndroidIsGame: 1 + androidAppCategory: 3 + useAndroidAppCategory: 1 + androidAppCategoryOther: + AndroidEnableTango: 0 + androidEnableBanner: 1 + androidUseLowAccuracyLocation: 0 + androidUseCustomKeystore: 0 + m_AndroidBanners: + - width: 320 + height: 180 + banner: {fileID: 0} + androidGamepadSupportLevel: 0 + AndroidMinifyRelease: 0 + AndroidMinifyDebug: 0 + AndroidValidateAppBundleSize: 1 + AndroidAppBundleSizeToValidate: 200 + AndroidReportGooglePlayAppDependencies: 1 + androidSymbolsSizeThreshold: 800 + m_BuildTargetIcons: [] + m_BuildTargetPlatformIcons: [] + m_BuildTargetBatching: [] + m_BuildTargetShaderSettings: [] + m_BuildTargetGraphicsJobs: [] + m_BuildTargetGraphicsJobMode: [] + m_BuildTargetGraphicsAPIs: [] + m_DefaultShaderChunkSizeInMB: 16 + m_DefaultShaderChunkCount: 0 + openGLRequireES31: 0 + openGLRequireES31AEP: 0 + openGLRequireES32: 0 + m_TemplateCustomTags: {} + mobileMTRendering: + Android: 1 + VisionOS: 1 + iPhone: 1 + tvOS: 1 + m_BuildTargetGroupLightmapEncodingQuality: [] + m_BuildTargetGroupHDRCubemapEncodingQuality: [] + m_BuildTargetGroupLightmapSettings: [] + m_BuildTargetGroupLoadStoreDebugModeSettings: [] + m_BuildTargetNormalMapEncoding: [] + m_BuildTargetDefaultTextureCompressionFormat: [] + playModeTestRunnerEnabled: 0 + runPlayModeTestAsEditModeTest: 0 + actionOnDotNetUnhandledException: 1 + editorGfxJobOverride: 1 + enableInternalProfiler: 0 + logObjCUncaughtExceptions: 1 + enableCrashReportAPI: 0 + cameraUsageDescription: + locationUsageDescription: + microphoneUsageDescription: + bluetoothUsageDescription: + macOSTargetOSVersion: + switchNMETAOverride: + switchNetLibKey: + switchSocketMemoryPoolSize: 6144 + switchSocketAllocatorPoolSize: 128 + switchSocketConcurrencyLimit: 14 + switchScreenResolutionBehavior: 2 + switchUseCPUProfiler: 0 + switchEnableFileSystemTrace: 0 + switchLTOSetting: 0 + switchApplicationID: 0x01004b9000490000 + switchNSODependencies: + switchCompilerFlags: + switchTitleNames_0: + switchTitleNames_1: + switchTitleNames_2: + switchTitleNames_3: + switchTitleNames_4: + switchTitleNames_5: + switchTitleNames_6: + switchTitleNames_7: + switchTitleNames_8: + switchTitleNames_9: + switchTitleNames_10: + switchTitleNames_11: + switchTitleNames_12: + switchTitleNames_13: + switchTitleNames_14: + switchTitleNames_15: + switchPublisherNames_0: + switchPublisherNames_1: + switchPublisherNames_2: + switchPublisherNames_3: + switchPublisherNames_4: + switchPublisherNames_5: + switchPublisherNames_6: + switchPublisherNames_7: + switchPublisherNames_8: + switchPublisherNames_9: + switchPublisherNames_10: + switchPublisherNames_11: + switchPublisherNames_12: + switchPublisherNames_13: + switchPublisherNames_14: + switchPublisherNames_15: + switchIcons_0: {fileID: 0} + switchIcons_1: {fileID: 0} + switchIcons_2: {fileID: 0} + switchIcons_3: {fileID: 0} + switchIcons_4: {fileID: 0} + switchIcons_5: {fileID: 0} + switchIcons_6: {fileID: 0} + switchIcons_7: {fileID: 0} + switchIcons_8: {fileID: 0} + switchIcons_9: {fileID: 0} + switchIcons_10: {fileID: 0} + switchIcons_11: {fileID: 0} + switchIcons_12: {fileID: 0} + switchIcons_13: {fileID: 0} + switchIcons_14: {fileID: 0} + switchIcons_15: {fileID: 0} + switchSmallIcons_0: {fileID: 0} + switchSmallIcons_1: {fileID: 0} + switchSmallIcons_2: {fileID: 0} + switchSmallIcons_3: {fileID: 0} + switchSmallIcons_4: {fileID: 0} + switchSmallIcons_5: {fileID: 0} + switchSmallIcons_6: {fileID: 0} + switchSmallIcons_7: {fileID: 0} + switchSmallIcons_8: {fileID: 0} + switchSmallIcons_9: {fileID: 0} + switchSmallIcons_10: {fileID: 0} + switchSmallIcons_11: {fileID: 0} + switchSmallIcons_12: {fileID: 0} + switchSmallIcons_13: {fileID: 0} + switchSmallIcons_14: {fileID: 0} + switchSmallIcons_15: {fileID: 0} + switchManualHTML: + switchAccessibleURLs: + switchLegalInformation: + switchMainThreadStackSize: 1048576 + switchPresenceGroupId: + switchLogoHandling: 0 + switchReleaseVersion: 0 + switchDisplayVersion: 1.0.0 + switchStartupUserAccount: 0 + switchSupportedLanguagesMask: 0 + switchLogoType: 0 + switchApplicationErrorCodeCategory: + switchUserAccountSaveDataSize: 0 + switchUserAccountSaveDataJournalSize: 0 + switchApplicationAttribute: 0 + switchCardSpecSize: -1 + switchCardSpecClock: -1 + switchRatingsMask: 0 + switchRatingsInt_0: 0 + switchRatingsInt_1: 0 + switchRatingsInt_2: 0 + switchRatingsInt_3: 0 + switchRatingsInt_4: 0 + switchRatingsInt_5: 0 + switchRatingsInt_6: 0 + switchRatingsInt_7: 0 + switchRatingsInt_8: 0 + switchRatingsInt_9: 0 + switchRatingsInt_10: 0 + switchRatingsInt_11: 0 + switchRatingsInt_12: 0 + switchLocalCommunicationIds_0: + switchLocalCommunicationIds_1: + switchLocalCommunicationIds_2: + switchLocalCommunicationIds_3: + switchLocalCommunicationIds_4: + switchLocalCommunicationIds_5: + switchLocalCommunicationIds_6: + switchLocalCommunicationIds_7: + switchParentalControl: 0 + switchAllowsScreenshot: 1 + switchAllowsVideoCapturing: 1 + switchAllowsRuntimeAddOnContentInstall: 0 + switchDataLossConfirmation: 0 + switchUserAccountLockEnabled: 0 + switchSystemResourceMemory: 16777216 + switchSupportedNpadStyles: 22 + switchNativeFsCacheSize: 32 + switchIsHoldTypeHorizontal: 1 + switchSupportedNpadCount: 8 + switchEnableTouchScreen: 1 + switchSocketConfigEnabled: 0 + switchTcpInitialSendBufferSize: 32 + switchTcpInitialReceiveBufferSize: 64 + switchTcpAutoSendBufferSizeMax: 256 + switchTcpAutoReceiveBufferSizeMax: 256 + switchUdpSendBufferSize: 9 + switchUdpReceiveBufferSize: 42 + switchSocketBufferEfficiency: 4 + switchSocketInitializeEnabled: 1 + switchNetworkInterfaceManagerInitializeEnabled: 1 + switchDisableHTCSPlayerConnection: 0 + switchUseNewStyleFilepaths: 1 + switchUseLegacyFmodPriorities: 0 + switchUseMicroSleepForYield: 1 + switchEnableRamDiskSupport: 0 + switchMicroSleepForYieldTime: 25 + switchRamDiskSpaceSize: 12 + switchUpgradedPlayerSettingsToNMETA: 0 + switchCaStoreSource: 0 + switchCaStoreFilePath: + ps4NPAgeRating: 12 + ps4NPTitleSecret: + ps4NPTrophyPackPath: + ps4ParentalLevel: 11 + ps4ContentID: ED1633-NPXX51362_00-0000000000000000 + ps4Category: 0 + ps4MasterVersion: 01.00 + ps4AppVersion: 01.00 + ps4AppType: 0 + ps4ParamSfxPath: + ps4VideoOutPixelFormat: 0 + ps4VideoOutInitialWidth: 1920 + ps4VideoOutBaseModeInitialWidth: 1920 + ps4VideoOutReprojectionRate: 60 + ps4PronunciationXMLPath: + ps4PronunciationSIGPath: + ps4BackgroundImagePath: + ps4StartupImagePath: + ps4StartupImagesFolder: + ps4IconImagesFolder: + ps4SaveDataImagePath: + ps4SdkOverride: + ps4BGMPath: + ps4ShareFilePath: + ps4ShareOverlayImagePath: + ps4PrivacyGuardImagePath: + ps4ExtraSceSysFile: + ps4NPtitleDatPath: + ps4RemotePlayKeyAssignment: -1 + ps4RemotePlayKeyMappingDir: + ps4PlayTogetherPlayerCount: 0 + ps4EnterButtonAssignment: 2 + ps4ApplicationParam1: 0 + ps4ApplicationParam2: 0 + ps4ApplicationParam3: 0 + ps4ApplicationParam4: 0 + ps4DownloadDataSize: 0 + ps4GarlicHeapSize: 2048 + ps4ProGarlicHeapSize: 2560 + playerPrefsMaxSize: 32768 + ps4Passcode: uDdy0X8VD0S0vJhdOb926rGchjPrGVeA + ps4pnSessions: 1 + ps4pnPresence: 1 + ps4pnFriends: 1 + ps4pnGameCustomData: 1 + playerPrefsSupport: 0 + enableApplicationExit: 0 + resetTempFolder: 1 + restrictedAudioUsageRights: 0 + ps4UseResolutionFallback: 0 + ps4ReprojectionSupport: 0 + ps4UseAudio3dBackend: 0 + ps4UseLowGarlicFragmentationMode: 1 + ps4SocialScreenEnabled: 0 + ps4ScriptOptimizationLevel: 2 + ps4Audio3dVirtualSpeakerCount: 14 + ps4attribCpuUsage: 0 + ps4PatchPkgPath: + ps4PatchLatestPkgPath: + ps4PatchChangeinfoPath: + ps4PatchDayOne: 0 + ps4attribUserManagement: 0 + ps4attribMoveSupport: 0 + ps4attrib3DSupport: 0 + ps4attribShareSupport: 0 + ps4attribExclusiveVR: 0 + ps4disableAutoHideSplash: 0 + ps4videoRecordingFeaturesUsed: 0 + ps4contentSearchFeaturesUsed: 0 + ps4CompatibilityPS5: 0 + ps4AllowPS5Detection: 0 + ps4GPU800MHz: 1 + ps4attribEyeToEyeDistanceSettingVR: 0 + ps4IncludedModules: [] + ps4attribVROutputEnabled: 0 + monoEnv: + splashScreenBackgroundSourceLandscape: {fileID: 0} + splashScreenBackgroundSourcePortrait: {fileID: 0} + blurSplashScreenBackground: 1 + spritePackerPolicy: + webGLMemorySize: 32 + webGLExceptionSupport: 1 + webGLNameFilesAsHashes: 0 + webGLShowDiagnostics: 0 + webGLDataCaching: 1 + webGLDebugSymbols: 0 + webGLEmscriptenArgs: + webGLModulesDirectory: + webGLTemplate: APPLICATION:Default + webGLAnalyzeBuildSize: 0 + webGLUseEmbeddedResources: 0 + webGLCompressionFormat: 1 + webGLWasmArithmeticExceptions: 0 + webGLLinkerTarget: 1 + webGLThreadsSupport: 0 + webGLDecompressionFallback: 0 + webGLInitialMemorySize: 32 + webGLMaximumMemorySize: 2048 + webGLMemoryGrowthMode: 2 + webGLMemoryLinearGrowthStep: 16 + webGLMemoryGeometricGrowthStep: 0.2 + webGLMemoryGeometricGrowthCap: 96 + webGLPowerPreference: 2 + webGLWebAssemblyTable: 0 + webGLWebAssemblyBigInt: 0 + webGLCloseOnQuit: 0 + webWasm2023: 1 + webEnableSubmoduleStrippingCompatibility: 0 + webProgressiveAssetLoading: 0 + scriptingDefineSymbols: {} + additionalCompilerArguments: {} + platformArchitecture: {} + scriptingBackend: {} + il2cppCompilerConfiguration: {} + il2cppCodeGeneration: {} + il2cppLTOMode: {} + il2cppStacktraceInformation: {} + managedStrippingLevel: {} + incrementalIl2cppBuild: {} + suppressCommonWarnings: 1 + allowUnsafeCode: 0 + useDeterministicCompilation: 1 + additionalIl2CppArgs: + scriptingRuntimeVersion: 1 + gcIncremental: 1 + gcWBarrierValidation: 0 + managedCodeVariant: {} + apiCompatibilityLevelPerPlatform: {} + editorAssembliesCompatibilityLevel: 1 + m_RenderingPath: 1 + m_MobileRenderingPath: 1 + metroPackageName: bioDome + metroPackageVersion: + metroCertificatePath: + metroCertificatePassword: + metroCertificateSubject: + metroCertificateIssuer: + metroCertificateNotAfter: 0000000000000000 + metroApplicationDescription: bioDome + wsaImages: {} + metroTileShortName: + metroTileShowName: 0 + metroMediumTileShowName: 0 + metroLargeTileShowName: 0 + metroWideTileShowName: 0 + metroSupportStreamingInstall: 0 + metroLastRequiredScene: 0 + metroDefaultTileSize: 1 + metroTileForegroundText: 2 + metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} + metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1} + metroSplashScreenUseBackgroundColor: 0 + syncCapabilities: 0 + platformCapabilities: {} + metroTargetDeviceFamilies: {} + metroFTAName: + metroFTAFileTypes: [] + metroProtocolName: + vcxProjDefaultLanguage: + XboxOneProductId: + XboxOneUpdateKey: + XboxOneSandboxId: + XboxOneContentId: + XboxOneTitleId: + XboxOneSCId: + XboxOneGameOsOverridePath: + XboxOnePackagingOverridePath: + XboxOneAppManifestOverridePath: + XboxOneVersion: 1.0.0.0 + XboxOnePackageEncryption: 0 + XboxOnePackageUpdateGranularity: 2 + XboxOneDescription: + XboxOneLanguage: + - enus + XboxOneCapability: [] + XboxOneGameRating: {} + XboxOneIsContentPackage: 0 + XboxOneEnhancedXboxCompatibilityMode: 0 + XboxOneEnableGPUVariability: 1 + XboxOneSockets: {} + XboxOneSplashScreen: {fileID: 0} + XboxOneAllowedProductIds: [] + XboxOnePersistentLocalStorageSize: 0 + XboxOneXTitleMemory: 8 + XboxOneOverrideIdentityName: + XboxOneOverrideIdentityPublisher: + cloudServicesEnabled: {} + luminIcon: + m_Name: + m_ModelFolderPath: + m_PortalFolderPath: + luminCert: + m_CertPath: + m_SignPackage: 1 + luminIsChannelApp: 0 + luminVersion: + m_VersionCode: 1 + m_VersionName: + hmiPlayerDataPath: + hmiForceSRGBBlit: 0 + embeddedLinuxEnableGamepadInput: 0 + hmiCpuConfiguration: + hmiLogStartupTiming: 0 + qnxGraphicConfPath: + apiCompatibilityLevel: 6 + captureStartupLogs: {} + activeInputHandler: 0 + windowsGamepadBackendHint: 0 + enableDirectStorage: 0 + cloudProjectId: + framebufferDepthMemorylessMode: 0 + qualitySettingsNames: [] + projectName: + organizationId: + cloudEnabled: 0 + legacyClampBlendShapeWeights: 0 + hmiLoadingImage: {fileID: 0} + platformRequiresReadableAssets: 0 + virtualTexturingSupportEnabled: 0 + insecureHttpOption: 0 + androidVulkanDenyFilterList: [] + androidVulkanAllowFilterList: [] + androidVulkanDeviceFilterListAsset: {fileID: 0} + d3d12DeviceFilterListAsset: {fileID: 0} + webGPUDeviceFilterListAsset: {fileID: 0} + allowedHttpConnections: 3 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt new file mode 100644 index 0000000..eafb275 --- /dev/null +++ b/ProjectSettings/ProjectVersion.txt @@ -0,0 +1,2 @@ +m_EditorVersion: 6000.6.8f1 +m_EditorVersionWithRevision: 6000.6.8f1 (237b6593792b) diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset new file mode 100644 index 0000000..64f8aba --- /dev/null +++ b/ProjectSettings/QualitySettings.asset @@ -0,0 +1,347 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!47 &1 +QualitySettings: + m_ObjectHideFlags: 0 + serializedVersion: 5 + m_CurrentQuality: 5 + m_QualitySettings: + - serializedVersion: 5 + name: Very Low + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 15 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + skinWeights: 1 + globalTextureMipmapLimit: 1 + textureMipmapLimitSettings: [] + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + useLegacyDetailDistribution: 0 + adaptiveVsync: 0 + vSyncCount: 0 + realtimeGICPUUsage: 25 + adaptiveVsyncExtraA: 0 + adaptiveVsyncExtraB: 0 + lodBias: 0.3 + meshLodThreshold: 1 + maximumLODLevel: 0 + enableLODCrossFade: 1 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 4 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + terrainQualityOverrides: 0 + terrainPixelError: 1 + terrainDetailDensityScale: 1 + terrainBasemapDistance: 1000 + terrainDetailDistance: 80 + terrainTreeDistance: 5000 + terrainBillboardStart: 50 + terrainFadeLength: 5 + terrainMaxTrees: 50 + excludedTargetPlatforms: [] + - serializedVersion: 5 + name: Low + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + skinWeights: 2 + globalTextureMipmapLimit: 0 + textureMipmapLimitSettings: [] + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + useLegacyDetailDistribution: 0 + adaptiveVsync: 0 + vSyncCount: 0 + realtimeGICPUUsage: 25 + adaptiveVsyncExtraA: 0 + adaptiveVsyncExtraB: 0 + lodBias: 0.4 + meshLodThreshold: 1 + maximumLODLevel: 0 + enableLODCrossFade: 1 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 16 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + terrainQualityOverrides: 0 + terrainPixelError: 1 + terrainDetailDensityScale: 1 + terrainBasemapDistance: 1000 + terrainDetailDistance: 80 + terrainTreeDistance: 5000 + terrainBillboardStart: 50 + terrainFadeLength: 5 + terrainMaxTrees: 50 + excludedTargetPlatforms: [] + - serializedVersion: 5 + name: Medium + pixelLightCount: 1 + shadows: 1 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + skinWeights: 2 + globalTextureMipmapLimit: 0 + textureMipmapLimitSettings: [] + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + useLegacyDetailDistribution: 0 + adaptiveVsync: 0 + vSyncCount: 1 + realtimeGICPUUsage: 25 + adaptiveVsyncExtraA: 0 + adaptiveVsyncExtraB: 0 + lodBias: 0.7 + meshLodThreshold: 1 + maximumLODLevel: 0 + enableLODCrossFade: 1 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 64 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + terrainQualityOverrides: 0 + terrainPixelError: 1 + terrainDetailDensityScale: 1 + terrainBasemapDistance: 1000 + terrainDetailDistance: 80 + terrainTreeDistance: 5000 + terrainBillboardStart: 50 + terrainFadeLength: 5 + terrainMaxTrees: 50 + excludedTargetPlatforms: [] + - serializedVersion: 5 + name: High + pixelLightCount: 2 + shadows: 2 + shadowResolution: 1 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 40 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + skinWeights: 2 + globalTextureMipmapLimit: 0 + textureMipmapLimitSettings: [] + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + useLegacyDetailDistribution: 0 + adaptiveVsync: 0 + vSyncCount: 1 + realtimeGICPUUsage: 50 + adaptiveVsyncExtraA: 0 + adaptiveVsyncExtraB: 0 + lodBias: 1 + meshLodThreshold: 1 + maximumLODLevel: 0 + enableLODCrossFade: 1 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 256 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + terrainQualityOverrides: 0 + terrainPixelError: 1 + terrainDetailDensityScale: 1 + terrainBasemapDistance: 1000 + terrainDetailDistance: 80 + terrainTreeDistance: 5000 + terrainBillboardStart: 50 + terrainFadeLength: 5 + terrainMaxTrees: 50 + excludedTargetPlatforms: [] + - serializedVersion: 5 + name: Very High + pixelLightCount: 3 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 70 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + skinWeights: 4 + globalTextureMipmapLimit: 0 + textureMipmapLimitSettings: [] + anisotropicTextures: 2 + antiAliasing: 2 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + useLegacyDetailDistribution: 0 + adaptiveVsync: 0 + vSyncCount: 1 + realtimeGICPUUsage: 50 + adaptiveVsyncExtraA: 0 + adaptiveVsyncExtraB: 0 + lodBias: 1.5 + meshLodThreshold: 1 + maximumLODLevel: 0 + enableLODCrossFade: 1 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 1024 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + terrainQualityOverrides: 0 + terrainPixelError: 1 + terrainDetailDensityScale: 1 + terrainBasemapDistance: 1000 + terrainDetailDistance: 80 + terrainTreeDistance: 5000 + terrainBillboardStart: 50 + terrainFadeLength: 5 + terrainMaxTrees: 50 + excludedTargetPlatforms: [] + - serializedVersion: 5 + name: Ultra + pixelLightCount: 4 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 4 + shadowDistance: 150 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + skinWeights: 255 + globalTextureMipmapLimit: 0 + textureMipmapLimitSettings: [] + anisotropicTextures: 2 + antiAliasing: 2 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + useLegacyDetailDistribution: 0 + adaptiveVsync: 0 + vSyncCount: 1 + realtimeGICPUUsage: 100 + adaptiveVsyncExtraA: 0 + adaptiveVsyncExtraB: 0 + lodBias: 2 + meshLodThreshold: 1 + maximumLODLevel: 0 + enableLODCrossFade: 1 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 4096 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + terrainQualityOverrides: 0 + terrainPixelError: 1 + terrainDetailDensityScale: 1 + terrainBasemapDistance: 1000 + terrainDetailDistance: 80 + terrainTreeDistance: 5000 + terrainBillboardStart: 50 + terrainFadeLength: 5 + terrainMaxTrees: 50 + excludedTargetPlatforms: [] + m_TextureMipmapLimitGroupNames: [] + m_PerPlatformDefaultQuality: + Android: 2 + EmbeddedLinux: 5 + GameCoreScarlett: 5 + GameCoreXboxOne: 5 + Kepler: 5 + LinuxHeadlessSimulation: 5 + Nintendo Switch: 5 + Nintendo Switch 2: 5 + PS4: 5 + PS5: 5 + QNX: 5 + Server: 5 + Standalone: 5 + VisionOS: 5 + WebGL: 3 + Windows Store Apps: 5 + XboxOne: 5 + iPhone: 2 + tvOS: 2 diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset new file mode 100644 index 0000000..6abf33d --- /dev/null +++ b/ProjectSettings/TagManager.asset @@ -0,0 +1,46 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!78 &1 +TagManager: + serializedVersion: 3 + tags: [] + layers: + - Default + - TransparentFX + - Ignore Raycast + - + - Water + - UI + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + m_SortingLayers: + - name: Default + uniqueID: 0 + locked: 0 + m_RenderingLayers: + - Default + m_MigratedRenderPipelines: [] diff --git a/ProjectSettings/TimeManager.asset b/ProjectSettings/TimeManager.asset new file mode 100644 index 0000000..2e23a1f --- /dev/null +++ b/ProjectSettings/TimeManager.asset @@ -0,0 +1,14 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!5 &1 +TimeManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + Fixed Timestep: + m_Count: 2822399 + m_Rate: + m_Denominator: 1 + m_Numerator: 141120000 + Maximum Allowed Timestep: 0.33333334 + m_TimeScale: 1 + Maximum Particle Timestep: 0.03 diff --git a/ProjectSettings/UnityConnectSettings.asset b/ProjectSettings/UnityConnectSettings.asset new file mode 100644 index 0000000..c009170 --- /dev/null +++ b/ProjectSettings/UnityConnectSettings.asset @@ -0,0 +1,42 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!310 &1 +UnityConnectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 1 + m_Enabled: 0 + m_TestMode: 0 + m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events + m_EventUrl: https://cdp.cloud.unity3d.com/v1/events + m_ConfigUrl: https://config.uca.cloud.unity3d.com + m_DashboardUrl: https://dashboard.unity3d.com + m_TestInitMode: 0 + InsightsSettings: + m_EventUrl: https://engine-data.unity3d.com + m_StackTraceUrl: https://engine-data.services.api.unity.com/v1/stack-traces + m_EngineDiagnosticsEnabled: 0 + m_Enabled: 0 + CrashReportingSettings: + serializedVersion: 2 + m_EventUrl: https://perf-events.cloud.unity3d.com + m_EnableCloudDiagnosticsReporting: 0 + m_LogBufferSize: 10 + m_CaptureEditorExceptions: 1 + UnityPurchasingSettings: + m_Enabled: 0 + m_TestMode: 0 + UnityAnalyticsSettings: + m_Enabled: 0 + m_TestMode: 0 + m_InitializeOnStartup: 1 + m_PackageRequiringCoreStatsPresent: 0 + UnityAdsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_IosGameId: + m_AndroidGameId: + m_GameIds: {} + m_GameId: + PerformanceReportingSettings: + m_Enabled: 0 diff --git a/ProjectSettings/VFXManager.asset b/ProjectSettings/VFXManager.asset new file mode 100644 index 0000000..d51c4d3 --- /dev/null +++ b/ProjectSettings/VFXManager.asset @@ -0,0 +1,21 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!937362698 &1 +VFXManager: + m_ObjectHideFlags: 0 + m_IndirectShader: {fileID: 0} + m_CopyBufferShader: {fileID: 0} + m_PrefixSumShader: {fileID: 0} + m_SortShader: {fileID: 0} + m_StripUpdateShader: {fileID: 0} + m_EmptyShader: {fileID: 0} + m_RenderPipeSettingsPath: + m_FixedTimeStep: 0.016666668 + m_MaxDeltaTime: 0.05 + m_MaxScrubTime: 30 + m_MaxCapacity: 100000000 + m_CompiledVersion: 0 + m_RuntimeVersion: 0 + m_RuntimeResources: {fileID: 0} + m_EditorResources: {fileID: 0} + m_BatchEmptyLifetime: 300 diff --git a/ProjectSettings/VersionControlSettings.asset b/ProjectSettings/VersionControlSettings.asset new file mode 100644 index 0000000..979fd8e --- /dev/null +++ b/ProjectSettings/VersionControlSettings.asset @@ -0,0 +1,7 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!890905787 &1 +VersionControlSettings: + m_ObjectHideFlags: 0 + m_Mode: Visible Meta Files + m_TrackPackagesOutsideProject: 0