diff --git a/Assets/DynamicModelling/Scripts/ModelFactory.cs b/Assets/DynamicModelling/Scripts/ModelFactory.cs deleted file mode 100644 index 3d980b08..00000000 --- a/Assets/DynamicModelling/Scripts/ModelFactory.cs +++ /dev/null @@ -1,591 +0,0 @@ -using System; -using Unibas.DBIS.DynamicModelling.Models; -using UnityEngine; - -namespace Unibas.DBIS.DynamicModelling -{ - public static class ModelFactory - { - /// - /// Quad of sorts: - /// - /// c---d - /// | | - /// a---b - /// - /// - /// - /// - /// - /// - /// - /// - public static GameObject CreateFreeformQuad(Vector3 a, Vector3 b, Vector3 c, Vector3 d, - Material material = null) - { - GameObject go = new GameObject("FreeformQuad"); - MeshFilter meshFilter = go.AddComponent(); - MeshRenderer meshRenderer = go.AddComponent(); - Mesh mesh = meshFilter.mesh; - Vector3[] vertices = new[] - { - a, b, c, d - }; - mesh.vertices = vertices; - - int[] tri = new int[6]; - - tri[0] = 0; - tri[1] = 2; - tri[2] = 1; - - tri[3] = 2; - tri[4] = 3; - tri[5] = 1; - - mesh.triangles = tri; - - /* - Vector3[] normals = new Vector3[4]; - - normals[0] = -Vector3.forward; - normals[1] = -Vector3.forward; - normals[2] = -Vector3.forward; - normals[3] = -Vector3.forward; - - mesh.normals = normals;*/ - - Vector2[] uv = new Vector2[4]; - - /* - float xUnit = 1; - float yUnit = 1; - - if (width > height) - { - xUnit = width / height; - } - else - { - yUnit = height / width; - } - */ - - // TODO - - uv[0] = new Vector2(0, 0); - uv[1] = new Vector2(1, 0); - uv[2] = new Vector2(0, 1); - uv[3] = new Vector2(1, 1); - - mesh.uv = uv; - - mesh.RecalculateBounds(); - mesh.RecalculateNormals(); - mesh.RecalculateTangents(); - - if (material != null) - { - meshRenderer.material.CopyPropertiesFromMaterial(material); - //meshRenderer.material.SetTextureScale("_MainTex", new Vector2(1,1)); - meshRenderer.material.name = material.name + "(Instance)"; - } - else - { - meshRenderer.material = new Material(Shader.Find("Standard")); - meshRenderer.material.color = Color.white; - } - - - return go; - } - - /// - /// Creates a wall between two positions - /// - /// - /// - /// - /// - /// - public static GameObject CreatePositionedWall(Vector3 start, Vector3 end, float height, - string materialName = null) - { - float width = Vector3.Distance(start, end); - float a = Vector3.Angle(end - start, Vector3.right); - GameObject go = new GameObject("PositionedWall"); - GameObject wall = CreateWall(width, height, materialName); - - wall.transform.parent = go.transform; - wall.transform.position = Vector3.zero; - wall.transform.Rotate(Vector3.up, -a); - go.transform.position = start; - return go; - } - - public static GameObject CreateWall(WallModel model) - { - float width = Vector3.Distance(model.Start, model.End); - float a = Vector3.Angle(model.Start - model.End, Vector3.right); - GameObject go = new GameObject("PositionedWall"); - GameObject wall = CreateWall(width, model.Height, model.Material); - - wall.transform.parent = go.transform; - wall.transform.position = Vector3.zero; - wall.transform.Rotate(Vector3.up, -a); - go.transform.position = model.Start; - go.AddComponent().Model = model; - return go; - } - - - /// - /// - /// - /// center of room - /// - /// - /// 0 floor, 1 ceiling, 2 north (pos z), 3 east (pos x), 4 south (neg z), 5 west (neg x) - /// - public static GameObject CreateCuboidRoom(Vector3 position, float size, float height, string[] materialNames) - { - GameObject root = new GameObject("SquareRoom"); - - float halfSize = size / 2f; - - // North wall - GameObject north = CreateWall(size, height, materialNames[2]); - north.name = "NorthWall"; - north.transform.parent = root.transform; - north.transform.position = new Vector3(-halfSize, 0, halfSize); - // East wall - GameObject east = CreateWall(size, height, materialNames[3]); - east.name = "EastWall"; - east.transform.parent = root.transform; - east.transform.position = new Vector3(halfSize, 0, halfSize); - east.transform.Rotate(Vector3.up, 90); - // South wall - GameObject south = CreateWall(size, height, materialNames[4]); - south.name = "SouthWall"; - south.transform.parent = root.transform; - south.transform.position = new Vector3(halfSize, 0, -halfSize); - south.transform.Rotate(Vector3.up, 180); - // West wall - GameObject west = CreateWall(size, height, materialNames[5]); - west.name = "WestWall"; - west.transform.parent = root.transform; - west.transform.position = new Vector3(-halfSize, 0, -halfSize); - west.transform.Rotate(Vector3.up, 270); - - // Floor - GameObject floorAnchor = new GameObject("FloorAnchor"); - floorAnchor.transform.parent = root.transform; - - GameObject floor = CreateWall(size, size, materialNames[0]); - floor.name = "Floor"; - floor.transform.parent = floorAnchor.transform; - // North Aligned - floorAnchor.transform.position = new Vector3(-halfSize, 0, -halfSize); - floorAnchor.transform.Rotate(Vector3.right, 90); - // East Aligned - //floorAnchor.transform.position = new Vector3(-halfSize, 0, halfSize); - //floorAnchor.transform.Rotate(Vector3f.back,90); - - // Ceiling - GameObject ceilingAnchor = new GameObject("CeilingAnchor"); - ceilingAnchor.transform.parent = root.transform; - - GameObject ceiling = CreateWall(size, size, materialNames[1]); - ceiling.name = "Ceiling"; - ceiling.transform.parent = ceilingAnchor.transform; - - root.transform.position = position; - // North Aligned - ceilingAnchor.transform.position = new Vector3(halfSize, height, halfSize); - ceilingAnchor.transform.Rotate(Vector3.right, -90); - // East Aligned - //ceilingAnchor.transform.position = new Vector3(halfSize, height, -halfSize); - //ceilingAnchor.transform.Rotate( Vector3.back, -90); - - return root; - } - - public static GameObject CreateCuboidRoom(CuboidRoomModel model) - { - GameObject root = new GameObject("CuboidRoom"); - - float halfSize = model.Size / 2f; - - // North wall - GameObject north = CreateWall(model.Size, model.Height, model.NorthMaterial); - north.name = "NorthWall"; - north.transform.parent = root.transform; - north.transform.position = new Vector3(-halfSize, 0, halfSize); - // East wall - GameObject east = CreateWall(model.Size, model.Height, model.EastMaterial); - east.name = "EastWall"; - east.transform.parent = root.transform; - east.transform.position = new Vector3(halfSize, 0, halfSize); - east.transform.Rotate(Vector3.up, 90); - // South wall - GameObject south = CreateWall(model.Size, model.Height, model.SouthMaterial); - south.name = "SouthWall"; - south.transform.parent = root.transform; - south.transform.position = new Vector3(halfSize, 0, -halfSize); - south.transform.Rotate(Vector3.up, 180); - // West wall - GameObject west = CreateWall(model.Size, model.Height, model.WestMaterial); - west.name = "WestWall"; - west.transform.parent = root.transform; - west.transform.position = new Vector3(-halfSize, 0, -halfSize); - west.transform.Rotate(Vector3.up, 270); - - // Floor - GameObject floorAnchor = new GameObject("FloorAnchor"); - floorAnchor.transform.parent = root.transform; - - GameObject floor = CreateWall(model.Size, model.Size, model.FloorMaterial); - floor.name = "Floor"; - floor.transform.parent = floorAnchor.transform; - // North Aligned - floorAnchor.transform.position = new Vector3(-halfSize, 0, -halfSize); - floorAnchor.transform.Rotate(Vector3.right, 90); - // East Aligned - //floorAnchor.transform.position = new Vector3(-halfSize, 0, halfSize); - //floorAnchor.transform.Rotate(Vector3f.back,90); - - // Ceiling - GameObject ceilingAnchor = new GameObject("CeilingAnchor"); - ceilingAnchor.transform.parent = root.transform; - - GameObject ceiling = CreateWall(model.Size, model.Size, model.CeilingMaterial); - ceiling.name = "Ceiling"; - ceiling.transform.parent = ceilingAnchor.transform; - - - // North Aligned - ceilingAnchor.transform.position = new Vector3(-halfSize, model.Height, halfSize); - ceilingAnchor.transform.Rotate(Vector3.right, -90); - // East Aligned - //ceilingAnchor.transform.position = new Vector3(halfSize, height, -halfSize); - //ceilingAnchor.transform.Rotate( Vector3.back, -90); - - root.transform.position = model.Position; - - root.AddComponent().Model = model; - return root; - } - - - - - /// - /// Creates a wall game object to position later. - /// The wall is flat and always "upright", e.g. the normal of the mesh is negative z. - /// Use the resulting gameobject to rotate and re-position the wall. - /// - /// The width of the wall in Unity units - /// The height of the wall in Unity units - /// The wall's material name. Expects the material file to be at Resources/Materials/materalName. If no present, the word Material will be suffixed. - /// - public static GameObject CreateWall(float width, float height, string materialName = null) - { - - return CreateWall(width, height, LoadMaterialByName(materialName)); - } - - private static Material LoadMaterialByName(string materialName) - { - if (!string.IsNullOrEmpty(materialName)) - { - if (!materialName.EndsWith("Material")) - { - materialName = materialName + "Material"; - } - - return Resources.Load("Materials/" + materialName); - } - - return null; - } - - public static GameObject CreateWall(float width, float height, Material mat = null) - { - GameObject go = new GameObject("Wall"); - MeshFilter meshFilter = go.AddComponent(); - MeshRenderer meshRenderer = go.AddComponent(); - Mesh mesh = meshFilter.mesh; - Vector3[] vertices = new Vector3[4]; - vertices[0] = new Vector3(0, 0, 0); - vertices[1] = new Vector3(width, 0, 0); - vertices[2] = new Vector3(0, height, 0); - vertices[3] = new Vector3(width, height, 0); - - mesh.vertices = vertices; - - int[] tri = new int[6]; - - tri[0] = 0; - tri[1] = 2; - tri[2] = 1; - - tri[3] = 2; - tri[4] = 3; - tri[5] = 1; - - mesh.triangles = tri; - - Vector3[] normals = new Vector3[4]; - - normals[0] = -Vector3.forward; - normals[1] = -Vector3.forward; - normals[2] = -Vector3.forward; - normals[3] = -Vector3.forward; - - mesh.normals = normals; - - Vector2[] uv = new Vector2[4]; - - float xUnit = 1; - float yUnit = 1; - - if (width > height) - { - xUnit = width / height; - } - else - { - yUnit = height / width; - } - - uv[0] = new Vector2(0, 0); - uv[1] = new Vector2(xUnit, 0); - uv[2] = new Vector2(0, yUnit); - uv[3] = new Vector2(xUnit, yUnit); - - mesh.uv = uv; - - mesh.RecalculateBounds(); - mesh.RecalculateNormals(); - mesh.RecalculateTangents(); - - if (mat != null) - { - meshRenderer.material.CopyPropertiesFromMaterial(mat); - //meshRenderer.material.SetTextureScale("_MainTex", new Vector2(1,1)); - meshRenderer.material.name = mat.name; - } - else - { - meshRenderer.material = new Material(Shader.Find("Standard")); - meshRenderer.material.color = Color.white; - } - - // TODO Highly experimental! - - var boxCollider = go.AddComponent(); - boxCollider.size = new Vector3(width,height,0.0001f); - - return go; - } - - - private static Vector3 CalculateUnit(Vector3 dimensions) - { - float m = Math.Max(Math.Max(dimensions.x, dimensions.y), dimensions.z); - return new Vector3(m/dimensions.x, m/dimensions.y, m/dimensions.z); - } - - private static Vector2 CalculateUnit(float width, float height) - { - return CalculateNormalizedToLeastSquareUnit(width, height); - //return CalculateNormalizedToOneUnit(width, height); - } - - private static Vector2 CalculateNormalizedToLeastSquareUnit(float width, float height) - { - float xUnit = 1, - yUnit = 1; - - if (width > height) - { - xUnit = width / height; - } - else - { - yUnit = height / width; - } - - return new Vector2(xUnit, yUnit); - } - - private static Vector2 CalculateNormalizedToOneUnit(float width, float height) - { - return new Vector2(1f / width, 1f / height); - } - - public static GameObject CreateCuboid(CuboidModel cuboid) - { - GameObject cub = CreateCuboid(cuboid.Width, cuboid.Height, cuboid.Depth); - MeshRenderer meshRenderer = cub.GetComponent(); - if (cuboid.Material != null) - { - meshRenderer.material.CopyPropertiesFromMaterial(cuboid.Material); - } - else - { - meshRenderer.material = new Material(Shader.Find("Standard")); - meshRenderer.material.name = "Default"; - meshRenderer.material.color = Color.white; - } - cub.AddComponent().Model = cuboid; - return cub; - } - - public static GameObject CreateCuboid(float width, float height, float depth) - { - GameObject go = new GameObject("Cuboid"); - MeshFilter meshFilter = go.AddComponent(); - MeshRenderer meshRenderer = go.AddComponent(); - Mesh mesh = meshFilter.mesh; - - // The naming is always from the front and downwards looking! e.g. From the back, left and right is swapped - Vector3 frontLeftDown = Vector3.zero; - Vector3 frontRightDown = new Vector3(width, 0, 0); - Vector3 frontLeftUp = new Vector3(0, height, 0); - Vector3 frontRightUp = new Vector3(width, height, 0); - - Vector3 backLeftDown = new Vector3(0, 0, depth); - Vector3 backRightDown = new Vector3(width, 0, depth); - Vector3 backLeftUp = new Vector3(0, height, depth); - Vector3 backRightUp = new Vector3(width, height, depth); - - Vector3[] vertices = new[] - { - // Front - frontLeftDown, frontRightDown, frontLeftUp, frontRightUp, - // Back - backLeftDown, backRightDown, backLeftUp, backRightUp, - // Left - backLeftDown, frontLeftDown, backLeftUp, frontLeftUp, - // Right - frontRightDown, backRightDown, frontRightUp, backRightUp, - // Up - frontLeftUp, frontRightUp, backLeftUp, backRightUp, - // Down - frontLeftDown, frontRightDown, backLeftDown, backRightDown - }; - mesh.vertices = vertices; - - int[] triangles = new[] - { - // Front - 0, 2, 1, 2, 3, 1, - // Back - 5, 7, 4, 7, 6, 4, - // Left - 8, 10, 9, 10, 11, 9, - // Right - 12, 14, 13, 14, 15, 13, - // Up - 16, 18, 17, 18, 19, 17, - // Down - 21, 23, 20, 23, 22, 20 - }; - mesh.triangles = triangles; - - Vector3[] normals = new[] - { - // Front - -Vector3.forward, -Vector3.forward, -Vector3.forward, -Vector3.forward, - // Back - -Vector3.back, -Vector3.back, -Vector3.back, -Vector3.back, - // Left - -Vector3.left, -Vector3.left, -Vector3.left, -Vector3.left, - // Right - -Vector3.right, -Vector3.right, -Vector3.right, -Vector3.right, - // Up - -Vector3.up, -Vector3.up, -Vector3.up, -Vector3.up, - // Down - -Vector3.down, -Vector3.down, -Vector3.down, -Vector3.down - }; - mesh.normals = normals; - - - /* - * Unwrapping of mesh for uf like following - * U - * LFRB - * D - */ - - var u = Math.Min(Math.Min(width, height), depth); - var w = width / u; - var h = height / u; - var d = depth / u; - - Vector2 uvUnits = new Vector2(u,u); - var fOff = uvUnits.x * depth; - var rOff = uvUnits.x * width + fOff; - var bOff = uvUnits.x * depth + rOff; - var uOff = uvUnits.y * depth + uvUnits.y * height; - Vector2[] uv = new[] - { - // Front - new Vector2(fOff, uvUnits.y * depth), new Vector2(fOff + uvUnits.x * width, uvUnits.y * depth), - new Vector2(fOff, uvUnits.y * depth + uvUnits.y * height), - new Vector2(fOff + uvUnits.x * width, uvUnits.y * depth + uvUnits.y * height), - - // Back - new Vector2(bOff, uvUnits.y * depth), new Vector2(bOff + uvUnits.x * width, uvUnits.y * depth), - new Vector2(bOff, uvUnits.y * depth + uvUnits.y * height), - new Vector2(bOff + uvUnits.x * width, uvUnits.y * depth + uvUnits.y * height), - - // Left - new Vector2(0, uvUnits.y * depth), new Vector2(uvUnits.x * depth, uvUnits.y * depth), - new Vector2(0, uvUnits.y * depth + uvUnits.y * height), - new Vector2(uvUnits.x * depth, uvUnits.y * depth + uvUnits.y * height), - // Right - new Vector2(rOff, uvUnits.y * depth), new Vector2(rOff + uvUnits.x * depth, uvUnits.y * depth), - new Vector2(rOff, uvUnits.y * depth + uvUnits.y * height), - new Vector2(rOff + uvUnits.x * depth, uvUnits.y * depth + uvUnits.y * height), - // Up - new Vector2(fOff, uOff), new Vector2(fOff + uvUnits.x * width, uOff), - new Vector2(fOff, uOff + uvUnits.y * depth), - new Vector2(fOff + uvUnits.x * width, uOff + uvUnits.y * depth), - - // Down - new Vector2(fOff, 0), new Vector2(fOff + uvUnits.x * width, 0), new Vector2(fOff, uvUnits.y * depth), - new Vector2(fOff + uvUnits.x * width, uvUnits.y * depth) - }; - - mesh.uv = uv; - - mesh.RecalculateBounds(); - mesh.RecalculateNormals(); - mesh.RecalculateTangents(); - - meshRenderer.material = new Material(Shader.Find("Standard")); - meshRenderer.material.name = "Default"; - meshRenderer.material.color = Color.green; - - return go; - } - - public static GameObject CreateModel(ComplexCuboidModel model) - { - GameObject root = new GameObject("ComplexCuboid"); - for (int i = 0; i < model.Size(); i++) - { - Vector3 pos = model.GetPositionAt(i); - CuboidModel cuboid = model.GetCuboidAt(i); - GameObject cub = CreateCuboid(cuboid); - cub.transform.parent = root.transform; - cub.transform.position = pos; - } - - root.AddComponent().Model = model; - return root; - } - } -} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/Models/ComplexCuboidModel.cs b/Assets/DynamicModelling/Scripts/Models/ComplexCuboidModel.cs deleted file mode 100644 index e13d599c..00000000 --- a/Assets/DynamicModelling/Scripts/Models/ComplexCuboidModel.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace Unibas.DBIS.DynamicModelling.Models -{ - /// - /// Represents a complex model, based on cuboids. - /// Each cuboid has a position relative to the model's origin. - /// - /// This class is basically a glorified list of tuples: (pos, cuboidmodel) - /// - [System.Serializable] - public class ComplexCuboidModel : IModel - { - - private List _positions = new List(); - private List _cuboids = new List(); - - public ComplexCuboidModel(Vector3[] positions, CuboidModel[] models) - { - if (positions.Length != models.Length) - { - throw new ArgumentException("Must have equal amount of positions and cuboids"); - } - _positions.AddRange(positions); - _cuboids.AddRange(models); - } - - public ComplexCuboidModel() - { - - } - - public void Add(Vector3 position, CuboidModel cuboid) - { - _positions.Add(position); - _cuboids.Add(cuboid); - } - - public Vector3 GetPositionAt(int index) - { - return _positions[index]; - } - - public CuboidModel GetCuboidAt(int index) - { - return _cuboids[index]; - } - - public int Size() - { - return _positions.Count; - } - - public bool IsEmpty() - { - return _cuboids.Count == 0; - } - } -} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/Models/CuboidModel.cs b/Assets/DynamicModelling/Scripts/Models/CuboidModel.cs deleted file mode 100644 index bc0c7986..00000000 --- a/Assets/DynamicModelling/Scripts/Models/CuboidModel.cs +++ /dev/null @@ -1,48 +0,0 @@ -using UnityEngine; - -namespace Unibas.DBIS.DynamicModelling.Models -{ - /// - /// Abstract cuboid representation. - /// A cuboid consists of three parameters: - /// Width, Height and Depth. - /// In Unity3d these parameters are along the x, y and z axis. - /// - /// - [System.Serializable] - public class CuboidModel : IModel - { - /// - /// The width of the cuboid (along the X axis) in standard units. - /// - public float Width; - /// - /// The height of the cuboid (along the Y axis) in standard units. - /// - public float Height; - /// - /// The depth of the cuboid (along the Z axis) in standard units. - /// - public float Depth; - /// - /// The cuboid's material, iff any. - /// - public Material Material; - - /// - /// Creates a new cuboid based on its width, height and depth. - /// Also optionally with a material - /// - /// The width of the cuboid in standard units. Width is along the x axis. - /// The height of the cuboid in standard units. Height is along the y axis. - /// The depth of the cuboid in standard units. Depth is along the z axis. - /// The optional material of the cuboid. Otherwise it will be white - public CuboidModel(float width, float height, float depth, Material material = null) - { - Width = width; - Height = height; - Depth = depth; - Material = material; - } - } -} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/Models/CuboidRoomModel.cs b/Assets/DynamicModelling/Scripts/Models/CuboidRoomModel.cs deleted file mode 100644 index 5a7e9194..00000000 --- a/Assets/DynamicModelling/Scripts/Models/CuboidRoomModel.cs +++ /dev/null @@ -1,39 +0,0 @@ -using UnityEngine; - -namespace Unibas.DBIS.DynamicModelling.Models -{ - [System.Serializable] - public class CuboidRoomModel : IModel - { - public Vector3 Position; - public float Size; - public float Height; - - public Material FloorMaterial; - public Material CeilingMaterial; - public Material NorthMaterial; - public Material EastMaterial; - public Material SouthMaterial; - public Material WestMaterial; - - public CuboidRoomModel(Vector3 position, float size, float height) - { - Position = position; - Size = size; - Height = height; - } - - public CuboidRoomModel(Vector3 position, float size, float height, Material floorMaterial = null, Material ceilingMaterial = null, Material northMaterial = null, Material eastMaterial = null, Material southMaterial = null, Material westMaterial = null) - { - Position = position; - Size = size; - Height = height; - FloorMaterial = floorMaterial; - CeilingMaterial = ceilingMaterial; - NorthMaterial = northMaterial; - EastMaterial = eastMaterial; - SouthMaterial = southMaterial; - WestMaterial = westMaterial; - } - } -} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/Models/IModel.cs b/Assets/DynamicModelling/Scripts/Models/IModel.cs deleted file mode 100644 index 8b7c31c4..00000000 --- a/Assets/DynamicModelling/Scripts/Models/IModel.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Unibas.DBIS.DynamicModelling.Models -{ - public interface IModel - { - - } -} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/Models/PolygonRoomModel.cs b/Assets/DynamicModelling/Scripts/Models/PolygonRoomModel.cs deleted file mode 100644 index e48e3398..00000000 --- a/Assets/DynamicModelling/Scripts/Models/PolygonRoomModel.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; - -namespace Unibas.DBIS.DynamicModelling.Models -{ - [System.Serializable] - public class PolygonRoomModel : IModel - { - public Vector3 Position; - private List _walls; - public Material FloorMaterial; - public Material CeilingMaterial; - - public PolygonRoomModel(Vector3 position, List walls, Material floorMaterial, Material ceilingMaterial) - { - Position = position; - _walls = walls; - FloorMaterial = floorMaterial; - CeilingMaterial = ceilingMaterial; - } - - public WallModel[] GetWalls() - { - return _walls.ToArray(); - } - - public WallModel GetWallAt(int index) - { - return _walls[index]; - } - - public void Add(WallModel model) - { - _walls.Add(model); - } - } -} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/Models/WallModel.cs b/Assets/DynamicModelling/Scripts/Models/WallModel.cs deleted file mode 100644 index 848a46ff..00000000 --- a/Assets/DynamicModelling/Scripts/Models/WallModel.cs +++ /dev/null @@ -1,37 +0,0 @@ -using UnityEngine; - -namespace Unibas.DBIS.DynamicModelling.Models -{ - [System.Serializable] - public class WallModel: IModel - { - public Vector3 Start; - public Vector3 End; - public float Height; - public Material Material; - - public WallModel(Vector3 start, Vector3 end, float height, Material material = null) - { - Start = start; - End = end; - Height = height; - Material = material; - } - - public WallModel(Vector3 position, float width, float height, Material material = null) - { - Start = position; - End = position + Vector3.right * width; - Height = height; - Material = material; - } - - public WallModel(float width, float height, Material material = null) - { - Start = Vector3.zero; - End = Vector3.right * width; - Height = height; - Material = material; - } - } -} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/Objects/CuboidObject.cs b/Assets/DynamicModelling/Scripts/Objects/CuboidObject.cs deleted file mode 100644 index dc0a83f1..00000000 --- a/Assets/DynamicModelling/Scripts/Objects/CuboidObject.cs +++ /dev/null @@ -1,216 +0,0 @@ -using System; -using UnityEngine; - -namespace Unibas.DBIS.DynamicModelling.Objects -{ - /// - /// Custom cuboid model. - /// This model's size is actually the one specified, in unity units.
- /// In contrast, the vanilla unity cube object has to be resized, which this one doesn't, to get other shapes than a cube.
- /// - /// Note The material is copied, so modifications on the material are not reflected at runtime. - /// - /// - /// UV Mapping is based on the smallest dimension, e.g. depending on the texture, further adjustments are required.
- /// This can be achieved by accessing the MeshRenderer via GetComponent.
- /// - /// If this object's dimensions are changed during runtime, the caller has to call GenerateModel() afterwards, - /// to reflect the changes on the model. - ///
- [RequireComponent(typeof(MeshRenderer), typeof(MeshFilter), typeof(BoxCollider))] - public class CuboidObject : MonoBehaviour, IObject - { - - /// - /// Creates a cuboid object with the specified dimensions and an optional material parameter - /// - /// The width in unity units. Width is along the x axis. - /// The height in unity units. Height is along the y axis. - /// The depth in untiy units. Depth is along the z axis. - /// A gameobject whose mesh and collider represent a cuboid with the specified dimensions. - public static CuboidObject Create(float width, float height, float depth, Material material = null) - { - GameObject go = new GameObject("CuboidObject"); - var co = go.AddComponent(); - co.Width = width; - co.Height = height; - co.Depth = depth; - co.Material = material; - return co; - } - - /// - /// The width in unity units. Width is along the x axis. - /// - public float Width; - - /// - /// The height in unity units. Height is along the y axis. - /// - public float Height; - /// - /// The depth in untiy units. Depth is along the z axis. - /// - public float Depth; - /// - /// The material to use for texturing this cuboid. - /// Be aware that while drag'n'drop a material to this gameobject works in the scene view, - /// it is not the same and this material will always override the one from the inspector. - /// Use null if you want the default object material. - /// - public Material Material; - - private void OnValidate() - { - GenerateModel(); - } - - private void Start() - { - GenerateModel(); - } - - /// - /// Generates the mesh based on the object's configuration - /// - public void GenerateModel() - { - MeshFilter meshFilter = GetComponent(); // No null value due to RequireComponent statements - MeshRenderer meshRenderer = GetComponent(); - Mesh mesh = meshFilter.mesh; - - // The naming is always from the front and downwards looking! e.g. From the back, left and right is swapped - Vector3 frontLeftDown = Vector3.zero; - Vector3 frontRightDown = new Vector3(Width, 0, 0); - Vector3 frontLeftUp = new Vector3(0, Height, 0); - Vector3 frontRightUp = new Vector3(Width, Height, 0); - - Vector3 backLeftDown = new Vector3(0, 0, Depth); - Vector3 backRightDown = new Vector3(Width, 0, Depth); - Vector3 backLeftUp = new Vector3(0, Height, Depth); - Vector3 backRightUp = new Vector3(Width, Height, Depth); - - Vector3[] vertices = new[] - { - // Front - frontLeftDown, frontRightDown, frontLeftUp, frontRightUp, - // Back - backLeftDown, backRightDown, backLeftUp, backRightUp, - // Left - backLeftDown, frontLeftDown, backLeftUp, frontLeftUp, - // Right - frontRightDown, backRightDown, frontRightUp, backRightUp, - // Up - frontLeftUp, frontRightUp, backLeftUp, backRightUp, - // Down - frontLeftDown, frontRightDown, backLeftDown, backRightDown - }; - mesh.vertices = vertices; - - int[] triangles = new[] - { - // Front - 0, 2, 1, 2, 3, 1, - // Back - 5, 7, 4, 7, 6, 4, - // Left - 8, 10, 9, 10, 11, 9, - // Right - 12, 14, 13, 14, 15, 13, - // Up - 16, 18, 17, 18, 19, 17, - // Down - 21, 23, 20, 23, 22, 20 - }; - mesh.triangles = triangles; - - Vector3[] normals = new[] - { - // Front - -Vector3.forward, -Vector3.forward, -Vector3.forward, -Vector3.forward, - // Back - -Vector3.back, -Vector3.back, -Vector3.back, -Vector3.back, - // Left - -Vector3.left, -Vector3.left, -Vector3.left, -Vector3.left, - // Right - -Vector3.right, -Vector3.right, -Vector3.right, -Vector3.right, - // Up - -Vector3.up, -Vector3.up, -Vector3.up, -Vector3.up, - // Down - -Vector3.down, -Vector3.down, -Vector3.down, -Vector3.down - }; - mesh.normals = normals; - - - /* - * Unwrapping of mesh for uf like following - * U - * LFRB - * D - */ - - var u = Math.Min(Math.Min(Width, Height), Depth); - var w = Width / u; - var h = Height / u; - var d = Depth / u; - - Vector2 uvUnits = new Vector2(u,u); - var fOff = uvUnits.x * Depth; - var rOff = uvUnits.x * Width + fOff; - var bOff = uvUnits.x * Depth + rOff; - var uOff = uvUnits.y * Depth + uvUnits.y * Height; - Vector2[] uv = new[] - { - // Front - new Vector2(fOff, uvUnits.y * Depth), new Vector2(fOff + uvUnits.x * Width, uvUnits.y * Depth), - new Vector2(fOff, uvUnits.y * Depth + uvUnits.y * Height), - new Vector2(fOff + uvUnits.x * Width, uvUnits.y * Depth + uvUnits.y * Height), - - // Back - new Vector2(bOff, uvUnits.y * Depth), new Vector2(bOff + uvUnits.x * Width, uvUnits.y * Depth), - new Vector2(bOff, uvUnits.y * Depth + uvUnits.y * Height), - new Vector2(bOff + uvUnits.x * Width, uvUnits.y * Depth + uvUnits.y * Height), - - // Left - new Vector2(0, uvUnits.y * Depth), new Vector2(uvUnits.x * Depth, uvUnits.y * Depth), - new Vector2(0, uvUnits.y * Depth + uvUnits.y * Height), - new Vector2(uvUnits.x * Depth, uvUnits.y * Depth + uvUnits.y * Height), - // Right - new Vector2(rOff, uvUnits.y * Depth), new Vector2(rOff + uvUnits.x * Depth, uvUnits.y * Depth), - new Vector2(rOff, uvUnits.y * Depth + uvUnits.y * Height), - new Vector2(rOff + uvUnits.x * Depth, uvUnits.y * Depth + uvUnits.y * Height), - // Up - new Vector2(fOff, uOff), new Vector2(fOff + uvUnits.x * Width, uOff), - new Vector2(fOff, uOff + uvUnits.y * Depth), - new Vector2(fOff + uvUnits.x * Width, uOff + uvUnits.y * Depth), - - // Down - new Vector2(fOff, 0), new Vector2(fOff + uvUnits.x * Width, 0), new Vector2(fOff, uvUnits.y * Depth), - new Vector2(fOff + uvUnits.x * Width, uvUnits.y * Depth) - }; - - mesh.uv = uv; - - mesh.RecalculateBounds(); - mesh.RecalculateNormals(); - mesh.RecalculateTangents(); - - if (Material == null) - { - meshRenderer.material = new Material(Shader.Find("Standard")); - meshRenderer.material.name = "Default"; - meshRenderer.material.color = Color.green; - - } - else - { - meshRenderer.material.CopyPropertiesFromMaterial(Material); - meshRenderer.material.name = Material.name + " (Copy)"; - } - - var col = GetComponent(); - col.center = new Vector3(Width/2, Height/2, Depth/2); - col.size = new Vector3(Width,Height,Depth); - } - } -} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/Objects/IObject.cs b/Assets/DynamicModelling/Scripts/Objects/IObject.cs deleted file mode 100644 index c3d80fef..00000000 --- a/Assets/DynamicModelling/Scripts/Objects/IObject.cs +++ /dev/null @@ -1,12 +0,0 @@ -using UnityEngine; - -namespace Unibas.DBIS.DynamicModelling.Objects -{ - - // TODO Rename to something with model, maybe even abstract class instead of interface - - public interface IObject - { - void GenerateModel(); - } -} \ No newline at end of file diff --git a/Assets/New UXML.uxml b/Assets/New UXML.uxml deleted file mode 100644 index 271d109a..00000000 --- a/Assets/New UXML.uxml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/Assets/New UXML.uxml.meta b/Assets/New UXML.uxml.meta deleted file mode 100644 index 7aa3f8a1..00000000 --- a/Assets/New UXML.uxml.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 59ba6b4102d77cd4780cf57e17eb0ece -ScriptedImporter: - fileIDToRecycleName: - 11400000: tree - 11400002: inlineStyle - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0} diff --git a/Assets/Plugins/Editor/JetBrains.meta b/Assets/Plugins/Editor/JetBrains.meta deleted file mode 100644 index ef029ee7..00000000 --- a/Assets/Plugins/Editor/JetBrains.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: 4761ebe6b6522b249bf7b91988981414 -folderAsset: yes -timeCreated: 1540415111 -licenseType: Free -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Editor/JetBrains/JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll b/Assets/Plugins/Editor/JetBrains/JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll deleted file mode 100644 index 76c68b08..00000000 Binary files a/Assets/Plugins/Editor/JetBrains/JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll and /dev/null differ diff --git a/Assets/Plugins/Editor/JetBrains/JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll.meta b/Assets/Plugins/Editor/JetBrains/JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll.meta deleted file mode 100644 index 98b00b74..00000000 --- a/Assets/Plugins/Editor/JetBrains/JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll.meta +++ /dev/null @@ -1,32 +0,0 @@ -fileFormatVersion: 2 -guid: a4cb1cface6b82041ad27e603bfddb66 -timeCreated: 1540543436 -licenseType: Free -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Prefab/Displayal.prefab b/Assets/Prefab/Displayal.prefab deleted file mode 100644 index 61937aa8..00000000 --- a/Assets/Prefab/Displayal.prefab +++ /dev/null @@ -1,780 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 1723144634915134} - m_IsPrefabParent: 1 ---- !u!1 &1252948249754226 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224060020141320070} - - component: {fileID: 222459678687191998} - - component: {fileID: 114302990138164502} - m_Layer: 5 - m_Name: TitlePlaquette - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1353986276004208 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224446323252090680} - - component: {fileID: 223117270479298574} - - component: {fileID: 114759047581987320} - - component: {fileID: 114100792534263084} - - component: {fileID: 114787337458666904} - m_Layer: 5 - m_Name: TitlePlaquette - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1637201265278576 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4109601935991362} - - component: {fileID: 108825092587025252} - m_Layer: 0 - m_Name: Directional light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1708492548645724 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224144878835216254} - - component: {fileID: 223213355586316726} - - component: {fileID: 114865178109114850} - - component: {fileID: 114521434601030862} - - component: {fileID: 114145872248263022} - m_Layer: 5 - m_Name: DescriptionPlaquette - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1713165086033716 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4991959776836746} - - component: {fileID: 33838697945103052} - - component: {fileID: 64643193177418190} - - component: {fileID: 23721829456853052} - m_Layer: 0 - m_Name: Plane - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1723144634915134 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4386545470508082} - - component: {fileID: 114394835898518556} - m_Layer: 0 - m_Name: Displayal - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1751713187549858 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224733523696523440} - - component: {fileID: 222687117963447242} - - component: {fileID: 114050182069843912} - m_Layer: 5 - m_Name: TitleText - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1786497188386454 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224100897550168486} - - component: {fileID: 222576530714016308} - - component: {fileID: 114420626376548140} - m_Layer: 5 - m_Name: TitleText - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1924922032731184 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224201423252828788} - - component: {fileID: 222348370431411672} - - component: {fileID: 114880238729083600} - m_Layer: 5 - m_Name: TitlePlaquette - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1987613213182048 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4977662649216140} - - component: {fileID: 33873630901453308} - - component: {fileID: 23980293081860978} - m_Layer: 0 - m_Name: Frame - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &4109601935991362 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1637201265278576} - m_LocalRotation: {x: 0, y: 0, z: 0.6427876, w: 0.7660445} - m_LocalPosition: {x: 0, y: 1, z: -9.83} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4386545470508082} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 80} ---- !u!4 &4386545470508082 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1723144634915134} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 4991959776836746} - - {fileID: 4977662649216140} - - {fileID: 4109601935991362} - - {fileID: 224446323252090680} - - {fileID: 224144878835216254} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4977662649216140 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1987613213182048} - m_LocalRotation: {x: -0, y: -0.38268346, z: -0, w: 0.9238795} - m_LocalPosition: {x: 0, y: -0.7, z: 0} - m_LocalScale: {x: 0.11, y: 0.04, z: 0.11} - m_Children: [] - m_Father: {fileID: 4386545470508082} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4991959776836746 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1713165086033716} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: -0.7, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4386545470508082} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!23 &23721829456853052 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1713165086033716} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 872c918e12b121d4b9e71fea0604e4ab, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23980293081860978 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1987613213182048} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: b24e1b8be8c33ab4695e0dbc2fd4dc36, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!33 &33838697945103052 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1713165086033716} - m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} ---- !u!33 &33873630901453308 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1987613213182048} - m_Mesh: {fileID: 4300006, guid: 0743c68fcf30c4bdea39c4b9fe19f8a5, type: 3} ---- !u!64 &64643193177418190 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1713165086033716} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 3 - m_Convex: 0 - m_CookingOptions: 14 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} ---- !u!108 &108825092587025252 -Light: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1637201265278576} - m_Enabled: 1 - serializedVersion: 8 - m_Type: 0 - m_Color: {r: 1, g: 0.85490197, b: 0.62352943, a: 1} - m_Intensity: 1.2 - m_Range: 30 - m_SpotAngle: 70 - m_CookieSize: 10 - m_Shadows: - m_Type: 2 - m_Resolution: -1 - m_CustomResolution: -1 - m_Strength: 0.3 - m_Bias: 0 - m_NormalBias: 3 - m_NearPlane: 0.2 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_Lightmapping: 4 - m_AreaSize: {x: 1, y: 1} - m_BounceIntensity: 0.1 - m_ColorTemperature: 6570 - m_UseColorTemperature: 0 - m_ShadowRadius: 0 - m_ShadowAngle: 0 ---- !u!114 &114050182069843912 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1751713187549858} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 12800000, guid: 36e3ff808c4d44a408eb07452a39988b, type: 3} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 1 - m_MinSize: 10 - m_MaxSize: 30 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: ---- !u!114 &114100792534263084 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1353986276004208} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &114145872248263022 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1708492548645724} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8dd3ad628df0c254eb0e0cdc0828164b, type: 3} - m_Name: - m_EditorClassIdentifier: - text: {fileID: 114050182069843912} - font: {fileID: 0} ---- !u!114 &114302990138164502 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1252948249754226} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -98529514, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: 2067f760c18509c4693e2190b898fe2a, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Texture: {fileID: 0} - m_UVRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 ---- !u!114 &114394835898518556 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1723144634915134} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6af774a6990477e44be69639f4b78147, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114420626376548140 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1786497188386454} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0, g: 0, b: 0, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 12800000, guid: 4cca38632e100ce4ab77e777934f592f, type: 3} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 1 - m_MinSize: 10 - m_MaxSize: 30 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: ---- !u!114 &114521434601030862 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1708492548645724} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &114759047581987320 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1353986276004208} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 50 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 2 ---- !u!114 &114787337458666904 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1353986276004208} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8dd3ad628df0c254eb0e0cdc0828164b, type: 3} - m_Name: - m_EditorClassIdentifier: - text: {fileID: 114420626376548140} - font: {fileID: 0} ---- !u!114 &114865178109114850 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1708492548645724} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 50 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 2 ---- !u!114 &114880238729083600 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1924922032731184} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -98529514, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: 190ae71093c17bb4682fd48babadaa4c, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Texture: {fileID: 0} - m_UVRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 ---- !u!222 &222348370431411672 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1924922032731184} ---- !u!222 &222459678687191998 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1252948249754226} ---- !u!222 &222576530714016308 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1786497188386454} ---- !u!222 &222687117963447242 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1751713187549858} ---- !u!223 &223117270479298574 -Canvas: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1353986276004208} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 2 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!223 &223213355586316726 -Canvas: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1708492548645724} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 2 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!224 &224060020141320070 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1252948249754226} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224446323252090680} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224100897550168486 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1786497188386454} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.1} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224446323252090680} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.1, y: 0.1} - m_AnchorMax: {x: 0.9, y: 0.9} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 60, y: 16} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224144878835216254 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1708492548645724} - m_LocalRotation: {x: -0, y: 0.7071068, z: -0.7071068, w: 0} - m_LocalPosition: {x: 0, y: 0, z: 4.81} - m_LocalScale: {x: 0.010000011, y: 0.0100000035, z: 0.10000005} - m_Children: - - {fileID: 224201423252828788} - - {fileID: 224733523696523440} - m_Father: {fileID: 4386545470508082} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 90, y: 180, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: -7.44, y: -0.65} - m_SizeDelta: {x: 300, y: 200} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224201423252828788 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1924922032731184} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224144878835216254} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224446323252090680 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1353986276004208} - m_LocalRotation: {x: 0, y: 0.7071068, z: -0.7071068, w: 0} - m_LocalPosition: {x: 0, y: 0, z: 5.39} - m_LocalScale: {x: 0.01, y: 0.01, z: 0.1} - m_Children: - - {fileID: 224060020141320070} - - {fileID: 224100897550168486} - m_Father: {fileID: 4386545470508082} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 90, y: 180, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: -0.547} - m_SizeDelta: {x: 300, y: 60} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224733523696523440 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1751713187549858} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.1} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224144878835216254} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.1, y: 0.1} - m_AnchorMax: {x: 0.9, y: 0.9} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 60, y: 40} - m_Pivot: {x: 0.5, y: 0.5} diff --git a/Assets/Prefab/Displayal.prefab.meta b/Assets/Prefab/Displayal.prefab.meta deleted file mode 100644 index baa4161e..00000000 --- a/Assets/Prefab/Displayal.prefab.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: 693ba3952c1874807ad3166efd424e58 -timeCreated: 1540658633 -licenseType: Free -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 100100000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Resources/BillingMode.json b/Assets/Resources/BillingMode.json new file mode 100644 index 00000000..6f4bfb71 --- /dev/null +++ b/Assets/Resources/BillingMode.json @@ -0,0 +1 @@ +{"androidStore":"GooglePlay"} \ No newline at end of file diff --git a/Assets/Resources/BillingMode.json.meta b/Assets/Resources/BillingMode.json.meta new file mode 100644 index 00000000..9a67caa7 --- /dev/null +++ b/Assets/Resources/BillingMode.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 47dccf757d3a2fa48a8714308c052997 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Objects/ImageWithFrame/Bild mir Rahmen.c4d b/Assets/Resources/Objects/ImageWithFrame/Bild mir Rahmen.c4d deleted file mode 100644 index 70065d96..00000000 Binary files a/Assets/Resources/Objects/ImageWithFrame/Bild mir Rahmen.c4d and /dev/null differ diff --git a/Assets/Resources/Objects/ImageWithFrame/Bild mir Rahmen.3ds b/Assets/Resources/Objects/ImageWithFrame/Bild mit Rahmen.3ds similarity index 100% rename from Assets/Resources/Objects/ImageWithFrame/Bild mir Rahmen.3ds rename to Assets/Resources/Objects/ImageWithFrame/Bild mit Rahmen.3ds diff --git a/Assets/Resources/Objects/ImageWithFrame/Bild mir Rahmen.3ds.meta b/Assets/Resources/Objects/ImageWithFrame/Bild mit Rahmen.3ds.meta similarity index 95% rename from Assets/Resources/Objects/ImageWithFrame/Bild mir Rahmen.3ds.meta rename to Assets/Resources/Objects/ImageWithFrame/Bild mit Rahmen.3ds.meta index 3b38b965..a0672413 100644 --- a/Assets/Resources/Objects/ImageWithFrame/Bild mir Rahmen.3ds.meta +++ b/Assets/Resources/Objects/ImageWithFrame/Bild mit Rahmen.3ds.meta @@ -1,115 +1,115 @@ -fileFormatVersion: 2 -guid: 0743c68fcf30c4bdea39c4b9fe19f8a5 -ModelImporter: - serializedVersion: 22 - fileIDToRecycleName: - 100000: Bild - 100002: //RootNode - 100004: Glas - 100006: Licht - 100008: R_ckseite - 100010: Ramen - 100012: Sonne - 400000: Bild - 400002: //RootNode - 400004: Glas - 400006: Licht - 400008: R_ckseite - 400010: Ramen - 400012: Sonne - 2100000: R_ckseite - 2100002: Glas - 2100004: Bild - 2100006: Rahmen - 2300000: Bild - 2300002: Glas - 2300004: R_ckseite - 2300006: Ramen - 3300000: Bild - 3300002: Glas - 3300004: R_ckseite - 3300006: Ramen - 4300000: R_ckseite - 4300002: Glas - 4300004: Bild - 4300006: Ramen - externalObjects: {} - materials: - importMaterials: 1 - materialName: 0 - materialSearch: 1 - materialLocation: 1 - animations: - legacyGenerateAnimations: 4 - bakeSimulation: 0 - resampleCurves: 1 - optimizeGameObjects: 0 - motionNodeName: - rigImportErrors: - rigImportWarnings: - animationImportErrors: - animationImportWarnings: - animationRetargetingWarnings: - animationDoRetargetingWarnings: 0 - importAnimatedCustomProperties: 0 - animationCompression: 1 - animationRotationError: 0.5 - animationPositionError: 0.5 - animationScaleError: 0.5 - animationWrapMode: 0 - extraExposedTransformPaths: [] - extraUserProperties: [] - clipAnimations: [] - isReadable: 1 - meshes: - lODScreenPercentages: [] - globalScale: 1 - meshCompression: 0 - addColliders: 0 - importVisibility: 1 - importBlendShapes: 1 - importCameras: 1 - importLights: 1 - swapUVChannels: 0 - generateSecondaryUV: 0 - useFileUnits: 1 - optimizeMeshForGPU: 1 - keepQuads: 0 - weldVertices: 1 - preserveHierarchy: 0 - indexFormat: 0 - secondaryUVAngleDistortion: 8 - secondaryUVAreaDistortion: 15.000001 - secondaryUVHardAngle: 88 - secondaryUVPackMargin: 4 - useFileScale: 1 - tangentSpace: - normalSmoothAngle: 60 - normalImportMode: 0 - tangentImportMode: 3 - normalCalculationMode: 4 - importAnimation: 1 - copyAvatar: 0 - humanDescription: - serializedVersion: 2 - human: [] - skeleton: [] - armTwist: 0.5 - foreArmTwist: 0.5 - upperLegTwist: 0.5 - legTwist: 0.5 - armStretch: 0.05 - legStretch: 0.05 - feetSpacing: 0 - rootMotionBoneName: - rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} - hasTranslationDoF: 0 - hasExtraRoot: 0 - skeletonHasParents: 1 - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 0 - humanoidOversampling: 1 - additionalBone: 0 - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 0743c68fcf30c4bdea39c4b9fe19f8a5 +ModelImporter: + serializedVersion: 22 + fileIDToRecycleName: + 100000: Bild + 100002: //RootNode + 100004: Glas + 100006: Licht + 100008: R_ckseite + 100010: Ramen + 100012: Sonne + 400000: Bild + 400002: //RootNode + 400004: Glas + 400006: Licht + 400008: R_ckseite + 400010: Ramen + 400012: Sonne + 2100000: R_ckseite + 2100002: Glas + 2100004: Bild + 2100006: Rahmen + 2300000: Bild + 2300002: Glas + 2300004: R_ckseite + 2300006: Ramen + 3300000: Bild + 3300002: Glas + 3300004: R_ckseite + 3300006: Ramen + 4300000: R_ckseite + 4300002: Glas + 4300004: Bild + 4300006: Ramen + externalObjects: {} + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + serializedVersion: 2 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + rootMotionBoneName: + rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 0 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Objects/ImageWithFrame/Bild mir Rahmen.fbx b/Assets/Resources/Objects/ImageWithFrame/Bild mit Rahmen.fbx similarity index 100% rename from Assets/Resources/Objects/ImageWithFrame/Bild mir Rahmen.fbx rename to Assets/Resources/Objects/ImageWithFrame/Bild mit Rahmen.fbx diff --git a/Assets/Resources/Objects/ImageWithFrame/Bild mir Rahmen.fbx.meta b/Assets/Resources/Objects/ImageWithFrame/Bild mit Rahmen.fbx.meta similarity index 95% rename from Assets/Resources/Objects/ImageWithFrame/Bild mir Rahmen.fbx.meta rename to Assets/Resources/Objects/ImageWithFrame/Bild mit Rahmen.fbx.meta index f2cd4e93..7751ec58 100644 --- a/Assets/Resources/Objects/ImageWithFrame/Bild mir Rahmen.fbx.meta +++ b/Assets/Resources/Objects/ImageWithFrame/Bild mit Rahmen.fbx.meta @@ -1,118 +1,118 @@ -fileFormatVersion: 2 -guid: 38d7cdab0d1114da595b1a26bea5847c -ModelImporter: - serializedVersion: 22 - fileIDToRecycleName: - 100000: Bild - 100002: //RootNode - 100004: Glas - 100006: Licht - 100008: Ramen - 100010: "R\xFCckseite" - 100012: Sonne - 400000: Bild - 400002: //RootNode - 400004: Glas - 400006: Licht - 400008: Ramen - 400010: "R\xFCckseite" - 400012: Sonne - 2100000: "R\xFCckseite" - 2100002: Glas - 2100004: Bild - 2100006: Rahmen - 2300000: Bild - 2300002: Glas - 2300004: Ramen - 2300006: "R\xFCckseite" - 3300000: Bild - 3300002: Glas - 3300004: Ramen - 3300006: "R\xFCckseite" - 4300000: "R\xFCckseite" - 4300002: Glas - 4300004: Bild - 4300006: Ramen - 9500000: //RootNode - 10800000: Licht - 10800002: Sonne - externalObjects: {} - materials: - importMaterials: 1 - materialName: 0 - materialSearch: 1 - materialLocation: 1 - animations: - legacyGenerateAnimations: 4 - bakeSimulation: 0 - resampleCurves: 1 - optimizeGameObjects: 0 - motionNodeName: - rigImportErrors: - rigImportWarnings: - animationImportErrors: - animationImportWarnings: - animationRetargetingWarnings: - animationDoRetargetingWarnings: 0 - importAnimatedCustomProperties: 0 - animationCompression: 1 - animationRotationError: 0.5 - animationPositionError: 0.5 - animationScaleError: 0.5 - animationWrapMode: 0 - extraExposedTransformPaths: [] - extraUserProperties: [] - clipAnimations: [] - isReadable: 1 - meshes: - lODScreenPercentages: [] - globalScale: 1 - meshCompression: 0 - addColliders: 0 - importVisibility: 1 - importBlendShapes: 1 - importCameras: 1 - importLights: 1 - swapUVChannels: 0 - generateSecondaryUV: 0 - useFileUnits: 1 - optimizeMeshForGPU: 1 - keepQuads: 0 - weldVertices: 1 - preserveHierarchy: 0 - indexFormat: 0 - secondaryUVAngleDistortion: 8 - secondaryUVAreaDistortion: 15.000001 - secondaryUVHardAngle: 88 - secondaryUVPackMargin: 4 - useFileScale: 1 - tangentSpace: - normalSmoothAngle: 60 - normalImportMode: 0 - tangentImportMode: 3 - normalCalculationMode: 4 - importAnimation: 1 - copyAvatar: 0 - humanDescription: - serializedVersion: 2 - human: [] - skeleton: [] - armTwist: 0.5 - foreArmTwist: 0.5 - upperLegTwist: 0.5 - legTwist: 0.5 - armStretch: 0.05 - legStretch: 0.05 - feetSpacing: 0 - rootMotionBoneName: - rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} - hasTranslationDoF: 0 - hasExtraRoot: 0 - skeletonHasParents: 1 - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 2 - humanoidOversampling: 1 - additionalBone: 0 - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 38d7cdab0d1114da595b1a26bea5847c +ModelImporter: + serializedVersion: 22 + fileIDToRecycleName: + 100000: Bild + 100002: //RootNode + 100004: Glas + 100006: Licht + 100008: Ramen + 100010: "R\xFCckseite" + 100012: Sonne + 400000: Bild + 400002: //RootNode + 400004: Glas + 400006: Licht + 400008: Ramen + 400010: "R\xFCckseite" + 400012: Sonne + 2100000: "R\xFCckseite" + 2100002: Glas + 2100004: Bild + 2100006: Rahmen + 2300000: Bild + 2300002: Glas + 2300004: Ramen + 2300006: "R\xFCckseite" + 3300000: Bild + 3300002: Glas + 3300004: Ramen + 3300006: "R\xFCckseite" + 4300000: "R\xFCckseite" + 4300002: Glas + 4300004: Bild + 4300006: Ramen + 9500000: //RootNode + 10800000: Licht + 10800002: Sonne + externalObjects: {} + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + serializedVersion: 2 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + rootMotionBoneName: + rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 2 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Prefabs/Displayal.prefab b/Assets/Resources/Prefabs/Displayal.prefab index 5ee28702..e4fc8b2b 100644 --- a/Assets/Resources/Prefabs/Displayal.prefab +++ b/Assets/Resources/Prefabs/Displayal.prefab @@ -1,44 +1,16 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 1302269862261132} - m_IsPrefabParent: 1 ---- !u!1 &1033257218762798 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4831132150147046} - - component: {fileID: 108402919408155458} - m_Layer: 0 - m_Name: Directional light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1146698127220840 +--- !u!1 &1252948249754226 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - component: {fileID: 224898500349374658} - - component: {fileID: 223838394677348898} - - component: {fileID: 114416688181433732} - - component: {fileID: 114593354878245856} - - component: {fileID: 114035755260652190} + - component: {fileID: 224060020141320070} + - component: {fileID: 222459678687191998} + - component: {fileID: 114302990138164502} m_Layer: 5 m_Name: TitlePlaquette m_TagString: Untagged @@ -46,16 +18,73 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1279493164949892 +--- !u!224 &224060020141320070 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1252948249754226} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224446323252090680} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222459678687191998 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1252948249754226} + m_CullTransparentMesh: 1 +--- !u!114 &114302990138164502 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1252948249754226} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: 2067f760c18509c4693e2190b898fe2a, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!1 &1353986276004208 GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - component: {fileID: 224982644317131656} - - component: {fileID: 222416832003772490} - - component: {fileID: 114420308021494582} + - component: {fileID: 224446323252090680} + - component: {fileID: 223117270479298574} + - component: {fileID: 114759047581987320} + - component: {fileID: 114100792534263084} + - component: {fileID: 114787337458666904} m_Layer: 5 m_Name: TitlePlaquette m_TagString: Untagged @@ -63,105 +92,208 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1302269862261132 -GameObject: +--- !u!224 &224446323252090680 +RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4894471851820578} - - component: {fileID: 114686576913915960} - - component: {fileID: 65518658933749486} - m_Layer: 0 - m_Name: Displayal - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1495570396300978 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224688668321344266} - - component: {fileID: 222153847815872102} - - component: {fileID: 114783901546005428} - m_Layer: 5 - m_Name: TitleText - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1550338680515270 -GameObject: + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1353986276004208} + m_LocalRotation: {x: 0, y: 0.7071068, z: -0.7071068, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 5.39} + m_LocalScale: {x: 0.01, y: 0.01, z: 0.1} + m_Children: + - {fileID: 224060020141320070} + - {fileID: 224100897550168486} + m_Father: {fileID: 4386545470508082} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 90, y: 180, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: -0.547} + m_SizeDelta: {x: 300, y: 60} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &223117270479298574 +Canvas: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4716170255960452} - - component: {fileID: 33772642790513284} - - component: {fileID: 64305755207969996} - - component: {fileID: 23951493507061592} - m_Layer: 0 - m_Name: Plane - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1636588304056794 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224071902039454216} - - component: {fileID: 222259669601946956} - - component: {fileID: 114545915762722286} - m_Layer: 5 - m_Name: TitleText - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1692291792904570 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1353986276004208} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &114759047581987320 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1353986276004208} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 50 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 2 + m_PresetInfoIsWorld: 1 +--- !u!114 &114100792534263084 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1353986276004208} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &114787337458666904 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1353986276004208} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8dd3ad628df0c254eb0e0cdc0828164b, type: 3} + m_Name: + m_EditorClassIdentifier: + text: {fileID: 114420626376548140} + font: {fileID: 0} +--- !u!1 &1637201265278576 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - component: {fileID: 4573243634688148} - - component: {fileID: 33389533994231516} - - component: {fileID: 64282388066525410} - - component: {fileID: 23624711814364798} + - component: {fileID: 4109601935991362} + - component: {fileID: 108825092587025252} m_Layer: 0 - m_Name: Back + m_Name: Directional light m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1692428713872368 +--- !u!4 &4109601935991362 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1637201265278576} + m_LocalRotation: {x: 0, y: 0, z: 0.6427876, w: 0.7660445} + m_LocalPosition: {x: 0, y: 1, z: -9.83} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4386545470508082} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 80} +--- !u!108 &108825092587025252 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1637201265278576} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 0 + m_Shape: 0 + m_Color: {r: 1, g: 0.85490197, b: 0.62352943, a: 1} + m_Intensity: 1.2 + m_Range: 30 + m_SpotAngle: 70 + m_InnerSpotAngle: 53.42987 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 0.3 + m_Bias: 0 + m_NormalBias: 3 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 0.1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!1 &1708492548645724 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - component: {fileID: 224747469537501470} - - component: {fileID: 223083162367953570} - - component: {fileID: 114708901558555258} - - component: {fileID: 114866101839128518} - - component: {fileID: 114044222523643888} + - component: {fileID: 224144878835216254} + - component: {fileID: 223213355586316726} + - component: {fileID: 114865178109114850} + - component: {fileID: 114521434601030862} + - component: {fileID: 114145872248263022} m_Layer: 5 m_Name: DescriptionPlaquette m_TagString: Untagged @@ -169,185 +301,149 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1895752110289046 +--- !u!224 &224144878835216254 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1708492548645724} + m_LocalRotation: {x: -0, y: 0.7071068, z: -0.7071068, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 4.81} + m_LocalScale: {x: 0.010000011, y: 0.0100000035, z: 0.10000005} + m_Children: + - {fileID: 224201423252828788} + - {fileID: 224733523696523440} + m_Father: {fileID: 4386545470508082} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 90, y: 180, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: -7.44, y: -0.65} + m_SizeDelta: {x: 300, y: 200} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &223213355586316726 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1708492548645724} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &114865178109114850 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1708492548645724} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 50 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 2 + m_PresetInfoIsWorld: 1 +--- !u!114 &114521434601030862 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1708492548645724} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &114145872248263022 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1708492548645724} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8dd3ad628df0c254eb0e0cdc0828164b, type: 3} + m_Name: + m_EditorClassIdentifier: + text: {fileID: 114050182069843912} + font: {fileID: 0} +--- !u!1 &1713165086033716 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - component: {fileID: 4346963726472754} - - component: {fileID: 33165122712933374} - - component: {fileID: 23107304942307554} + - component: {fileID: 4991959776836746} + - component: {fileID: 33838697945103052} + - component: {fileID: 23721829456853052} m_Layer: 0 - m_Name: Frame - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1952636572763874 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224701556999131010} - - component: {fileID: 222469059213100282} - - component: {fileID: 114830972437805028} - m_Layer: 5 - m_Name: TitlePlaquette + m_Name: Plane m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &4346963726472754 +--- !u!4 &4991959776836746 Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1895752110289046} - m_LocalRotation: {x: -0, y: -0.38268346, z: -0, w: 0.9238795} - m_LocalPosition: {x: 0, y: -0.7, z: 0} - m_LocalScale: {x: 0.11, y: 0.04, z: 0.11} - m_Children: [] - m_Father: {fileID: 4894471851820578} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4573243634688148 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1692291792904570} - m_LocalRotation: {x: 0, y: 0, z: 1, w: 0} - m_LocalPosition: {x: 0, y: -0.7, z: -0.1} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4894471851820578} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 180} ---- !u!4 &4716170255960452 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1550338680515270} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1713165086033716} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: -0.7, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 4894471851820578} + m_Father: {fileID: 4386545470508082} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4831132150147046 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1033257218762798} - m_LocalRotation: {x: 0, y: 0, z: 0.6427876, w: 0.7660445} - m_LocalPosition: {x: 0, y: 1, z: -9.83} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4894471851820578} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 80} ---- !u!4 &4894471851820578 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1302269862261132} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 4716170255960452} - - {fileID: 4573243634688148} - - {fileID: 4346963726472754} - - {fileID: 4831132150147046} - - {fileID: 224898500349374658} - - {fileID: 224747469537501470} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!23 &23107304942307554 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1895752110289046} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: b24e1b8be8c33ab4695e0dbc2fd4dc36, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23624711814364798 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1692291792904570} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 872c918e12b121d4b9e71fea0604e4ab, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23951493507061592 +--- !u!33 &33838697945103052 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1713165086033716} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &23721829456853052 MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1550338680515270} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1713165086033716} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -355,6 +451,10 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 m_Materials: - {fileID: 2100000, guid: 872c918e12b121d4b9e71fea0604e4ab, type: 2} m_StaticBatchInfo: @@ -364,6 +464,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -376,197 +477,139 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!33 &33165122712933374 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1895752110289046} - m_Mesh: {fileID: 4300006, guid: 0743c68fcf30c4bdea39c4b9fe19f8a5, type: 3} ---- !u!33 &33389533994231516 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1692291792904570} - m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} ---- !u!33 &33772642790513284 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1550338680515270} - m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} ---- !u!64 &64282388066525410 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1692291792904570} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 3 - m_Convex: 0 - m_CookingOptions: 14 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} ---- !u!64 &64305755207969996 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1550338680515270} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 3 - m_Convex: 0 - m_CookingOptions: 14 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} ---- !u!65 &65518658933749486 -BoxCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1302269862261132} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 11.651288, y: 0.29812765, z: 11.618954} - m_Center: {x: -0.005042553, y: -0.7, z: 0.003323555} ---- !u!108 &108402919408155458 -Light: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1033257218762798} - m_Enabled: 1 - serializedVersion: 8 - m_Type: 0 - m_Color: {r: 1, g: 0.85490197, b: 0.62352943, a: 1} - m_Intensity: 1.2 - m_Range: 30 - m_SpotAngle: 70 - m_CookieSize: 10 - m_Shadows: - m_Type: 2 - m_Resolution: -1 - m_CustomResolution: -1 - m_Strength: 0.3 - m_Bias: 0 - m_NormalBias: 3 - m_NearPlane: 0.2 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_Lightmapping: 4 - m_AreaSize: {x: 1, y: 1} - m_BounceIntensity: 0.1 - m_ColorTemperature: 6570 - m_UseColorTemperature: 0 - m_ShadowRadius: 0 - m_ShadowAngle: 0 ---- !u!114 &114035755260652190 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1146698127220840} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8dd3ad628df0c254eb0e0cdc0828164b, type: 3} - m_Name: - m_EditorClassIdentifier: - text: {fileID: 114545915762722286} - font: {fileID: 0} ---- !u!114 &114044222523643888 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1692428713872368} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8dd3ad628df0c254eb0e0cdc0828164b, type: 3} - m_Name: - m_EditorClassIdentifier: - text: {fileID: 114783901546005428} - font: {fileID: 0} ---- !u!114 &114416688181433732 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1723144634915134 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4386545470508082} + - component: {fileID: 114394835898518556} + - component: {fileID: 6959743349364673984} + m_Layer: 0 + m_Name: Displayal + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4386545470508082 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1723144634915134} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4991959776836746} + - {fileID: 4977662649216140} + - {fileID: 4109601935991362} + - {fileID: 224446323252090680} + - {fileID: 224144878835216254} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &114394835898518556 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1146698127220840} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1723144634915134} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 6af774a6990477e44be69639f4b78147, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 50 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 2 ---- !u!114 &114420308021494582 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1279493164949892} + id: + originalPosition: {x: 0, y: 0, z: 0} + originalRotation: {x: 0, y: 0, z: 0, w: 0} +--- !u!65 &6959743349364673984 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1723144634915134} + m_Material: {fileID: 0} + m_IsTrigger: 0 m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -98529514, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: 2067f760c18509c4693e2190b898fe2a, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Texture: {fileID: 0} - m_UVRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 ---- !u!114 &114545915762722286 + serializedVersion: 2 + m_Size: {x: 12, y: 0.4, z: 12} + m_Center: {x: 0, y: -0.7, z: 0} +--- !u!1 &1751713187549858 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224733523696523440} + - component: {fileID: 222687117963447242} + - component: {fileID: 114050182069843912} + m_Layer: 5 + m_Name: TitleText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224733523696523440 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1751713187549858} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224144878835216254} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.1, y: 0.1} + m_AnchorMax: {x: 0.9, y: 0.9} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 60, y: 40} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222687117963447242 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1751713187549858} + m_CullTransparentMesh: 1 +--- !u!114 &114050182069843912 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1636588304056794} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1751713187549858} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0, g: 0, b: 0, a: 1} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: - m_Font: {fileID: 12800000, guid: 4cca38632e100ce4ab77e777934f592f, type: 3} + m_Font: {fileID: 12800000, guid: 36e3ff808c4d44a408eb07452a39988b, type: 3} m_FontSize: 14 m_FontStyle: 0 m_BestFit: 1 @@ -579,75 +622,73 @@ MonoBehaviour: m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: ---- !u!114 &114593354878245856 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1146698127220840} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &114686576913915960 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1302269862261132} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6af774a6990477e44be69639f4b78147, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114708901558555258 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1692428713872368} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 50 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 2 ---- !u!114 &114783901546005428 +--- !u!1 &1786497188386454 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224100897550168486} + - component: {fileID: 222576530714016308} + - component: {fileID: 114420626376548140} + m_Layer: 5 + m_Name: TitleText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224100897550168486 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1786497188386454} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224446323252090680} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.1, y: 0.1} + m_AnchorMax: {x: 0.9, y: 0.9} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 60, y: 16} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222576530714016308 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1786497188386454} + m_CullTransparentMesh: 1 +--- !u!114 &114420626376548140 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1495570396300978} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1786497188386454} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0, g: 0, b: 0, a: 1} m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: - m_Font: {fileID: 12800000, guid: 36e3ff808c4d44a408eb07452a39988b, type: 3} + m_Font: {fileID: 12800000, guid: 4cca38632e100ce4ab77e777934f592f, type: 3} m_FontSize: 14 m_FontStyle: 0 m_BestFit: 1 @@ -660,25 +701,71 @@ MonoBehaviour: m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: ---- !u!114 &114830972437805028 +--- !u!1 &1924922032731184 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224201423252828788} + - component: {fileID: 222348370431411672} + - component: {fileID: 114880238729083600} + m_Layer: 5 + m_Name: TitlePlaquette + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224201423252828788 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1924922032731184} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224144878835216254} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222348370431411672 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1924922032731184} + m_CullTransparentMesh: 1 +--- !u!114 &114880238729083600 MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1952636572763874} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1924922032731184} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -98529514, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 2100000, guid: 190ae71093c17bb4682fd48babadaa4c, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_Texture: {fileID: 0} m_UVRect: serializedVersion: 2 @@ -686,195 +773,84 @@ MonoBehaviour: y: 0 width: 1 height: 1 ---- !u!114 &114866101839128518 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1692428713872368} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!222 &222153847815872102 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1495570396300978} ---- !u!222 &222259669601946956 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1636588304056794} ---- !u!222 &222416832003772490 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1279493164949892} ---- !u!222 &222469059213100282 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1952636572763874} ---- !u!223 &223083162367953570 -Canvas: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1692428713872368} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 2 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!223 &223838394677348898 -Canvas: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1146698127220840} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 2 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!224 &224071902039454216 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1636588304056794} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.1} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224898500349374658} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.1, y: 0.1} - m_AnchorMax: {x: 0.9, y: 0.9} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 60, y: 16} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224688668321344266 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1495570396300978} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.1} - m_LocalScale: {x: 1, y: 1, z: 1} +--- !u!1 &1987613213182048 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4977662649216140} + - component: {fileID: 33873630901453308} + - component: {fileID: 23980293081860978} + m_Layer: 0 + m_Name: Frame + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4977662649216140 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1987613213182048} + m_LocalRotation: {x: -0, y: -0.38268346, z: -0, w: 0.9238795} + m_LocalPosition: {x: 0, y: -0.7, z: 0} + m_LocalScale: {x: 0.11, y: 0.04, z: 0.11} m_Children: [] - m_Father: {fileID: 224747469537501470} + m_Father: {fileID: 4386545470508082} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.1, y: 0.1} - m_AnchorMax: {x: 0.9, y: 0.9} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 60, y: 40} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224701556999131010 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1952636572763874} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224747469537501470} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224747469537501470 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1692428713872368} - m_LocalRotation: {x: -0, y: 0.7071068, z: -0.7071068, w: 0} - m_LocalPosition: {x: 0, y: 0, z: 4.81} - m_LocalScale: {x: 0.010000011, y: 0.0100000035, z: 0.10000005} - m_Children: - - {fileID: 224701556999131010} - - {fileID: 224688668321344266} - m_Father: {fileID: 4894471851820578} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 90, y: 180, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: -7.44, y: -0.65} - m_SizeDelta: {x: 300, y: 200} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224898500349374658 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1146698127220840} - m_LocalRotation: {x: 0, y: 0.7071068, z: -0.7071068, w: 0} - m_LocalPosition: {x: 0, y: 0, z: 5.39} - m_LocalScale: {x: 0.01, y: 0.01, z: 0.1} - m_Children: - - {fileID: 224982644317131656} - - {fileID: 224071902039454216} - m_Father: {fileID: 4894471851820578} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 90, y: 180, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: -0.547} - m_SizeDelta: {x: 300, y: 60} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224982644317131656 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1279493164949892} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224898500349374658} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} +--- !u!33 &33873630901453308 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1987613213182048} + m_Mesh: {fileID: 4300006, guid: 0743c68fcf30c4bdea39c4b9fe19f8a5, type: 3} +--- !u!23 &23980293081860978 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1987613213182048} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: b24e1b8be8c33ab4695e0dbc2fd4dc36, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} diff --git a/Assets/Resources/Prefabs/Displayal.prefab.meta b/Assets/Resources/Prefabs/Displayal.prefab.meta index 565ea3d6..e9549cde 100644 --- a/Assets/Resources/Prefabs/Displayal.prefab.meta +++ b/Assets/Resources/Prefabs/Displayal.prefab.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 -guid: c874740265edf1c41a14d92cddd9afdd +guid: 693ba3952c1874807ad3166efd424e58 +timeCreated: 1540658633 +licenseType: Free NativeFormatImporter: externalObjects: {} mainObjectFileID: 100100000 diff --git a/Assets/Resources/Prefabs/ThrowableDisplayal.prefab b/Assets/Resources/Prefabs/ThrowableDisplayal.prefab new file mode 100644 index 00000000..27ea7959 --- /dev/null +++ b/Assets/Resources/Prefabs/ThrowableDisplayal.prefab @@ -0,0 +1,187 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &3983172048088829474 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4023542279716075658} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b93b6a877adcbf94c89a9d6e0c0e844d, type: 3} + m_Name: + m_EditorClassIdentifier: + activateActionSetOnAttach: + actionSetPath: + hideHandOnAttach: 1 + hideSkeletonOnAttach: 0 + hideControllerOnAttach: 0 + handAnimationOnPickup: 0 + setRangeOfMotionOnPickup: -1 + useHandObjectAttachmentPoint: 1 + attachEaseIn: 0 + snapAttachEaseInCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + snapAttachEaseInTime: 0.15 + snapAttachEaseInCompleted: 0 + skeletonPoser: {fileID: 0} + handFollowTransform: 1 + highlightOnHover: 1 + hideHighlight: [] + hoverPriority: 0 +--- !u!54 &718238593843748537 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4023542279716075658} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &1571331645399042507 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4023542279716075658} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ffefbea063cab884ca33e5a449e5c22c, type: 3} + m_Name: + m_EditorClassIdentifier: + attachmentFlags: 44 + attachmentOffset: {fileID: 0} + catchingSpeedThreshold: -1 + releaseVelocityStyle: 1 + releaseVelocityTimeOffset: -0.011 + scaleReleaseVelocity: 1.1 + scaleReleaseVelocityThreshold: -1 + scaleReleaseVelocityCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + restoreOriginalParent: 0 + onPickUp: + m_PersistentCalls: + m_Calls: [] + onDetachFromHand: + m_PersistentCalls: + m_Calls: [] + onHeldUpdate: + m_PersistentCalls: + m_Calls: [] + interactable: {fileID: 0} +--- !u!1001 &4021821472575168948 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1723144634915134, guid: 693ba3952c1874807ad3166efd424e58, type: 3} + propertyPath: m_Name + value: Throwable Displayal + objectReference: {fileID: 0} + - target: {fileID: 4386545470508082, guid: 693ba3952c1874807ad3166efd424e58, type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4386545470508082, guid: 693ba3952c1874807ad3166efd424e58, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4386545470508082, guid: 693ba3952c1874807ad3166efd424e58, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4386545470508082, guid: 693ba3952c1874807ad3166efd424e58, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4386545470508082, guid: 693ba3952c1874807ad3166efd424e58, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4386545470508082, guid: 693ba3952c1874807ad3166efd424e58, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4386545470508082, guid: 693ba3952c1874807ad3166efd424e58, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4386545470508082, guid: 693ba3952c1874807ad3166efd424e58, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4386545470508082, guid: 693ba3952c1874807ad3166efd424e58, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4386545470508082, guid: 693ba3952c1874807ad3166efd424e58, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4386545470508082, guid: 693ba3952c1874807ad3166efd424e58, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 693ba3952c1874807ad3166efd424e58, type: 3} +--- !u!1 &4023542279716075658 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1723144634915134, guid: 693ba3952c1874807ad3166efd424e58, + type: 3} + m_PrefabInstance: {fileID: 4021821472575168948} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/Resources/Prefabs/ThrowableDisplayal.prefab.meta b/Assets/Resources/Prefabs/ThrowableDisplayal.prefab.meta new file mode 100644 index 00000000..088ad45a --- /dev/null +++ b/Assets/Resources/Prefabs/ThrowableDisplayal.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9f7bf6b3d84434f28940acdbecb311cb +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Sprites/UI/chevron-down.png.meta b/Assets/Resources/Sprites/UI/chevron-down.png.meta index e53b9aa2..c65f6d6d 100644 --- a/Assets/Resources/Sprites/UI/chevron-down.png.meta +++ b/Assets/Resources/Sprites/UI/chevron-down.png.meta @@ -1,9 +1,9 @@ fileFormatVersion: 2 guid: 4d3171f11af7f534d9dc02d7c983cfa6 TextureImporter: - fileIDToRecycleName: {} + internalIDToNameTable: [] externalObjects: {} - serializedVersion: 4 + serializedVersion: 11 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -21,6 +21,9 @@ TextureImporter: heightScale: 0.25 normalMapFilter: 0 isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,7 +34,7 @@ TextureImporter: serializedVersion: 2 filterMode: -1 aniso: -1 - mipBias: -1 + mipBias: -100 wrapU: 1 wrapV: 1 wrapW: -1 @@ -51,11 +54,17 @@ TextureImporter: spriteTessellationDetail: -1 textureType: 8 textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 platformSettings: - - buildTarget: DefaultTexturePlatform + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 @@ -65,7 +74,9 @@ TextureImporter: allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 - - buildTarget: Standalone + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 @@ -75,12 +86,23 @@ TextureImporter: allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 spriteSheet: serializedVersion: 2 sprites: [] outline: [] physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Resources/Sprites/UI/chevron-left.png.meta b/Assets/Resources/Sprites/UI/chevron-left.png.meta index a91bf399..089236a7 100644 --- a/Assets/Resources/Sprites/UI/chevron-left.png.meta +++ b/Assets/Resources/Sprites/UI/chevron-left.png.meta @@ -1,9 +1,9 @@ fileFormatVersion: 2 guid: e0002731981ae754197fe7fbe6a24645 TextureImporter: - fileIDToRecycleName: {} + internalIDToNameTable: [] externalObjects: {} - serializedVersion: 4 + serializedVersion: 11 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -21,6 +21,9 @@ TextureImporter: heightScale: 0.25 normalMapFilter: 0 isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,7 +34,7 @@ TextureImporter: serializedVersion: 2 filterMode: -1 aniso: -1 - mipBias: -1 + mipBias: -100 wrapU: 1 wrapV: 1 wrapW: -1 @@ -51,11 +54,17 @@ TextureImporter: spriteTessellationDetail: -1 textureType: 8 textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 platformSettings: - - buildTarget: DefaultTexturePlatform + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 @@ -65,7 +74,9 @@ TextureImporter: allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 - - buildTarget: Standalone + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 @@ -75,12 +86,23 @@ TextureImporter: allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 spriteSheet: serializedVersion: 2 sprites: [] outline: [] physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Resources/Sprites/UI/chevron-right.png.meta b/Assets/Resources/Sprites/UI/chevron-right.png.meta index d14b97e0..d756fb03 100644 --- a/Assets/Resources/Sprites/UI/chevron-right.png.meta +++ b/Assets/Resources/Sprites/UI/chevron-right.png.meta @@ -1,9 +1,9 @@ fileFormatVersion: 2 guid: a234e54f802b57244b4b0e51a1fafdc1 TextureImporter: - fileIDToRecycleName: {} + internalIDToNameTable: [] externalObjects: {} - serializedVersion: 4 + serializedVersion: 11 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -21,6 +21,9 @@ TextureImporter: heightScale: 0.25 normalMapFilter: 0 isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,7 +34,7 @@ TextureImporter: serializedVersion: 2 filterMode: -1 aniso: -1 - mipBias: -1 + mipBias: -100 wrapU: 1 wrapV: 1 wrapW: -1 @@ -51,11 +54,17 @@ TextureImporter: spriteTessellationDetail: -1 textureType: 8 textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 platformSettings: - - buildTarget: DefaultTexturePlatform + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 @@ -65,7 +74,9 @@ TextureImporter: allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 - - buildTarget: Standalone + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 @@ -75,12 +86,23 @@ TextureImporter: allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 spriteSheet: serializedVersion: 2 sprites: [] outline: [] physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Resources/Sprites/UI/chevron-up.png.meta b/Assets/Resources/Sprites/UI/chevron-up.png.meta index 80c47329..2a15e279 100644 --- a/Assets/Resources/Sprites/UI/chevron-up.png.meta +++ b/Assets/Resources/Sprites/UI/chevron-up.png.meta @@ -1,9 +1,9 @@ fileFormatVersion: 2 guid: aa6d2bda0c420374baeb14046061206f TextureImporter: - fileIDToRecycleName: {} + internalIDToNameTable: [] externalObjects: {} - serializedVersion: 4 + serializedVersion: 11 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -21,6 +21,9 @@ TextureImporter: heightScale: 0.25 normalMapFilter: 0 isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,7 +34,7 @@ TextureImporter: serializedVersion: 2 filterMode: -1 aniso: -1 - mipBias: -1 + mipBias: -100 wrapU: 1 wrapV: 1 wrapW: -1 @@ -51,11 +54,17 @@ TextureImporter: spriteTessellationDetail: -1 textureType: 8 textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 platformSettings: - - buildTarget: DefaultTexturePlatform + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 @@ -65,7 +74,9 @@ TextureImporter: allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 - - buildTarget: Standalone + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 @@ -75,12 +86,23 @@ TextureImporter: allowsAlphaSplitting: 0 overridden: 0 androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 spriteSheet: serializedVersion: 2 sprites: [] outline: [] physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Scenes/Exhibition.unity b/Assets/Scenes/Exhibition.unity index 7d387219..461f9520 100644 --- a/Assets/Scenes/Exhibition.unity +++ b/Assets/Scenes/Exhibition.unity @@ -13,7 +13,7 @@ OcclusionCullingSettings: --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 8 + serializedVersion: 9 m_Fog: 0 m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -38,31 +38,31 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.12731749, g: 0.13414757, b: 0.1210787, a: 1} + m_IndirectSpecularColor: {r: 0.12731707, g: 0.13414726, b: 0.12107857, a: 1} + m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 11 + serializedVersion: 12 m_GIWorkflowMode: 0 m_GISettings: serializedVersion: 2 m_BounceScale: 1 m_IndirectOutputScale: 1 m_AlbedoBoost: 1 - m_TemporalCoherenceThreshold: 1 m_EnvironmentLightingMode: 0 m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 9 + serializedVersion: 12 m_Resolution: 2 m_BakeResolution: 40 - m_TextureWidth: 1024 - m_TextureHeight: 1024 + m_AtlasSize: 1024 m_AO: 0 m_AOMaxDistance: 1 m_CompAOExponent: 1 m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 m_Padding: 2 m_LightmapParameters: {fileID: 0} m_LightmapsBakeMode: 1 @@ -77,10 +77,16 @@ LightmapSettings: m_PVRDirectSampleCount: 32 m_PVRSampleCount: 500 m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 m_PVRFilterTypeDirect: 0 m_PVRFilterTypeIndirect: 0 m_PVRFilterTypeAO: 0 - m_PVRFilteringMode: 1 + m_PVREnvironmentMIS: 0 m_PVRCulling: 1 m_PVRFilteringGaussRadiusDirect: 1 m_PVRFilteringGaussRadiusIndirect: 5 @@ -88,9 +94,12 @@ LightmapSettings: m_PVRFilteringAtrousPositionSigmaDirect: 0.5 m_PVRFilteringAtrousPositionSigmaIndirect: 2 m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ShowResolutionOverlay: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 1 + m_LightingSettings: {fileID: 4890085278179872738, guid: ef280cb8a1b96844086fbbce111f0aca, + type: 2} --- !u!196 &4 NavMeshSettings: serializedVersion: 2 @@ -110,18 +119,20 @@ NavMeshSettings: manualTileSize: 0 tileSize: 256 accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 debug: m_Flags: 0 m_NavMeshData: {fileID: 0} --- !u!1 &123453529 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 123453532} - - component: {fileID: 123453531} - component: {fileID: 123453530} - component: {fileID: 123453533} m_Layer: 0 @@ -134,77 +145,68 @@ GameObject: --- !u!114 &123453530 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 123453529} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: bd383596e0c94e46a6268577549e3d30, type: 3} m_Name: m_EditorClassIdentifier: - ExhibitionId: 5c2c65934d7ec8ccb89bef9e - LobbySpawn: {x: 0, y: -9.9, z: 0} - Settings: - StartInLobby: 0 - VREMAddress: 127.0.0.1:4567 + lobbySpawn: {x: 0, y: -9, z: 0} + settings: + StartInLobby: 1 + VREMAddress: http://127.0.0.1:4567 SpotsEnabled: 0 LobbyFloorLogoEnabled: 1 LobbyCeilingLogoEnabled: 1 CeilingLogoEnabled: 1 + WallTimerCount: 0 PlaygroundEnabled: 0 RequestExhibitions: 0 - exhibitionIds: [] + ExhibitionId: settingsPath: ---- !u!114 &123453531 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 123453529} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6408bd7e6b99ba745a8f2541dbd30bac, type: 3} - m_Name: - m_EditorClassIdentifier: - RoomSize: 10 - Offset: 5 - RoomPrefab: {fileID: 1414472768723842, guid: f3ec7ae51b8e6124797fd84a359dc393, type: 2} --- !u!4 &123453532 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 123453529} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &123453533 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 123453529} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 23c68d093f404f82a3a4e01368162c86, type: 3} m_Name: m_EditorClassIdentifier: - Enabled: 0 + isEnabled: 0 --- !u!1 &169713636 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 100002, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 100002, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 169713637} - component: {fileID: 169713638} m_Layer: 0 - m_Name: IndoorPlant1 (2) + m_Name: IndoorPlant3 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -213,8 +215,10 @@ GameObject: --- !u!4 &169713637 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 400002, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 400002, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 169713636} m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} m_LocalPosition: {x: 4.25, y: 0, z: -4.25} @@ -230,9 +234,10 @@ Transform: Animator: serializedVersion: 3 m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 9500000, guid: ce6402bc5c0679344a343b08fe9026d4, + m_CorrespondingSourceObject: {fileID: 9500000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 169713636} m_Enabled: 1 m_Avatar: {fileID: 9000000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} @@ -244,97 +249,34 @@ Animator: m_WarningMessage: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 ---- !u!1 &322547914 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 322547915} - - component: {fileID: 322547918} - - component: {fileID: 322547917} - - component: {fileID: 322547916} - m_Layer: 0 - m_Name: Cube - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &322547915 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 322547914} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.3, y: 0.3, z: 0.3} - m_Children: [] - m_Father: {fileID: 1717517717} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!23 &322547916 -MeshRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 322547914} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!65 &322547917 -BoxCollider: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 322547914} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!33 &322547918 -MeshFilter: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 322547914} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} + m_KeepAnimatorControllerStateOnDisable: 0 --- !u!1001 &325534108 -Prefab: +PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: m_TransformParent: {fileID: 995871351} m_Modifications: + - target: {fileID: 100000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} + propertyPath: m_Name + value: UnibasLogoCeiling + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} + propertyPath: m_LocalScale.x + value: 10000 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} + propertyPath: m_LocalScale.y + value: 10000 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} + propertyPath: m_LocalScale.z + value: 10000 + objectReference: {fileID: 0} - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} propertyPath: m_LocalPosition.x value: 1.6 @@ -347,6 +289,10 @@ Prefab: propertyPath: m_LocalPosition.z value: -1.02 objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} propertyPath: m_LocalRotation.x value: -0.7071068 @@ -360,54 +306,33 @@ Prefab: value: 0 objectReference: {fileID: 0} - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - propertyPath: m_LocalRotation.w - value: 0.7071068 + propertyPath: m_LocalEulerAnglesHint.x + value: -90 objectReference: {fileID: 0} - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - propertyPath: m_RootOrder + propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - propertyPath: m_LocalScale.y - value: 10000 - objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - propertyPath: m_LocalScale.z - value: 10000 - objectReference: {fileID: 0} - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - propertyPath: m_LocalScale.x - value: 10000 - objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: -90 - objectReference: {fileID: 0} - - target: {fileID: 100000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - propertyPath: m_Name - value: UnibasLogoCeiling - objectReference: {fileID: 0} m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - m_IsPrefabParent: 0 + m_SourcePrefab: {fileID: 100100000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} --- !u!4 &325534109 stripped Transform: - m_PrefabParentObject: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - m_PrefabInternal: {fileID: 325534108} + m_CorrespondingSourceObject: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, + type: 3} + m_PrefabInstance: {fileID: 325534108} + m_PrefabAsset: {fileID: 0} --- !u!1 &338978627 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 100008, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 100008, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 338978628} - component: {fileID: 338978629} @@ -421,8 +346,10 @@ GameObject: --- !u!4 &338978628 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 400008, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 400008, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 338978627} m_LocalRotation: {x: 0.4394856, y: -0.08095074, z: 0.053188283, w: 0.893012} m_LocalPosition: {x: 1.3324754, y: 13.804519, z: -7.092948} @@ -434,17 +361,20 @@ Transform: --- !u!108 &338978629 Light: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 10800002, guid: ce6402bc5c0679344a343b08fe9026d4, + m_CorrespondingSourceObject: {fileID: 10800002, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 338978627} m_Enabled: 1 - serializedVersion: 8 + serializedVersion: 10 m_Type: 0 + m_Shape: 0 m_Color: {r: 0.54, g: 0.54, b: 0.54, a: 1} m_Intensity: 1 m_Range: 0.5 m_SpotAngle: 34.08 + m_InnerSpotAngle: 24.846834 m_CookieSize: 10 m_Shadows: m_Type: 2 @@ -454,6 +384,24 @@ Light: m_Bias: 0.05 m_NormalBias: 0.4 m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -461,19 +409,25 @@ Light: m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 + m_RenderingLayerMask: 1 m_Lightmapping: 4 + m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 m_ColorTemperature: 6570 m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 m_ShadowRadius: 0 m_ShadowAngle: 0 --- !u!1 &405422128 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 405422129} - component: {fileID: 405422132} @@ -489,8 +443,9 @@ GameObject: --- !u!224 &405422129 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 405422128} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.51} @@ -508,12 +463,13 @@ RectTransform: --- !u!114 &405422130 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 405422128} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} m_Name: m_EditorClassIdentifier: m_IgnoreReversedGraphics: 1 @@ -524,12 +480,13 @@ MonoBehaviour: --- !u!114 &405422131 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 405422128} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} m_Name: m_EditorClassIdentifier: m_UiScaleMode: 0 @@ -542,11 +499,13 @@ MonoBehaviour: m_FallbackScreenDPI: 96 m_DefaultSpriteDPI: 96 m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 --- !u!223 &405422132 Canvas: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 405422128} m_Enabled: 1 serializedVersion: 3 @@ -565,9 +524,11 @@ Canvas: --- !u!1 &458316998 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 100008, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 100008, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 458316999} - component: {fileID: 458317000} @@ -581,8 +542,10 @@ GameObject: --- !u!4 &458316999 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 400008, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 400008, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 458316998} m_LocalRotation: {x: 0.4394856, y: -0.08095074, z: 0.053188283, w: 0.893012} m_LocalPosition: {x: 1.3324754, y: 13.804519, z: -7.092948} @@ -594,17 +557,20 @@ Transform: --- !u!108 &458317000 Light: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 10800002, guid: ce6402bc5c0679344a343b08fe9026d4, + m_CorrespondingSourceObject: {fileID: 10800002, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 458316998} m_Enabled: 1 - serializedVersion: 8 + serializedVersion: 10 m_Type: 0 + m_Shape: 0 m_Color: {r: 0.54, g: 0.54, b: 0.54, a: 1} m_Intensity: 1 m_Range: 0.5 m_SpotAngle: 34.08 + m_InnerSpotAngle: 24.846834 m_CookieSize: 10 m_Shadows: m_Type: 2 @@ -614,6 +580,24 @@ Light: m_Bias: 0.05 m_NormalBias: 0.4 m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -621,19 +605,26 @@ Light: m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 + m_RenderingLayerMask: 1 m_Lightmapping: 4 + m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 m_ColorTemperature: 6570 m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 m_ShadowRadius: 0 m_ShadowAngle: 0 --- !u!1 &465261837 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 100008, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 100008, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 465261838} - component: {fileID: 465261839} @@ -647,8 +638,10 @@ GameObject: --- !u!4 &465261838 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 400008, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 400008, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 465261837} m_LocalRotation: {x: 0.4394856, y: -0.08095074, z: 0.053188283, w: 0.893012} m_LocalPosition: {x: 1.3324754, y: 13.804519, z: -7.092948} @@ -660,17 +653,20 @@ Transform: --- !u!108 &465261839 Light: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 10800002, guid: ce6402bc5c0679344a343b08fe9026d4, + m_CorrespondingSourceObject: {fileID: 10800002, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 465261837} m_Enabled: 1 - serializedVersion: 8 + serializedVersion: 10 m_Type: 0 + m_Shape: 0 m_Color: {r: 0.54, g: 0.54, b: 0.54, a: 1} m_Intensity: 1 m_Range: 0.5 m_SpotAngle: 34.08 + m_InnerSpotAngle: 24.846834 m_CookieSize: 10 m_Shadows: m_Type: 2 @@ -680,6 +676,24 @@ Light: m_Bias: 0.05 m_NormalBias: 0.4 m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -687,23 +701,28 @@ Light: m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 + m_RenderingLayerMask: 1 m_Lightmapping: 4 + m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 m_ColorTemperature: 6570 m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 m_ShadowRadius: 0 m_ShadowAngle: 0 --- !u!1 &471107340 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 1091954227334992, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 1091954227334992, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 471107342} - - component: {fileID: 471107341} - component: {fileID: 471107343} m_Layer: 0 m_Name: Lobby @@ -712,29 +731,13 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &471107341 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 114247994260953484, guid: 43ad350a40367054ca51c3cb0d240eb8, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 471107340} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f7adf81c04b262a4b8e81b9aff5a8793, type: 3} - m_Name: - m_EditorClassIdentifier: - PlanePrefab: {fileID: 1723144634915134, guid: 693ba3952c1874807ad3166efd424e58, - type: 2} - audio: {fileID: 0} - GlobePrefab: {fileID: 1051155230607358, guid: 31ec8781b97bb41f09b6daa2cea5b36f, - type: 2} --- !u!4 &471107342 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 4415345949160624, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 4415345949160624, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 471107340} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: -10, z: 0} @@ -754,15 +757,15 @@ Transform: - {fileID: 1432769504} - {fileID: 169713637} - {fileID: 1913549275} - - {fileID: 1717517717} m_Father: {fileID: 0} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &471107343 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 471107340} m_Enabled: 1 m_EditorHideFlags: 0 @@ -772,9 +775,11 @@ MonoBehaviour: --- !u!1 &477856384 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 100004, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 100004, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 477856385} - component: {fileID: 477856387} @@ -789,8 +794,10 @@ GameObject: --- !u!4 &477856385 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 400004, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 400004, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 477856384} m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} @@ -802,9 +809,10 @@ Transform: --- !u!23 &477856386 MeshRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 2300000, guid: ce6402bc5c0679344a343b08fe9026d4, + m_CorrespondingSourceObject: {fileID: 2300000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 477856384} m_Enabled: 1 m_CastShadows: 1 @@ -813,6 +821,10 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 m_Materials: - {fileID: 2100000, guid: a0ddbdd7cfb8ae94c8454c138df77a64, type: 2} - {fileID: 2100000, guid: ec1565be7383e2e49a2300ec6ea284b6, type: 2} @@ -827,6 +839,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -839,99 +852,120 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &477856387 MeshFilter: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 3300000, guid: ce6402bc5c0679344a343b08fe9026d4, + m_CorrespondingSourceObject: {fileID: 3300000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 477856384} m_Mesh: {fileID: 4300000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} --- !u!1001 &515702456 -Prefab: +PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} + - target: {fileID: 107946, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} + propertyPath: m_TagString + value: Player + objectReference: {fileID: 0} + - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} + - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} + - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} + - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} + - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} + - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} - propertyPath: m_LocalRotation.w + - target: {fileID: 5475726, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} + propertyPath: m_Interpolate value: 1 objectReference: {fileID: 0} - - target: {fileID: 447954, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} - propertyPath: m_RootOrder + - target: {fileID: 5475726, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} + propertyPath: m_IsKinematic value: 1 objectReference: {fileID: 0} - - target: {fileID: 107946, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} - propertyPath: m_TagString - value: Player + - target: {fileID: 5475726, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} + propertyPath: m_CollisionDetection + value: 2 objectReference: {fileID: 0} - - target: {fileID: 13693334, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} + - target: {fileID: 11455280, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} + propertyPath: head + value: + objectReference: {fileID: 731344901} + - target: {fileID: 11455280, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} propertyPath: m_Enabled value: 1 objectReference: {fileID: 0} - - target: {fileID: 11455280, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} + - target: {fileID: 13693334, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} propertyPath: m_Enabled value: 1 objectReference: {fileID: 0} - - target: {fileID: 11455280, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} - propertyPath: head - value: - objectReference: {fileID: 731344901} - - target: {fileID: 5475726, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} - propertyPath: m_CollisionDetection - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 13693334, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} + - target: {fileID: 13693334, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} propertyPath: m_Center.y value: 0.5 objectReference: {fileID: 0} - - target: {fileID: 5475726, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} - propertyPath: m_Interpolate - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5475726, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} - propertyPath: m_IsKinematic - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 13693334, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} + - target: {fileID: 13693334, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} propertyPath: m_IsTrigger value: 1 objectReference: {fileID: 0} m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} - m_IsPrefabParent: 0 + m_SourcePrefab: {fileID: 100100000, guid: dc06161b6d97feb419f45f03b62e14b9, type: 3} --- !u!1001 &561656636 -Prefab: +PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: m_TransformParent: {fileID: 1389145820} m_Modifications: + - target: {fileID: 100000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} + propertyPath: m_Name + value: UnibasLogoFloor + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} + propertyPath: m_LocalScale.x + value: 10000.014 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} + propertyPath: m_LocalScale.y + value: 10000.01 + objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} + propertyPath: m_LocalScale.z + value: 10000.01 + objectReference: {fileID: 0} - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} propertyPath: m_LocalPosition.x value: 1.6 @@ -944,6 +978,10 @@ Prefab: propertyPath: m_LocalPosition.z value: -1.02 objectReference: {fileID: 0} + - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} propertyPath: m_LocalRotation.x value: -0.7071068 @@ -957,136 +995,102 @@ Prefab: value: 0 objectReference: {fileID: 0} - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - propertyPath: m_LocalRotation.w - value: 0.7071068 + propertyPath: m_LocalEulerAnglesHint.x + value: -90 objectReference: {fileID: 0} - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - propertyPath: m_RootOrder + propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - propertyPath: m_LocalScale.y - value: 10000.01 - objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - propertyPath: m_LocalScale.z - value: 10000.01 - objectReference: {fileID: 0} - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - propertyPath: m_LocalScale.x - value: 10000.014 - objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: -90 - objectReference: {fileID: 0} - - target: {fileID: 100000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - propertyPath: m_Name - value: UnibasLogoFloor - objectReference: {fileID: 0} m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - m_IsPrefabParent: 0 + m_SourcePrefab: {fileID: 100100000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} --- !u!4 &561656637 stripped Transform: - m_PrefabParentObject: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, type: 3} - m_PrefabInternal: {fileID: 561656636} + m_CorrespondingSourceObject: {fileID: 400000, guid: 9041ee39b903f90438ef3b7227756c8e, + type: 3} + m_PrefabInstance: {fileID: 561656636} + m_PrefabAsset: {fileID: 0} --- !u!1001 &720665647 -Prefab: +PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: m_TransformParent: {fileID: 471107342} m_Modifications: - - target: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} + - target: {fileID: 142912, guid: 73ac470d3d909d645a6c89a4664b6849, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 198004, guid: 73ac470d3d909d645a6c89a4664b6849, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 3} propertyPath: m_LocalPosition.x value: 4 objectReference: {fileID: 0} - - target: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} + - target: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} + - target: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} - propertyPath: m_LocalRotation.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} + - target: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 3} propertyPath: m_LocalRotation.w value: 0 objectReference: {fileID: 0} - - target: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} - propertyPath: m_RootOrder - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 11479906, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} - propertyPath: teleportType - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 13593758, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} - propertyPath: m_IsTrigger + - target: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 3} + propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 11479906, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} - propertyPath: markerActive + - target: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 3} + propertyPath: m_LocalRotation.y value: 1 objectReference: {fileID: 0} - - target: {fileID: 11479906, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} - propertyPath: title - value: - objectReference: {fileID: 0} - - target: {fileID: 198004, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} - propertyPath: m_IsActive + - target: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 3} + propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 142912, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 2356592, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} + - target: {fileID: 2356592, guid: 73ac470d3d909d645a6c89a4664b6849, type: 3} propertyPath: m_Materials.Array.data[0] value: objectReference: {fileID: 2100000, guid: 510c6e0b8b5c948458c2b4bc3de5a637, type: 2} - - target: {fileID: 11479906, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} - propertyPath: locked + - target: {fileID: 13593758, guid: 73ac470d3d909d645a6c89a4664b6849, type: 3} + propertyPath: m_IsTrigger value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} - m_IsPrefabParent: 0 + m_SourcePrefab: {fileID: 100100000, guid: 73ac470d3d909d645a6c89a4664b6849, type: 3} --- !u!4 &720665648 stripped Transform: - m_PrefabParentObject: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, type: 2} - m_PrefabInternal: {fileID: 720665647} + m_CorrespondingSourceObject: {fileID: 428928, guid: 73ac470d3d909d645a6c89a4664b6849, + type: 3} + m_PrefabInstance: {fileID: 720665647} + m_PrefabAsset: {fileID: 0} --- !u!4 &731344901 stripped Transform: - m_PrefabParentObject: {fileID: 429506, guid: dc06161b6d97feb419f45f03b62e14b9, type: 2} - m_PrefabInternal: {fileID: 515702456} + m_CorrespondingSourceObject: {fileID: 429506, guid: dc06161b6d97feb419f45f03b62e14b9, + type: 3} + m_PrefabInstance: {fileID: 515702456} + m_PrefabAsset: {fileID: 0} --- !u!1 &738498677 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 100004, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 100004, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 738498678} - component: {fileID: 738498680} @@ -1101,8 +1105,10 @@ GameObject: --- !u!4 &738498678 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 400004, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 400004, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 738498677} m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} @@ -1114,9 +1120,10 @@ Transform: --- !u!23 &738498679 MeshRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 2300000, guid: ce6402bc5c0679344a343b08fe9026d4, + m_CorrespondingSourceObject: {fileID: 2300000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 738498677} m_Enabled: 1 m_CastShadows: 1 @@ -1125,6 +1132,10 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 m_Materials: - {fileID: 2100000, guid: a0ddbdd7cfb8ae94c8454c138df77a64, type: 2} - {fileID: 2100000, guid: ec1565be7383e2e49a2300ec6ea284b6, type: 2} @@ -1139,6 +1150,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1151,20 +1163,24 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &738498680 MeshFilter: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 3300000, guid: ce6402bc5c0679344a343b08fe9026d4, + m_CorrespondingSourceObject: {fileID: 3300000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 738498677} m_Mesh: {fileID: 4300000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} --- !u!1 &870455544 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 100000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 100000, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 870455545} - component: {fileID: 870455546} @@ -1178,8 +1194,10 @@ GameObject: --- !u!4 &870455545 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 400000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 400000, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 870455544} m_LocalRotation: {x: 0.50595576, y: -0.15491147, z: -0.14537717, w: 0.83598846} m_LocalPosition: {x: 1.3324754, y: 13.512797, z: -8.130181} @@ -1191,17 +1209,20 @@ Transform: --- !u!108 &870455546 Light: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 10800000, guid: ce6402bc5c0679344a343b08fe9026d4, + m_CorrespondingSourceObject: {fileID: 10800000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 870455544} m_Enabled: 1 - serializedVersion: 8 + serializedVersion: 10 m_Type: 1 + m_Shape: 0 m_Color: {r: 1, g: 1, b: 1, a: 1} m_Intensity: 0.29999998 m_Range: 10 m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 m_CookieSize: 10 m_Shadows: m_Type: 0 @@ -1211,6 +1232,24 @@ Light: m_Bias: 0.05 m_NormalBias: 0.4 m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -1218,19 +1257,25 @@ Light: m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 + m_RenderingLayerMask: 1 m_Lightmapping: 4 + m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 m_ColorTemperature: 6570 m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 m_ShadowRadius: 0 m_ShadowAngle: 0 --- !u!1 &879060031 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 879060032} - component: {fileID: 879060034} @@ -1245,8 +1290,9 @@ GameObject: --- !u!224 &879060032 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 879060031} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} @@ -1263,22 +1309,23 @@ RectTransform: --- !u!114 &879060033 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 879060031} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} m_FontSize: 14 @@ -1296,22 +1343,24 @@ MonoBehaviour: --- !u!222 &879060034 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 879060031} + m_CullTransparentMesh: 1 --- !u!1 &913630414 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 1729293968386264, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 1729293968386264, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 913630415} - component: {fileID: 913630419} - component: {fileID: 913630418} - component: {fileID: 913630417} - - component: {fileID: 913630416} m_Layer: 0 m_Name: SouthWall m_TagString: Untagged @@ -1322,9 +1371,10 @@ GameObject: --- !u!4 &913630415 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 4489302658765550, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 4489302658765550, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 913630414} m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} m_LocalPosition: {x: -5.5, y: 2.5, z: 0} @@ -1333,26 +1383,13 @@ Transform: m_Father: {fileID: 471107342} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} ---- !u!114 &913630416 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 114846969025674480, guid: 43ad350a40367054ca51c3cb0d240eb8, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 913630414} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 453b6e0995157534e90ddd721f3fc607, type: 3} - m_Name: - m_EditorClassIdentifier: - Orientation: 2 - RoomRadius: 5 --- !u!23 &913630417 MeshRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 23496733994142770, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 23496733994142770, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 913630414} m_Enabled: 1 m_CastShadows: 1 @@ -1361,6 +1398,10 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 m_Materials: - {fileID: 2100000, guid: 6cafa1d1c58356f4981fd9832800bf69, type: 2} m_StaticBatchInfo: @@ -1370,6 +1411,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1382,12 +1424,14 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!65 &913630418 BoxCollider: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 65302388588502814, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 65302388588502814, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 913630414} m_Material: {fileID: 0} m_IsTrigger: 0 @@ -1398,17 +1442,19 @@ BoxCollider: --- !u!33 &913630419 MeshFilter: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 33881291610697942, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 33881291610697942, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 913630414} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &937120730 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 937120731} - component: {fileID: 937120736} @@ -1427,8 +1473,9 @@ GameObject: --- !u!224 &937120731 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 937120730} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} @@ -1446,8 +1493,9 @@ RectTransform: --- !u!114 &937120732 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 937120730} m_Enabled: 1 m_EditorHideFlags: 0 @@ -1458,6 +1506,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: - m_Target: {fileID: 1913549276} + m_TargetAssemblyTypeName: m_MethodName: TeleportPlayer m_Mode: 1 m_Arguments: @@ -1468,44 +1517,73 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 - m_TypeName: Valve.VR.InteractionSystem.CustomEvents+UnityEventHand, Assembly-CSharp, - Version=0.0.0.0, Culture=neutral, PublicKeyToken=null --- !u!114 &937120733 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 937120730} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: b93b6a877adcbf94c89a9d6e0c0e844d, type: 3} m_Name: m_EditorClassIdentifier: - activateActionSetOnAttach: {fileID: 0} + activateActionSetOnAttach: + actionSetPath: hideHandOnAttach: 1 hideSkeletonOnAttach: 0 hideControllerOnAttach: 0 handAnimationOnPickup: 0 setRangeOfMotionOnPickup: -1 useHandObjectAttachmentPoint: 1 - handFollowTransform: {fileID: 0} - handFollowTransformPosition: 1 - handFollowTransformRotation: 1 + attachEaseIn: 0 + snapAttachEaseInCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + snapAttachEaseInTime: 0.15 + snapAttachEaseInCompleted: 0 + skeletonPoser: {fileID: 0} + handFollowTransform: 1 highlightOnHover: 1 hideHighlight: [] + hoverPriority: 0 --- !u!114 &937120734 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 937120730} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} m_Name: m_EditorClassIdentifier: m_Navigation: m_Mode: 3 + m_WrapAround: 0 m_SelectOnUp: {fileID: 0} m_SelectOnDown: {fileID: 0} m_SelectOnLeft: {fileID: 0} @@ -1515,44 +1593,46 @@ MonoBehaviour: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} m_DisabledSprite: {fileID: 0} m_AnimationTriggers: m_NormalTrigger: Normal m_HighlightedTrigger: Highlighted m_PressedTrigger: Pressed + m_SelectedTrigger: Highlighted m_DisabledTrigger: Disabled m_Interactable: 1 m_TargetGraphic: {fileID: 937120735} m_OnClick: m_PersistentCalls: m_Calls: [] - m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null --- !u!114 &937120735 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 937120730} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} m_Type: 1 m_PreserveAspect: 0 @@ -1561,17 +1641,22 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!222 &937120736 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 937120730} + m_CullTransparentMesh: 1 --- !u!65 &937120737 BoxCollider: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 937120730} m_Material: {fileID: 0} m_IsTrigger: 0 @@ -1582,10 +1667,11 @@ BoxCollider: --- !u!1 &995871350 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 1381129657105970, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 1381129657105970, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 995871351} - component: {fileID: 995871355} @@ -1602,9 +1688,10 @@ GameObject: --- !u!4 &995871351 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 4380875659379194, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 4380875659379194, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 995871350} m_LocalRotation: {x: 0, y: 0, z: 1, w: 0} m_LocalPosition: {x: 0, y: 5, z: 0} @@ -1617,9 +1704,10 @@ Transform: --- !u!114 &995871352 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 114398750414707916, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 114398750414707916, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 995871350} m_Enabled: 1 m_EditorHideFlags: 0 @@ -1629,9 +1717,10 @@ MonoBehaviour: --- !u!23 &995871353 MeshRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 23612666943450240, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 23612666943450240, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 995871350} m_Enabled: 1 m_CastShadows: 1 @@ -1640,6 +1729,10 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 m_Materials: - {fileID: 2100000, guid: 3894610d5dbb44b43b07127f8f20b3a8, type: 2} m_StaticBatchInfo: @@ -1649,6 +1742,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1661,35 +1755,39 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!64 &995871354 MeshCollider: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 64217718344059280, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 64217718344059280, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 995871350} m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 - serializedVersion: 3 + serializedVersion: 4 m_Convex: 0 - m_CookingOptions: 14 - m_SkinWidth: 0.01 + m_CookingOptions: 30 m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} --- !u!33 &995871355 MeshFilter: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 33691126756034102, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 33691126756034102, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 995871350} m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1073577007 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 100000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 100000, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 1073577008} - component: {fileID: 1073577009} @@ -1703,8 +1801,10 @@ GameObject: --- !u!4 &1073577008 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 400000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 400000, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1073577007} m_LocalRotation: {x: 0.50595576, y: -0.15491147, z: -0.14537717, w: 0.83598846} m_LocalPosition: {x: 1.3324754, y: 13.512797, z: -8.130181} @@ -1716,17 +1816,20 @@ Transform: --- !u!108 &1073577009 Light: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 10800000, guid: ce6402bc5c0679344a343b08fe9026d4, + m_CorrespondingSourceObject: {fileID: 10800000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1073577007} m_Enabled: 1 - serializedVersion: 8 + serializedVersion: 10 m_Type: 1 + m_Shape: 0 m_Color: {r: 1, g: 1, b: 1, a: 1} m_Intensity: 0.29999998 m_Range: 10 m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 m_CookieSize: 10 m_Shadows: m_Type: 0 @@ -1736,6 +1839,24 @@ Light: m_Bias: 0.05 m_NormalBias: 0.4 m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -1743,104 +1864,26 @@ Light: m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 + m_RenderingLayerMask: 1 m_Lightmapping: 4 + m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 m_ColorTemperature: 6570 m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 m_ShadowRadius: 0 m_ShadowAngle: 0 ---- !u!1 &1204909359 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 1204909360} - - component: {fileID: 1204909363} - - component: {fileID: 1204909362} - - component: {fileID: 1204909361} - m_Layer: 0 - m_Name: Capsule - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1204909360 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1204909359} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.3, y: 0.3, z: 0.3} - m_Children: [] - m_Father: {fileID: 1717517717} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!23 &1204909361 -MeshRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1204909359} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!136 &1204909362 -CapsuleCollider: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1204909359} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - m_Radius: 0.5 - m_Height: 2 - m_Direction: 1 - m_Center: {x: 0, y: 0, z: 0} ---- !u!33 &1204909363 -MeshFilter: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1204909359} - m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1289380961 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 100000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 100000, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 1289380962} - component: {fileID: 1289380963} @@ -1854,8 +1897,10 @@ GameObject: --- !u!4 &1289380962 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 400000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 400000, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1289380961} m_LocalRotation: {x: 0.50595576, y: -0.15491147, z: -0.14537717, w: 0.83598846} m_LocalPosition: {x: 1.3324754, y: 13.512797, z: -8.130181} @@ -1867,17 +1912,20 @@ Transform: --- !u!108 &1289380963 Light: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 10800000, guid: ce6402bc5c0679344a343b08fe9026d4, + m_CorrespondingSourceObject: {fileID: 10800000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1289380961} m_Enabled: 1 - serializedVersion: 8 + serializedVersion: 10 m_Type: 1 + m_Shape: 0 m_Color: {r: 1, g: 1, b: 1, a: 1} m_Intensity: 0.29999998 m_Range: 10 m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 m_CookieSize: 10 m_Shadows: m_Type: 0 @@ -1887,6 +1935,24 @@ Light: m_Bias: 0.05 m_NormalBias: 0.4 m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -1894,26 +1960,31 @@ Light: m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 + m_RenderingLayerMask: 1 m_Lightmapping: 4 + m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 m_ColorTemperature: 6570 m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 m_ShadowRadius: 0 m_ShadowAngle: 0 --- !u!1 &1294949431 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 1600139916946542, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 1600139916946542, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 1294949432} - component: {fileID: 1294949436} - component: {fileID: 1294949435} - component: {fileID: 1294949434} - - component: {fileID: 1294949433} m_Layer: 0 m_Name: WestWall m_TagString: Untagged @@ -1924,9 +1995,10 @@ GameObject: --- !u!4 &1294949432 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 4715313820008144, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 4715313820008144, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1294949431} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 2.5, z: -5.5} @@ -1935,26 +2007,13 @@ Transform: m_Father: {fileID: 471107342} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1294949433 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 114859673643067282, guid: 43ad350a40367054ca51c3cb0d240eb8, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1294949431} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 453b6e0995157534e90ddd721f3fc607, type: 3} - m_Name: - m_EditorClassIdentifier: - Orientation: 3 - RoomRadius: 5 --- !u!23 &1294949434 MeshRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 23858465925333696, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 23858465925333696, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1294949431} m_Enabled: 1 m_CastShadows: 1 @@ -1963,6 +2022,10 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 m_Materials: - {fileID: 2100000, guid: 6cafa1d1c58356f4981fd9832800bf69, type: 2} m_StaticBatchInfo: @@ -1972,6 +2035,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -1984,12 +2048,14 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!65 &1294949435 BoxCollider: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 65560704715985190, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 65560704715985190, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1294949431} m_Material: {fileID: 0} m_IsTrigger: 0 @@ -2000,18 +2066,20 @@ BoxCollider: --- !u!33 &1294949436 MeshFilter: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 33731531607506108, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 33731531607506108, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1294949431} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1389145819 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 1493211288455760, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 1493211288455760, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 1389145820} - component: {fileID: 1389145824} @@ -2028,9 +2096,10 @@ GameObject: --- !u!4 &1389145820 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 4394856343597108, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 4394856343597108, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1389145819} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} @@ -2043,9 +2112,10 @@ Transform: --- !u!114 &1389145821 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 114569960176821088, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 114569960176821088, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1389145819} m_Enabled: 1 m_EditorHideFlags: 0 @@ -2055,9 +2125,10 @@ MonoBehaviour: --- !u!23 &1389145822 MeshRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 23988839637209296, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 23988839637209296, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1389145819} m_Enabled: 1 m_CastShadows: 1 @@ -2066,6 +2137,10 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 m_Materials: - {fileID: 2100000, guid: d080de54422fc074da28032623a48860, type: 2} m_StaticBatchInfo: @@ -2075,6 +2150,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -2087,42 +2163,44 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!64 &1389145823 MeshCollider: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 64824310659656924, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 64824310659656924, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1389145819} m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 - serializedVersion: 3 + serializedVersion: 4 m_Convex: 0 - m_CookingOptions: 14 - m_SkinWidth: 0.01 + m_CookingOptions: 30 m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} --- !u!33 &1389145824 MeshFilter: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 33881137363756132, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 33881137363756132, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1389145819} m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1393683088 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 1471210206939388, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 1471210206939388, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 1393683089} - component: {fileID: 1393683093} - component: {fileID: 1393683092} - component: {fileID: 1393683091} - - component: {fileID: 1393683090} m_Layer: 0 m_Name: NorthWall m_TagString: Untagged @@ -2133,9 +2211,10 @@ GameObject: --- !u!4 &1393683089 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 4123904704037662, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 4123904704037662, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1393683088} m_LocalRotation: {x: 0, y: 0.7071068, z: -0, w: -0.7071068} m_LocalPosition: {x: 5.5, y: 2.5, z: 0} @@ -2144,26 +2223,13 @@ Transform: m_Father: {fileID: 471107342} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 270, z: 0} ---- !u!114 &1393683090 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 114957097166043772, guid: 43ad350a40367054ca51c3cb0d240eb8, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1393683088} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 453b6e0995157534e90ddd721f3fc607, type: 3} - m_Name: - m_EditorClassIdentifier: - Orientation: 0 - RoomRadius: 5 --- !u!23 &1393683091 MeshRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 23540454350119734, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 23540454350119734, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1393683088} m_Enabled: 1 m_CastShadows: 1 @@ -2172,6 +2238,10 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 m_Materials: - {fileID: 2100000, guid: 5ca7add038ee24f4f99ca733a846e082, type: 2} m_StaticBatchInfo: @@ -2181,6 +2251,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -2193,12 +2264,14 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!65 &1393683092 BoxCollider: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 65750050019559060, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 65750050019559060, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1393683088} m_Material: {fileID: 0} m_IsTrigger: 0 @@ -2209,24 +2282,25 @@ BoxCollider: --- !u!33 &1393683093 MeshFilter: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 33698469859399172, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 33698469859399172, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1393683088} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1402571953 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 1167024307849844, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 1167024307849844, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 1402571954} - component: {fileID: 1402571958} - component: {fileID: 1402571957} - component: {fileID: 1402571956} - - component: {fileID: 1402571955} m_Layer: 0 m_Name: EastWall m_TagString: Untagged @@ -2237,9 +2311,10 @@ GameObject: --- !u!4 &1402571954 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 4836259712654746, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 4836259712654746, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1402571953} m_LocalRotation: {x: 0, y: 1, z: 0, w: 0} m_LocalPosition: {x: 0, y: 2.5, z: 5.5} @@ -2248,26 +2323,13 @@ Transform: m_Father: {fileID: 471107342} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} ---- !u!114 &1402571955 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 114187801076618424, guid: 43ad350a40367054ca51c3cb0d240eb8, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1402571953} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 453b6e0995157534e90ddd721f3fc607, type: 3} - m_Name: - m_EditorClassIdentifier: - Orientation: 1 - RoomRadius: 5 --- !u!23 &1402571956 MeshRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 23276166737891744, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 23276166737891744, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1402571953} m_Enabled: 1 m_CastShadows: 1 @@ -2276,6 +2338,10 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 m_Materials: - {fileID: 2100000, guid: 5ca7add038ee24f4f99ca733a846e082, type: 2} m_StaticBatchInfo: @@ -2285,6 +2351,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -2297,12 +2364,14 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!65 &1402571957 BoxCollider: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 65779432455423020, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 65779432455423020, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1402571953} m_Material: {fileID: 0} m_IsTrigger: 0 @@ -2313,80 +2382,25 @@ BoxCollider: --- !u!33 &1402571958 MeshFilter: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 33963883579405500, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 33963883579405500, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1402571953} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1001 &1417515579 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 2} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 2} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 2} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 2} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 2} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 2} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 2} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 2} - propertyPath: m_RootOrder - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 12071126, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 2} - propertyPath: m_DynamicOccludee - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 11445746, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 2} - propertyPath: debugFloor - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 11445746, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 2} - propertyPath: showOffsetReticle - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 11445746, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 2} - propertyPath: pointHighlightedMaterial - value: - objectReference: {fileID: 2100000, guid: 510c6e0b8b5c948458c2b4bc3de5a637, type: 2} - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 2} - m_IsPrefabParent: 0 --- !u!1 &1432769503 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 100002, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 100002, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 1432769504} - component: {fileID: 1432769505} m_Layer: 0 - m_Name: IndoorPlant1 (1) + m_Name: IndoorPlant2 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -2395,8 +2409,10 @@ GameObject: --- !u!4 &1432769504 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 400002, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 400002, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1432769503} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -4.25, y: 0, z: 4.25} @@ -2412,9 +2428,10 @@ Transform: Animator: serializedVersion: 3 m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 9500000, guid: ce6402bc5c0679344a343b08fe9026d4, + m_CorrespondingSourceObject: {fileID: 9500000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1432769503} m_Enabled: 1 m_Avatar: {fileID: 9000000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} @@ -2426,12 +2443,15 @@ Animator: m_WarningMessage: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 --- !u!1 &1491220644 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 100002, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 100002, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 1491220645} - component: {fileID: 1491220646} @@ -2445,8 +2465,10 @@ GameObject: --- !u!4 &1491220645 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 400002, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 400002, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1491220644} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 4.25, y: 0, z: 4.25} @@ -2462,9 +2484,10 @@ Transform: Animator: serializedVersion: 3 m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 9500000, guid: ce6402bc5c0679344a343b08fe9026d4, + m_CorrespondingSourceObject: {fileID: 9500000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1491220644} m_Enabled: 1 m_Avatar: {fileID: 9000000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} @@ -2476,13 +2499,15 @@ Animator: m_WarningMessage: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 --- !u!1 &1559008200 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 1163618553892468, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 1163618553892468, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 1559008201} - component: {fileID: 1559008205} @@ -2499,9 +2524,10 @@ GameObject: --- !u!4 &1559008201 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 4478756644364986, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 4478756644364986, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1559008200} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0.01, z: 0} @@ -2513,9 +2539,10 @@ Transform: --- !u!114 &1559008202 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 114860609840922904, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 114860609840922904, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1559008200} m_Enabled: 1 m_EditorHideFlags: 0 @@ -2527,17 +2554,22 @@ MonoBehaviour: --- !u!23 &1559008203 MeshRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 23847835417151178, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 23847835417151178, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1559008200} - m_Enabled: 1 + m_Enabled: 0 m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 m_Materials: - {fileID: 2100000, guid: 417e639b66cd3a24e9c5312be99ce3bd, type: 2} m_StaticBatchInfo: @@ -2547,6 +2579,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -2559,35 +2592,39 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!64 &1559008204 MeshCollider: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 64280608297398338, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 64280608297398338, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1559008200} m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 - serializedVersion: 3 + serializedVersion: 4 m_Convex: 0 - m_CookingOptions: 14 - m_SkinWidth: 0.01 + m_CookingOptions: 30 m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} --- !u!33 &1559008205 MeshFilter: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 33157466841060802, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 33157466841060802, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1559008200} m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1668980313 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 100004, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 100004, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 1668980314} - component: {fileID: 1668980316} @@ -2602,8 +2639,10 @@ GameObject: --- !u!4 &1668980314 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 400004, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 400004, guid: ce6402bc5c0679344a343b08fe9026d4, + type: 3} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1668980313} m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} m_LocalPosition: {x: -0, y: 0, z: 0} @@ -2615,9 +2654,10 @@ Transform: --- !u!23 &1668980315 MeshRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 2300000, guid: ce6402bc5c0679344a343b08fe9026d4, + m_CorrespondingSourceObject: {fileID: 2300000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1668980313} m_Enabled: 1 m_CastShadows: 1 @@ -2626,6 +2666,10 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 m_Materials: - {fileID: 2100000, guid: a0ddbdd7cfb8ae94c8454c138df77a64, type: 2} - {fileID: 2100000, guid: ec1565be7383e2e49a2300ec6ea284b6, type: 2} @@ -2640,6 +2684,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -2652,157 +2697,24 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1668980316 MeshFilter: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 3300000, guid: ce6402bc5c0679344a343b08fe9026d4, + m_CorrespondingSourceObject: {fileID: 3300000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1668980313} m_Mesh: {fileID: 4300000, guid: ce6402bc5c0679344a343b08fe9026d4, type: 3} ---- !u!1 &1717517716 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 1717517717} - - component: {fileID: 1717517721} - - component: {fileID: 1717517720} - - component: {fileID: 1717517719} - - component: {fileID: 1717517718} - m_Layer: 0 - m_Name: TestThrowable - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1717517717 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1717517716} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 2.269, y: 0.935, z: 3.374} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 1204909360} - - {fileID: 322547915} - m_Father: {fileID: 471107342} - m_RootOrder: 14 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1717517718 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1717517716} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ffefbea063cab884ca33e5a449e5c22c, type: 3} - m_Name: - m_EditorClassIdentifier: - attachmentFlags: 44 - attachmentOffset: {fileID: 0} - catchingSpeedThreshold: -1 - releaseVelocityStyle: 1 - releaseVelocityTimeOffset: -0.011 - scaleReleaseVelocity: 1.1 - restoreOriginalParent: 0 - attachEaseIn: 0 - snapAttachEaseInCurve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 2 - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - - serializedVersion: 2 - time: 1 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - snapAttachEaseInTime: 0.15 - onPickUp: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null - onDetachFromHand: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null - snapAttachEaseInCompleted: 0 - interactable: {fileID: 0} ---- !u!114 &1717517719 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1717517716} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b93b6a877adcbf94c89a9d6e0c0e844d, type: 3} - m_Name: - m_EditorClassIdentifier: - activateActionSetOnAttach: {fileID: 0} - hideHandOnAttach: 1 - hideSkeletonOnAttach: 0 - hideControllerOnAttach: 0 - handAnimationOnPickup: 0 - setRangeOfMotionOnPickup: -1 - useHandObjectAttachmentPoint: 1 - handFollowTransform: {fileID: 0} - handFollowTransformPosition: 1 - handFollowTransformRotation: 1 - highlightOnHover: 1 - hideHighlight: [] ---- !u!54 &1717517720 -Rigidbody: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1717517716} - serializedVersion: 2 - m_Mass: 1 - m_Drag: 0 - m_AngularDrag: 0.05 - m_UseGravity: 1 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 ---- !u!114 &1717517721 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1717517716} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 783750eec4c41da428b7651515146d14, type: 3} - m_Name: - m_EditorClassIdentifier: - velocityAverageFrames: 5 - angularVelocityAverageFrames: 11 - estimateOnAwake: 0 --- !u!1 &1740654616 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 1446357605606800, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 1446357605606800, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 1740654617} - component: {fileID: 1740654618} @@ -2816,9 +2728,10 @@ GameObject: --- !u!4 &1740654617 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 4983058559591610, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 4983058559591610, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1740654616} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 2.5, z: 0} @@ -2830,17 +2743,20 @@ Transform: --- !u!108 &1740654618 Light: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 108182542944349988, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 108182542944349988, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1740654616} m_Enabled: 1 - serializedVersion: 8 + serializedVersion: 10 m_Type: 2 + m_Shape: 0 m_Color: {r: 1, g: 1, b: 1, a: 1} m_Intensity: 1.5 m_Range: 8 m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 m_CookieSize: 10 m_Shadows: m_Type: 0 @@ -2850,6 +2766,24 @@ Light: m_Bias: 0.05 m_NormalBias: 0.4 m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -2857,20 +2791,26 @@ Light: m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 + m_RenderingLayerMask: 1 m_Lightmapping: 1 + m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 m_ColorTemperature: 6570 m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 m_ShadowRadius: 0 m_ShadowAngle: 0 --- !u!1 &1804425771 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 1347579624763508, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 1347579624763508, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 1804425772} - component: {fileID: 1804425773} @@ -2884,9 +2824,10 @@ GameObject: --- !u!4 &1804425772 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 4648397159026360, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 4648397159026360, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1804425771} m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} m_LocalPosition: {x: 0, y: 5, z: 0} @@ -2898,17 +2839,20 @@ Transform: --- !u!108 &1804425773 Light: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 108790063669734454, guid: 43ad350a40367054ca51c3cb0d240eb8, + m_CorrespondingSourceObject: {fileID: 108790063669734454, guid: 43ad350a40367054ca51c3cb0d240eb8, type: 2} - m_PrefabInternal: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1804425771} m_Enabled: 1 - serializedVersion: 8 + serializedVersion: 10 m_Type: 1 + m_Shape: 0 m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 1 m_Range: 10 m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 m_CookieSize: 10 m_Shadows: m_Type: 2 @@ -2918,6 +2862,24 @@ Light: m_Bias: 0.05 m_NormalBias: 0.4 m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -2925,19 +2887,25 @@ Light: m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 + m_RenderingLayerMask: 1 m_Lightmapping: 4 + m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 m_ColorTemperature: 6570 m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 m_ShadowRadius: 0 m_ShadowAngle: 0 --- !u!1 &1913549274 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 1913549275} - component: {fileID: 1913549279} @@ -2954,8 +2922,9 @@ GameObject: --- !u!4 &1913549275 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1913549274} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0.5, z: 4.5} @@ -2968,21 +2937,23 @@ Transform: --- !u!114 &1913549276 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1913549274} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: bf19c800ac07f2347a6149846709dc15, type: 3} m_Name: m_EditorClassIdentifier: - Destination: {x: 0, y: 0, z: 0} - MinDistance: 1 + destination: {x: 0, y: 0, z: 0} + minDistance: 1 --- !u!23 &1913549277 MeshRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1913549274} m_Enabled: 1 m_CastShadows: 1 @@ -2991,6 +2962,10 @@ MeshRenderer: m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 m_Materials: - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} m_StaticBatchInfo: @@ -3000,6 +2975,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 + m_ReceiveGI: 1 m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 @@ -3012,11 +2988,13 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!65 &1913549278 BoxCollider: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1913549274} m_Material: {fileID: 0} m_IsTrigger: 0 @@ -3027,16 +3005,75 @@ BoxCollider: --- !u!33 &1913549279 MeshFilter: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1913549274} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1001 &1960535419 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 153878, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3} + propertyPath: m_Name + value: Teleporting + objectReference: {fileID: 0} + - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 475244, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 7a135b1a2cb9c8f488d4dd00c55ab283, type: 3} --- !u!1 &2042787372 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - component: {fileID: 2042787374} - component: {fileID: 2042787373} @@ -3050,16 +3087,19 @@ GameObject: --- !u!108 &2042787373 Light: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2042787372} m_Enabled: 1 - serializedVersion: 8 + serializedVersion: 10 m_Type: 1 + m_Shape: 0 m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 1 m_Range: 10 m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 m_CookieSize: 10 m_Shadows: m_Type: 2 @@ -3069,6 +3109,24 @@ Light: m_Bias: 0.05 m_NormalBias: 0.4 m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 m_Cookie: {fileID: 0} m_DrawHalo: 0 m_Flare: {fileID: 0} @@ -3076,18 +3134,24 @@ Light: m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 + m_RenderingLayerMask: 1 m_Lightmapping: 4 + m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 m_ColorTemperature: 6570 m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 m_ShadowRadius: 0 m_ShadowAngle: 0 --- !u!4 &2042787374 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2042787372} m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} m_LocalPosition: {x: 0, y: 3, z: 0} diff --git a/Assets/Scripts/ObjImport.meta b/Assets/Scripts/ObjImport.meta index d02be668..a92f76ba 100644 --- a/Assets/Scripts/ObjImport.meta +++ b/Assets/Scripts/ObjImport.meta @@ -1,3 +1,8 @@ -fileFormatVersion: 2 -guid: e13219550518426495bf40a9a0ec1076 -timeCreated: 1540641673 \ No newline at end of file +fileFormatVersion: 2 +guid: e13219550518426495bf40a9a0ec1076 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/ObjImport/FastObjImporter.cs b/Assets/Scripts/ObjImport/FastObjImporter.cs index 9cd3db90..54b00003 100644 --- a/Assets/Scripts/ObjImport/FastObjImporter.cs +++ b/Assets/Scripts/ObjImport/FastObjImporter.cs @@ -2,243 +2,277 @@ using System.Text; using UnityEngine; -namespace DefaultNamespace.ObjImport { - - /// - /// Kindly provided at http://wiki.unity3d.com/index.php/FastObjImporter - /// Modified version to work with web - /// - public sealed class FastObjImporter { - /* FastObjImporter.cs +namespace ObjImport +{ + /// + /// Kindly provided at http://wiki.unity3d.com/index.php/FastObjImporter + /// Modified version to work with web + /// + public sealed class FastObjImporter + { + /* FastObjImporter.cs * by Marc Kusters (Nighteyes) - * * Used for loading .obj files exported by Blender * Example usage: Mesh myMesh = FastObjImporter.Instance.ImportFile("path_to_obj_file.obj"); */ + #region singleton - #region singleton + // Singleton code + // Static can be called from anywhere without having to make an instance + private static FastObjImporter _instance; - // Singleton code - // Static can be called from anywhere without having to make an instance - private static FastObjImporter _instance; + // If called check if there is an instance, otherwise create it + public static FastObjImporter Instance + { + get { return _instance ??= new FastObjImporter(); } + } - // If called check if there is an instance, otherwise create it - public static FastObjImporter Instance - { - get { return _instance ?? (_instance = new FastObjImporter()); } - } + #endregion + + private List _triangles; + private List _vertices; + private List _uv; + private List _normals; + private List _faceData; + private List _intArray; + + private const int MIN_POW_10 = -16; + private const int MAX_POW_10 = 16; + private const int NUM_POWS_10 = MAX_POW_10 - MIN_POW_10 + 1; + private static readonly float[] Pow10 = GenerateLookupTable(); + + // Use this for initialization + public Mesh ImportFile(string text) + { + _triangles = new List(); + _vertices = new List(); + _uv = new List(); + _normals = new List(); + _faceData = new List(); + _intArray = new List(); + + LoadMeshData(text); + + var newVerts = new Vector3[_faceData.Count]; + var newUVs = new Vector2[_faceData.Count]; + var newNormals = new Vector3[_faceData.Count]; + + /* The following foreach loops through the facedata and assigns the appropriate vertex, uv, or normal + * for the appropriate Unity mesh array. + */ + for (var i = 0; i < _faceData.Count; i++) + { + newVerts[i] = _vertices[_faceData[i].X - 1]; + if (_faceData[i].Y >= 1) + newUVs[i] = _uv[_faceData[i].Y - 1]; + + if (_faceData[i].Z >= 1) + newNormals[i] = _normals[_faceData[i].Z - 1]; + } + + var mesh = new Mesh + { + vertices = newVerts, uv = newUVs, normals = newNormals, triangles = _triangles.ToArray() + }; + + + mesh.RecalculateBounds(); + //mesh.Optimize(); + + return mesh; + } - #endregion - - private List triangles; - private List vertices; - private List uv; - private List normals; - private List faceData; - private List intArray; - - private const int MIN_POW_10 = -16; - private const int MAX_POW_10 = 16; - private const int NUM_POWS_10 = MAX_POW_10 - MIN_POW_10 + 1; - private static readonly float[] pow10 = GenerateLookupTable(); - - // Use this for initialization - public Mesh ImportFile(string text) { - triangles = new List(); - vertices = new List(); - uv = new List(); - normals = new List(); - faceData = new List(); - intArray = new List(); - - LoadMeshData(text); - - Vector3[] newVerts = new Vector3[faceData.Count]; - Vector2[] newUVs = new Vector2[faceData.Count]; - Vector3[] newNormals = new Vector3[faceData.Count]; - - /* The following foreach loops through the facedata and assigns the appropriate vertex, uv, or normal - * for the appropriate Unity mesh array. - */ - for (int i = 0; i < faceData.Count; i++) { - newVerts[i] = vertices[faceData[i].x - 1]; - if (faceData[i].y >= 1) - newUVs[i] = uv[faceData[i].y - 1]; - - if (faceData[i].z >= 1) - newNormals[i] = normals[faceData[i].z - 1]; - } + private void LoadMeshData(string text) + { + var sb = new StringBuilder(); + var start = 0; + string objectName = null; + var faceDataCount = 0; - Mesh mesh = new Mesh(); + var sbFloat = new StringBuilder(); - mesh.vertices = newVerts; - mesh.uv = newUVs; - mesh.normals = newNormals; - mesh.triangles = triangles.ToArray(); + for (var i = 0; i < text.Length; i++) + { + if (text[i] != '\n') continue; - mesh.RecalculateBounds(); - //mesh.Optimize(); + sb.Remove(0, sb.Length); - return mesh; - } + // Start +1 for whitespace '\n' + sb.Append(text, start + 1, i - start); + start = i; - private void LoadMeshData(string text) { - - StringBuilder sb = new StringBuilder(); - int start = 0; - string objectName = null; - int faceDataCount = 0; - - StringBuilder sbFloat = new StringBuilder(); - - for (int i = 0; i < text.Length; i++) { - if (text[i] == '\n') { - sb.Remove(0, sb.Length); - - // Start +1 for whitespace '\n' - sb.Append(text, start + 1, i - start); - start = i; - - if (sb[0] == 'o' && sb[1] == ' ') { - sbFloat.Remove(0, sbFloat.Length); - int j = 2; - while (j < sb.Length) { - objectName += sb[j]; - j++; - } - } else if (sb[0] == 'v' && sb[1] == ' ') // Vertices - { - int splitStart = 2; - - vertices.Add(new Vector3(GetFloat(sb, ref splitStart, ref sbFloat), - GetFloat(sb, ref splitStart, ref sbFloat), GetFloat(sb, ref splitStart, ref sbFloat))); - } else if (sb[0] == 'v' && sb[1] == 't' && sb[2] == ' ') // UV - { - int splitStart = 3; - - uv.Add(new Vector2(GetFloat(sb, ref splitStart, ref sbFloat), - GetFloat(sb, ref splitStart, ref sbFloat))); - } else if (sb[0] == 'v' && sb[1] == 'n' && sb[2] == ' ') // Normals - { - int splitStart = 3; - - normals.Add(new Vector3(GetFloat(sb, ref splitStart, ref sbFloat), - GetFloat(sb, ref splitStart, ref sbFloat), GetFloat(sb, ref splitStart, ref sbFloat))); - } else if (sb[0] == 'f' && sb[1] == ' ') { - int splitStart = 2; - - int j = 1; - intArray.Clear(); - int info = 0; - // Add faceData, a face can contain multiple triangles, facedata is stored in following order vert, uv, normal. If uv or normal are / set it to a 0 - while (splitStart < sb.Length && char.IsDigit(sb[splitStart])) { - faceData.Add(new Vector3Int(GetInt(sb, ref splitStart, ref sbFloat), - GetInt(sb, ref splitStart, ref sbFloat), GetInt(sb, ref splitStart, ref sbFloat))); - j++; - - intArray.Add(faceDataCount); - faceDataCount++; - } - - info += j; - j = 1; - while (j + 2 < info - ) //Create triangles out of the face data. There will generally be more than 1 triangle per face. - { - triangles.Add(intArray[0]); - triangles.Add(intArray[j]); - triangles.Add(intArray[j + 1]); - - j++; - } - } - } + switch (sb[0]) + { + case 'o' when sb[1] == ' ': + { + sbFloat.Remove(0, sbFloat.Length); + var j = 2; + while (j < sb.Length) + { + objectName += sb[j]; + j++; } - } - private float GetFloat(StringBuilder sb, ref int start, ref StringBuilder sbFloat) { - sbFloat.Remove(0, sbFloat.Length); - while (start < sb.Length && - (char.IsDigit(sb[start]) || sb[start] == '-' || sb[start] == '.')) { - sbFloat.Append(sb[start]); - start++; + break; + } + // Vertices + case 'v' when sb[1] == ' ': + { + var splitStart = 2; + + _vertices.Add(new Vector3(GetFloat(sb, ref splitStart, ref sbFloat), + GetFloat(sb, ref splitStart, ref sbFloat), GetFloat(sb, ref splitStart, ref sbFloat))); + break; + } + // UV + case 'v' when sb[1] == 't' && sb[2] == ' ': + { + var splitStart = 3; + + _uv.Add(new Vector2(GetFloat(sb, ref splitStart, ref sbFloat), + GetFloat(sb, ref splitStart, ref sbFloat))); + break; + } + // Normals + case 'v' when sb[1] == 'n' && sb[2] == ' ': + { + var splitStart = 3; + + _normals.Add(new Vector3(GetFloat(sb, ref splitStart, ref sbFloat), + GetFloat(sb, ref splitStart, ref sbFloat), GetFloat(sb, ref splitStart, ref sbFloat))); + break; + } + case 'f' when sb[1] == ' ': + { + var splitStart = 2; + + var j = 1; + _intArray.Clear(); + var info = 0; + // Add faceData, a face can contain multiple triangles, facedata is stored in following order vert, uv, normal. If uv or normal are / set it to a 0 + while (splitStart < sb.Length && char.IsDigit(sb[splitStart])) + { + _faceData.Add(new Vector3Int(GetInt(sb, ref splitStart, ref sbFloat), + GetInt(sb, ref splitStart, ref sbFloat), GetInt(sb, ref splitStart, ref sbFloat))); + j++; + + _intArray.Add(faceDataCount); + faceDataCount++; } - start++; + info += j; + j = 1; + while (j + 2 < info + ) //Create triangles out of the face data. There will generally be more than 1 triangle per face. + { + _triangles.Add(_intArray[0]); + _triangles.Add(_intArray[j]); + _triangles.Add(_intArray[j + 1]); + + j++; + } - return ParseFloat(sbFloat); + break; + } } + } + } - private int GetInt(StringBuilder sb, ref int start, ref StringBuilder sbInt) { - sbInt.Remove(0, sbInt.Length); - while (start < sb.Length && - (char.IsDigit(sb[start]))) { - sbInt.Append(sb[start]); - start++; - } + private float GetFloat(StringBuilder sb, ref int start, ref StringBuilder sbFloat) + { + sbFloat.Remove(0, sbFloat.Length); + while (start < sb.Length && + (char.IsDigit(sb[start]) || sb[start] == '-' || sb[start] == '.')) + { + sbFloat.Append(sb[start]); + start++; + } - start++; + start++; - return IntParseFast(sbInt); - } + return ParseFloat(sbFloat); + } + private int GetInt(StringBuilder sb, ref int start, ref StringBuilder sbInt) + { + sbInt.Remove(0, sbInt.Length); + while (start < sb.Length && + (char.IsDigit(sb[start]))) + { + sbInt.Append(sb[start]); + start++; + } - private static float[] GenerateLookupTable() { - var result = new float[(-MIN_POW_10 + MAX_POW_10) * 10]; - for (int i = 0; i < result.Length; i++) - result[i] = (float) ((i / NUM_POWS_10) * - Mathf.Pow(10, i % NUM_POWS_10 + MIN_POW_10)); - return result; - } + start++; - private float ParseFloat(StringBuilder value) { - float result = 0; - bool negate = false; - int len = value.Length; - int decimalIndex = value.Length; - for (int i = len - 1; i >= 0; i--) - if (value[i] == '.') { - decimalIndex = i; - break; - } - - int offset = -MIN_POW_10 + decimalIndex; - for (int i = 0; i < decimalIndex; i++) - if (i != decimalIndex && value[i] != '-') - result += pow10[(value[i] - '0') * NUM_POWS_10 + offset - i - 1]; - else if (value[i] == '-') - negate = true; - for (int i = decimalIndex + 1; i < len; i++) - if (i != decimalIndex) - result += pow10[(value[i] - '0') * NUM_POWS_10 + offset - i]; - if (negate) - result = -result; - return result; - } + return IntParseFast(sbInt); + } - private int IntParseFast(StringBuilder value) { - // An optimized int parse method. - int result = 0; - for (int i = 0; i < value.Length; i++) { - result = 10 * result + (value[i] - 48); - } - return result; + private static float[] GenerateLookupTable() + { + var result = new float[(-MIN_POW_10 + MAX_POW_10) * 10]; + for (var i = 0; i < result.Length; i++) + result[i] = (float) i / NUM_POWS_10 * Mathf.Pow(10, i % NUM_POWS_10 + MIN_POW_10); + return result; + } + + private static float ParseFloat(StringBuilder value) + { + float result = 0; + var negate = false; + var len = value.Length; + var decimalIndex = value.Length; + for (var i = len - 1; i >= 0; i--) + if (value[i] == '.') + { + decimalIndex = i; + break; } + + var offset = -MIN_POW_10 + decimalIndex; + for (var i = 0; i < decimalIndex; i++) + if (i != decimalIndex && value[i] != '-') + result += Pow10[(value[i] - '0') * NUM_POWS_10 + offset - i - 1]; + else if (value[i] == '-') + negate = true; + for (var i = decimalIndex + 1; i < len; i++) + if (i != decimalIndex) + result += Pow10[(value[i] - '0') * NUM_POWS_10 + offset - i]; + if (negate) + result = -result; + return result; } - public sealed class Vector3Int { - public int x { get; set; } - public int y { get; set; } - public int z { get; set; } + private static int IntParseFast(StringBuilder value) + { + // An optimized int parse method. + var result = 0; + for (var i = 0; i < value.Length; i++) + { + result = 10 * result + (value[i] - 48); + } - public Vector3Int() { } + return result; + } + } - public Vector3Int(int x, int y, int z) { - this.x = x; - this.y = y; - this.z = z; - } + public sealed class Vector3Int + { + public int X { get; set; } + public int Y { get; set; } + public int Z { get; set; } + + public Vector3Int() + { + } + + public Vector3Int(int x, int y, int z) + { + X = x; + Y = y; + Z = z; } + } } \ No newline at end of file diff --git a/Assets/Scripts/ObjImport/ObjLoader.cs b/Assets/Scripts/ObjImport/ObjLoader.cs index 8e9a1902..ecc39846 100644 --- a/Assets/Scripts/ObjImport/ObjLoader.cs +++ b/Assets/Scripts/ObjImport/ObjLoader.cs @@ -2,70 +2,35 @@ using UnityEngine; using UnityEngine.Networking; -namespace DefaultNamespace.ObjImport { - public class ObjLoader : MonoBehaviour{ - - - - void Start() { - - } - - public void Load(string url) { - StartCoroutine(LoadModel(url)); - } - - private IEnumerator LoadModel(string url) { - Debug.Log("Loading "+url); - using (var request = UnityWebRequest.Get(url)) { - yield return request.SendWebRequest(); - if (!(request.isNetworkError || request.isHttpError)) { - Debug.Log(request.downloadHandler.text); - Mesh holderMesh = new Mesh(); - - holderMesh = FastObjImporter.Instance.ImportFile(request.downloadHandler.text); - - MeshRenderer renderer = gameObject.AddComponent(); - MeshFilter filter = gameObject.AddComponent(); - filter.mesh = holderMesh; - } else { - Debug.LogError(request.error); - } - } - } - - +namespace ObjImport +{ + public class ObjLoader : MonoBehaviour + { + public void Load(string url) + { + StartCoroutine(LoadModel(url)); + } + + private IEnumerator LoadModel(string url) + { + Debug.Log("Loading " + url); + using var request = UnityWebRequest.Get(url); + + yield return request.SendWebRequest(); + if (!(request.result == UnityWebRequest.Result.ConnectionError || + request.result == UnityWebRequest.Result.ProtocolError)) + { + Debug.Log(request.downloadHandler.text); + var holderMesh = FastObjImporter.Instance.ImportFile(request.downloadHandler.text); + + gameObject.AddComponent(); + var filter = gameObject.AddComponent(); + filter.mesh = holderMesh; + } + else + { + Debug.LogError(request.error); + } + } } - - /* - * private MeshRenderer _renderer; - - // Use this for initialization - void Start () { - _renderer = GetComponent(); - //StartCoroutine(LoadImage()); - } - - private IEnumerator LoadImage(string url) - { - Texture2D tex = new Texture2D(4, 4, TextureFormat.DXT1, false); - using (WWW www = new WWW(url)) - { - yield return www; - www.LoadImageIntoTexture(tex); - GetComponent().material.mainTexture = tex; - } - - _renderer.material.mainTexture = tex; - } - - /// - /// - /// - /// - public void ReloadImage(string url) - { - StartCoroutine(LoadImage(url)); - } - */ } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS.meta b/Assets/Scripts/Unibas/DBIS.meta index 2f6e8a8f..201cb7c0 100644 --- a/Assets/Scripts/Unibas/DBIS.meta +++ b/Assets/Scripts/Unibas/DBIS.meta @@ -1,3 +1,3 @@ -fileFormatVersion: 2 -guid: 7c4568b525c146d1819568ed95ef9836 -timeCreated: 1546810889 \ No newline at end of file +fileFormatVersion: 2 +guid: 76459217530d4b59b6965923f134c3ce +timeCreated: 1626864074 \ No newline at end of file diff --git a/Assets/DynamicModelling.meta b/Assets/Scripts/Unibas/DBIS/DynamicModelling.meta similarity index 100% rename from Assets/DynamicModelling.meta rename to Assets/Scripts/Unibas/DBIS/DynamicModelling.meta diff --git a/Assets/DynamicModelling/Scripts/ModelContainer.cs b/Assets/Scripts/Unibas/DBIS/DynamicModelling/ModelContainer.cs similarity index 51% rename from Assets/DynamicModelling/Scripts/ModelContainer.cs rename to Assets/Scripts/Unibas/DBIS/DynamicModelling/ModelContainer.cs index 37eb31ab..af933b5b 100644 --- a/Assets/DynamicModelling/Scripts/ModelContainer.cs +++ b/Assets/Scripts/Unibas/DBIS/DynamicModelling/ModelContainer.cs @@ -3,8 +3,8 @@ namespace Unibas.DBIS.DynamicModelling { - public class ModelContainer : MonoBehaviour - { - public IModel Model; - } + public class ModelContainer : MonoBehaviour + { + public IModel Model; + } } \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/ModelContainer.cs.meta b/Assets/Scripts/Unibas/DBIS/DynamicModelling/ModelContainer.cs.meta similarity index 100% rename from Assets/DynamicModelling/Scripts/ModelContainer.cs.meta rename to Assets/Scripts/Unibas/DBIS/DynamicModelling/ModelContainer.cs.meta diff --git a/Assets/Scripts/Unibas/DBIS/DynamicModelling/ModelFactory.cs b/Assets/Scripts/Unibas/DBIS/DynamicModelling/ModelFactory.cs new file mode 100644 index 00000000..5cc29831 --- /dev/null +++ b/Assets/Scripts/Unibas/DBIS/DynamicModelling/ModelFactory.cs @@ -0,0 +1,592 @@ +using System; +using Unibas.DBIS.DynamicModelling.Models; +using UnityEngine; + +namespace Unibas.DBIS.DynamicModelling +{ + public static class ModelFactory + { + /// + /// Quad of sorts: + /// + /// c---d + /// | | + /// a---b + /// + /// + /// + /// + /// + /// + /// + /// + public static GameObject CreateFreeformQuad(Vector3 a, Vector3 b, Vector3 c, Vector3 d, + Material material = null) + { + var go = new GameObject("FreeformQuad"); + var meshFilter = go.AddComponent(); + var meshRenderer = go.AddComponent(); + var mesh = meshFilter.mesh; + var vertices = new[] + { + a, b, c, d + }; + mesh.vertices = vertices; + + var tri = new int[6]; + + tri[0] = 0; + tri[1] = 2; + tri[2] = 1; + + tri[3] = 2; + tri[4] = 3; + tri[5] = 1; + + mesh.triangles = tri; + + /* + Vector3[] normals = new Vector3[4]; + + normals[0] = -Vector3.forward; + normals[1] = -Vector3.forward; + normals[2] = -Vector3.forward; + normals[3] = -Vector3.forward; + + mesh.normals = normals;*/ + + var uv = new Vector2[4]; + + /* + float xUnit = 1; + float yUnit = 1; + + if (width > height) + { + xUnit = width / height; + } + else + { + yUnit = height / width; + } + */ + + // TODO + + uv[0] = new Vector2(0, 0); + uv[1] = new Vector2(1, 0); + uv[2] = new Vector2(0, 1); + uv[3] = new Vector2(1, 1); + + mesh.uv = uv; + + mesh.RecalculateBounds(); + mesh.RecalculateNormals(); + mesh.RecalculateTangents(); + + if (material != null) + { + var mat = meshRenderer.material; + mat.CopyPropertiesFromMaterial(material); + //meshRenderer.material.SetTextureScale("_MainTex", new Vector2(1,1)); + mat.name = material.name + "(Instance)"; + } + else + { + meshRenderer.material = new Material(Shader.Find("Standard")); + meshRenderer.material.color = Color.white; + } + + + return go; + } + + /// + /// Creates a wall between two positions + /// + /// + /// + /// + /// + /// + public static GameObject CreatePositionedWall(Vector3 start, Vector3 end, float height, + string materialName = null) + { + var width = Vector3.Distance(start, end); + var a = Vector3.Angle(end - start, Vector3.right); + var go = new GameObject("PositionedWall"); + var wall = CreateWall(width, height, materialName); + + wall.transform.parent = go.transform; + wall.transform.position = Vector3.zero; + wall.transform.Rotate(Vector3.up, -a); + go.transform.position = start; + return go; + } + + public static GameObject CreateWall(WallModel model) + { + var width = Vector3.Distance(model.start, model.end); + var a = Vector3.Angle(model.start - model.end, Vector3.right); + var go = new GameObject("PositionedWall"); + var wall = CreateWall(width, model.height, model.material); + + wall.transform.parent = go.transform; + wall.transform.position = Vector3.zero; + wall.transform.Rotate(Vector3.up, -a); + go.transform.position = model.start; + go.AddComponent().Model = model; + return go; + } + + + /// + /// + /// + /// center of room + /// + /// + /// 0 floor, 1 ceiling, 2 north (pos z), 3 east (pos x), 4 south (neg z), 5 west (neg x) + /// + public static GameObject CreateCuboidRoom(Vector3 position, float size, float height, string[] materialNames) + { + var root = new GameObject("SquareRoom"); + + var halfSize = size / 2f; + + // North wall + var north = CreateWall(size, height, materialNames[2]); + north.name = "NorthWall"; + north.transform.parent = root.transform; + north.transform.position = new Vector3(-halfSize, 0, halfSize); + // East wall + var east = CreateWall(size, height, materialNames[3]); + east.name = "EastWall"; + east.transform.parent = root.transform; + east.transform.position = new Vector3(halfSize, 0, halfSize); + east.transform.Rotate(Vector3.up, 90); + // South wall + var south = CreateWall(size, height, materialNames[4]); + south.name = "SouthWall"; + south.transform.parent = root.transform; + south.transform.position = new Vector3(halfSize, 0, -halfSize); + south.transform.Rotate(Vector3.up, 180); + // West wall + var west = CreateWall(size, height, materialNames[5]); + west.name = "WestWall"; + west.transform.parent = root.transform; + west.transform.position = new Vector3(-halfSize, 0, -halfSize); + west.transform.Rotate(Vector3.up, 270); + + // Floor + var floorAnchor = new GameObject("FloorAnchor"); + floorAnchor.transform.parent = root.transform; + + var floor = CreateWall(size, size, materialNames[0]); + floor.name = "Floor"; + floor.transform.parent = floorAnchor.transform; + // North Aligned + floorAnchor.transform.position = new Vector3(-halfSize, 0, -halfSize); + floorAnchor.transform.Rotate(Vector3.right, 90); + // East Aligned + //floorAnchor.transform.position = new Vector3(-halfSize, 0, halfSize); + //floorAnchor.transform.Rotate(Vector3f.back,90); + + // Ceiling + var ceilingAnchor = new GameObject("CeilingAnchor"); + ceilingAnchor.transform.parent = root.transform; + + var ceiling = CreateWall(size, size, materialNames[1]); + ceiling.name = "Ceiling"; + ceiling.transform.parent = ceilingAnchor.transform; + + root.transform.position = position; + // North Aligned + ceilingAnchor.transform.position = new Vector3(halfSize, height, halfSize); + ceilingAnchor.transform.Rotate(Vector3.right, -90); + // East Aligned + //ceilingAnchor.transform.position = new Vector3(halfSize, height, -halfSize); + //ceilingAnchor.transform.Rotate( Vector3.back, -90); + + return root; + } + + public static GameObject CreateCuboidRoom(CuboidRoomModel model) + { + var root = new GameObject("CuboidRoom"); + + var halfSize = model.size / 2f; + + // North wall + var north = CreateWall(model.size, model.height, model.northMaterial); + north.name = "NorthWall"; + north.transform.parent = root.transform; + north.transform.position = new Vector3(-halfSize, 0, halfSize); + // East wall + var east = CreateWall(model.size, model.height, model.eastMaterial); + east.name = "EastWall"; + east.transform.parent = root.transform; + east.transform.position = new Vector3(halfSize, 0, halfSize); + east.transform.Rotate(Vector3.up, 90); + // South wall + var south = CreateWall(model.size, model.height, model.southMaterial); + south.name = "SouthWall"; + south.transform.parent = root.transform; + south.transform.position = new Vector3(halfSize, 0, -halfSize); + south.transform.Rotate(Vector3.up, 180); + // West wall + var west = CreateWall(model.size, model.height, model.westMaterial); + west.name = "WestWall"; + west.transform.parent = root.transform; + west.transform.position = new Vector3(-halfSize, 0, -halfSize); + west.transform.Rotate(Vector3.up, 270); + + // Floor + var floorAnchor = new GameObject("FloorAnchor"); + floorAnchor.transform.parent = root.transform; + + var floor = CreateWall(model.size, model.size, model.floorMaterial); + floor.name = "Floor"; + floor.transform.parent = floorAnchor.transform; + // North Aligned + floorAnchor.transform.position = new Vector3(-halfSize, 0, -halfSize); + floorAnchor.transform.Rotate(Vector3.right, 90); + // East Aligned + //floorAnchor.transform.position = new Vector3(-halfSize, 0, halfSize); + //floorAnchor.transform.Rotate(Vector3f.back,90); + + // Ceiling + var ceilingAnchor = new GameObject("CeilingAnchor"); + ceilingAnchor.transform.parent = root.transform; + + var ceiling = CreateWall(model.size, model.size, model.ceilingMaterial); + ceiling.name = "Ceiling"; + ceiling.transform.parent = ceilingAnchor.transform; + + + // North Aligned + ceilingAnchor.transform.position = new Vector3(-halfSize, model.height, halfSize); + ceilingAnchor.transform.Rotate(Vector3.right, -90); + // East Aligned + //ceilingAnchor.transform.position = new Vector3(halfSize, height, -halfSize); + //ceilingAnchor.transform.Rotate( Vector3.back, -90); + + root.transform.position = model.position; + + root.AddComponent().Model = model; + return root; + } + + + /// + /// Creates a wall game object to position later. + /// The wall is flat and always "upright", e.g. the normal of the mesh is negative z. + /// Use the resulting gameobject to rotate and re-position the wall. + /// + /// The width of the wall in Unity units + /// The height of the wall in Unity units + /// The wall's material name. Expects the material file to be at Resources/Materials/materalName. If no present, the word Material will be suffixed. + /// + public static GameObject CreateWall(float width, float height, string materialName = null) + { + return CreateWall(width, height, LoadMaterialByName(materialName)); + } + + private static Material LoadMaterialByName(string materialName) + { + if (!string.IsNullOrEmpty(materialName)) + { + if (!materialName.EndsWith("Material")) + { + materialName = materialName + "Material"; + } + + return Resources.Load("Materials/" + materialName); + } + + return null; + } + + public static GameObject CreateWall(float width, float height, Material mat = null) + { + var go = new GameObject("Wall"); + var meshFilter = go.AddComponent(); + var meshRenderer = go.AddComponent(); + var mesh = meshFilter.mesh; + var vertices = new Vector3[4]; + vertices[0] = new Vector3(0, 0, 0); + vertices[1] = new Vector3(width, 0, 0); + vertices[2] = new Vector3(0, height, 0); + vertices[3] = new Vector3(width, height, 0); + + mesh.vertices = vertices; + + var tri = new int[6]; + + tri[0] = 0; + tri[1] = 2; + tri[2] = 1; + + tri[3] = 2; + tri[4] = 3; + tri[5] = 1; + + mesh.triangles = tri; + + var normals = new Vector3[4]; + + normals[0] = -Vector3.forward; + normals[1] = -Vector3.forward; + normals[2] = -Vector3.forward; + normals[3] = -Vector3.forward; + + mesh.normals = normals; + + var uv = new Vector2[4]; + + float xUnit = 1; + float yUnit = 1; + + if (width > height) + { + xUnit = width / height; + } + else + { + yUnit = height / width; + } + + uv[0] = new Vector2(0, 0); + uv[1] = new Vector2(xUnit, 0); + uv[2] = new Vector2(0, yUnit); + uv[3] = new Vector2(xUnit, yUnit); + + mesh.uv = uv; + + mesh.RecalculateBounds(); + mesh.RecalculateNormals(); + mesh.RecalculateTangents(); + + if (mat != null) + { + var material = meshRenderer.material; + material.CopyPropertiesFromMaterial(mat); + //meshRenderer.material.SetTextureScale("_MainTex", new Vector2(1,1)); + material.name = mat.name; + } + else + { + meshRenderer.material = new Material(Shader.Find("Standard")); + meshRenderer.material.color = Color.white; + } + + // TODO Highly experimental! + + var boxCollider = go.AddComponent(); + boxCollider.size = new Vector3(width, height, 0.0001f); + + return go; + } + + + private static Vector3 CalculateUnit(Vector3 dimensions) + { + var m = Math.Max(Math.Max(dimensions.x, dimensions.y), dimensions.z); + return new Vector3(m / dimensions.x, m / dimensions.y, m / dimensions.z); + } + + private static Vector2 CalculateUnit(float width, float height) + { + return CalculateNormalizedToLeastSquareUnit(width, height); + } + + private static Vector2 CalculateNormalizedToLeastSquareUnit(float width, float height) + { + float xUnit = 1, + yUnit = 1; + + if (width > height) + { + xUnit = width / height; + } + else + { + yUnit = height / width; + } + + return new Vector2(xUnit, yUnit); + } + + private static Vector2 CalculateNormalizedToOneUnit(float width, float height) + { + return new Vector2(1f / width, 1f / height); + } + + public static GameObject CreateCuboid(CuboidModel cuboid) + { + var cub = CreateCuboid(cuboid.width, cuboid.height, cuboid.depth); + var meshRenderer = cub.GetComponent(); + if (cuboid.material != null) + { + meshRenderer.material.CopyPropertiesFromMaterial(cuboid.material); + } + else + { + var material = new Material(Shader.Find("Standard")); + meshRenderer.material = material; + material.name = "Default"; + material.color = Color.white; + } + + cub.AddComponent().Model = cuboid; + return cub; + } + + public static GameObject CreateCuboid(float width, float height, float depth) + { + var go = new GameObject("Cuboid"); + var meshFilter = go.AddComponent(); + var meshRenderer = go.AddComponent(); + var mesh = meshFilter.mesh; + + // The naming is always from the front and downwards looking! e.g. From the back, left and right is swapped + var frontLeftDown = Vector3.zero; + var frontRightDown = new Vector3(width, 0, 0); + var frontLeftUp = new Vector3(0, height, 0); + var frontRightUp = new Vector3(width, height, 0); + + var backLeftDown = new Vector3(0, 0, depth); + var backRightDown = new Vector3(width, 0, depth); + var backLeftUp = new Vector3(0, height, depth); + var backRightUp = new Vector3(width, height, depth); + + var vertices = new[] + { + // Front + frontLeftDown, frontRightDown, frontLeftUp, frontRightUp, + // Back + backLeftDown, backRightDown, backLeftUp, backRightUp, + // Left + backLeftDown, frontLeftDown, backLeftUp, frontLeftUp, + // Right + frontRightDown, backRightDown, frontRightUp, backRightUp, + // Up + frontLeftUp, frontRightUp, backLeftUp, backRightUp, + // Down + frontLeftDown, frontRightDown, backLeftDown, backRightDown + }; + mesh.vertices = vertices; + + var triangles = new[] + { + // Front + 0, 2, 1, 2, 3, 1, + // Back + 5, 7, 4, 7, 6, 4, + // Left + 8, 10, 9, 10, 11, 9, + // Right + 12, 14, 13, 14, 15, 13, + // Up + 16, 18, 17, 18, 19, 17, + // Down + 21, 23, 20, 23, 22, 20 + }; + mesh.triangles = triangles; + + var normals = new[] + { + // Front + -Vector3.forward, -Vector3.forward, -Vector3.forward, -Vector3.forward, + // Back + -Vector3.back, -Vector3.back, -Vector3.back, -Vector3.back, + // Left + -Vector3.left, -Vector3.left, -Vector3.left, -Vector3.left, + // Right + -Vector3.right, -Vector3.right, -Vector3.right, -Vector3.right, + // Up + -Vector3.up, -Vector3.up, -Vector3.up, -Vector3.up, + // Down + -Vector3.down, -Vector3.down, -Vector3.down, -Vector3.down + }; + mesh.normals = normals; + + + /* + * Unwrapping of mesh for uf like following + * U + * LFRB + * D + */ + + var u = Math.Min(Math.Min(width, height), depth); + // var w = width / u; + // var h = height / u; + // var d = depth / u; + + var uvUnits = new Vector2(u, u); + var fOff = uvUnits.x * depth; + var rOff = uvUnits.x * width + fOff; + var bOff = uvUnits.x * depth + rOff; + var uOff = uvUnits.y * depth + uvUnits.y * height; + var uv = new[] + { + // Front + new Vector2(fOff, uvUnits.y * depth), new Vector2(fOff + uvUnits.x * width, uvUnits.y * depth), + new Vector2(fOff, uvUnits.y * depth + uvUnits.y * height), + new Vector2(fOff + uvUnits.x * width, uvUnits.y * depth + uvUnits.y * height), + + // Back + new Vector2(bOff, uvUnits.y * depth), new Vector2(bOff + uvUnits.x * width, uvUnits.y * depth), + new Vector2(bOff, uvUnits.y * depth + uvUnits.y * height), + new Vector2(bOff + uvUnits.x * width, uvUnits.y * depth + uvUnits.y * height), + + // Left + new Vector2(0, uvUnits.y * depth), new Vector2(uvUnits.x * depth, uvUnits.y * depth), + new Vector2(0, uvUnits.y * depth + uvUnits.y * height), + new Vector2(uvUnits.x * depth, uvUnits.y * depth + uvUnits.y * height), + // Right + new Vector2(rOff, uvUnits.y * depth), new Vector2(rOff + uvUnits.x * depth, uvUnits.y * depth), + new Vector2(rOff, uvUnits.y * depth + uvUnits.y * height), + new Vector2(rOff + uvUnits.x * depth, uvUnits.y * depth + uvUnits.y * height), + // Up + new Vector2(fOff, uOff), new Vector2(fOff + uvUnits.x * width, uOff), + new Vector2(fOff, uOff + uvUnits.y * depth), + new Vector2(fOff + uvUnits.x * width, uOff + uvUnits.y * depth), + + // Down + new Vector2(fOff, 0), new Vector2(fOff + uvUnits.x * width, 0), new Vector2(fOff, uvUnits.y * depth), + new Vector2(fOff + uvUnits.x * width, uvUnits.y * depth) + }; + + mesh.uv = uv; + + mesh.RecalculateBounds(); + mesh.RecalculateNormals(); + mesh.RecalculateTangents(); + + var material = new Material(Shader.Find("Standard")); + meshRenderer.material = material; + material.name = "Default"; + material.color = Color.green; + + return go; + } + + public static GameObject CreateModel(ComplexCuboidModel model) + { + var root = new GameObject("ComplexCuboid"); + for (var i = 0; i < model.Size(); i++) + { + var pos = model.GetPositionAt(i); + var cuboid = model.GetCuboidAt(i); + var cub = CreateCuboid(cuboid); + cub.transform.parent = root.transform; + cub.transform.position = pos; + } + + root.AddComponent().Model = model; + return root; + } + } +} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/ModelFactory.cs.meta b/Assets/Scripts/Unibas/DBIS/DynamicModelling/ModelFactory.cs.meta similarity index 100% rename from Assets/DynamicModelling/Scripts/ModelFactory.cs.meta rename to Assets/Scripts/Unibas/DBIS/DynamicModelling/ModelFactory.cs.meta diff --git a/Assets/DynamicModelling/Scripts/Models.meta b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models.meta similarity index 100% rename from Assets/DynamicModelling/Scripts/Models.meta rename to Assets/Scripts/Unibas/DBIS/DynamicModelling/Models.meta diff --git a/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/ComplexCuboidModel.cs b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/ComplexCuboidModel.cs new file mode 100644 index 00000000..6c67ed78 --- /dev/null +++ b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/ComplexCuboidModel.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace Unibas.DBIS.DynamicModelling.Models +{ + /// + /// Represents a complex model, based on cuboids. + /// Each cuboid has a position relative to the model's origin. + /// + /// This class is basically a list of (pos, cuboidmodel) tuples. + /// + [Serializable] + public class ComplexCuboidModel : IModel + { + private List _positions = new List(); + private List _cuboids = new List(); + + public ComplexCuboidModel(Vector3[] positions, CuboidModel[] models) + { + if (positions.Length != models.Length) + { + throw new ArgumentException("Must have equal amount of positions and cuboids"); + } + + _positions.AddRange(positions); + _cuboids.AddRange(models); + } + + public ComplexCuboidModel() + { + } + + public void Add(Vector3 position, CuboidModel cuboid) + { + _positions.Add(position); + _cuboids.Add(cuboid); + } + + public Vector3 GetPositionAt(int index) + { + return _positions[index]; + } + + public CuboidModel GetCuboidAt(int index) + { + return _cuboids[index]; + } + + public int Size() + { + return _positions.Count; + } + + public bool IsEmpty() + { + return _cuboids.Count == 0; + } + } +} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/Models/ComplexCuboidModel.cs.meta b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/ComplexCuboidModel.cs.meta similarity index 100% rename from Assets/DynamicModelling/Scripts/Models/ComplexCuboidModel.cs.meta rename to Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/ComplexCuboidModel.cs.meta diff --git a/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/CuboidModel.cs b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/CuboidModel.cs new file mode 100644 index 00000000..0ddae3dd --- /dev/null +++ b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/CuboidModel.cs @@ -0,0 +1,51 @@ +using UnityEngine; + +namespace Unibas.DBIS.DynamicModelling.Models +{ + /// + /// Abstract cuboid representation. + /// A cuboid consists of three parameters: + /// Width, Height and Depth. + /// In Unity3d these parameters are along the x, y and z axis. + /// + /// + [System.Serializable] + public class CuboidModel : IModel + { + /// + /// The width of the cuboid (along the X axis) in standard units. + /// + public float width; + + /// + /// The height of the cuboid (along the Y axis) in standard units. + /// + public float height; + + /// + /// The depth of the cuboid (along the Z axis) in standard units. + /// + public float depth; + + /// + /// The cuboid's material, iff any. + /// + public Material material; + + /// + /// Creates a new cuboid based on its width, height and depth. + /// Also optionally with a material + /// + /// The width of the cuboid in standard units. Width is along the x axis. + /// The height of the cuboid in standard units. Height is along the y axis. + /// The depth of the cuboid in standard units. Depth is along the z axis. + /// The optional material of the cuboid. Otherwise it will be white + public CuboidModel(float width, float height, float depth, Material material = null) + { + this.width = width; + this.height = height; + this.depth = depth; + this.material = material; + } + } +} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/Models/CuboidModel.cs.meta b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/CuboidModel.cs.meta similarity index 100% rename from Assets/DynamicModelling/Scripts/Models/CuboidModel.cs.meta rename to Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/CuboidModel.cs.meta diff --git a/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/CuboidRoomModel.cs b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/CuboidRoomModel.cs new file mode 100644 index 00000000..a18b66d6 --- /dev/null +++ b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/CuboidRoomModel.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace Unibas.DBIS.DynamicModelling.Models +{ + [System.Serializable] + public class CuboidRoomModel : IModel + { + public Vector3 position; + public float size; + public float height; + + public Material floorMaterial; + public Material ceilingMaterial; + public Material northMaterial; + public Material eastMaterial; + public Material southMaterial; + public Material westMaterial; + + public CuboidRoomModel(Vector3 position, float size, float height) + { + this.position = position; + this.size = size; + this.height = height; + } + + public CuboidRoomModel(Vector3 position, float size, float height, Material floorMaterial = null, + Material ceilingMaterial = null, Material northMaterial = null, Material eastMaterial = null, + Material southMaterial = null, Material westMaterial = null) + { + this.position = position; + this.size = size; + this.height = height; + this.floorMaterial = floorMaterial; + this.ceilingMaterial = ceilingMaterial; + this.northMaterial = northMaterial; + this.eastMaterial = eastMaterial; + this.southMaterial = southMaterial; + this.westMaterial = westMaterial; + } + } +} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/Models/CuboidRoomModel.cs.meta b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/CuboidRoomModel.cs.meta similarity index 100% rename from Assets/DynamicModelling/Scripts/Models/CuboidRoomModel.cs.meta rename to Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/CuboidRoomModel.cs.meta diff --git a/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/IModel.cs b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/IModel.cs new file mode 100644 index 00000000..2f6f43e0 --- /dev/null +++ b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/IModel.cs @@ -0,0 +1,6 @@ +namespace Unibas.DBIS.DynamicModelling.Models +{ + public interface IModel + { + } +} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/Models/IModel.cs.meta b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/IModel.cs.meta similarity index 100% rename from Assets/DynamicModelling/Scripts/Models/IModel.cs.meta rename to Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/IModel.cs.meta diff --git a/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/PolygonRoomModel.cs b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/PolygonRoomModel.cs new file mode 100644 index 00000000..5bc71282 --- /dev/null +++ b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/PolygonRoomModel.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace Unibas.DBIS.DynamicModelling.Models +{ + [System.Serializable] + public class PolygonRoomModel : IModel + { + public Vector3 position; + private List _walls; + public Material floorMaterial; + public Material ceilingMaterial; + + public PolygonRoomModel(Vector3 position, List walls, Material floorMaterial, Material ceilingMaterial) + { + this.position = position; + _walls = walls; + this.floorMaterial = floorMaterial; + this.ceilingMaterial = ceilingMaterial; + } + + public WallModel[] GetWalls() + { + return _walls.ToArray(); + } + + public WallModel GetWallAt(int index) + { + return _walls[index]; + } + + public void Add(WallModel model) + { + _walls.Add(model); + } + } +} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/Models/PolygonRoomModel.cs.meta b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/PolygonRoomModel.cs.meta similarity index 100% rename from Assets/DynamicModelling/Scripts/Models/PolygonRoomModel.cs.meta rename to Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/PolygonRoomModel.cs.meta diff --git a/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/WallModel.cs b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/WallModel.cs new file mode 100644 index 00000000..ce26bbb1 --- /dev/null +++ b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/WallModel.cs @@ -0,0 +1,37 @@ +using UnityEngine; + +namespace Unibas.DBIS.DynamicModelling.Models +{ + [System.Serializable] + public class WallModel : IModel + { + public Vector3 start; + public Vector3 end; + public float height; + public Material material; + + public WallModel(Vector3 start, Vector3 end, float height, Material material = null) + { + this.start = start; + this.end = end; + this.height = height; + this.material = material; + } + + public WallModel(Vector3 position, float width, float height, Material material = null) + { + start = position; + end = position + Vector3.right * width; + this.height = height; + this.material = material; + } + + public WallModel(float width, float height, Material material = null) + { + start = Vector3.zero; + end = Vector3.right * width; + this.height = height; + this.material = material; + } + } +} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/Models/WallModel.cs.meta b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/WallModel.cs.meta similarity index 100% rename from Assets/DynamicModelling/Scripts/Models/WallModel.cs.meta rename to Assets/Scripts/Unibas/DBIS/DynamicModelling/Models/WallModel.cs.meta diff --git a/Assets/DynamicModelling/Scripts/Objects.meta b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Objects.meta similarity index 100% rename from Assets/DynamicModelling/Scripts/Objects.meta rename to Assets/Scripts/Unibas/DBIS/DynamicModelling/Objects.meta diff --git a/Assets/Scripts/Unibas/DBIS/DynamicModelling/Objects/CuboidObject.cs b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Objects/CuboidObject.cs new file mode 100644 index 00000000..f756be5d --- /dev/null +++ b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Objects/CuboidObject.cs @@ -0,0 +1,219 @@ +using System; +using UnityEngine; + +namespace Unibas.DBIS.DynamicModelling.Objects +{ + /// + /// Custom cuboid model. + /// This model's size is actually the one specified, in unity units.
+ /// In contrast, the vanilla unity cube object has to be resized, which this one doesn't, to get other shapes than a cube.
+ /// + /// Note The material is copied, so modifications on the material are not reflected at runtime. + /// + /// + /// UV Mapping is based on the smallest dimension, e.g. depending on the texture, further adjustments are required.
+ /// This can be achieved by accessing the MeshRenderer via GetComponent.
+ /// + /// If this object's dimensions are changed during runtime, the caller has to call GenerateModel() afterwards, + /// to reflect the changes on the model. + ///
+ [RequireComponent(typeof(MeshRenderer), typeof(MeshFilter), typeof(BoxCollider))] + public class CuboidObject : MonoBehaviour, IObject + { + /// + /// Creates a cuboid object with the specified dimensions and an optional material parameter + /// + /// The width in unity units. Width is along the x axis. + /// The height in unity units. Height is along the y axis. + /// The depth in unity units. Depth is along the z axis. + /// The material to use (defaults to white) + /// A gameobject whose mesh and collider represent a cuboid with the specified dimensions. + public static CuboidObject Create(float width, float height, float depth, Material material = null) + { + var go = new GameObject("CuboidObject"); + var co = go.AddComponent(); + co.width = width; + co.height = height; + co.depth = depth; + co.material = material; + return co; + } + + /// + /// The width in unity units. Width is along the x axis. + /// + public float width; + + /// + /// The height in unity units. Height is along the y axis. + /// + public float height; + + /// + /// The depth in untiy units. Depth is along the z axis. + /// + public float depth; + + /// + /// The material to use for texturing this cuboid. + /// Be aware that while drag'n'drop a material to this gameobject works in the scene view, + /// it is not the same and this material will always override the one from the inspector. + /// Use null if you want the default object material. + /// + public Material material; + + private void OnValidate() + { + GenerateModel(); + } + + private void Start() + { + GenerateModel(); + } + + /// + /// Generates the mesh based on the object's configuration + /// + public void GenerateModel() + { + var meshFilter = GetComponent(); // No null value due to RequireComponent statements + var meshRenderer = GetComponent(); + var mesh = meshFilter.mesh; + + // The naming is always from the front and downwards looking! e.g. From the back, left and right is swapped + var frontLeftDown = Vector3.zero; + var frontRightDown = new Vector3(width, 0, 0); + var frontLeftUp = new Vector3(0, height, 0); + var frontRightUp = new Vector3(width, height, 0); + + var backLeftDown = new Vector3(0, 0, depth); + var backRightDown = new Vector3(width, 0, depth); + var backLeftUp = new Vector3(0, height, depth); + var backRightUp = new Vector3(width, height, depth); + + var vertices = new[] + { + // Front + frontLeftDown, frontRightDown, frontLeftUp, frontRightUp, + // Back + backLeftDown, backRightDown, backLeftUp, backRightUp, + // Left + backLeftDown, frontLeftDown, backLeftUp, frontLeftUp, + // Right + frontRightDown, backRightDown, frontRightUp, backRightUp, + // Up + frontLeftUp, frontRightUp, backLeftUp, backRightUp, + // Down + frontLeftDown, frontRightDown, backLeftDown, backRightDown + }; + mesh.vertices = vertices; + + var triangles = new[] + { + // Front + 0, 2, 1, 2, 3, 1, + // Back + 5, 7, 4, 7, 6, 4, + // Left + 8, 10, 9, 10, 11, 9, + // Right + 12, 14, 13, 14, 15, 13, + // Up + 16, 18, 17, 18, 19, 17, + // Down + 21, 23, 20, 23, 22, 20 + }; + mesh.triangles = triangles; + + var normals = new[] + { + // Front + -Vector3.forward, -Vector3.forward, -Vector3.forward, -Vector3.forward, + // Back + -Vector3.back, -Vector3.back, -Vector3.back, -Vector3.back, + // Left + -Vector3.left, -Vector3.left, -Vector3.left, -Vector3.left, + // Right + -Vector3.right, -Vector3.right, -Vector3.right, -Vector3.right, + // Up + -Vector3.up, -Vector3.up, -Vector3.up, -Vector3.up, + // Down + -Vector3.down, -Vector3.down, -Vector3.down, -Vector3.down + }; + mesh.normals = normals; + + + /* + * Unwrapping of mesh for uf like following + * U + * LFRB + * D + */ + + var u = Math.Min(Math.Min(width, height), depth); + // var w = width / u; + // var h = height / u; + // var d = depth / u; + + var uvUnits = new Vector2(u, u); + var fOff = uvUnits.x * depth; + var rOff = uvUnits.x * width + fOff; + var bOff = uvUnits.x * depth + rOff; + var uOff = uvUnits.y * depth + uvUnits.y * height; + var uv = new[] + { + // Front + new Vector2(fOff, uvUnits.y * depth), new Vector2(fOff + uvUnits.x * width, uvUnits.y * depth), + new Vector2(fOff, uvUnits.y * depth + uvUnits.y * height), + new Vector2(fOff + uvUnits.x * width, uvUnits.y * depth + uvUnits.y * height), + + // Back + new Vector2(bOff, uvUnits.y * depth), new Vector2(bOff + uvUnits.x * width, uvUnits.y * depth), + new Vector2(bOff, uvUnits.y * depth + uvUnits.y * height), + new Vector2(bOff + uvUnits.x * width, uvUnits.y * depth + uvUnits.y * height), + + // Left + new Vector2(0, uvUnits.y * depth), new Vector2(uvUnits.x * depth, uvUnits.y * depth), + new Vector2(0, uvUnits.y * depth + uvUnits.y * height), + new Vector2(uvUnits.x * depth, uvUnits.y * depth + uvUnits.y * height), + // Right + new Vector2(rOff, uvUnits.y * depth), new Vector2(rOff + uvUnits.x * depth, uvUnits.y * depth), + new Vector2(rOff, uvUnits.y * depth + uvUnits.y * height), + new Vector2(rOff + uvUnits.x * depth, uvUnits.y * depth + uvUnits.y * height), + // Up + new Vector2(fOff, uOff), new Vector2(fOff + uvUnits.x * width, uOff), + new Vector2(fOff, uOff + uvUnits.y * depth), + new Vector2(fOff + uvUnits.x * width, uOff + uvUnits.y * depth), + + // Down + new Vector2(fOff, 0), new Vector2(fOff + uvUnits.x * width, 0), new Vector2(fOff, uvUnits.y * depth), + new Vector2(fOff + uvUnits.x * width, uvUnits.y * depth) + }; + + mesh.uv = uv; + + mesh.RecalculateBounds(); + mesh.RecalculateNormals(); + mesh.RecalculateTangents(); + + if (material == null) + { + var mat = new Material(Shader.Find("Standard")); + meshRenderer.material = mat; + mat.name = "Default"; + mat.color = Color.green; + } + else + { + Material mat; + (mat = meshRenderer.material).CopyPropertiesFromMaterial(material); + mat.name = material.name + " (Copy)"; + } + + var col = GetComponent(); + col.center = new Vector3(width / 2, height / 2, depth / 2); + col.size = new Vector3(width, height, depth); + } + } +} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/Objects/CuboidObject.cs.meta b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Objects/CuboidObject.cs.meta similarity index 100% rename from Assets/DynamicModelling/Scripts/Objects/CuboidObject.cs.meta rename to Assets/Scripts/Unibas/DBIS/DynamicModelling/Objects/CuboidObject.cs.meta diff --git a/Assets/Scripts/Unibas/DBIS/DynamicModelling/Objects/IObject.cs b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Objects/IObject.cs new file mode 100644 index 00000000..ff66229e --- /dev/null +++ b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Objects/IObject.cs @@ -0,0 +1,9 @@ +namespace Unibas.DBIS.DynamicModelling.Objects +{ + // TODO Rename to something with model, maybe even abstract class instead of interface + + public interface IObject + { + void GenerateModel(); + } +} \ No newline at end of file diff --git a/Assets/DynamicModelling/Scripts/Objects/IObject.cs.meta b/Assets/Scripts/Unibas/DBIS/DynamicModelling/Objects/IObject.cs.meta similarity index 100% rename from Assets/DynamicModelling/Scripts/Objects/IObject.cs.meta rename to Assets/Scripts/Unibas/DBIS/DynamicModelling/Objects/IObject.cs.meta diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Core/ExhibitionManager.cs b/Assets/Scripts/Unibas/DBIS/VREP/Core/ExhibitionManager.cs index e1967b72..daa252cc 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/Core/ExhibitionManager.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/Core/ExhibitionManager.cs @@ -1,168 +1,169 @@ using System.Collections.Generic; -using DefaultNamespace; -using DefaultNamespace.VREM.Model; +using Unibas.DBIS.VREP.Utils; +using Unibas.DBIS.VREP.VREM.Model; using Unibas.DBIS.VREP.World; using UnityEngine; -using World; namespace Unibas.DBIS.VREP.Core { - public class ExhibitionManager + /// + /// Exhibition manager to create and load exhibitions from model exhibitions to actual VR exhibitions. + /// + public class ExhibitionManager + { + private Exhibition _exhibition; + private List _rooms = new List(); + + public ExhibitionManager(Exhibition exhibition) { - private Exhibition _exhibition; + _exhibition = exhibition; + } - public ExhibitionManager(Exhibition exhibition) - { - this._exhibition = exhibition; - } + public CuboidExhibitionRoom GetRoomByIndex(int index) + { + return _rooms[index]; + } - private List _rooms = new List(); + /// + /// Restores all exhibits of the currently loaded exhibition. + /// + public void RestoreExhibits() + { + _rooms.ForEach(r => r.RestoreWallExhibits()); + } - public CuboidExhibitionRoom GetRoomByIndex(int index) - { - return _rooms[index]; - } + private int GetNextRoomIndex(int pos) + { + return (pos + 1) % _exhibition.rooms.Length; + } - public void RestoreExhibits() { - _rooms.ForEach(r => r.RestoreWallExhibits()); - } + private int GetPreviousRoomIndex(int pos) + { + return (pos - 1 + _exhibition.rooms.Length) % _exhibition.rooms.Length; + } - private int GetNextRoomIndex(int pos) + private int GetRoomIndex(Room room) + { + for (var i = 0; i < _exhibition.rooms.Length; i++) + { + if (room.Equals(_exhibition.rooms[i])) { - return (pos + 1) % _exhibition.rooms.Length; + return i; } + } - private int GetPreviousRoomIndex(int pos) - { - return (pos - 1 + _exhibition.rooms.Length) % _exhibition.rooms.Length; - } + return -1; + } - private int GetRoomIndex(DefaultNamespace.VREM.Model.Room room) - { - for (int i = 0; i < _exhibition.rooms.Length; i++) - { - if (room.Equals(_exhibition.rooms[i])) - { - return i; - } - } - - return -1; - } + private Room GetNext(Room room) + { + var pos = GetRoomIndex(room); - private DefaultNamespace.VREM.Model.Room GetNext(DefaultNamespace.VREM.Model.Room room) - { - var pos = GetRoomIndex(room); - if (pos == -1) - { - // TODO This should not happen - return null; - } - - return _exhibition.rooms[GetNextRoomIndex(pos)]; - } + return _exhibition.rooms[GetNextRoomIndex(pos)]; + } - private DefaultNamespace.VREM.Model.Room GetPrevious(DefaultNamespace.VREM.Model.Room room) + private Room GetPrevious(Room room) + { + var pos = GetRoomIndex(room); + + return _exhibition.rooms[GetPreviousRoomIndex(pos)]; + } + + /// + /// Creates and loads the exhibition from the Exhibition model object currently stored. + /// This includes building all rooms with their walls and generating displayals from exhibits. + /// + public void GenerateExhibition() + { + foreach (var room in _exhibition.rooms) + { + var roomGameObject = ObjectFactory.BuildRoom(room); + var exhibitionRoom = roomGameObject.GetComponent(); + _rooms.Add(exhibitionRoom); + + if (VrepController.Instance.settings.CeilingLogoEnabled) { - var pos = GetRoomIndex(room); - if (pos == -1) - { - // TODO This should not happen - return null; - } - - return _exhibition.rooms[GetPreviousRoomIndex(pos)]; + var pref = Resources.Load("Objects/unibas"); + var logo = Object.Instantiate(pref, exhibitionRoom.transform, false); + + logo.name = "UnibasLogo"; + logo.transform.localPosition = new Vector3(-1.493f, room.size.y - .01f, 3.35f); // manually found values + logo.transform.localRotation = Quaternion.Euler(new Vector3(90, 180)); + logo.transform.localScale = Vector3.one * 10000; } - public void GenerateExhibition() + if (VrepController.Instance.settings.WallTimerCount > 0) { - foreach (var room in _exhibition.rooms) - { - var roomGameObject = ObjectFactory.BuildRoom(room); - var exhibitionRoom = roomGameObject.GetComponent(); - _rooms.Add(exhibitionRoom); - - if (VREPController.Instance.Settings.CeilingLogoEnabled) - { - GameObject pref = Resources.Load("Objects/unibas"); - var logo = GameObject.Instantiate(pref); - logo.name = "UnibasLogo"; - logo.transform.SetParent(exhibitionRoom.transform, false); - //logo.transform.localPosition = new Vector3(-1.493f, room.size.y-.01f, -0.642f); // manually found values - logo.transform.localPosition = - new Vector3(-1.493f, room.size.y - .01f, 3.35f); // manually found values - logo.transform.localRotation = Quaternion.Euler(new Vector3(90, 180)); - logo.transform.localScale = Vector3.one * 10000; - } - if (VREPController.Instance.Settings.WallTimerCount > 0) - { - GameObject obj = new GameObject("Timer"); - obj.transform.SetParent(exhibitionRoom.transform, false); - obj.transform.localPosition = - new Vector3(-room.size.x/2 + 0.2f, room.size.y - 0.2f, room.size.z/2); // manually found values - obj.transform.localScale = Vector3.one * 0.05f; - TextMesh textMesh = obj.AddComponent(); - textMesh.fontSize = 150; - Countdown timer = obj.AddComponent(); - timer.countdown = textMesh; - timer.initTime = VREPController.Instance.Settings.WallTimerCount; - obj.transform.GetComponent().enabled = false; - } - } - - // For teleporting, each room needs to be created. - foreach (var room in _rooms) - { - CreateAndAttachTeleporters(room); - } - } + var obj = new GameObject("Timer"); + obj.transform.SetParent(exhibitionRoom.transform, false); + obj.transform.localPosition = + new Vector3(-room.size.x / 2 + 0.2f, room.size.y - 0.2f, room.size.z / 2); // manually found values + obj.transform.localScale = Vector3.one * 0.05f; + var textMesh = obj.AddComponent(); + textMesh.fontSize = 150; - private void CreateAndAttachTeleporters(CuboidExhibitionRoom room) - { - var index = GetRoomIndex(room.RoomData); - var next = _rooms[GetNextRoomIndex(index)]; - var prev = _rooms[GetPreviousRoomIndex(index)]; - - var nd = next.GetEntryPoint(); - var pd = prev.GetEntryPoint(); - - var backPos = new Vector3(-.25f, 0, .2f); - var nextPos = new Vector3(.25f, 0, .2f); - - // TODO Configurable TPBtnModel - var model = new SteamVRTeleportButton.TeleportButtonModel(0.1f, .02f, 1f, - TexturingUtility.LoadMaterialByName("none"), - TexturingUtility.LoadMaterialByName("NMetal"), TexturingUtility.LoadMaterialByName("NPlastic")); - - if (_exhibition.rooms.Length > 1) - { - // back teleporter - var backTpBtn = SteamVRTeleportButton.Create(room.gameObject, backPos, pd, model - , - Resources.Load("Sprites/UI/chevron-left")); - - backTpBtn.OnTeleportStart = room.OnRoomLeave; - backTpBtn.OnTeleportEnd = prev.OnRoomEnter; - - // back teleporter - var nextTpBtn = SteamVRTeleportButton.Create(room.gameObject, nextPos, nd, - model, - Resources.Load("Sprites/UI/chevron-right")); - - nextTpBtn.OnTeleportStart = room.OnRoomLeave; - nextTpBtn.OnTeleportEnd = next.OnRoomEnter; - } - - - if (VREPController.Instance.Settings.StartInLobby) - { - var lobbyTpBtn = SteamVRTeleportButton.Create(room.gameObject, new Vector3(0, 0, .2f), - VREPController.Instance.LobbySpawn, - model, - "Lobby"); - lobbyTpBtn.OnTeleportStart = room.OnRoomLeave; - } + var timer = obj.AddComponent(); + timer.countdown = textMesh; + timer.initTime = VrepController.Instance.settings.WallTimerCount; + + obj.transform.GetComponent().enabled = false; } + } + + // For teleporting, each room needs to be created. + foreach (var room in _rooms) + { + CreateAndAttachTeleporters(room); + } + } + + /// + /// Attaches teleporters to a previously generated CuboidExhibitionRoom for an exhibition. + /// To properly navigate rooms, this includes one forward teleporter into the next room + /// and one backward teleporter to the previous room. + /// + /// The CuboidExhibitionRoom to generate the teleporters for. + private void CreateAndAttachTeleporters(CuboidExhibitionRoom room) + { + var index = GetRoomIndex(room.RoomData); + var next = _rooms[GetNextRoomIndex(index)]; + var prev = _rooms[GetPreviousRoomIndex(index)]; + + var nd = next.GetEntryPoint(); + var pd = prev.GetEntryPoint(); + + var backPos = new Vector3(-.25f, 0, .2f); + var nextPos = new Vector3(.25f, 0, .2f); + + // TODO Configurable TPBtnModel. + var model = new SteamVRTeleportButton.TeleportButtonModel(0.1f, .02f, 1f, null, + TexturingUtility.LoadMaterialByName("NMetal"), TexturingUtility.LoadMaterialByName("NPlastic")); + + if (_exhibition.rooms.Length > 1) + { + // Back teleporter. + var backTpBtn = SteamVRTeleportButton.Create(room.gameObject, backPos, pd, model, + Resources.Load("Sprites/UI/chevron-left")); + + backTpBtn.OnTeleportStart = room.OnRoomLeave; + backTpBtn.OnTeleportEnd = prev.OnRoomEnter; + + // Forward teleporter. + var nextTpBtn = SteamVRTeleportButton.Create(room.gameObject, nextPos, nd, model, + Resources.Load("Sprites/UI/chevron-right")); + + nextTpBtn.OnTeleportStart = room.OnRoomLeave; + nextTpBtn.OnTeleportEnd = next.OnRoomEnter; + } + + // If we start in the lobby, also allow the user to teleport back to the lobby. + if (VrepController.Instance.settings.StartInLobby) + { + var lobbyTpBtn = SteamVRTeleportButton.Create(room.gameObject, new Vector3(0, 0, .2f), + VrepController.Instance.lobbySpawn, model, "Lobby"); + lobbyTpBtn.OnTeleportStart = room.OnRoomLeave; + } } + } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Core/Sandbox.cs b/Assets/Scripts/Unibas/DBIS/VREP/Core/Sandbox.cs index 80597ef4..9a8db838 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/Core/Sandbox.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/Core/Sandbox.cs @@ -1,46 +1,41 @@ -using UnityEngine; -using World; -using Wall = DefaultNamespace.VREM.Model.Wall; +using Unibas.DBIS.VREP.VREM.Model; +using Unibas.DBIS.VREP.World; +using UnityEngine; -namespace DefaultNamespace { - public class Sandbox : MonoBehaviour { +namespace Unibas.DBIS.VREP.Core +{ + /// + /// Sandbox component to test things. + /// + public class Sandbox : MonoBehaviour + { + public bool isEnabled; - public bool Enabled; - - void Start() { - if (Enabled) { + private void Start() + { + if (isEnabled) + { TestObjectFactory(); } - } - private void TestObjectFactory() { - var nw = new VREM.Model.Wall(); - nw.direction = "NORTH"; - nw.texture = "NBricks"; - var ew = new VREM.Model.Wall(); - ew.direction = "EAST"; - ew.texture = "LimeBricks"; - var sw = new VREM.Model.Wall(); - sw.direction = "SOUTH"; - sw.texture = "NConcrete"; - var ww = new VREM.Model.Wall(); - ww.direction = "WEST"; - ww.texture = "MarbleBricks"; + private static void TestObjectFactory() + { + var nw = new Wall {direction = "NORTH", texture = "NBricks"}; + var ew = new Wall {direction = "EAST", texture = "LimeBricks"}; + var sw = new Wall {direction = "SOUTH", texture = "NConcrete"}; + var ww = new Wall {direction = "WEST", texture = "MarbleBricks"}; - var room = new VREM.Model.Room(); - room.floor = "MarbleTiles"; - room.size = new Vector3(10,5,10); - room.position = new Vector3(10,-10,10); - room.ceiling = "NFabric"; - room.walls = new[] { - nw, ew, sw, ww + var room = new Room + { + floor = "MarbleTiles", + size = new Vector3(10, 5, 10), + position = new Vector3(10, -10, 10), + ceiling = "NFabric", + walls = new[] {nw, ew, sw, ww} }; ObjectFactory.BuildRoom(room); } - } - - } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Core/Settings.cs b/Assets/Scripts/Unibas/DBIS/VREP/Core/Settings.cs index b4ccdbe5..b103332c 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/Core/Settings.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/Core/Settings.cs @@ -1,162 +1,172 @@ -using System; -using System.IO; -using UnityEngine; - -namespace DefaultNamespace -{ - [Serializable] - public class Settings - { - /// - /// Whether the player starts in the lobby - /// Default: False - /// - public bool StartInLobby = true; - - /// - /// The Address of the VREM server instance, inclusive port - /// Usually this is 127.0.0.1:4567 - /// Default: 127.0.0.1:4567 - /// - public string VREMAddress = "http://127.0.0.1:4567"; - - /// - /// Whether each exhibit has its own spotlight - /// Default: False - /// - public bool SpotsEnabled = false; - - /// - /// Whether in the Lobby the UNIBAS logo is displayed on the floor - /// Default: True - /// - public bool LobbyFloorLogoEnabled = true; - - /// - /// Whether in the Lobby the UNIBAS logo is displayed on the ceiling - /// Default: True - /// - public bool LobbyCeilingLogoEnabled = true; - - /// - /// Whether in each room the Logo is placed on the ceiling. - /// - public bool CeilingLogoEnabled = true; - - /// - /// Whether in each room a timer is placed on the wall, counting down provided seconds. - /// - public int WallTimerCount; - - /// - /// Whether experimental, "playground" features are enabled - /// Default: False - /// - public bool PlaygroundEnabled = false; - - /// - /// Whether the server will be queried for exhibitions - /// Default: False - /// - public bool RequestExhibitions = false; - - /// - /// A list of exhibition ids, which shall be loaded - /// Default: Empty - /// - public string[] exhibitionIds = new string[0]; - - /// - /// The file name of this settings file. - /// - public const string FILE_NAME = "settings.json"; - - private bool _default = false; - - /// - /// Returns whether this settings file is the default one. - /// - /// Whether this settings file is the default one - public bool IsDefault() - { - return _default; - } - - /// - /// Loads the settings file. In UnityEditor this is at Assets/settings.json, in standalone this should be a sibling of the executable - /// - /// - public static Settings LoadSettings() - { - Debug.Log("Settings path: " + getPath()); - if (File.Exists(getPath())) - { - string json = File.ReadAllText(getPath()); - return JsonUtility.FromJson(json); - } - else - { - return createDefault(); - } - } - - public static Settings LoadSettings(string path) - { - var filePath = Application.dataPath + "/" + path; - if (File.Exists(filePath)) - { - string json = File.ReadAllText(filePath); - return JsonUtility.FromJson(json); - } - else - { - return createDefault(); - } - } - - private Settings() - { - // no public constructor allowed - } - - private static Settings createDefault() - { - Settings s = new Settings(); - s._default = true; - return s; - } - - public static Settings Default() - { - return createDefault(); - } - - private static string getPath() - { - if (Application.isEditor) - { - return Application.dataPath + "/" + FILE_NAME; - } - else - { - return Application.dataPath + "/../" + FILE_NAME; - } - } - - /// - /// Stores this settings file at the preferred location, if there isn't already one - /// - public void StoreSettings() - { - if (!File.Exists(getPath())) - { - string json = JsonUtility.ToJson(this, true); - File.WriteAllText(getPath(), json); - } - else - { - Debug.LogWarning("Will not override settings"); - } - } - } +using System; +using System.IO; +using UnityEngine; + +namespace Unibas.DBIS.VREP.Core +{ + /// + /// Settings class; serialized from/to JSON. + /// + [Serializable] + public class Settings + { + /// + /// The Address of the VREM server instance, inclusive port. + /// + public string VremAddress; + + /// + /// Whether the player starts in the lobby. + /// Default: False + /// + public bool StartInLobby = true; + + /// + /// Whether each exhibit has its own spotlight. + /// Default: False + /// + public bool SpotsEnabled; + + /// + /// Whether in the Lobby the Unibas logo is displayed on the floor. + /// Default: True + /// + public bool LobbyFloorLogoEnabled = true; + + /// + /// Whether in the Lobby the Unibas logo is displayed on the ceiling. + /// Default: True + /// + public bool LobbyCeilingLogoEnabled = true; + + /// + /// Whether in each room the Logo is placed on the ceiling. + /// + public bool CeilingLogoEnabled = true; + + /// + /// Whether in each room a timer is placed on the wall, counting down provided seconds. + /// + public int WallTimerCount; + + /// + /// Whether experimental features are enabled. + /// Default: False + /// + public bool PlaygroundEnabled; + + /// + /// The ID of the exhibition to load. + /// Default: Empty + /// + public string ExhibitionId; + + /// + /// The file name of this settings file. + /// + [NonSerialized] public const string FileName = "settings.json"; + + [NonSerialized] private bool _default; + + /// + /// Returns whether this settings object is a default configuration (unless you programatically changed attributes). + /// + /// True if this is the default config, false otherwise. + public bool IsDefault() + { + return _default; + } + + /// + /// Loads the settings file. + /// In the UnityEditor this is at Assets/settings.json, in the standalone this should be a sibling of the executable. + /// Default settings are used if the settings file cannot be read. + /// + /// The resulting Settings object. + public static Settings LoadSettings() + { + Debug.Log("Settings path: " + GetPath()); + + if (File.Exists(GetPath())) + { + var json = File.ReadAllText(GetPath()); + return JsonUtility.FromJson(json); + } + + return CreateDefault(); + } + + /// + /// Loads the settings file from a provided path. + /// Default settings are used if the settings file cannot be read. + /// + /// + /// The resulting Settings object. + public static Settings LoadSettings(string path) + { + var filePath = Application.dataPath + "/" + path; + + if (!File.Exists(filePath)) return CreateDefault(); + + var json = File.ReadAllText(filePath); + return JsonUtility.FromJson(json); + } + + private Settings() + { + // Settings can only be loaded via LoadSettings or Default! + } + + /// + /// Creates default settings. + /// + /// The created default Settings object. + private static Settings CreateDefault() + { + var s = new Settings {_default = true}; + return s; + } + + /// + /// Creates default settings. + /// + /// The created default Settings object. + public static Settings Default() + { + return CreateDefault(); + } + + /// + /// Obtains the path of the configuration file, depending on whether we're running from the editor or not. + /// For the actual deployment, the configuration file is assumed to be a sibling of the executable. + /// + /// The path to the configuration file. + private static string GetPath() + { + if (Application.isEditor) + { + return Application.dataPath + "/" + FileName; + } + else + { + return Application.dataPath + "/../" + FileName; + } + } + + /// + /// Stores this settings file at the preferred location unless the file already exists. + /// + public void StoreSettings() + { + if (!File.Exists(GetPath())) + { + var json = JsonUtility.ToJson(this, true); + File.WriteAllText(GetPath(), json); + } + else + { + Debug.Log("Configuration already exists, will not override settings."); + } + } + } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Core/VREPController.cs b/Assets/Scripts/Unibas/DBIS/VREP/Core/VREPController.cs deleted file mode 100644 index 4abca510..00000000 --- a/Assets/Scripts/Unibas/DBIS/VREP/Core/VREPController.cs +++ /dev/null @@ -1,161 +0,0 @@ -using System; -using DefaultNamespace; -using DefaultNamespace.VREM; -using DefaultNamespace.VREM.Model; -using Unibas.DBIS.VREP.Core; -using UnityEngine; - -namespace Unibas.DBIS.VREP -{ - public class VREPController : MonoBehaviour - { - private VREMClient _vremClient; - private BuildingManager _buildingManager; - public String ExhibitionId = "5c17b10ea6abfddbb3fa66ae"; - - public Vector3 LobbySpawn = new Vector3(0, -9, 0); - - public Settings Settings; - - public string settingsPath; - - public static VREPController Instance; - private ExhibitionManager _exhibitionManager; - - private void Awake() - { - if (Application.isEditor) - { - if (string.IsNullOrEmpty(settingsPath)) - { - Settings = Settings.LoadSettings(); - } - else - { - Settings = Settings.LoadSettings(settingsPath); - } - } - else - { - Settings = Settings.LoadSettings(); - } - - SanitizeHost(); - Instance = this; - } - - private void SanitizeHost() - { - if (!Settings.VREMAddress.EndsWith("/")) - { - Settings.VREMAddress += "/"; - } - - if (!Settings.VREMAddress.StartsWith("http://")) - { - Settings.VREMAddress = "http://" + Settings.VREMAddress; - } - } - - private void OnApplicationQuit() - { - Settings.StoreSettings(); - } - - private void Start() - { - if (Settings == null) - { - Settings = Settings.LoadSettings(); - if (Settings == null) - { - Settings = Settings.Default(); - } - } - var go = GameObject.FindWithTag("Player"); - if (go != null && Settings.StartInLobby) - { - go.transform.position = new Vector3(0, -9.9f, 0); - } - - var lby = GameObject.Find("Lobby"); - if (lby != null && !Settings.StartInLobby) - { - lby.SetActive(false); - } - - Debug.Log("Starting ExMan"); - _vremClient = gameObject.AddComponent(); - _buildingManager = GetComponent(); - - LoadAndCreateExhibition(); - } - - public void LoadAndCreateExhibition() - { - _vremClient.ServerUrl = Settings.VREMAddress; - - var exId = ""; - if (Settings.exhibitionIds != null && Settings.exhibitionIds.Length > 0 && Settings.exhibitionIds[0] != null) - { - exId = Settings.exhibitionIds[0]; - } - else - { - exId = ExhibitionId; - } - - - _vremClient.RequestExhibition(exId, ParseExhibition); - Debug.Log("Requested ex"); - } - - private void Update() { - if (Input.GetKey(KeyCode.F12)) { - _exhibitionManager.RestoreExhibits(); - } - } - - private void ParseExhibition(string json) - { - if (json == null) - { - Debug.LogError("Couldn't load exhibition from backend"); - Debug.Log("Loading placeholder instead"); - var jtf = Resources.Load("Configs/placeholder-exhibition"); - json = jtf.text; - } - - Debug.Log(json); - Exhibition ex = JsonUtility.FromJson(json); - Debug.Log(json); - Debug.Log(ex); - Debug.Log(_buildingManager); - // TODO create lobby - - _exhibitionManager = new ExhibitionManager(ex); - _exhibitionManager.GenerateExhibition(); - if (VREPController.Instance.Settings.StartInLobby) - { - GameObject.Find("Lobby").GetComponent().activateRoomTrigger(_exhibitionManager); - } - else - { - GameObject.Find("Room").gameObject.transform.Find("Timer").transform.GetComponent().enabled = true; - } - - //_buildingManager.Create(ex); - - - //_buildingManager.BuildRoom(ex.rooms[0]); -/* - if (Settings.PlaygroundEnabled) - {*/ - /* - ex.rooms[0].position = new Vector3(15,0,0); - ObjectFactory.BuildRoom(ex.rooms[0]); - */ - // } - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Core/VrepController.cs b/Assets/Scripts/Unibas/DBIS/VREP/Core/VrepController.cs new file mode 100644 index 00000000..f9367b1d --- /dev/null +++ b/Assets/Scripts/Unibas/DBIS/VREP/Core/VrepController.cs @@ -0,0 +1,153 @@ +using Unibas.DBIS.VREP.VREM; +using Unibas.DBIS.VREP.VREM.Model; +using Unibas.DBIS.VREP.World; +using UnityEngine; + +namespace Unibas.DBIS.VREP.Core +{ + /// + /// Controller component for VirtualExhibitionManager. + /// + public class VrepController : MonoBehaviour + { + private VremClient _vremClient; + + public Vector3 lobbySpawn = new Vector3(0, -9, 0); + + public Settings settings; + public string settingsPath; + + public static VrepController Instance; + private ExhibitionManager _exhibitionManager; + + /// + /// Upon awaking, the settings are loaded and the VREM host address is sanitized and set. + /// + private void Awake() + { + if (Application.isEditor) + { + settings = string.IsNullOrEmpty(settingsPath) ? Settings.LoadSettings() : Settings.LoadSettings(settingsPath); + } + else + { + settings = Settings.LoadSettings(); + } + + SanitizeHost(); + + // Set instance. + Instance = this; + } + + /// + /// Fixes the server URL by adding the http:// prefix and/or trailing /. + /// + private void SanitizeHost() + { + if (!settings.VremAddress.EndsWith("/")) + { + settings.VremAddress += "/"; + } + + // TODO TLS support. + if (!settings.VremAddress.StartsWith("http://")) + { + settings.VremAddress = "http://" + settings.VremAddress; + } + } + + /// + /// Write settings on termination if the file doesn't already exist. + /// + private void OnApplicationQuit() + { + settings.StoreSettings(); + } + + /// + /// Handles lobby start settings and loads the exhibition. + /// + private void Start() + { + // TODO After what happens in Awake, this is not necessary. + settings ??= Settings.LoadSettings() ?? Settings.Default(); + + var go = GameObject.FindWithTag("Player"); + if (go != null && settings.StartInLobby) + { + go.transform.position = new Vector3(0, -9.9f, 0); + } + + var lby = GameObject.Find("Lobby"); + if (lby != null && !settings.StartInLobby) + { + lby.SetActive(false); + } + + Debug.Log("Starting Exhibition manager."); + _vremClient = gameObject.AddComponent(); + + LoadAndCreateExhibition(); + } + + /// + /// Creates and loads the exhibition specified in the configuration. + /// + public void LoadAndCreateExhibition() + { + _vremClient.serverUrl = settings.VremAddress; + + _vremClient.RequestExhibition(settings.ExhibitionId, ParseExhibition); + Debug.Log("Requested exhibition."); + } + + /// + /// Restores exhibits upon pressing F12. + /// + private void Update() + { + if (Input.GetKey(KeyCode.F12)) + { + _exhibitionManager.RestoreExhibits(); + } + } + + /// + /// Parses an exhibition in JSON format loaded from VREM and calls the exhibition manager to actually + /// generate the loaded/parsed exhibition. + /// + /// The JSON string to parse. + private void ParseExhibition(string json) + { + if (json == null) + { + Debug.LogError("Couldn't load exhibition from backend."); + Debug.Log("Loading placeholder instead."); + var jtf = Resources.Load("Configs/placeholder-exhibition"); + json = jtf.text; + } + + Debug.Log(json); + + // Actual parsing to Exhibition model object. + var ex = JsonUtility.FromJson(json); + + // TODO Create lobby. + + // Create exhibition manager and generate the exhibition. + _exhibitionManager = new ExhibitionManager(ex); + _exhibitionManager.GenerateExhibition(); + + if (Instance.settings.StartInLobby) + { + GameObject.Find("Lobby").GetComponent().ActivateRoomTrigger(_exhibitionManager); + } + else + { + GameObject.Find("Room").gameObject.transform.Find("Timer").transform.GetComponent().enabled = + true; + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Core/VREPController.cs.meta b/Assets/Scripts/Unibas/DBIS/VREP/Core/VrepController.cs.meta similarity index 97% rename from Assets/Scripts/Unibas/DBIS/VREP/Core/VREPController.cs.meta rename to Assets/Scripts/Unibas/DBIS/VREP/Core/VrepController.cs.meta index a6e0a9ea..8cbd39b8 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/Core/VREPController.cs.meta +++ b/Assets/Scripts/Unibas/DBIS/VREP/Core/VrepController.cs.meta @@ -1,3 +1,3 @@ -fileFormatVersion: 2 -guid: bd383596e0c94e46a6268577549e3d30 +fileFormatVersion: 2 +guid: bd383596e0c94e46a6268577549e3d30 timeCreated: 1540578983 \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/LegacyObjects/Displayal.cs b/Assets/Scripts/Unibas/DBIS/VREP/LegacyObjects/Displayal.cs index 1dd59405..dbd2d0da 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/LegacyObjects/Displayal.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/LegacyObjects/Displayal.cs @@ -1,115 +1,112 @@ -using System.Collections; -using System.Collections.Generic; -using DefaultNamespace.VREM.Model; -using Unibas.DBIS.DynamicModelling; -using Unibas.DBIS.DynamicModelling.Models; -using Unibas.DBIS.VREP; -using UnityEngine; -using Valve.VR.InteractionSystem; - -public class Displayal : MonoBehaviour -{ - private Exhibit _exhibitModel; - - - public string id; - - public Vector3 OriginalPosition; - public Quaternion OriginalRotation; - - private CuboidModel _anchor = new CuboidModel(1,0.01f,.1f); - - - public void RestorePosition() { - transform.localPosition = OriginalPosition; - transform.localRotation = OriginalRotation; - var rigid = GetComponent(); - if (rigid != null) - { - rigid.velocity = Vector3.zero; - } - } - - public void SetExhibitModel(Exhibit exhibit) - { - _exhibitModel = exhibit; - id = _exhibitModel.id; - name = "Displayal (" + id + ")"; - var tp = transform.Find("TitlePlaquette"); - if (tp != null) - { - if (string.IsNullOrEmpty(exhibit.name)) - { - tp.gameObject.SetActive(false); - } - else - { - tp.GetComponent().text.text = exhibit.name; - } - } - else - { - Debug.LogError("no tp"); - } - - var dp = transform.Find("DescriptionPlaquette"); - if (dp != null) - { - if (string.IsNullOrEmpty(exhibit.description)) - { - dp.gameObject.SetActive(false); - } - else - { - dp.GetComponent().text.text = exhibit.description; - } - } - else - { - Debug.LogError("no dp"); - } - - if (VREPController.Instance.Settings.PlaygroundEnabled) - { - var magicOffset = 0.17f; - var t = gameObject.AddComponent(); - t.attachmentFlags = Hand.AttachmentFlags.VelocityMovement | Hand.AttachmentFlags.TurnOffGravity; - //Hand.AttachmentFlags.VelocityMovement Hand.AttachmentFlags.TurnOffGravity; - t.releaseVelocityStyle = ReleaseStyle.AdvancedEstimation; - - // Fix non-convex meshcollider since unity5 not allowed... - var plane = transform.Find("Plane"); - plane.GetComponent().convex = true; - var back = transform.Find("Back"); - back.GetComponent().convex = true; - - var anch = ModelFactory.CreateCuboid(_anchor); - var col = anch.AddComponent(); - col.center = new Vector3(_anchor.Width / 2, _anchor.Height / 2, _anchor.Depth/2); - col.size = new Vector3(_anchor.Width, _anchor.Height, _anchor.Depth); - anch.name = "Anchor (" + id + ")"; - anch.transform.parent = transform.parent; - anch.transform.localPosition = new Vector3(_exhibitModel.position.x-_anchor.Width/2, _exhibitModel.position.y-(_exhibitModel.size.y/2+magicOffset), -_anchor.Depth); //0.2 is magic number for frame - anch.transform.localRotation = Quaternion.Euler(Vector3.zero); - } - } - - public Exhibit GetExhibit() - { - return _exhibitModel; - } - - - Renderer m_Renderer; - - // Use this for initialization - void Start() - { - m_Renderer = GetComponent(); - } - - // Update is called once per frame - void Update() - { - } +using Unibas.DBIS.DynamicModelling; +using Unibas.DBIS.DynamicModelling.Models; +using Unibas.DBIS.VREP.Core; +using Unibas.DBIS.VREP.VREM.Model; +using UnityEngine; + +namespace Unibas.DBIS.VREP.LegacyObjects +{ + /// + /// Displayal object, GameObject representation of an Exhibit. + /// + public class Displayal : MonoBehaviour + { + // The corresponding exhibit for this displayal. + private Exhibit _exhibitModel; + public string id; + + public Vector3 originalPosition; + public Quaternion originalRotation; + + private readonly CuboidModel _anchor = new CuboidModel(1, 0.01f, .1f); + + /// + /// Restores the original position and resets velocity for this displayal. + /// + public void RestorePosition() + { + var t = transform; + t.localPosition = originalPosition; + t.localRotation = originalRotation; + var rigid = GetComponent(); + if (rigid != null) + { + rigid.velocity = Vector3.zero; + } + } + + /// + /// Sets the exhibit model for this displayal object, also processing the text to display on the plaquette + /// and the image to load. + /// + /// + public void SetExhibitModel(Exhibit exhibit) + { + _exhibitModel = exhibit; + id = _exhibitModel.id; + name = "Displayal (" + id + ")"; + + var tp = transform.Find("TitlePlaquette"); + if (tp != null) + { + if (string.IsNullOrEmpty(exhibit.name)) + { + tp.gameObject.SetActive(false); + } + else + { + tp.GetComponent().text.text = exhibit.name; + } + } + else + { + Debug.LogError("no tp"); + } + + var dp = transform.Find("DescriptionPlaquette"); + if (dp != null) + { + if (string.IsNullOrEmpty(exhibit.description)) + { + dp.gameObject.SetActive(false); + } + else + { + dp.GetComponent().text.text = exhibit.description; + } + } + else + { + Debug.LogError("no dp"); + } + + if (VrepController.Instance.settings.PlaygroundEnabled) + { + // TODO Find a fix so this works regardless of image dimensions. + const float magicOffset = 0.5f; + + var anchor = ModelFactory.CreateCuboid(_anchor); + var col = anchor.AddComponent(); + + col.center = new Vector3(_anchor.width / 2, _anchor.height / 2, _anchor.depth / 2); + col.size = new Vector3(_anchor.width, _anchor.height, _anchor.depth); + + anchor.name = "Anchor (" + id + ")"; + anchor.transform.parent = transform.parent; + anchor.transform.localPosition = new Vector3(_exhibitModel.position.x - _anchor.width / 2, + _exhibitModel.position.y - (_exhibitModel.size.y / 2 + magicOffset), + -_anchor.depth); + anchor.transform.localRotation = Quaternion.Euler(Vector3.zero); + } + } + + /// + /// Obtains the exhibit associated to this displayal. + /// + /// The associated exhibit model. + public Exhibit GetExhibit() + { + return _exhibitModel; + } + } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/LegacyObjects/Plaquette.cs b/Assets/Scripts/Unibas/DBIS/VREP/LegacyObjects/Plaquette.cs index d7dd4477..494de845 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/LegacyObjects/Plaquette.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/LegacyObjects/Plaquette.cs @@ -1,20 +1,26 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; +using UnityEngine; using UnityEngine.UI; -public class Plaquette : MonoBehaviour +namespace Unibas.DBIS.VREP.LegacyObjects { + /// + /// Plaquette component describing the title of an image. + /// + public class Plaquette : MonoBehaviour + { public Text text; public Font font; - // Use this for initialization - void Start() + /// + /// Sets the text font if a font has been provided. + /// + private void Start() { - if (font != null) - { - text.font = font; - } + if (font != null) + { + text.font = font; + } } + } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/LegacyScripts.meta b/Assets/Scripts/Unibas/DBIS/VREP/LegacyScripts.meta deleted file mode 100644 index de453629..00000000 --- a/Assets/Scripts/Unibas/DBIS/VREP/LegacyScripts.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: a3509960955e4eff86f18ec70bb41a3c -timeCreated: 1546809951 \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/LegacyScripts/BuildingManager.cs b/Assets/Scripts/Unibas/DBIS/VREP/LegacyScripts/BuildingManager.cs deleted file mode 100644 index 06703ccf..00000000 --- a/Assets/Scripts/Unibas/DBIS/VREP/LegacyScripts/BuildingManager.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using DefaultNamespace.VREM.Model; -using UnityEngine; -using Valve.VR.InteractionSystem; - -public class BuildingManager : MonoBehaviour { - - - public float RoomSize = 10f; - - public float Offset = 5f; - - public GameObject RoomPrefab; - - private Exhibition _exhibition; - private int currentPosition = 0; - - private GameObject roomObject; - private Room roomLogic; - - private List theRooms = new List(); - - private int GetNextPosition(int pos) { - return (pos + 1) % _exhibition.rooms.Length; - } - - private int GetPreviousPosition(int pos) { - return (pos - 1 + _exhibition.rooms.Length) % _exhibition.rooms.Length; - } - - - private Vector3 CalculateRoomPosition(DefaultNamespace.VREM.Model.Room room) { - float x = room.position.x, y = room.position.y, z = room.position.z; - return new Vector3(x * RoomSize + x * Offset, y * RoomSize + y * Offset, z * RoomSize + z * Offset); - } - - public void BuildRoom(DefaultNamespace.VREM.Model.Room room) { - var goRoom = Instantiate(RoomPrefab); - goRoom.transform.position = CalculateRoomPosition(room); - Room roomLogic = goRoom.GetComponent(); - roomLogic.Populate(room); - } - - private Room CreateRoom(DefaultNamespace.VREM.Model.Room room) { - var goRoom = Instantiate(RoomPrefab); - goRoom.transform.position = CalculateRoomPosition(room); - Room roomLogic = goRoom.GetComponent(); - return roomLogic; - } - - - - public void Create(Exhibition exhibition) { - _exhibition = exhibition; - foreach (var room in exhibition.rooms) { - Room r = CreateRoom(room); - theRooms.Add(r); - r.Populate(room); - } - - for (int i = 0; i < exhibition.rooms.Length; i++) - { - Room r = theRooms[i]; - r.SetNextRoom(theRooms[GetNextPosition(i)]); - var tp = r.gameObject.transform.Find("TeleportPoint"); - if (tp != null && theRooms.Count > 1) - { - var porter = tp.GetComponent(); - var dest = CalculateRoomPosition(r.GetNextRoom().GetRoomModel()); - porter.destination = dest; - r.SetPrevRoom(theRooms[GetPreviousPosition(i)]); - } - } - } - -} diff --git a/Assets/Scripts/Unibas/DBIS/VREP/LegacyScripts/Room.cs b/Assets/Scripts/Unibas/DBIS/VREP/LegacyScripts/Room.cs deleted file mode 100644 index 063cc5a0..00000000 --- a/Assets/Scripts/Unibas/DBIS/VREP/LegacyScripts/Room.cs +++ /dev/null @@ -1,282 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using DefaultNamespace; -using DefaultNamespace.ObjImport; -using DefaultNamespace.VREM.Model; -using Unibas.DBIS.VREP; -using UnityEngine; -using Valve.VR.InteractionSystem; -using World; - -[Obsolete("Got replaced by CuboidExhibitionRoom")] -public class Room : MonoBehaviour { - - private string _northWallName = "NorthWall"; - private string _eastWallName = "EastWall"; - private string _southWallName = "SouthWall"; - private string _westWallName = "WestWall"; - - public GameObject PlanePrefab; - - public AudioLoader audio; - - private List displayedImages = new List(); - - private bool LightingActivated = false; - - public GameObject GlobePrefab; - - // Use this for initialization - void Start () { - if (audio == null) - { - audio = gameObject.AddComponent(); - } - } - - - /// - /// - /// - void OnLeave() - { - //TODO: call this when leaving room - audio.Stop(); - } - - - /// - /// - /// - /// - /// - private Wall GetWall(string name) { - var go = transform.Find(name); - string str = "Components: "; - - foreach( var e in go.transform.GetComponents()) { - str += e.ToString(); - } - - Debug.Log("[Room] "+str); - - return transform.Find(name).GetComponent(); - } - - - /// - /// - /// - /// - /// - /// - private Wall GetWallForOrientation(WallOrientation orientation) { - switch (orientation) { - case WallOrientation.NORTH: - return GetWall(_northWallName); - case WallOrientation.EAST: - return GetWall(_eastWallName); - case WallOrientation.SOUTH: - return GetWall(_southWallName); - case WallOrientation.WEST: - return GetWall(_westWallName); - default: - throw new ArgumentOutOfRangeException("orientation", orientation, null); - } - } - - - /// - /// - /// - /// url to access image - /// wall orientation - /// x coordinate for corresponding wall based on left lower anchor - /// x coordinate for corresponding wall based on left lower anchor - public Displayal Display(string url, WallOrientation wall, float x, float y, float w, float h, bool lightOn = true, string audioUrl = null) { - Debug.Log(string.Format("{0}, {1}, {2}/{3}, {4}/{5}",url,wall,x,y,w,h)); - GameObject displayal = Instantiate(PlanePrefab); - - var go = GameObject.Find("VirtualExhibitionManager"); - if (go.GetComponent().Settings.PlaygroundEnabled) - { - //var r = displayal.AddComponent(); - //r.useGravity = false; - /*var i = displayal.AddComponent(); - i.hideHandOnAttach = true; - i.useHandObjectAttachmentPoint = true; - i.handFollowTransformPosition = true; - i.handFollowTransformRotation = true; - i.highlightOnHover = true; - var t = displayal.AddComponent(); - t.releaseVelocityStyle = ReleaseStyle.NoChange; - t.restoreOriginalParent = false;*/ - } - - if(!LightingActivated || !lightOn){ - displayal.transform.Find("Directional light").gameObject.SetActive(false); - } - - - Displayal disp = displayal.gameObject.GetComponent(); - - ImageLoader image = displayal.transform.Find("Plane").gameObject.AddComponent(); // Displayal - //ImageLoader image = displayal.AddComponent();// ImageDisplayPlane - image.ReloadImage(url); - Debug.Log(GetWallForOrientation(wall)); - Vector3 pos = GetWallForOrientation(wall).CalculatePosition(transform.position,new Vector2(x,y)); - Vector3 rot = GetWallForOrientation(wall).CalculateRotation(); - displayal.transform.position = pos; - displayal.transform.rotation = Quaternion.Euler(rot); - displayal.transform.localScale = ScalingUtility.convertMeters2PlaneScaleSize(w, h); - - if (audioUrl != null) - { - Debug.Log("added audio to display object"); - var closenessDetector = displayal.AddComponent(); - closenessDetector.url = audioUrl; - } - - - displayedImages.Add(displayal); - return disp; - } - - - // UNUSED - private volatile bool first = true; - - - // Update is called once per frame - void Update () { - /* - if (first) { - // TESTING: - Debug.Log("[Room] debug"); - Display("https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg/402px-Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg", WallOrientation.NORTH, 5,5, .53f, .77f); - Display("https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg/402px-Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg", WallOrientation.EAST, 5,5, .53f, .77f); - Display("https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg/402px-Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg", WallOrientation.SOUTH, 5,5, .53f, .77f); - Display("https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg/402px-Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg", WallOrientation.WEST, 5,5, .53f, .77f); - first = false; - }*/ - } - - private DefaultNamespace.VREM.Model.Room _roomModel; - - private Room next; - private Room prev; - - public void SetNextRoom(Room next) { - this.next = next; - } - - public void SetPrevRoom(Room prev) { - this.prev = prev; - } - - public Room GetNextRoom() { - return next; - } - - public Room GetPrevRoom() { - return prev; - } - - - public DefaultNamespace.VREM.Model.Room GetRoomModel() { - return _roomModel; - } - - public void Populate(DefaultNamespace.VREM.Model.Room room) { - Debug.Log(room); - Debug.Log(room.walls); - _roomModel = room; - - - Debug.Log("adjusting ceiling and floor"); - // TODO Use new material loading code - this.gameObject.transform.Find("Ceiling").gameObject.GetComponent().LoadMaterial(TexturingUtility.Translate(room.ceiling)); - this.gameObject.transform.Find("Floor").gameObject.GetComponent().LoadMaterial(TexturingUtility.Translate(room.floor)); - - /*Debug.Log("add globe"); - if(GlobePrefab != null){ //TODO: add a new check - var globe = Instantiate(GlobePrefab) as GameObject; - globe.transform.rotation = Quaternion.Euler(-90, -90, 0); - globe.transform.position = new Vector3(-2.5f, 0, -2.5f); - globe.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f); - }*/ - - if (!string.IsNullOrEmpty(room.GetURLEncodedAudioPath())) - { - Debug.Log("add audio to room"); - - if (audio == null) - { - audio = gameObject.AddComponent(); - } - - audio.ReloadAudio(room.GetURLEncodedAudioPath()); - } - // - - PopulateWalls(room.walls); - //PlaceExhibits(room.exhibits); - - - // DEBUG TESTING TODO REMOVE this when done - //Debug.Log("Test"); - //LoadAndPlaceModel(ServerSettings.SERVER_ID+"content/get/5bd3292c64aa33a460bcdade%2f1%2fexhibits%2fearth.obj", new Vector3(0,1,0)); - - } - - private void PlaceExhibits(DefaultNamespace.VREM.Model.Exhibit[] exhibits) { - foreach (Exhibit exhibit in exhibits) { - LoadAndPlaceModel(exhibit.GetURLEncodedPath(), exhibit.position); - } - } - - private void LoadAndPlaceModel(string url, Vector3 pos) { - GameObject parent = new GameObject("Model Anchor"); - GameObject model = new GameObject("Model"); - model.transform.SetParent(parent.transform); - parent.transform.position = pos; - ObjLoader objLoader = model.AddComponent(); - model.transform.Rotate(-90,0,0); - model.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f); - objLoader.Load(url); - } - - private void PopulateWalls(DefaultNamespace.VREM.Model.Wall[] walls) { - foreach (var wall in walls) { - if (wall.direction == "NORTH") { - LoadExhibits(wall, WallOrientation.NORTH); - GetWallForOrientation(WallOrientation.NORTH).LoadMaterial(TexturingUtility.Translate(wall.texture)); - } - - if (wall.direction == "EAST") { - LoadExhibits(wall, WallOrientation.EAST); - GetWallForOrientation(WallOrientation.EAST).LoadMaterial(TexturingUtility.Translate(wall.texture)); - } - - if (wall.direction == "SOUTH") { - LoadExhibits(wall, WallOrientation.SOUTH); - GetWallForOrientation(WallOrientation.SOUTH).LoadMaterial(TexturingUtility.Translate(wall.texture)); - } - - if (wall.direction == "WEST") { - LoadExhibits(wall, WallOrientation.WEST); - GetWallForOrientation(WallOrientation.WEST).LoadMaterial(TexturingUtility.Translate(wall.texture)); - } - } - } - - private void LoadExhibits(DefaultNamespace.VREM.Model.Wall wall, WallOrientation orientation) { - foreach (Exhibit e in wall.exhibits) { - Debug.Log(string.Format("E: {0}/{1} at {2}/{3}", e.position.x, e.position.y, e.size.x, e.size.y)); - var disp = Display(e.GetURLEncodedPath(), orientation, e.position.x, e.position.y, e.size.x, e.size.y, e.light, e.GetURLEncodedAudioPath()); - disp.SetExhibitModel(e); - } - } -} diff --git a/Assets/Scripts/Unibas/DBIS/VREP/LegacyScripts/Wall.cs b/Assets/Scripts/Unibas/DBIS/VREP/LegacyScripts/Wall.cs deleted file mode 100644 index d369e6b1..00000000 --- a/Assets/Scripts/Unibas/DBIS/VREP/LegacyScripts/Wall.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using DefaultNamespace; -using UnityEngine; -using World; - -[Obsolete("Got replaced by ExhibitionWall")] -public class Wall : TexturedMonoBehaviour { - - public WallOrientation Orientation; - - public float RoomRadius = 5; - -/// -/// Calculates the position relative to the wall. Origin is lower left corner -/// -/// -/// x value is to the right, y value is up -/// -/// - public Vector3 CalculatePosition(Vector3 floorCenter, Vector2 pos){ - float epsilon = 0.1f; // Required 0.1f with Displayal - - switch (Orientation) { - case WallOrientation.NORTH: - return new Vector3( - floorCenter.x + (RoomRadius - epsilon), - floorCenter.y + pos.y, - (floorCenter.z + RoomRadius) - pos.x); - case WallOrientation.EAST: - return new Vector3( - (floorCenter.x + RoomRadius) - pos.x, - floorCenter.y + pos.y, - floorCenter.z - (RoomRadius - epsilon)); - case WallOrientation.SOUTH: - return new Vector3( - floorCenter.x - (RoomRadius - epsilon), - floorCenter.y + pos.y, - (floorCenter.z - RoomRadius) + pos.x); - case WallOrientation.WEST: - return new Vector3( - (floorCenter.x - RoomRadius) + pos.x, - floorCenter.y + pos.y, - floorCenter.z + (RoomRadius - epsilon)); - default: - throw new ArgumentOutOfRangeException(); - } - } - - /// - /// - /// - /// - /// - public Vector3 CalculateRotation() { - switch (Orientation) { - case WallOrientation.NORTH: - return new Vector3(90, 270, 0); - case WallOrientation.EAST: - return new Vector3(90, 0, 0); - case WallOrientation.SOUTH: - return new Vector3(90, 90, 0); - case WallOrientation.WEST: - return new Vector3(90, 180, 0); - default: - throw new ArgumentOutOfRangeException(); - } - } - - -} \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Movement/PlayerTeleporter.cs b/Assets/Scripts/Unibas/DBIS/VREP/Movement/PlayerTeleporter.cs index 8f972e7d..dd5ed866 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/Movement/PlayerTeleporter.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/Movement/PlayerTeleporter.cs @@ -1,45 +1,40 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; +using UnityEngine; using Valve.VR; using Valve.VR.InteractionSystem; -public class PlayerTeleporter : MonoBehaviour { - - public Vector3 Destination = Vector3.zero; +namespace Unibas.DBIS.VREP.Movement +{ + /// + /// Player teleporter component. + /// + public class PlayerTeleporter : MonoBehaviour + { + public Vector3 destination = Vector3.zero; + public float minDistance = 1f; - public float MinDistance = 1f; + /// + /// Teleports a player to the destination set. + /// + public void TeleportPlayer() + { + SteamVR_Fade.Start(Color.clear, 0.2f); - public void TeleportPlayer() - { - SteamVR_Fade.Start( Color.clear, 0.2f ); + var pgo = GameObject.FindWithTag("Player"); + if (pgo == null) + { + Debug.LogWarning("No player found!"); + } - var pgo = GameObject.FindWithTag("Player"); - if (pgo == null) - { - Debug.LogWarning("No player found!"); - } + var player = pgo.GetComponent(); - var _player = pgo.GetComponent(); - - if (_player == null) - { - Debug.LogWarning("No SteamVR Player attached!"); - } - - - Vector3 playerFeetOffset = _player.trackingOriginTransform.position - _player.feetPositionGuess; - _player.trackingOriginTransform.position = Destination + playerFeetOffset; - } + if (player == null) + { + Debug.LogWarning("No SteamVR Player attached!"); + } - // Use this for initialization - void Start () { - - } - - // Update is called once per frame - void Update () { - - } -} + var playerFeetOffset = player.trackingOriginTransform.position - player.feetPositionGuess; + player.trackingOriginTransform.position = destination + playerFeetOffset; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Movement/SmoothMouseLook.cs b/Assets/Scripts/Unibas/DBIS/VREP/Movement/SmoothMouseLook.cs index 4c08aaf0..d4525af4 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/Movement/SmoothMouseLook.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/Movement/SmoothMouseLook.cs @@ -1,138 +1,170 @@ -using System.Collections; -using System.Collections.Generic; +using System.Collections.Generic; using UnityEngine; +namespace Unibas.DBIS.VREP.Movement +{ + /// + /// Taken from http://wiki.unity3d.com/index.php/SmoothMouseLook + /// + [AddComponentMenu("Camera-Control/Smooth Mouse Look")] + public class SmoothMouseLook : MonoBehaviour + { + public enum RotationAxes + { + MouseXAndY = 0, + MouseX = 1, + MouseY = 2 + } -/// -/// by http://wiki.unity3d.com/index.php/SmoothMouseLook -/// -[AddComponentMenu("Camera-Control/Smooth Mouse Look")] -public class SmoothMouseLook : MonoBehaviour { -public enum RotationAxes { MouseXAndY = 0, MouseX = 1, MouseY = 2 } - public RotationAxes axes = RotationAxes.MouseXAndY; - public float sensitivityX = 15F; - public float sensitivityY = 15F; - - public float minimumX = -360F; - public float maximumX = 360F; - - public float minimumY = -60F; - public float maximumY = 60F; - - float rotationX = 0F; - float rotationY = 0F; - - private List rotArrayX = new List(); - float rotAverageX = 0F; - - private List rotArrayY = new List(); - float rotAverageY = 0F; - - public float frameCounter = 20; - - Quaternion originalRotation; - - void Update () - { - if (axes == RotationAxes.MouseXAndY) - { - rotAverageY = 0f; - rotAverageX = 0f; - - rotationY += Input.GetAxis("Mouse Y") * sensitivityY; - rotationX += Input.GetAxis("Mouse X") * sensitivityX; - - rotArrayY.Add(rotationY); - rotArrayX.Add(rotationX); - - if (rotArrayY.Count >= frameCounter) { - rotArrayY.RemoveAt(0); - } - if (rotArrayX.Count >= frameCounter) { - rotArrayX.RemoveAt(0); - } - - for(int j = 0; j < rotArrayY.Count; j++) { - rotAverageY += rotArrayY[j]; - } - for(int i = 0; i < rotArrayX.Count; i++) { - rotAverageX += rotArrayX[i]; - } - - rotAverageY /= rotArrayY.Count; - rotAverageX /= rotArrayX.Count; - - rotAverageY = ClampAngle (rotAverageY, minimumY, maximumY); - rotAverageX = ClampAngle (rotAverageX, minimumX, maximumX); - - Quaternion yQuaternion = Quaternion.AngleAxis (rotAverageY, Vector3.left); - Quaternion xQuaternion = Quaternion.AngleAxis (rotAverageX, Vector3.up); - - transform.localRotation = originalRotation * xQuaternion * yQuaternion; - } - else if (axes == RotationAxes.MouseX) - { - rotAverageX = 0f; - - rotationX += Input.GetAxis("Mouse X") * sensitivityX; - - rotArrayX.Add(rotationX); - - if (rotArrayX.Count >= frameCounter) { - rotArrayX.RemoveAt(0); - } - for(int i = 0; i < rotArrayX.Count; i++) { - rotAverageX += rotArrayX[i]; - } - rotAverageX /= rotArrayX.Count; - - rotAverageX = ClampAngle (rotAverageX, minimumX, maximumX); - - Quaternion xQuaternion = Quaternion.AngleAxis (rotAverageX, Vector3.up); - transform.localRotation = originalRotation * xQuaternion; - } - else - { - rotAverageY = 0f; - - rotationY += Input.GetAxis("Mouse Y") * sensitivityY; - - rotArrayY.Add(rotationY); - - if (rotArrayY.Count >= frameCounter) { - rotArrayY.RemoveAt(0); - } - for(int j = 0; j < rotArrayY.Count; j++) { - rotAverageY += rotArrayY[j]; - } - rotAverageY /= rotArrayY.Count; - - rotAverageY = ClampAngle (rotAverageY, minimumY, maximumY); - - Quaternion yQuaternion = Quaternion.AngleAxis (rotAverageY, Vector3.left); - transform.localRotation = originalRotation * yQuaternion; - } - } - - void Start () - { - Rigidbody rb = GetComponent(); - if (rb) - rb.freezeRotation = true; - originalRotation = transform.localRotation; - } - - public static float ClampAngle (float angle, float min, float max) - { - angle = angle % 360; - if ((angle >= -360F) && (angle <= 360F)) { - if (angle < -360F) { - angle += 360F; - } - if (angle > 360F) { - angle -= 360F; - } - } - return Mathf.Clamp (angle, min, max); - } -} + public RotationAxes axes = RotationAxes.MouseXAndY; + public float sensitivityX = 15F; + public float sensitivityY = 15F; + + public float minimumX = -360F; + public float maximumX = 360F; + + public float minimumY = -60F; + public float maximumY = 60F; + + private float _rotationX; + private float _rotationY; + + private readonly List _rotArrayX = new List(); + private float _rotAverageX; + + private readonly List _rotArrayY = new List(); + private float _rotAverageY; + + public float frameCounter = 20; + + private Quaternion _originalRotation; + + private void Update() + { + switch (axes) + { + case RotationAxes.MouseXAndY: + { + _rotAverageY = 0f; + _rotAverageX = 0f; + + _rotationY += Input.GetAxis("Mouse Y") * sensitivityY; + _rotationX += Input.GetAxis("Mouse X") * sensitivityX; + + _rotArrayY.Add(_rotationY); + _rotArrayX.Add(_rotationX); + + if (_rotArrayY.Count >= frameCounter) + { + _rotArrayY.RemoveAt(0); + } + + if (_rotArrayX.Count >= frameCounter) + { + _rotArrayX.RemoveAt(0); + } + + foreach (var t in _rotArrayY) + { + _rotAverageY += t; + } + + foreach (var t in _rotArrayX) + { + _rotAverageX += t; + } + + _rotAverageY /= _rotArrayY.Count; + _rotAverageX /= _rotArrayX.Count; + + _rotAverageY = ClampAngle(_rotAverageY, minimumY, maximumY); + _rotAverageX = ClampAngle(_rotAverageX, minimumX, maximumX); + + var yQuaternion = Quaternion.AngleAxis(_rotAverageY, Vector3.left); + var xQuaternion = Quaternion.AngleAxis(_rotAverageX, Vector3.up); + + transform.localRotation = _originalRotation * xQuaternion * yQuaternion; + break; + } + case RotationAxes.MouseX: + { + _rotAverageX = 0f; + + _rotationX += Input.GetAxis("Mouse X") * sensitivityX; + + _rotArrayX.Add(_rotationX); + + if (_rotArrayX.Count >= frameCounter) + { + _rotArrayX.RemoveAt(0); + } + + foreach (var t in _rotArrayX) + { + _rotAverageX += t; + } + + _rotAverageX /= _rotArrayX.Count; + + _rotAverageX = ClampAngle(_rotAverageX, minimumX, maximumX); + + var xQuaternion = Quaternion.AngleAxis(_rotAverageX, Vector3.up); + transform.localRotation = _originalRotation * xQuaternion; + break; + } + default: + { + _rotAverageY = 0f; + + _rotationY += Input.GetAxis("Mouse Y") * sensitivityY; + + _rotArrayY.Add(_rotationY); + + if (_rotArrayY.Count >= frameCounter) + { + _rotArrayY.RemoveAt(0); + } + + foreach (var t in _rotArrayY) + { + _rotAverageY += t; + } + + _rotAverageY /= _rotArrayY.Count; + + _rotAverageY = ClampAngle(_rotAverageY, minimumY, maximumY); + + var yQuaternion = Quaternion.AngleAxis(_rotAverageY, Vector3.left); + transform.localRotation = _originalRotation * yQuaternion; + break; + } + } + } + + private void Start() + { + var rb = GetComponent(); + if (rb) + rb.freezeRotation = true; + _originalRotation = transform.localRotation; + } + + public static float ClampAngle(float angle, float min, float max) + { + angle %= 360; + if (!(angle >= -360F) || !(angle <= 360F)) return Mathf.Clamp(angle, min, max); + + if (angle < -360F) + { + angle += 360F; + } + + if (angle > 360F) + { + angle -= 360F; + } + + return Mathf.Clamp(angle, min, max); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Multimedia/AudioLoader.cs b/Assets/Scripts/Unibas/DBIS/VREP/Multimedia/AudioLoader.cs index 3edf6fbd..8cbf6c7c 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/Multimedia/AudioLoader.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/Multimedia/AudioLoader.cs @@ -2,86 +2,92 @@ using UnityEngine; using UnityEngine.Networking; -namespace DefaultNamespace +namespace Unibas.DBIS.VREP.Multimedia { - - public class AudioLoader : MonoBehaviour - { - private AudioSource audioSource; + /// + /// Audio loader component for exhibits. + /// + public class AudioLoader : MonoBehaviour + { + private AudioSource _audioSource; - private bool _loaded = false; - private string _lastUrl = null; + private bool _loaded; + private string _lastUrl; + private void Start() + { + _audioSource = gameObject.AddComponent(); + } - // Use this for initialization - void Start() - { - audioSource = gameObject.AddComponent(); - } + /// + /// Loads an audio source from the provided URL. + /// + /// The full audio URL. + /// The result yielded from the request. + private IEnumerator LoadAudio(string url) + { + if (_loaded && _lastUrl.Equals(url)) + { + Play(); + yield break; + } - private IEnumerator LoadAudio(string url) - { - if (_loaded && _lastUrl.Equals(url)) - { - Play(); - yield break; - } + using var request = UnityWebRequestMultimedia.GetAudioClip(url, AudioType.OGGVORBIS); + yield return request.SendWebRequest(); - using (var request = UnityWebRequestMultimedia.GetAudioClip(url, AudioType.OGGVORBIS)) - { - yield return request.SendWebRequest(); - if (!(request.isNetworkError || request.isHttpError)) - { - var audioClip = DownloadHandlerAudioClip.GetContent(request); - this.audioSource.clip = audioClip; - this.audioSource.volume = 0.2f; - this.audioSource.loop = true; - this.audioSource.Play(); - _loaded = true; - _lastUrl = url; - } - else - { - Debug.LogError(request.error); - Debug.LogError(request.url); - Debug.LogError(request.GetResponseHeaders()); - } - } - } + if (!(request.result == UnityWebRequest.Result.ConnectionError || + request.result == UnityWebRequest.Result.ProtocolError)) + { + var audioClip = DownloadHandlerAudioClip.GetContent(request); - /// - /// Plays the audio which was previosuly loaded via ReloadAudio(). - /// - public void Play() - { - if (_loaded) - { - audioSource.Play(); - } - else - { - ReloadAudio(_lastUrl); - } - } + _audioSource.clip = audioClip; + _audioSource.volume = 0.2f; + _audioSource.loop = true; + _audioSource.Play(); + _loaded = true; + _lastUrl = url; + } + else + { + Debug.LogError(request.error); + Debug.LogError(request.url); + Debug.LogError(request.GetResponseHeaders()); + } + } - /// - /// - /// - public void Stop() - { - audioSource.Stop(); - } + /// + /// Plays the audio which was previously loaded via ReloadAudio(). + /// + public void Play() + { + if (_loaded) + { + _audioSource.Play(); + } + else + { + ReloadAudio(_lastUrl); + } + } - /// - /// - /// - /// - public void ReloadAudio(string url) - { - if (!string.IsNullOrEmpty(url)) - { - StartCoroutine(LoadAudio(url)); - } - } + /// + /// Stops the audio which was previously loaded (and playing). + /// + public void Stop() + { + _audioSource.Stop(); + } + + /// + /// Reloads an audio source from the provided URL. + /// + /// The full audio source URL. + public void ReloadAudio(string url) + { + if (!string.IsNullOrEmpty(url)) + { + StartCoroutine(LoadAudio(url)); + } } + } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Multimedia/ImageLoader.cs b/Assets/Scripts/Unibas/DBIS/VREP/Multimedia/ImageLoader.cs index 3610e530..4f1a7d5a 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/Multimedia/ImageLoader.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/Multimedia/ImageLoader.cs @@ -3,58 +3,69 @@ using UnityEngine; using UnityEngine.Networking; -public class ImageLoader : MonoBehaviour { - - private MeshRenderer _renderer; - - // Use this for initialization - void Start () { - } - - private IEnumerator LoadImage(string url) - { - if (_renderer == null) - { - _renderer = GetComponent(); - } - Texture2D tex = new Texture2D(512, 512, TextureFormat.ARGB32, true); - var hasError = false; - using (var request = UnityWebRequestTexture.GetTexture(url)) - { - yield return request.SendWebRequest(); - if (!(request.isNetworkError || request.isHttpError)) - { - tex = DownloadHandlerTexture.GetContent(request); - } - else - { - Debug.LogError(request.error); - Debug.LogError(request.url); - Debug.LogError(request.GetResponseHeaders()); - hasError = true; - } - } - - if (hasError) - { - _renderer.material.mainTexture = Resources.Load("Textures/not-available"); - } - else - { - _renderer.material.mainTexture = tex; - } - GC.Collect(); - } - - /// - /// - /// - /// - public void ReloadImage(string url) - { - StartCoroutine(LoadImage(url)); - } - -} +namespace Unibas.DBIS.VREP.Multimedia +{ + /// + /// Image loader component for exhibits. + /// + public class ImageLoader : MonoBehaviour + { + private MeshRenderer _renderer; + /// + /// Reloads an image from the provided URL. If the image is too large, it gets downscaled to reduce memory usage. + /// This allows larger exhibitions. + /// + /// The full image URL. + /// The result yielded from the request. + private IEnumerator LoadImage(string url) + { + if (_renderer == null) + { + _renderer = GetComponent(); + } + var tex = new Texture2D(512, 512, TextureFormat.ARGB32, true); + var hasError = false; + + // Do NOT use UnityWebRequestTexture here or you will run out of memory quickly if you load many images. + using (var request = UnityWebRequest.Get(url)) + { + yield return request.SendWebRequest(); + if (!(request.result == UnityWebRequest.Result.ConnectionError || + request.result == UnityWebRequest.Result.ProtocolError)) + { + tex.LoadImage(request.downloadHandler.data); + + // Rescale so we don't run out of memory upon loading huge images. + // TODO This should only be a temporary resolution; consider adjusting this based on the exhibits size vector. + if (tex.height > 1024 || tex.width > 1024) + { + var resize = 1024.0 / Math.Max(tex.height, tex.width); + TextureScale.Bilinear(tex, (int) (tex.width * resize), (int) (tex.height * resize)); + } + } + else + { + Debug.LogError(request.error); + Debug.LogError(request.url); + Debug.LogError(request.GetResponseHeaders()); + hasError = true; + } + } + + _renderer.material.mainTexture = hasError ? Resources.Load("Textures/not-available") : tex; + + GC.Collect(); + } + + /// + /// Reloads an image from the provided URL. + /// + /// The full image URL. + public void ReloadImage(string url) + { + StartCoroutine(LoadImage(url)); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Multimedia/TextureScale.cs b/Assets/Scripts/Unibas/DBIS/VREP/Multimedia/TextureScale.cs new file mode 100644 index 00000000..3462ee33 --- /dev/null +++ b/Assets/Scripts/Unibas/DBIS/VREP/Multimedia/TextureScale.cs @@ -0,0 +1,176 @@ +namespace Unibas.DBIS.VREP.Multimedia +{ + using System.Threading; + using UnityEngine; + + /// + /// Taken from http://wiki.unity3d.com/index.php/TextureScale + /// Copyright to Eric Haines. + /// Only works on ARGB32, RGB24 and Alpha8 textures that are marked readable. + /// + public class TextureScale + { + public class ThreadData + { + public int start; + public int end; + + public ThreadData(int s, int e) + { + start = s; + end = e; + } + } + + private static Color[] texColors; + private static Color[] newColors; + private static int w; + private static float ratioX; + private static float ratioY; + private static int w2; + private static int finishCount; + private static Mutex mutex; + + public static void Point(Texture2D tex, int newWidth, int newHeight) + { + ThreadedScale(tex, newWidth, newHeight, false); + } + + public static Texture2D Bilinear(Texture2D tex, int newWidth, int newHeight) + { + return ThreadedScale(tex, newWidth, newHeight, true); + } + + private static Texture2D ThreadedScale(Texture2D tex, int newWidth, int newHeight, bool useBilinear) + { + texColors = tex.GetPixels(); + newColors = new Color[newWidth * newHeight]; + if (useBilinear) + { + ratioX = 1.0f / ((float) newWidth / (tex.width - 1)); + ratioY = 1.0f / ((float) newHeight / (tex.height - 1)); + } + else + { + ratioX = ((float) tex.width) / newWidth; + ratioY = ((float) tex.height) / newHeight; + } + + w = tex.width; + w2 = newWidth; + var cores = Mathf.Min(SystemInfo.processorCount, newHeight); + var slice = newHeight / cores; + + finishCount = 0; + if (mutex == null) + { + mutex = new Mutex(false); + } + + if (cores > 1) + { + int i = 0; + ThreadData threadData; + for (i = 0; i < cores - 1; i++) + { + threadData = new ThreadData(slice * i, slice * (i + 1)); + ParameterizedThreadStart ts = useBilinear + ? new ParameterizedThreadStart(BilinearScale) + : new ParameterizedThreadStart(PointScale); + Thread thread = new Thread(ts); + thread.Start(threadData); + } + + threadData = new ThreadData(slice * i, newHeight); + if (useBilinear) + { + BilinearScale(threadData); + } + else + { + PointScale(threadData); + } + + while (finishCount < cores) + { + Thread.Sleep(1); + } + } + else + { + ThreadData threadData = new ThreadData(0, newHeight); + if (useBilinear) + { + BilinearScale(threadData); + } + else + { + PointScale(threadData); + } + } + + tex.Resize(newWidth, newHeight); + tex.SetPixels(newColors); + tex.Apply(); + + texColors = null; + newColors = null; + + return tex; + } + + public static void BilinearScale(System.Object obj) + { + ThreadData threadData = (ThreadData) obj; + for (var y = threadData.start; y < threadData.end; y++) + { + int yFloor = (int) Mathf.Floor(y * ratioY); + var y1 = yFloor * w; + var y2 = (yFloor + 1) * w; + var yw = y * w2; + + for (var x = 0; x < w2; x++) + { + int xFloor = (int) Mathf.Floor(x * ratioX); + var xLerp = x * ratioX - xFloor; + + newColors[yw + x] = ColorLerpUnclamped( + ColorLerpUnclamped(texColors[y1 + xFloor], texColors[y1 + xFloor + 1], xLerp), + ColorLerpUnclamped(texColors[y2 + xFloor], texColors[y2 + xFloor + 1], xLerp), + y * ratioY - yFloor); + } + } + + mutex.WaitOne(); + finishCount++; + mutex.ReleaseMutex(); + } + + public static void PointScale(System.Object obj) + { + ThreadData threadData = (ThreadData) obj; + for (var y = threadData.start; y < threadData.end; y++) + { + var thisY = (int) (ratioY * y) * w; + var yw = y * w2; + + for (var x = 0; x < w2; x++) + { + newColors[yw + x] = texColors[(int) (thisY + ratioX * x)]; + } + } + + mutex.WaitOne(); + finishCount++; + mutex.ReleaseMutex(); + } + + private static Color ColorLerpUnclamped(Color c1, Color c2, float value) + { + return new Color(c1.r + (c2.r - c1.r) * value, + c1.g + (c2.g - c1.g) * value, + c1.b + (c2.b - c1.b) * value, + c1.a + (c2.a - c1.a) * value); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Multimedia/TextureScale.cs.meta b/Assets/Scripts/Unibas/DBIS/VREP/Multimedia/TextureScale.cs.meta new file mode 100644 index 00000000..5f919389 --- /dev/null +++ b/Assets/Scripts/Unibas/DBIS/VREP/Multimedia/TextureScale.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 98cb3e5e07464b2a83873e6e30e0090b +timeCreated: 1626784288 \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Utils/ClosenessDetector.cs b/Assets/Scripts/Unibas/DBIS/VREP/Utils/ClosenessDetector.cs index ccf8642b..9bd07313 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/Utils/ClosenessDetector.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/Utils/ClosenessDetector.cs @@ -3,90 +3,102 @@ using UnityEngine; using UnityEngine.Networking; +namespace Unibas.DBIS.VREP.Utils +{ + /// + /// Closeness detector component to load and play audio sources. + /// + public class ClosenessDetector : MonoBehaviour + { + public string url; + private AudioSource _audioSource; + private bool _playing; + private bool _downloading; -public class ClosenessDetector : MonoBehaviour { - public string url; - private AudioSource audioSource; - private bool playing = false; - private bool downloading = false; + public float maxDistance = 2; - public float maxDistance = 2; - - // Use this for initialization - private void Start() - { - audioSource = gameObject.AddComponent(); - } + /// + /// Add component to audio source. + /// + private void Start() + { + _audioSource = gameObject.AddComponent(); + } + /// + /// Play or stop audio if the camera is close enough to the object. + /// + private void Update() + { + var cameraPosition = Camera.allCameras[0].transform.position; + var objectPosition = gameObject.transform.position; - private void Update() - { - var cameraPosition = Camera.allCameras[0].transform.position; - var objectPosition = this.gameObject.transform.position; + // Load audio if it hasn't been previously loaded/assigned. + if (!string.IsNullOrEmpty(url) && _audioSource.clip == null && !_downloading) + { + _downloading = true; + StartCoroutine(LoadAudio(url)); + } - if (!string.IsNullOrEmpty(url) && this.audioSource.clip == null && !downloading) - { - downloading = true; - StartCoroutine(LoadAudio(url)); - } + var dist = Vector3.Distance(cameraPosition, objectPosition); - var dist = Vector3.Distance(cameraPosition, objectPosition); - - if (Math.Abs(dist) < maxDistance){ - Play(); - } else - { - Stop(); - } - } + if (Math.Abs(dist) < maxDistance) + { + Play(); + } + else + { + Stop(); + } + } - private IEnumerator LoadAudio(string url) - { - using (var request = UnityWebRequestMultimedia.GetAudioClip(url, AudioType.OGGVORBIS)){ - yield return request.SendWebRequest(); + /// + /// Sends a request to load the specified audio file from VREM. + /// + /// The URL of the audio file. + /// The result yielded from the request. + private IEnumerator LoadAudio(string audioURL) + { + using var request = UnityWebRequestMultimedia.GetAudioClip(audioURL, AudioType.OGGVORBIS); - if (!(request.isNetworkError || request.isHttpError)) { - var audioClip = DownloadHandlerAudioClip.GetContent(request); - this.audioSource.clip = audioClip; - } - else - { - Debug.LogError(request.error); - Debug.LogError(request.url); - Debug.LogError(request.GetResponseHeaders()); - } - } - } + yield return request.SendWebRequest(); - - /// - /// - /// - public void Play() - { - if (!playing && !AudioListener.pause && audioSource != null && audioSource.clip != null) - { - AudioListener.pause = true; - audioSource.ignoreListenerPause = true; - audioSource.Play(); - playing = true; - } - } + if (!(request.result == UnityWebRequest.Result.ConnectionError || + request.result == UnityWebRequest.Result.ProtocolError)) + { + var audioClip = DownloadHandlerAudioClip.GetContent(request); + _audioSource.clip = audioClip; + } + else + { + Debug.LogError(request.error); + Debug.LogError(request.url); + Debug.LogError(request.GetResponseHeaders()); + } + } - /// - /// - /// - public void Stop() - { - if (playing && AudioListener.pause && audioSource != null && audioSource.clip != null) - { - audioSource.Stop(); - playing = false; - audioSource.ignoreListenerPause = false; - AudioListener.pause = false; - } - } - - -} + /// + /// Plays the audio file in this component. + /// + public void Play() + { + if (_playing || AudioListener.pause || _audioSource == null || _audioSource.clip == null) return; + AudioListener.pause = true; + _audioSource.ignoreListenerPause = true; + _audioSource.Play(); + _playing = true; + } + /// + /// Stops the audio file of this component. + /// + public void Stop() + { + if (!_playing || !AudioListener.pause || _audioSource == null || _audioSource.clip == null) return; + _audioSource.Stop(); + _playing = false; + _audioSource.ignoreListenerPause = false; + AudioListener.pause = false; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Utils/ScalingUtility.cs b/Assets/Scripts/Unibas/DBIS/VREP/Utils/ScalingUtility.cs index cde6683a..18ba1f7c 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/Utils/ScalingUtility.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/Utils/ScalingUtility.cs @@ -1,26 +1,31 @@ using UnityEngine; -namespace DefaultNamespace { - public class ScalingUtility { - +namespace Unibas.DBIS.VREP.Utils +{ + /// + /// Utility class for scaling vectors from meters to plane scale and back. + /// + public static class ScalingUtility + { /// - /// Transforms sizes from meters to unity scales + /// Transforms sizes from meters to unity scales. /// - /// width in meters - /// height in meters - /// - public static Vector3 convertMeters2PlaneScaleSize(float meterWidth, float meterHeight) { - return convertMeters2PlaceScaleSize(new Vector3(meterWidth, 1, meterHeight)); + /// The width in meters. + /// The height in meters. + /// The transformed vector. + public static Vector3 ConvertMeters2PlaneScaleSize(float meterWidth, float meterHeight) + { + return ConvertMeters2PlaceScaleSize(new Vector3(meterWidth, 1, meterHeight)); } /// - /// Transforms sizes from meters to unity scales + /// Transforms sizes from meters to unity scales. /// - /// size in meters - /// - private static Vector3 convertMeters2PlaceScaleSize(Vector3 meterSize) { + /// The size in meters. + /// The transformed vector. + private static Vector3 ConvertMeters2PlaceScaleSize(Vector3 meterSize) + { return meterSize / 10f; } - } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Utils/ServerSettings.cs b/Assets/Scripts/Unibas/DBIS/VREP/Utils/ServerSettings.cs deleted file mode 100644 index 99e6f3b9..00000000 --- a/Assets/Scripts/Unibas/DBIS/VREP/Utils/ServerSettings.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace DefaultNamespace { - public class ServerSettings { - [Obsolete("Replaced by settings.")] - public static string SERVER_ID = "http://localhost:4567/"; - } -} \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Utils/ServerSettings.cs.meta b/Assets/Scripts/Unibas/DBIS/VREP/Utils/ServerSettings.cs.meta deleted file mode 100644 index 9373fc23..00000000 --- a/Assets/Scripts/Unibas/DBIS/VREP/Utils/ServerSettings.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: c835f0d6499e4555a8b83448696e27a2 -timeCreated: 1540626511 \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Utils/TexturedMonoBehaviour.cs b/Assets/Scripts/Unibas/DBIS/VREP/Utils/TexturedMonoBehaviour.cs index c32a4a93..dd58bc33 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/Utils/TexturedMonoBehaviour.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/Utils/TexturedMonoBehaviour.cs @@ -1,35 +1,38 @@ using UnityEngine; -namespace DefaultNamespace { - - - public class TexturedMonoBehaviour : MonoBehaviour { - +namespace Unibas.DBIS.VREP.Utils +{ + /// + /// Loads materials from the resource folders. + /// Currently not used. + /// + public class TexturedMonoBehaviour : MonoBehaviour + { /// /// Loads the specified material as the renderer's main material. /// - /// The material to load - public void LoadMaterial(Material material) { - Renderer rend = GetComponent(); + /// The material to load. + public void LoadMaterial(Material material) + { + var rend = GetComponent(); if (rend != null && material != null) { rend.material = material; } } - + /// /// Loads the specified material from the resources folder. - /// The material must be a valid Unity3D material stored in Resources/Materials/ - /// The name of the material, as it is stored in Resources/Materials/ + /// The material must be a valid Unity3D material stored in Resources/Materials/. + /// The name of the material, as it is stored in Resources/Materials/. /// public void LoadMaterial(string materialName) { - Debug.Log("Loading material " + materialName); - + Debug.Log("Loading material " + materialName + "."); + var material = Resources.Load("Materials/" + materialName, typeof(Material)) as Material; - + LoadMaterial(material); } - } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/Utils/TexturingUtility.cs b/Assets/Scripts/Unibas/DBIS/VREP/Utils/TexturingUtility.cs index edae0510..5e971f6c 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/Utils/TexturingUtility.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/Utils/TexturingUtility.cs @@ -1,102 +1,69 @@ -using System; -using System.Collections; using UnityEngine; -namespace DefaultNamespace +namespace Unibas.DBIS.VREP.Utils { - public class TexturingUtility + /// + /// Utility for loading textures/Material objects. + /// + public static class TexturingUtility + { + public static string Translate(string name) { - public static string Translate(string name) - { - var material = ""; + var material = name switch + { + "BRICKS" => "NBricksMaterial", + "CONCRETE" => "NConcreteMaterial", + "CONCRETETILES" => "NConcreteMaterial", + "FABRIC" => "Fabric02Material", + "GOLD" => "GoldMaterial", + "LOUISXIV" => "LouisXIVMaterial", + "SCRATCHES" => "ScratchesMaterial", + "SILVER" => "ShinySilverMaterial", + "STARS" => "StarMaterial", + "TILES" => "TilesMaterial", + "WALLPAPER" => "WallpaperMaterial", + "WOOD1" => "NWoodFloorMaterial", + "WOOD2" => "NWoodMaterial", + "WOOD3" => "WoodMaterial3", + "NONE" => "", + _ => name + }; - switch (name) - { - case "BRICKS": - material = "NBricksMaterial"; - break; - case "CONCRETE": - material = "NConcreteMaterial"; - break; - case "CONCRETETILES": - material = "NConcreteMaterial"; - break; - case "FABRIC": - material = "Fabric02Material"; - break; - case "GOLD": - material = "GoldMaterial"; - break; - case "LOUISXIV": - material = "LouisXIVMaterial"; - break; - case "SCRATCHES": - material = "ScratchesMaterial"; - break; - case "SILVER": - material = "ShinySilverMaterial"; - break; - case "STARS": - material = "StarMaterial"; - break; - case "TILES": - material = "TilesMaterial"; - break; - case "WALLPAPER": - material = "WallpaperMaterial"; - break; - case "WOOD1": - material = "NWoodFloorMaterial"; - break; - case "WOOD2": - material = "NWoodMaterial"; - break; - case "WOOD3": - material = "WoodMaterial3"; - break; - case "NONE": - material = ""; - break; - default: - material = name; - break; - } + return material; + } - return material; - } + /// + /// Loads a Material object by name (e.g., from a wall model of VREM). + /// + /// The name of the texture. + /// Whether to translate from a shorter/more intuitive name. + /// The loaded Material according to the specified texture. + public static Material LoadMaterialByName(string name, bool translate = false) + { + var material = name; + if (translate) + { + material = Translate(name); + } - public static Material LoadMaterialByName(string name, bool translate = false) - { - string material = name; - if (translate) - { - material = Translate(name); - } - //else - //{ - if (!material.EndsWith("Material")) - { - material = material + "Material"; - } + if (!material.EndsWith("Material")) + { + material += "Material"; + } - //material = name; - //} + if (!string.IsNullOrEmpty(material)) + { + var mat = Resources.Load("Materials/" + material, typeof(Material)) as Material; + if (mat == null) + { + Debug.LogWarning("Couldn't load material for name: " + material); + } + return mat; + } - if (!string.IsNullOrEmpty(material)) - { - var mat = Resources.Load("Materials/" + material, typeof(Material)) as Material; - if (mat == null) - { - Debug.LogWarning("Couldn't load material for name: "+material); - } - return mat; - } - else - { - return null; //TODO: return default material - } - } + return null; // TODO Return default material. } + } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/VREM/ListExhibitionsResponse.cs b/Assets/Scripts/Unibas/DBIS/VREP/VREM/ListExhibitionsResponse.cs index f556c1a9..073d976c 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/VREM/ListExhibitionsResponse.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/VREM/ListExhibitionsResponse.cs @@ -1,11 +1,14 @@ -using System; -using DefaultNamespace.VREM.Model; - -namespace DefaultNamespace.VREM -{ - [Serializable] - public class ListExhibitionsResponse - { - public ExhibitionSummary[] exhibitions; - } +using System; +using Unibas.DBIS.VREP.VREM.Model; + +namespace Unibas.DBIS.VREP.VREM +{ + /// + /// ch.unibas.dmi.dbis.vrem.model.api.ListExhibitionsResponse + /// + [Serializable] + public class ListExhibitionsResponse + { + public ExhibitionSummary[] exhibitions; + } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/Exhibit.cs b/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/Exhibit.cs index 7fdb57f6..bf50e599 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/Exhibit.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/Exhibit.cs @@ -1,44 +1,58 @@ -using System; -using System.Collections.Generic; -using Unibas.DBIS.VREP; -using UnityEngine; - -namespace DefaultNamespace.VREM.Model { - - /// - /// ch.unibas.dmi.dbis.vrem.model.Ehibit - /// - [Serializable] - public class Exhibit { - public string id; - public string name; - public string type; - public string path; - public string description; - - public string audio; - public bool light; - - public Dictionary metadata; - - public Vector3 position; - public Vector3 size; - - public string GetURLEncodedPath() { - return VREPController.Instance.Settings.VREMAddress+"content/get/"+path.Substring(0).Replace("/", "%2F").Replace(" ", "%20"); - } - - public string GetURLEncodedAudioPath() { - if (!string.IsNullOrEmpty(audio)) { - //return "https://upload.wikimedia.org/wikipedia/commons/7/7b/FurElise.ogg"; - return VREPController.Instance.Settings.VREMAddress+"content/get/"+ audio.Substring(0).Replace("/", "%2F").Replace(" ", "%20"); - } - else - { - return null; - } - } - - - } +using System; +using System.Collections.Generic; +using Unibas.DBIS.VREP.Core; +using UnityEngine; +using Valve.Newtonsoft.Json; + +namespace Unibas.DBIS.VREP.VREM.Model +{ + /// + /// ch.unibas.dmi.dbis.vrem.model.exhibition.Exhibit + /// + [Serializable] + public class Exhibit + { + [JsonProperty("_id")] public string id; + public string name; + public string type; + public string path; + public string description; + + public string audio; + public bool light; + + public Dictionary Metadata; + + public Vector3 position; + public Vector3 size; + + /// + /// Composes the URL where an exhibit's image file can be found via the VREM API. + /// Note that this relies on exhibition ID stored in the configuration of the controller. + /// + /// A string with the full path/URL to the image of the exhibit. + public string GetURLEncodedPath() + { + return VrepController.Instance.settings.VremAddress + "content/get/" + + VrepController.Instance.settings.ExhibitionId + "%2F" + + path.Substring(0).Replace("/", "%2F").Replace(" ", "%20"); + } + + /// + /// Composes the URL where the audio for an exhibit can be found via the VREM API. + /// Note that this relies on exhibition ID stored in the configuration of the controller. + /// + /// A string with the full path/URL to the audio of the exhibit. + public string GetURLEncodedAudioPath() + { + if (!string.IsNullOrEmpty(audio)) + { + return VrepController.Instance.settings.VremAddress + "content/get/" + + VrepController.Instance.settings.ExhibitionId + "%2F" + + audio.Substring(0).Replace("/", "%2F").Replace(" ", "%20"); + } + + return null; + } + } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/Exhibition.cs b/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/Exhibition.cs index 6e7b5fdd..14063c5e 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/Exhibition.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/Exhibition.cs @@ -1,21 +1,18 @@ using System; -using System.Collections.Generic; -using UnityEngine; +using Valve.Newtonsoft.Json; -namespace DefaultNamespace.VREM.Model { - +namespace Unibas.DBIS.VREP.VREM.Model +{ /// /// ch.unibas.dmi.dbis.vrem.model.exhibition.Exhibition /// [Serializable] - public class Exhibition { - - public string id; + public class Exhibition + { + [JsonProperty("_id")] public string id; public string name; public string description; - - public Room[] rooms; - + public Room[] rooms; } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/ExhibitionSummary.cs b/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/ExhibitionSummary.cs index 8f4af880..095e7904 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/ExhibitionSummary.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/ExhibitionSummary.cs @@ -1,8 +1,14 @@ -namespace DefaultNamespace.VREM.Model -{ - public class ExhibitionSummary - { - public string objectId; - public string name; - } +using System; + +namespace Unibas.DBIS.VREP.VREM.Model +{ + /// + /// ch.unibas.dmi.dbis.vrem.model.exhibition.ExhibitionSummary + /// + [Serializable] + public class ExhibitionSummary + { + public string id; + public string name; + } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/Room.cs b/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/Room.cs index 31658bf8..10ce2f42 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/Room.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/Room.cs @@ -1,50 +1,49 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using World; - -namespace DefaultNamespace.VREM.Model { - [Serializable] - public class Room { - - public string text; - public Vector3 size; - public Vector3 position; - public Vector3 entrypoint; - public Wall[] walls; - - public string floor; - public string ceiling; - - public string ambient; - - public Exhibit[] exhibits; - - - public string GetURLEncodedAudioPath() { - if (!string.IsNullOrEmpty(ambient)) - { - return ServerSettings.SERVER_ID+"content/get/"+ ambient.Substring(0).Replace("/", "%2F").Replace(" ", "%20"); - } - else - { - return null; - } - - } - - public Wall GetWall(WallOrientation orientation) - { - foreach (var wall in walls) - { - WallOrientation wor = (WallOrientation) Enum.Parse(typeof(WallOrientation), wall.direction, true); - if (wor.Equals(orientation)) - { - return wall; - } - } - - return null; - } - } +using System; +using System.Linq; +using Unibas.DBIS.VREP.Core; +using Unibas.DBIS.VREP.Utils; +using Unibas.DBIS.VREP.World; +using UnityEngine; + +namespace Unibas.DBIS.VREP.VREM.Model +{ + /// + /// ch.unibas.dmi.dbis.vrem.model.exhibition.Room + /// + [Serializable] + public class Room + { + public string text; + public Vector3 size; + public Vector3 position; + public Vector3 entrypoint; + public Wall[] walls; + + public string floor; + public string ceiling; + + public string ambient; + + public Exhibit[] exhibits; + + public string GetURLEncodedAudioPath() + { + if (!string.IsNullOrEmpty(ambient)) + { + return VrepController.Instance.settings.VremAddress + "/content/get/" + + ambient.Substring(0).Replace("/", "%2F").Replace(" ", "%20"); + } + + return null; + } + + public Wall GetWall(WallOrientation orientation) + { + return (from wall in walls + let wor = (WallOrientation) Enum.Parse(typeof(WallOrientation), wall.direction, true) + where wor.Equals(orientation) + select wall) + .FirstOrDefault(); + } + } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/Wall.cs b/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/Wall.cs index 5466ac45..84064395 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/Wall.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/VREM/Model/Wall.cs @@ -1,23 +1,27 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using World; - -namespace DefaultNamespace.VREM.Model { - [Serializable] - public class Wall { - - public Vector3 color; - public string direction; - - public Exhibit[] exhibits; - - public string texture; // NONE -> debug: colors - - public WallOrientation GetOrientation() - { - return (WallOrientation) Enum.Parse(typeof(WallOrientation), direction, true); - } - - } +using System; +using Unibas.DBIS.VREP.World; +using UnityEngine; + +namespace Unibas.DBIS.VREP.VREM.Model +{ + /// + /// ch.unibas.dmi.dbis.vrem.model.exhibition.Wall + /// + [Serializable] + public class Wall + { + public string direction; + public string texture; + public Vector3 color; + public Exhibit[] exhibits; + + /// + /// Obtains the WallOrientation enum/direction of this wall object. + /// + /// + public WallOrientation GetOrientation() + { + return (WallOrientation) Enum.Parse(typeof(WallOrientation), direction, true); + } + } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/VREM/VREMClient.cs b/Assets/Scripts/Unibas/DBIS/VREP/VREM/VREMClient.cs deleted file mode 100644 index 9a412b61..00000000 --- a/Assets/Scripts/Unibas/DBIS/VREP/VREM/VREMClient.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System; -using System.Collections; -using System.Text; -using UnityEngine; -using UnityEngine.Networking; - -namespace DefaultNamespace.VREM -{ - public class VREMClient : MonoBehaviour - { - public string ServerUrl; - private string suffix; - - private string response; - - private const string LOAD_EXHIBITION_ACTION = "exhibitions/load/"; - private const string LIST_EXHIBITIONS_ACTION = "exhibitions/list"; - - private Action responseProcessor; - - /// - /// Requests an exhibition and calls the processor, once the exhibition is loaded. - /// - /// The ID of the exhibition - /// An Action which processes VREM's response. If null is passed to that action, an error occurred - public void RequestExhibition(string exhibitionId, Action processor) - { - // TODO Refactor Action to a proper interface - this.suffix = exhibitionId; - responseProcessor = processor; - StartCoroutine(DoExhibitionRequest()); - } - - private IEnumerator DoExhibitionRequest() - { - SanitizeServerUrl(); - - Debug.Log("[VREMClient] Requesting... "+ServerUrl+LOAD_EXHIBITION_ACTION+suffix); - using (var request = UnityWebRequest.Get(ServerUrl + LOAD_EXHIBITION_ACTION + suffix)) - { - yield return request.SendWebRequest(); - if (!(request.isNetworkError || request.isHttpError)) - { - response = request.downloadHandler.text; - if (responseProcessor != null) - { - responseProcessor.Invoke(response); - } - } - else - { - Debug.LogError(request.error); - // TODO Error, handle it! - error = true; - responseProcessor.Invoke(null); - } - } - } - - private IEnumerator DoListExhibitionRequest() - { - SanitizeServerUrl(); - - Debug.Log("[VREMClient] Requesting exhibition list "); - using (var request = UnityWebRequest.Get(ServerUrl+LIST_EXHIBITIONS_ACTION)) - { - yield return request.SendWebRequest(); - if (!(request.isNetworkError || request.isHttpError)) - { - response = request.downloadHandler.text; - // TODO Parse list of IDs and further loading of the exhibitions. - // Will induce follow-up DoExhibitonRequests - } - else - { - Debug.LogError(request.error); - // TODO Handle error properly - error = true; - responseProcessor.Invoke(null); - } - } - } - - private void SanitizeServerUrl() - { - if (!ServerUrl.StartsWith("http://")) - { - ServerUrl = "http://" + ServerUrl; - } - - if (!ServerUrl.EndsWith("/")) - { - ServerUrl = ServerUrl + "/"; - } - } - - private bool error = false; - - public bool HasError() - { - return error; - } - - /** - * Generates a WWW object with given params - * - * @param url - A string which represents the url - * @param json - The json data to send, as a string - * - */ - public static WWW GenerateJSONPostRequest(string url, string json) - { - Hashtable headers = new Hashtable(); - headers.Add("Content-Type", "application/json"); - byte[] postData = Encoding.ASCII.GetBytes(json.ToCharArray()); - return new WWW(url, - postData); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/VREM/VremClient.cs b/Assets/Scripts/Unibas/DBIS/VREP/VREM/VremClient.cs new file mode 100644 index 00000000..1df8fd6d --- /dev/null +++ b/Assets/Scripts/Unibas/DBIS/VREP/VREM/VremClient.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections; +using UnityEngine; +using UnityEngine.Networking; + +namespace Unibas.DBIS.VREP.VREM +{ + /// + /// VREM client handling requests to the VREM API to load exhibitions/exhibits. + /// + public class VremClient : MonoBehaviour + { + public string serverUrl; + private string _suffix; + private string _response; + + private const string LoadExhibitionAction = "exhibitions/load/"; + private const string ListExhibitionsAction = "exhibitions/list"; + + private Action _responseProcessor; + + /// + /// Requests an exhibition and calls the processor, once the exhibition is loaded. + /// + /// The ID of the exhibition. + /// An Action which processes VREM's response (e.g., VrepController.ParseExhibition()) + public void RequestExhibition(string exhibitionId, Action processor) + { + // TODO Refactor Action to a proper interface. + _suffix = exhibitionId; + _responseProcessor = processor; + StartCoroutine(DoExhibitionRequest()); + } + + /// + /// Executes an exhibition request based on the parameters that have been set previously. + /// Invoked via Coroutine. + /// + /// The result yielded from the request. + private IEnumerator DoExhibitionRequest() + { + SanitizeServerUrl(); + + Debug.Log("[VREMClient] Requesting " + serverUrl + LoadExhibitionAction + _suffix + "."); + + using var request = UnityWebRequest.Get(serverUrl + LoadExhibitionAction + _suffix); + yield return request.SendWebRequest(); + + if (!(request.result == UnityWebRequest.Result.ConnectionError || + request.result == UnityWebRequest.Result.ProtocolError)) + { + _response = request.downloadHandler.text; + _responseProcessor?.Invoke(_response); + } + else + { + Debug.LogError(request.error); + // TODO Error, handle it! + _error = true; + _responseProcessor.Invoke(null); + } + } + + /// + /// Executes a request to list all stored exhibitions (IDs & names, as in ExhibitionSummary objects). + /// + /// The result yielded from the request. + private IEnumerator DoListExhibitionRequest() + { + // TODO Implement this. + SanitizeServerUrl(); + + Debug.Log("[VREMClient] Requesting exhibition list."); + + using var request = UnityWebRequest.Get(serverUrl + ListExhibitionsAction); + yield return request.SendWebRequest(); + + if (!(request.result == UnityWebRequest.Result.ConnectionError || + request.result == UnityWebRequest.Result.ProtocolError)) + { + _response = request.downloadHandler.text; + // TODO Parse list of IDs and names of the ExhibitionSummary objects. + } + else + { + Debug.LogError(request.error); + // TODO Proper error handling. + _error = true; + _responseProcessor.Invoke(null); + } + } + + /// + /// Fixes the server URL by adding the http:// prefix and/or trailing /. + /// + private void SanitizeServerUrl() + { + if (!serverUrl.StartsWith("http://")) + { + serverUrl = "http://" + serverUrl; + } + + if (!serverUrl.EndsWith("/")) + { + serverUrl += "/"; + } + } + + private bool _error; + + /// + /// Checks whether this VremClient instance has encountered an error. + /// + /// True upon an encountered error, false otherwise. + public bool HasError() + { + return _error; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/VREM/VREMClient.cs.meta b/Assets/Scripts/Unibas/DBIS/VREP/VREM/VremClient.cs.meta similarity index 97% rename from Assets/Scripts/Unibas/DBIS/VREP/VREM/VREMClient.cs.meta rename to Assets/Scripts/Unibas/DBIS/VREP/VREM/VremClient.cs.meta index 87cd0b73..7037feb6 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/VREM/VREMClient.cs.meta +++ b/Assets/Scripts/Unibas/DBIS/VREP/VREM/VremClient.cs.meta @@ -1,3 +1,3 @@ -fileFormatVersion: 2 -guid: a4ce399d843a4057a861938236a323b8 +fileFormatVersion: 2 +guid: a4ce399d843a4057a861938236a323b8 timeCreated: 1540571206 \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/World/Countdown.cs b/Assets/Scripts/Unibas/DBIS/VREP/World/Countdown.cs index da70966e..bf18b516 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/World/Countdown.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/World/Countdown.cs @@ -3,49 +3,49 @@ namespace Unibas.DBIS.VREP.World { - public class Countdown : MonoBehaviour { - public int initTime; - private int timeLeft; - public TextMesh countdown; - void Start () - { - StartCoroutine("LoseTime"); - Time.timeScale = 1; - } - void Update () - { - var min = (timeLeft / 60).ToString().PadLeft(2,'0'); - var sec = (timeLeft % 60).ToString().PadLeft(2,'0'); - countdown.text = (min + ":" + sec); - } - - public void Restart() - { - StopCoroutine("LoseTime"); - countdown.color = Color.white; - StartCoroutine("LoseTime"); - } - - IEnumerator LoseTime() - { - timeLeft = initTime; - GameObject.Find("VRCamera").GetComponent().cullingMask = -1; - while (timeLeft > 0) { - yield return new WaitForSeconds (1); - timeLeft--; - if (timeLeft <= 30) - { - if (timeLeft % 2 == 0) - { - countdown.color = Color.red; - } - else - { - countdown.color = Color.white; - } - } - } - GameObject.Find("VRCamera").GetComponent().cullingMask = 0; - } + public class Countdown : MonoBehaviour + { + public int initTime; + private int _timeLeft; + public TextMesh countdown; + + private void Start() + { + StartCoroutine(nameof(LoseTime)); + Time.timeScale = 1; + } + + private void Update() + { + var min = (_timeLeft / 60).ToString().PadLeft(2, '0'); + var sec = (_timeLeft % 60).ToString().PadLeft(2, '0'); + countdown.text = min + ":" + sec; + } + + public void Restart() + { + StopCoroutine(nameof(LoseTime)); + countdown.color = Color.white; + StartCoroutine(nameof(LoseTime)); + } + + private IEnumerator LoseTime() + { + _timeLeft = initTime; + GameObject.Find("VRCamera").GetComponent().cullingMask = -1; + + while (_timeLeft > 0) + { + yield return new WaitForSeconds(1); + + _timeLeft--; + + if (_timeLeft > 30) continue; + + countdown.color = _timeLeft % 2 == 0 ? Color.red : Color.white; + } + + GameObject.Find("VRCamera").GetComponent().cullingMask = 0; } + } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/World/CuboidExhibitionRoom.cs b/Assets/Scripts/Unibas/DBIS/VREP/World/CuboidExhibitionRoom.cs index aaa00bcb..16a8fdd8 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/World/CuboidExhibitionRoom.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/World/CuboidExhibitionRoom.cs @@ -1,158 +1,146 @@ using System.Collections.Generic; -using DefaultNamespace; using Unibas.DBIS.DynamicModelling.Models; +using Unibas.DBIS.VREP.Multimedia; +using Unibas.DBIS.VREP.VREM.Model; using UnityEngine; -using World; namespace Unibas.DBIS.VREP.World { + /// + /// A cuboid exhibition room. + /// The exhibition room has four walls of type (north, east, south. west). + /// + /// The walls manage the exhibits associated with them by themselves. Call PopulateWalls() for that purpose. + /// The room may has 3D exhibits associated with it, which are placed by PopulateRoom(). + /// + /// There are two handlers for entering and leaving the room: OnRoomEnter() and OnRoomLeave() respectively. + /// It is expected that these handlers are called when appropriate. + /// + /// The room is set up as its corresponding model is defined (RoomData). The virtual 3D appearance is driven by its model. + /// + [RequireComponent(typeof(AudioLoader))] + public class CuboidExhibitionRoom : MonoBehaviour + { /// - /// A cuboid exhibition room. - /// The exhibition room has four walls of tyep (north, east, south. west). - /// - /// The walls manage the exhibits associated with them by themselves. Call PopulateWalls() for that purpose. - /// The room may has 3d exhibits associated with it, which are placed by PopulateRoom(). - /// - /// There are two handlers for entering and leaving the room: OnRoomEnter() and OnRoomLeave() respectively. - /// It is expected that these handlers are called when appropriate. - /// - /// The room is set up as its corresponding model is defined (RoomData). The virtual 3d appearance is driven by its model. - /// + /// The room's 3D appearance as a model. /// - [RequireComponent(typeof(AudioLoader))] - public class CuboidExhibitionRoom : MonoBehaviour + public CuboidRoomModel RoomModel { get; set; } + + /// + /// The model of the room which defines its appearance, its walls and everything. + /// This shall directly be passed from the backend server. + /// + public Room RoomData { get; set; } + + /// + /// The actual model game object. + /// + public GameObject Model { get; set; } + + /// + /// A list of ExhibitionWalls, representing the walls of this room. + /// + public List Walls { get; set; } + + /// + /// The private audio loader component reference. + /// + private AudioLoader _audioLoader; + + /// + /// Populates this room (walls load their exhibits). + /// + public void Populate() + { + PopulateRoom(); // Not yet implemented. + PopulateWalls(); + } + + /// + /// Handler for leaving this room. + /// Shall be called whenever the player leaves this room. + /// + public void OnRoomLeave() + { + if (_audioLoader != null) + { + _audioLoader.Stop(); + } + + gameObject.transform.Find("Timer").transform.GetComponent().enabled = false; + } + + /// + /// Handler for entering this room. + /// Shall be called whenever the player enters this room. + /// + public void OnRoomEnter() + { + LoadAmbientAudio(); + gameObject.transform.Find("Timer").transform.GetComponent().enabled = true; + } + + /// + /// Places the exhibits in this room's space. + /// Currently not implemented. + /// + public static void PopulateRoom() + { + Debug.LogWarning("Cannot place 3D objects yet."); + } + + /// + /// Induces the walls to place their exhibits. + /// + public void PopulateWalls() + { + Walls.ForEach(ew => ew.AttachExhibits()); + } + + /// + /// Returns the wall for the orientation. + /// + /// The orientation for which the wall is requested. + /// The ExhibitionWall component for the specified orientation. + public ExhibitionWall GetWallForOrientation(WallOrientation orientation) + { + return Walls.Find(wall => wall.GetOrientation() == orientation); + } + + /// + /// Loads the ambient audio of this room. + /// As soon as the audio is loaded, it will be played. + /// + public void LoadAmbientAudio() + { + if (string.IsNullOrEmpty(RoomData.GetURLEncodedAudioPath())) return; + Debug.Log("Add audio to room."); + + if (_audioLoader == null) + { + _audioLoader = gameObject.AddComponent(); + } + + _audioLoader.ReloadAudio(RoomData.GetURLEncodedAudioPath()); + } + + /// + /// Gets the entry point of this room object. + /// + /// A 3D vector representing the entry point of this room. + public Vector3 GetEntryPoint() + { + return transform.position + RoomData.entrypoint; + } + + + /// + /// Restores all exhibits on all walls and resets the countdown for all of them. + /// + public void RestoreWallExhibits() { - /// - /// The room's 3d appearance as a model. - /// - [SerializeField] - public CuboidRoomModel RoomModel { get; set; } - - /// - /// The model of the room which defines its appearance, its walls and everything. - /// This shall directly be passed from the backend server. - /// - [SerializeField] - public DefaultNamespace.VREM.Model.Room RoomData { get; set; } - - /// - /// The actual model game object. - /// - public GameObject Model { get; set; } - - /// - /// A list of ExhibitionWalls, which form the walls of this room. - /// - public List Walls { get; set; } - - /// - /// The private audio loader component reference. - /// - private AudioLoader _audioLoader; - - private void Start() - { - } - - /// - /// Populates this room. - /// In other words: The walls will load their exhibits and this room will place its exhibits in its space. - /// - public void Populate() - { - PopulateRoom(); - PopulateWalls(); - } - - /// - /// Handler for leaving this room. - /// Shall be called whenever the player leaves this room - /// - public void OnRoomLeave() - { - if (_audioLoader != null) - { - _audioLoader.Stop(); - } - gameObject.transform.Find("Timer").transform.GetComponent().enabled = false; - } - - /// - /// Handler for entering this room - /// Shall be called whenever the player enters this room - /// - public void OnRoomEnter() - { - LoadAmbientAudio(); - gameObject.transform.Find("Timer").transform.GetComponent().enabled = true; - } - - /// - /// Places the exhibits in this room's space. - /// Currently not implemented. - /// - public void PopulateRoom() - { - Debug.LogWarning("Cannot place 3d objects yet"); - /* - * GameObject parent = new GameObject("Model Anchor"); - * GameObject model = new GameObject("Model"); - * model.transform.SetParent(parent.transform); - * parent.transform.position = pos; - * ObjLoader objLoader = model.AddComponent(); - * model.transform.Rotate(-90,0,0); - * model.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f); - * objLoader.Load(url); - */ - } - - /// - /// Induces the walls to place their exhibits. - /// - public void PopulateWalls() - { - Walls.ForEach(ew => ew.AttachExhibits()); - } - - /// - /// Returns the wall for the orientation. - /// - /// The orientation for which the wall is requested - /// The ExhibitionWall component for the specified orientation - public ExhibitionWall GetWallForOrientation(WallOrientation orientation) - { - return Walls.Find(wall => wall.GetOrientation() == orientation); - } - - /// - /// Loads the ambient audio of this room. - /// As soon as the audio is loaded, it will be played. - /// - public void LoadAmbientAudio() - { - if (!string.IsNullOrEmpty(RoomData.GetURLEncodedAudioPath())) - { - Debug.Log("add audio to room"); - - - if (_audioLoader == null) - { - _audioLoader = gameObject.AddComponent(); - } - - _audioLoader.ReloadAudio(RoomData.GetURLEncodedAudioPath()); - } - } - - public Vector3 GetEntryPoint() - { - return transform.position + RoomData.entrypoint; - } - - public void RestoreWallExhibits() - { - Walls.ForEach(w => w.RestoreDisplayals()); - gameObject.transform.Find("Timer").GetComponent().Restart(); - } + Walls.ForEach(w => w.RestoreDisplayals()); + gameObject.transform.Find("Timer").GetComponent().Restart(); } + } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/World/ExhibitionBuildingSettings.cs b/Assets/Scripts/Unibas/DBIS/VREP/World/ExhibitionBuildingSettings.cs index 59211ac2..487b786a 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/World/ExhibitionBuildingSettings.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/World/ExhibitionBuildingSettings.cs @@ -1,41 +1,25 @@ -namespace World -{ - - /// - /// Class to store various exhibition building related settings. - /// - /// - [System.Serializable] - public class ExhibitionBuildingSettings - { - - private float _wallOffset = 0.125f; // experimentally found - - /// - /// Positive offset between the wall and the displayal. - /// - public float WallOffset - { - get { return _wallOffset; } - } - - private float _roomOffset = 2f; - - public float RoomOffset - { - get { return _roomOffset; } - } - - public bool UseStandardDisplayalPrefab = true; - - public string StandardDisplayalPrefabName = "Displayal"; - - - private static ExhibitionBuildingSettings _instance = null; - - public static ExhibitionBuildingSettings Instance - { - get { return _instance ?? (_instance = new ExhibitionBuildingSettings()); } - } - } +namespace Unibas.DBIS.VREP.World +{ + /// + /// Store various settings for building exhibitions. + /// + [System.Serializable] + public class ExhibitionBuildingSettings + { + /// + /// Positive offset between the wall and the displayal. + /// + public float WallOffset => 0.125f; + + public float RoomOffset => 2f; + + public bool useStandardDisplayalPrefab = true; + + public string standardDisplayalPrefabName = "Displayal"; + public string throwableDisplayalPrefabName = "ThrowableDisplayal"; + + private static ExhibitionBuildingSettings instance; + + public static ExhibitionBuildingSettings Instance => instance ??= new ExhibitionBuildingSettings(); + } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/World/ExhibitionWall.cs b/Assets/Scripts/Unibas/DBIS/VREP/World/ExhibitionWall.cs index 184c78ac..a345c57c 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/World/ExhibitionWall.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/World/ExhibitionWall.cs @@ -1,20 +1,23 @@ using System.Collections.Generic; -using DefaultNamespace; using Unibas.DBIS.DynamicModelling.Models; -using Unibas.DBIS.VREP; +using Unibas.DBIS.VREP.Core; +using Unibas.DBIS.VREP.LegacyObjects; +using Unibas.DBIS.VREP.Multimedia; +using Unibas.DBIS.VREP.Utils; +using Unibas.DBIS.VREP.VREM.Model; using UnityEngine; -namespace World { - +namespace Unibas.DBIS.VREP.World +{ /// - /// A representation of a wall, attachable to a gameobject. + /// A representation of a wall, attachable to a game object. /// - public class ExhibitionWall : MonoBehaviour { - + public class ExhibitionWall : MonoBehaviour + { /// - /// The wall's data + /// The wall's data. /// - public DefaultNamespace.VREM.Model.Wall WallData { get; set; } + public Wall WallData { get; set; } /// /// The model of the wall. @@ -24,58 +27,73 @@ public class ExhibitionWall : MonoBehaviour { /// /// The Anchor for adding exhibits. /// - public GameObject Anchor{ get; set; } + public GameObject Anchor { get; set; } - public List Displayals = new List(); + /// + /// Holds all displayals of this wall. + /// + public List displayals = new List(); - public void RestoreDisplayals() { - Displayals.ForEach(d => d.RestorePosition()); + /// + /// Restores the position of every displayal on this wall. + /// + public void RestoreDisplayals() + { + displayals.ForEach(d => d.RestorePosition()); } + /// + /// Creates and attaches the exhibits defined in this wall's data to the wall (or rather it's anchor). + /// public void AttachExhibits() { - // TODO Make displayal configurable var prefab = ObjectFactory.GetDisplayalPrefab(); + foreach (var e in WallData.exhibits) { - GameObject displayal = Instantiate(prefab); + var displayal = Instantiate(prefab, Anchor.transform, true); displayal.name = "Displayal (" + e.name + ")"; - displayal.transform.parent = Anchor.transform; + var pos = new Vector3(e.position.x, e.position.y, -ExhibitionBuildingSettings.Instance.WallOffset); displayal.transform.localPosition = pos; - //displayal.transform.rotation = Quaternion.Euler(ObjectFactory.CalculateRotation(WallData.direction)); - var rot = Quaternion.Euler(92.5f,0,180); // Non-90° as they would tip over othervise - displayal.transform.localRotation = rot;// Because prefab is messed up - - - if(!VREPController.Instance.Settings.SpotsEnabled || !e.light){ + + // Non-90° as they would tip over otherwise (exhibits stand on the little bar below). + var rot = VrepController.Instance.settings.PlaygroundEnabled + ? Quaternion.Euler(92.5f, 0, 180) // Slightly more than 90° or it would fall down. + : Quaternion.Euler(90, 0, 180); + displayal.transform.localRotation = rot; // Required due to prefab orientation. + + if (!VrepController.Instance.settings.SpotsEnabled || !e.light) + { displayal.transform.Find("Directional light").gameObject.SetActive(false); } - - Displayal disp = displayal.gameObject.GetComponent(); + + var disp = displayal.gameObject.GetComponent(); disp.SetExhibitModel(e); - disp.OriginalPosition = pos; - disp.OriginalRotation = rot; - Displayals.Add(disp); - - ImageLoader image = displayal.transform.Find("Plane").gameObject.AddComponent(); // Displayal - //ImageLoader image = displayal.AddComponent();// ImageDisplayPlane + disp.originalPosition = pos; + disp.originalRotation = rot; + displayals.Add(disp); + + var image = displayal.transform.Find("Plane").gameObject.AddComponent(); image.ReloadImage(e.GetURLEncodedPath()); - displayal.transform.localScale = ScalingUtility.convertMeters2PlaneScaleSize(e.size.x, e.size.y); + displayal.transform.localScale = ScalingUtility.ConvertMeters2PlaneScaleSize(e.size.x, e.size.y); - if (e.audio != null) - { - Debug.Log("added audio to display object"); - var closenessDetector = displayal.AddComponent(); - closenessDetector.url = e.GetURLEncodedAudioPath(); - } + if (e.audio == null) continue; + + Debug.Log("Added audio to display object."); + + var closenessDetector = displayal.AddComponent(); + closenessDetector.url = e.GetURLEncodedAudioPath(); } } + /// + /// Returns the orientation of this wall. + /// + /// The wall's orientation as WallOrientation enum object. public WallOrientation GetOrientation() { return WallData.GetOrientation(); } - } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/World/IDisplayalProvider.cs b/Assets/Scripts/Unibas/DBIS/VREP/World/IDisplayalProvider.cs deleted file mode 100644 index dd23bb95..00000000 --- a/Assets/Scripts/Unibas/DBIS/VREP/World/IDisplayalProvider.cs +++ /dev/null @@ -1,9 +0,0 @@ -using UnityEngine; - -namespace World -{ - public interface IDisplayalProvider - { - GameObject ProvideDisplayal(); - } -} \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/World/IDisplayalProvider.cs.meta b/Assets/Scripts/Unibas/DBIS/VREP/World/IDisplayalProvider.cs.meta deleted file mode 100644 index 84b344f4..00000000 --- a/Assets/Scripts/Unibas/DBIS/VREP/World/IDisplayalProvider.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: f54f6640cfaa4d098fdfb4322d441439 -timeCreated: 1546810281 \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/World/Lobby.cs b/Assets/Scripts/Unibas/DBIS/VREP/World/Lobby.cs index bf994a64..cceb2fa3 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/World/Lobby.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/World/Lobby.cs @@ -1,46 +1,54 @@ -using DefaultNamespace; -using Unibas.DBIS.VREP.Core; +using Unibas.DBIS.VREP.Core; +using Unibas.DBIS.VREP.Utils; using UnityEngine; -using World; -public class Lobby : MonoBehaviour +namespace Unibas.DBIS.VREP.World { - private SteamVRTeleportButton text; - private SteamVRTeleportButton next; - private SteamVRTeleportButton wall; - - // Use this for initialization - void Start() + /// + /// Lobby setup. + /// + public class Lobby : MonoBehaviour + { + private SteamVRTeleportButton _text; + private SteamVRTeleportButton _next; + private SteamVRTeleportButton _wall; + + /// + /// Create teleport button objects for the lobby. + /// + private void Start() { + _text = SteamVRTeleportButton.Create(gameObject, new Vector3(0, 0, 4.5f), Vector3.zero, + new SteamVRTeleportButton.TeleportButtonModel(0.1f, .02f, 1f, null, + TexturingUtility.LoadMaterialByName("NMetal"), TexturingUtility.LoadMaterialByName("NPlastic")), + "Text"); - text = SteamVRTeleportButton.Create(gameObject, new Vector3(0, 0, 4.5f), Vector3.zero, - new SteamVRTeleportButton.TeleportButtonModel(0.1f, .02f, 1f, TexturingUtility.LoadMaterialByName("none"), - TexturingUtility.LoadMaterialByName("NMetal"), TexturingUtility.LoadMaterialByName("NPlastic")), - "Text"); - next = SteamVRTeleportButton.Create(gameObject, new Vector3(.5f, 0, 4.5f), Vector3.zero, - new SteamVRTeleportButton.TeleportButtonModel(0.1f, .02f, 1f, TexturingUtility.LoadMaterialByName("NWood"), - TexturingUtility.LoadMaterialByName("NMetal"), TexturingUtility.LoadMaterialByName("NPlastic")), - Resources.Load("Sprites/UI/chevron-right")); - wall = SteamVRTeleportButton.Create(gameObject, new Vector3(0, 1.5f, 4.98f), Vector3.zero, - new SteamVRTeleportButton.TeleportButtonModel(0.2f, .02f, 2f, TexturingUtility.LoadMaterialByName("none"), - TexturingUtility.LoadMaterialByName("NMetal"), TexturingUtility.LoadMaterialByName("NPlastic"), hasPedestal:false), - "Wall"); - } + _next = SteamVRTeleportButton.Create(gameObject, new Vector3(.5f, 0, 4.5f), Vector3.zero, + new SteamVRTeleportButton.TeleportButtonModel(0.1f, .02f, 1f, TexturingUtility.LoadMaterialByName("NWood"), + TexturingUtility.LoadMaterialByName("NMetal"), TexturingUtility.LoadMaterialByName("NPlastic")), + Resources.Load("Sprites/UI/chevron-right")); - public void activateRoomTrigger(ExhibitionManager manager) - { - var room = manager.GetRoomByIndex(0); - if (room != null) - { - text.OnTeleportEnd = room.OnRoomEnter; - next.OnTeleportEnd = room.OnRoomEnter; - wall.OnTeleportEnd = room.OnRoomEnter; - } + _wall = SteamVRTeleportButton.Create(gameObject, new Vector3(0, 1.5f, 4.98f), Vector3.zero, + new SteamVRTeleportButton.TeleportButtonModel(0.2f, .02f, 2f, null, + TexturingUtility.LoadMaterialByName("NMetal"), TexturingUtility.LoadMaterialByName("NPlastic"), + false), + "Wall"); } - // Update is called once per frame - void Update() + /// + /// Sets the triggers for the teleport buttons to execute upon entering an exhibition room. + /// Currently only supports 1 room! + /// + /// The ExhibitionManager object holding room details. + public void ActivateRoomTrigger(ExhibitionManager manager) { - + var room = manager.GetRoomByIndex(0); + + if (room == null) return; + + _text.OnTeleportEnd = room.OnRoomEnter; + _next.OnTeleportEnd = room.OnRoomEnter; + _wall.OnTeleportEnd = room.OnRoomEnter; } + } } \ No newline at end of file diff --git a/Assets/Scripts/Unibas/DBIS/VREP/World/ObjectFactory.cs b/Assets/Scripts/Unibas/DBIS/VREP/World/ObjectFactory.cs index 0af17584..7f487614 100644 --- a/Assets/Scripts/Unibas/DBIS/VREP/World/ObjectFactory.cs +++ b/Assets/Scripts/Unibas/DBIS/VREP/World/ObjectFactory.cs @@ -1,215 +1,268 @@ using System; using System.Collections.Generic; -using DefaultNamespace; using Unibas.DBIS.DynamicModelling; using Unibas.DBIS.DynamicModelling.Models; -using Unibas.DBIS.VREP.World; +using Unibas.DBIS.VREP.Core; +using Unibas.DBIS.VREP.Movement; +using Unibas.DBIS.VREP.Utils; +using Unibas.DBIS.VREP.VREM.Model; using UnityEngine; using UnityEngine.UI; using Valve.VR.InteractionSystem; -namespace World +namespace Unibas.DBIS.VREP.World { + /// + /// Static class for Displayal/Room generation. + /// + public static class ObjectFactory + { + public static readonly ExhibitionBuildingSettings Settings = ExhibitionBuildingSettings.Instance; + + /// + /// Derives a displayal GameObject from the prefab. + /// + /// The created displayal GameObject. + /// If a prefab could not be loaded. + public static GameObject GetDisplayalPrefab() + { + var prefabName = VrepController.Instance.settings.PlaygroundEnabled + ? Settings.throwableDisplayalPrefabName + : Settings.standardDisplayalPrefabName; + var prefab = Resources.Load("Prefabs/" + prefabName, typeof(GameObject)) as GameObject; + + if (prefab == null) + { + throw new Exception($"Could not load '{Settings.standardDisplayalPrefabName}' as Resource."); + } + + return prefab; + } + + /// + /// Calculates the absolute position of a room based on its relative position and size in the exhibition. + /// + /// The room to calculate the absolute position for. + /// The absolute position of the room. + public static Vector3 CalculateRoomPosition(Room room) + { + // This currently works only for 1 exhibition (with multiple rooms). + // Rework this if multiple exhibitions should be loaded. + float x = room.position.x, y = room.position.y, z = room.position.z; + var off = Settings.RoomOffset; // Space between rooms. + return new Vector3(x * room.size.x + x * off, y * room.size.y + y * off, z * room.size.z + z * off); + } + + /// + /// Builds a room, i.e., creating and building its walls and exhibits as well as adding textures, lighting, + /// teleports, etc. + /// + /// The room data that should be used to build this room (as received from VREM). + /// The GameObject for the created room. + public static GameObject BuildRoom(Room roomData) + { + // Textures to use. + Material[] mats = + { + TexturingUtility.LoadMaterialByName(roomData.floor), + TexturingUtility.LoadMaterialByName(roomData.ceiling), + GetMaterialForWallOrientation(WallOrientation.North, roomData), + GetMaterialForWallOrientation(WallOrientation.East, roomData), + GetMaterialForWallOrientation(WallOrientation.South, roomData), + GetMaterialForWallOrientation(WallOrientation.West, roomData) + }; + + // Create room model. + var modelData = new CuboidRoomModel(CalculateRoomPosition(roomData), roomData.size.x, roomData.size.y, + mats[0], mats[1], mats[2], mats[3], mats[4], mats[5]); + + // Create the actual GameObject for the room. + var room = ModelFactory.CreateCuboidRoom(modelData); + + // Add exhibition room component, containing the room model. + var er = room.AddComponent(); + er.RoomModel = modelData; + er.Model = room; + er.RoomData = roomData; + + // Add walls. + var na = CreateAnchor(WallOrientation.North, room, modelData); + var ea = CreateAnchor(WallOrientation.East, room, modelData); + var sa = CreateAnchor(WallOrientation.South, room, modelData); + var wa = CreateAnchor(WallOrientation.West, room, modelData); + + var nw = CreateExhibitionWall(WallOrientation.North, roomData, na); + var ew = CreateExhibitionWall(WallOrientation.East, roomData, ea); + var sw = CreateExhibitionWall(WallOrientation.South, roomData, sa); + var ww = CreateExhibitionWall(WallOrientation.West, roomData, wa); + + er.Walls = new List(new[] {nw, ew, sw, ww}); + er.Populate(); + + // Light. + var light = new GameObject("RoomLight"); + var l = light.AddComponent(); + l.type = LightType.Point; + l.range = 8; + l.color = Color.white; + l.intensity = 1.5f; + l.renderMode = LightRenderMode.ForcePixel; + + var t = l.transform; + t.parent = room.transform; // Set room as parent for transform component. + t.localPosition = new Vector3(0, 2.5f, 0); + room.name = "Room"; + + // Teleport. + var teleportArea = new GameObject("TeleportArea"); + var col = teleportArea.AddComponent(); + col.size = new Vector3(modelData.size, 0.01f, modelData.size); + teleportArea.AddComponent(); + + var tpa = teleportArea.AddComponent(); + var t1 = tpa.transform; + t1.parent = room.transform; + t1.localPosition = new Vector3(0, 0.01f, 0); + + return room; + } + + /// + /// Attaches an exhibition wall as defined in the room model to the corresponding GameObject of the room. + /// + /// The orientation of the wall. + /// The room model object to take the data for the wall from. + /// The GameObject to set as the anchor for the room. + /// The created wall component (with a set anchor). + private static ExhibitionWall CreateExhibitionWall(WallOrientation orientation, Room room, GameObject anchor) + { + var wall = anchor.AddComponent(); + + wall.Anchor = anchor; + wall.WallModel = null; + wall.WallData = room.GetWall(orientation); + + return wall; + } + /// - /// Static class for object generation. + /// Returns the material (wall texture) for a specific wall orientation (= for 1 wall) as defined in the room model. /// - public static class ObjectFactory + /// The orientation of the wall to get the material for. + /// The room model object to take the data for the wall material from. + /// The resulting Material object. + /// + private static Material GetMaterialForWallOrientation(WallOrientation orientation, Room roomData) { - public static ExhibitionBuildingSettings Settings = ExhibitionBuildingSettings.Instance; - - public static GameObject GetDisplayalPrefab() - { - // TODO Use other prefabs - /*if (Settings.UseStandardDisplayalPrefab) - {*/ - var prefab = Resources.Load("Prefabs/"+Settings.StandardDisplayalPrefabName, typeof(GameObject)) as GameObject; - if (prefab == null) - { - throw new Exception(string.Format("Could not load '{0}' as Resource", Settings.StandardDisplayalPrefabName)); - } - - return prefab; - //} - } - - public static Vector3 CalculateRoomPosition(DefaultNamespace.VREM.Model.Room room) - { - // TODO exhibition-dependet calculation - float x = room.position.x, y = room.position.y, z = room.position.z; - var off = Settings.RoomOffset; - return new Vector3(x * room.size.x + x * off, y * room.size.y + y * off, z * room.size.z + z * off); - } - - public static GameObject BuildRoom(DefaultNamespace.VREM.Model.Room roomData) - { - Material[] mats = - { - TexturingUtility.LoadMaterialByName(roomData.floor), - TexturingUtility.LoadMaterialByName(roomData.ceiling), - GetMaterialForWallOrientation(WallOrientation.NORTH, roomData), - GetMaterialForWallOrientation(WallOrientation.EAST, roomData), - GetMaterialForWallOrientation(WallOrientation.SOUTH, roomData), - GetMaterialForWallOrientation(WallOrientation.WEST, roomData) - }; - CuboidRoomModel modelData = new CuboidRoomModel(CalculateRoomPosition(roomData), roomData.size.x, roomData.size.y, - mats[0], mats[1], mats[2], mats[3], mats[4], mats[5]); - GameObject room = ModelFactory.CreateCuboidRoom(modelData); - var er = room.AddComponent(); - er.RoomModel = modelData; - er.Model = room; - er.RoomData = roomData; - var na = CreateAnchor(WallOrientation.NORTH, room, modelData); - var ea = CreateAnchor(WallOrientation.EAST, room, modelData); - var sa = CreateAnchor(WallOrientation.SOUTH, room, modelData); - var wa = CreateAnchor(WallOrientation.WEST, room, modelData); - - var nw = CreateExhibitionWall(WallOrientation.NORTH, roomData, na); - var ew = CreateExhibitionWall(WallOrientation.EAST, roomData, ea); - var sw = CreateExhibitionWall(WallOrientation.SOUTH, roomData, sa); - var ww = CreateExhibitionWall(WallOrientation.WEST, roomData, wa); - - er.Walls = new List(new []{nw,ew,sw,ww}); - er.Populate(); - - GameObject light = new GameObject("RoomLight"); - var l = light.AddComponent(); - l.type = LightType.Point; - l.range = 8; - l.color = Color.white; - l.intensity = 1.5f; - l.renderMode = LightRenderMode.ForcePixel; - //l.lightmapBakeType = LightmapBakeType.Mixed; // Build fails with this line uncommented, even though unity automatically upgrades to this one. - //l.lightmappingMode = LightmappingMode.Mixed; // Build fails with this line uncommented. it is obsolete - // Results in mode Realtime (in Unity editor inspector) - l.transform.parent = room.transform; - l.transform.localPosition = new Vector3(0, 2.5f, 0); - room.name = "Room"; - - GameObject teleportArea = new GameObject("TeleportArea"); - var col = teleportArea.AddComponent(); - col.size = new Vector3(modelData.Size, 0.01f, modelData.Size); - teleportArea.AddComponent(); - var tpa = teleportArea.AddComponent(); - tpa.transform.parent = room.transform; - tpa.transform.localPosition = new Vector3(0, 0.01f, 0); - - return room; - } - - private static ExhibitionWall CreateExhibitionWall(WallOrientation orientation, DefaultNamespace.VREM.Model.Room room, GameObject anchor) - { - var wall = anchor.AddComponent(); - wall.Anchor = anchor; - wall.WallModel = null; - wall.WallData = room.GetWall(orientation); - return wall; - } - - private static Material GetMaterialForWallOrientation(WallOrientation orientation, - DefaultNamespace.VREM.Model.Room roomData) - { - foreach (DefaultNamespace.VREM.Model.Wall wallData in roomData.walls) - { - WallOrientation wor = (WallOrientation) Enum.Parse(typeof(WallOrientation), wallData.direction, true); - if (wor.Equals(orientation)) - { - Debug.Log("Material "+wallData.texture+" for room " + roomData.position); - return TexturingUtility.LoadMaterialByName(wallData.texture, true); - } - } - - throw new ArgumentException("Couldn't find material for orientation " + orientation + " in room at " + - roomData.position); - } - - private static GameObject CreateAnchor(WallOrientation orientation, GameObject room, CuboidRoomModel model) - { - GameObject anchor = new GameObject(orientation + "Anchor"); - anchor.transform.parent = room.transform; - Vector3 pos = Vector3.zero; - var a = 0f; - var sizeHalf = model.Size / 2f; - switch (orientation) - { - case WallOrientation.NORTH: - pos = new Vector3(-sizeHalf, 0, sizeHalf); - a = 0; - break; - case WallOrientation.EAST: - pos = new Vector3(sizeHalf, 0, sizeHalf); - a = 90; - break; - case WallOrientation.SOUTH: - pos = new Vector3(sizeHalf, 0, -sizeHalf); - a = 180; - break; - case WallOrientation.WEST: - pos = new Vector3(-sizeHalf, 0, -sizeHalf); - a = 270; - break; - default: - throw new ArgumentOutOfRangeException("orientation", orientation, null); - } - anchor.transform.Rotate(Vector3.up, a); - anchor.transform.localPosition = pos; - return anchor; - } - - private static ComplexCuboidModel GenerateButtonModel(float size, float border, float height) - { - ComplexCuboidModel model = new ComplexCuboidModel(); - // TODO Add material somehow - model.Add(Vector3.zero, new CuboidModel(size, size, height)); - model.Add(new Vector3(border, border, -height), new CuboidModel(size - 2 * border, size - 2 * border, height)); - return model; - } - - public static GameObject CreateTeleportButtonModel(Vector3 position, Vector3 destination, float size, float border) - { - var modelData = GenerateButtonModel(size, border, border / 2f); - GameObject buttonObj = ModelFactory.CreateModel(modelData); - PlayerTeleporter tpBtn = buttonObj.AddComponent(); - tpBtn.Destination = destination; - BoxCollider col = buttonObj.AddComponent(); - col.size = new Vector3(size,size,border*2); - col.center = new Vector3(size/2f, size/2f, -border); - buttonObj.AddComponent public class SteamVR_ActivateActionSetOnLoad : MonoBehaviour { - [SteamVR_DefaultActionSet("default")] - public SteamVR_ActionSet actionSet; + public SteamVR_ActionSet actionSet = SteamVR_Input.GetActionSet("default"); + + public SteamVR_Input_Sources forSources = SteamVR_Input_Sources.Any; public bool disableAllOtherActionSets = false; public bool activateOnStart = true; public bool deactivateOnDestroy = true; + public int initialPriority = 0; private void Start() { if (actionSet != null && activateOnStart) { //Debug.Log(string.Format("[SteamVR] Activating {0} action set.", actionSet.fullPath)); - actionSet.ActivatePrimary(disableAllOtherActionSets); + actionSet.Activate(forSources, initialPriority, disableAllOtherActionSets); } } @@ -33,7 +35,7 @@ private void OnDestroy() if (actionSet != null && deactivateOnDestroy) { //Debug.Log(string.Format("[SteamVR] Deactivating {0} action set.", actionSet.fullPath)); - actionSet.Deactivate(); + actionSet.Deactivate(forSources); } } } diff --git a/Assets/SteamVR/Input/SteamVR_ActivateActionSetOnLoad.cs.meta b/Assets/SteamVR/Input/SteamVR_ActivateActionSetOnLoad.cs.meta index db3b4866..c915b6b6 100644 --- a/Assets/SteamVR/Input/SteamVR_ActivateActionSetOnLoad.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_ActivateActionSetOnLoad.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 27991c206a5e66147bb8ee3ef31c8bac -timeCreated: 1532646958 +timeCreated: 1544852184 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Behaviour_Boolean.cs b/Assets/SteamVR/Input/SteamVR_Behaviour_Boolean.cs index ae72b4e2..f03141a7 100644 --- a/Assets/SteamVR/Input/SteamVR_Behaviour_Boolean.cs +++ b/Assets/SteamVR/Input/SteamVR_Behaviour_Boolean.cs @@ -11,78 +11,182 @@ namespace Valve.VR { /// - /// This component simplifies using boolean actions. Provides editor accessible events: onPress, onPressDown, onPressUp, onChange, and onUpdate. + /// This component simplifies using boolean actions. + /// Provides editor accessible events: OnPress, OnPressDown, OnPressUp, OnChange, and OnUpdate. + /// Provides script accessible events: OnPressEvent, OnPressDownEvent, OnPressUpEvent, OnChangeEvent, and OnUpdateEvent. /// public class SteamVR_Behaviour_Boolean : MonoBehaviour { + [Tooltip("The SteamVR boolean action that this component should use")] public SteamVR_Action_Boolean booleanAction; [Tooltip("The device this action should apply to. Any if the action is not device specific.")] public SteamVR_Input_Sources inputSource; - /// This event fires whenever a change happens in the action + /// This UnityEvent fires whenever a change happens in the action public SteamVR_Behaviour_BooleanEvent onChange; - /// This event fires whenever the action is updated + /// This C# event fires whenever a change happens in the action + public event ChangeHandler onChangeEvent; + + /// This UnityEvent fires whenever the action is updated public SteamVR_Behaviour_BooleanEvent onUpdate; - /// This event will fire whenever the boolean action is true and gets updated + /// This C# event fires whenever the action is updated + public event UpdateHandler onUpdateEvent; + + /// This UnityEvent will fire whenever the boolean action is true and gets updated public SteamVR_Behaviour_BooleanEvent onPress; - /// This event will fire whenever the boolean action has changed from false to true in the last update + /// This C# event will fire whenever the boolean action is true and gets updated + public event StateHandler onPressEvent; + + /// This UnityEvent will fire whenever the boolean action has changed from false to true in the last update public SteamVR_Behaviour_BooleanEvent onPressDown; - /// This event will fire whenever the boolean action has changed from true to false in the last update + /// This C# event will fire whenever the boolean action has changed from false to true in the last update + public event StateDownHandler onPressDownEvent; + + /// This UnityEvent will fire whenever the boolean action has changed from true to false in the last update public SteamVR_Behaviour_BooleanEvent onPressUp; + /// This C# event will fire whenever the boolean action has changed from true to false in the last update + public event StateUpHandler onPressUpEvent; + /// Returns true if this action is currently bound and its action set is active - public bool isActive { get { return booleanAction.GetActive(inputSource); } } + public bool isActive { get { return booleanAction[inputSource].active; } } /// Returns the action set that this action is in. public SteamVR_ActionSet actionSet { get { if (booleanAction != null) return booleanAction.actionSet; else return null; } } + + protected virtual void OnEnable() { - booleanAction.AddOnUpdateListener(ActionUpdated, inputSource); + if (booleanAction == null) + { + Debug.LogError("[SteamVR] Boolean action not set.", this); + return; + } + + AddHandlers(); } protected virtual void OnDisable() { - booleanAction.RemoveOnUpdateListener(ActionUpdated, inputSource); + RemoveHandlers(); } + protected void AddHandlers() + { + booleanAction[inputSource].onUpdate += SteamVR_Behaviour_Boolean_OnUpdate; + booleanAction[inputSource].onChange += SteamVR_Behaviour_Boolean_OnChange; + booleanAction[inputSource].onState += SteamVR_Behaviour_Boolean_OnState; + booleanAction[inputSource].onStateDown += SteamVR_Behaviour_Boolean_OnStateDown; + booleanAction[inputSource].onStateUp += SteamVR_Behaviour_Boolean_OnStateUp; + } - protected virtual void ActionUpdated(SteamVR_Action_In action) + protected void RemoveHandlers() { - SteamVR_Action_Boolean booleanAction = (SteamVR_Action_Boolean)action; - if (onChange != null && booleanAction.GetChanged(inputSource)) + if (booleanAction != null) { - onChange.Invoke(booleanAction); + booleanAction[inputSource].onUpdate -= SteamVR_Behaviour_Boolean_OnUpdate; + booleanAction[inputSource].onChange -= SteamVR_Behaviour_Boolean_OnChange; + booleanAction[inputSource].onState -= SteamVR_Behaviour_Boolean_OnState; + booleanAction[inputSource].onStateDown -= SteamVR_Behaviour_Boolean_OnStateDown; + booleanAction[inputSource].onStateUp -= SteamVR_Behaviour_Boolean_OnStateUp; } + } - if (onPressDown != null && booleanAction.GetStateDown(inputSource)) + private void SteamVR_Behaviour_Boolean_OnStateUp(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource) + { + if (onPressUp != null) { - onPressDown.Invoke(booleanAction); + onPressUp.Invoke(this, fromSource, false); } - if (onPress != null && booleanAction.GetState(inputSource)) + if (onPressUpEvent != null) { - onPress.Invoke(booleanAction); + onPressUpEvent.Invoke(this, fromSource); } + } - if (onPressUp != null && booleanAction.GetStateUp(inputSource)) + private void SteamVR_Behaviour_Boolean_OnStateDown(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource) + { + if (onPressDown != null) { - onPressUp.Invoke(booleanAction); + onPressDown.Invoke(this, fromSource, true); } + if (onPressDownEvent != null) + { + onPressDownEvent.Invoke(this, fromSource); + } + } + + private void SteamVR_Behaviour_Boolean_OnState(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource) + { + if (onPress != null) + { + onPress.Invoke(this, fromSource, true); + } + + if (onPressEvent != null) + { + onPressEvent.Invoke(this, fromSource); + } + } + + private void SteamVR_Behaviour_Boolean_OnUpdate(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource, bool newState) + { if (onUpdate != null) { - onUpdate.Invoke(booleanAction); + onUpdate.Invoke(this, fromSource, newState); + } + + if (onUpdateEvent != null) + { + onUpdateEvent.Invoke(this, fromSource, newState); } } - } - [Serializable] - public class SteamVR_Behaviour_BooleanEvent : UnityEvent { } + private void SteamVR_Behaviour_Boolean_OnChange(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource, bool newState) + { + if (onChange != null) + { + onChange.Invoke(this, fromSource, newState); + } + + if (onChangeEvent != null) + { + onChangeEvent.Invoke(this, fromSource, newState); + } + } + + /// + /// Gets the localized name of the device that the action corresponds to. + /// + /// + /// + /// VRInputString_Hand - Which hand the origin is in. E.g. "Left Hand" + /// VRInputString_ControllerType - What kind of controller the user has in that hand.E.g. "Vive Controller" + /// VRInputString_InputSource - What part of that controller is the origin. E.g. "Trackpad" + /// VRInputString_All - All of the above. E.g. "Left Hand Vive Controller Trackpad" + /// + /// + public string GetLocalizedName(params EVRInputStringBits[] localizedParts) + { + if (booleanAction != null) + return booleanAction.GetLocalizedOriginPart(inputSource, localizedParts); + return null; + } + + public delegate void StateDownHandler(SteamVR_Behaviour_Boolean fromAction, SteamVR_Input_Sources fromSource); + public delegate void StateUpHandler(SteamVR_Behaviour_Boolean fromAction, SteamVR_Input_Sources fromSource); + public delegate void StateHandler(SteamVR_Behaviour_Boolean fromAction, SteamVR_Input_Sources fromSource); + public delegate void ActiveChangeHandler(SteamVR_Behaviour_Boolean fromAction, SteamVR_Input_Sources fromSource, bool active); + public delegate void ChangeHandler(SteamVR_Behaviour_Boolean fromAction, SteamVR_Input_Sources fromSource, bool newState); + public delegate void UpdateHandler(SteamVR_Behaviour_Boolean fromAction, SteamVR_Input_Sources fromSource, bool newState); + } } \ No newline at end of file diff --git a/Assets/SteamVR/Input/SteamVR_Behaviour_Boolean.cs.meta b/Assets/SteamVR/Input/SteamVR_Behaviour_Boolean.cs.meta index 2cf0da96..a587e315 100644 --- a/Assets/SteamVR/Input/SteamVR_Behaviour_Boolean.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_Behaviour_Boolean.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 16a9b39235339104889bf8e9178fc630 -timeCreated: 1532646970 +timeCreated: 1544852184 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Behaviour_Pose.cs b/Assets/SteamVR/Input/SteamVR_Behaviour_Pose.cs index a7547b9a..6da969f8 100644 --- a/Assets/SteamVR/Input/SteamVR_Behaviour_Pose.cs +++ b/Assets/SteamVR/Input/SteamVR_Behaviour_Pose.cs @@ -10,12 +10,11 @@ namespace Valve.VR { /// /// This component simplifies the use of Pose actions. Adding it to a gameobject will auto set that transform's position and rotation every update to match the pose. - /// Advanced velocity estimation is also handled through a buffer of the last 30 updates. + /// Advanced velocity estimation is handled through a buffer of the last 30 updates. /// public class SteamVR_Behaviour_Pose : MonoBehaviour { - [SteamVR_DefaultAction("Pose")] - public SteamVR_Action_Pose poseAction; + public SteamVR_Action_Pose poseAction = SteamVR_Input.GetAction("Pose"); [Tooltip("The device this action should apply to. Any if the action is not device specific.")] public SteamVR_Input_Sources inputSource; @@ -24,70 +23,171 @@ public class SteamVR_Behaviour_Pose : MonoBehaviour public Transform origin; /// Returns whether or not the current pose is in a valid state - public bool isValid { get { return poseAction.GetPoseIsValid(inputSource); } } + public bool isValid { get { return poseAction[inputSource].poseIsValid; } } /// Returns whether or not the pose action is bound and able to be updated - public bool isActive { get { return poseAction.GetActive(inputSource); } } + public bool isActive { get { return poseAction[inputSource].active; } } - /// This event will fire whenever the position or rotation of this transform is updated. + + /// This Unity event will fire whenever the position or rotation of this transform is updated. public SteamVR_Behaviour_PoseEvent onTransformUpdated; - /// This event will fire whenever the position or rotation of this transform is changed. + /// This Unity event will fire whenever the position or rotation of this transform is changed. public SteamVR_Behaviour_PoseEvent onTransformChanged; - /// This event will fire whenever the device is connected or disconnected - public SteamVR_Behaviour_PoseEvent onConnectedChanged; + /// This Unity event will fire whenever the device is connected or disconnected + public SteamVR_Behaviour_Pose_ConnectedChangedEvent onConnectedChanged; + + /// This Unity event will fire whenever the device's tracking state changes + public SteamVR_Behaviour_Pose_TrackingChangedEvent onTrackingChanged; + + /// This Unity event will fire whenever the device's deviceIndex changes + public SteamVR_Behaviour_Pose_DeviceIndexChangedEvent onDeviceIndexChanged; + + + /// This C# event will fire whenever the position or rotation of this transform is updated. + public UpdateHandler onTransformUpdatedEvent; + + /// This C# event will fire whenever the position or rotation of this transform is changed. + public ChangeHandler onTransformChangedEvent; - /// This event will fire whenever the device's tracking state changes - public SteamVR_Behaviour_PoseEvent onTrackingChanged; + /// This C# event will fire whenever the device is connected or disconnected + public DeviceConnectedChangeHandler onConnectedChangedEvent; + + /// This C# event will fire whenever the device's tracking state changes + public TrackingChangeHandler onTrackingChangedEvent; + + /// This C# event will fire whenever the device's deviceIndex changes + public DeviceIndexChangedHandler onDeviceIndexChangedEvent; + + + [Tooltip("Can be disabled to stop broadcasting bound device status changes")] + public bool broadcastDeviceChanges = true; protected int deviceIndex = -1; protected SteamVR_HistoryBuffer historyBuffer = new SteamVR_HistoryBuffer(30); - + protected virtual void Start() { + if (poseAction == null) + { + Debug.LogError("[SteamVR] No pose action set for this component", this); + return; + } + CheckDeviceIndex(); if (origin == null) origin = this.transform.parent; } - protected virtual void OnDeviceConnectedChanged(SteamVR_Action_Pose changedAction) + protected virtual void OnEnable() + { + SteamVR.Initialize(); + + if (poseAction != null) + { + poseAction[inputSource].onUpdate += SteamVR_Behaviour_Pose_OnUpdate; + poseAction[inputSource].onDeviceConnectedChanged += OnDeviceConnectedChanged; + poseAction[inputSource].onTrackingChanged += OnTrackingChanged; + poseAction[inputSource].onChange += SteamVR_Behaviour_Pose_OnChange; + } + } + + protected virtual void OnDisable() + { + if (poseAction != null) + { + poseAction[inputSource].onUpdate -= SteamVR_Behaviour_Pose_OnUpdate; + poseAction[inputSource].onDeviceConnectedChanged -= OnDeviceConnectedChanged; + poseAction[inputSource].onTrackingChanged -= OnTrackingChanged; + poseAction[inputSource].onChange -= SteamVR_Behaviour_Pose_OnChange; + } + + historyBuffer.Clear(); + } + + private void SteamVR_Behaviour_Pose_OnUpdate(SteamVR_Action_Pose fromAction, SteamVR_Input_Sources fromSource) + { + UpdateHistoryBuffer(); + + UpdateTransform(); + + if (onTransformUpdated != null) + onTransformUpdated.Invoke(this, inputSource); + if (onTransformUpdatedEvent != null) + onTransformUpdatedEvent.Invoke(this, inputSource); + } + protected virtual void UpdateTransform() + { + CheckDeviceIndex(); + + if (origin != null) + { + transform.position = origin.transform.TransformPoint(poseAction[inputSource].localPosition); + transform.rotation = origin.rotation * poseAction[inputSource].localRotation; + } + else + { + transform.localPosition = poseAction[inputSource].localPosition; + transform.localRotation = poseAction[inputSource].localRotation; + } + } + + private void SteamVR_Behaviour_Pose_OnChange(SteamVR_Action_Pose fromAction, SteamVR_Input_Sources fromSource) + { + if (onTransformChanged != null) + onTransformChanged.Invoke(this, fromSource); + if (onTransformChangedEvent != null) + onTransformChangedEvent.Invoke(this, fromSource); + } + + protected virtual void OnDeviceConnectedChanged(SteamVR_Action_Pose changedAction, SteamVR_Input_Sources changedSource, bool connected) { CheckDeviceIndex(); if (onConnectedChanged != null) - onConnectedChanged.Invoke(poseAction); + onConnectedChanged.Invoke(this, inputSource, connected); + if (onConnectedChangedEvent != null) + onConnectedChangedEvent.Invoke(this, inputSource, connected); } - protected virtual void OnTrackingChanged(SteamVR_Action_Pose changedAction) + protected virtual void OnTrackingChanged(SteamVR_Action_Pose changedAction, SteamVR_Input_Sources changedSource, ETrackingResult trackingChanged) { if (onTrackingChanged != null) - onTrackingChanged.Invoke(poseAction); + onTrackingChanged.Invoke(this, inputSource, trackingChanged); + if (onTrackingChangedEvent != null) + onTrackingChangedEvent.Invoke(this, inputSource, trackingChanged); } protected virtual void CheckDeviceIndex() { - if (poseAction.GetActive(inputSource)) + if (poseAction[inputSource].active && poseAction[inputSource].deviceIsConnected) { - if (poseAction.GetDeviceIsConnected(inputSource)) + int currentDeviceIndex = (int)poseAction[inputSource].trackedDeviceIndex; + + if (deviceIndex != currentDeviceIndex) { - int currentDeviceIndex = (int)poseAction.GetDeviceIndex(inputSource); + deviceIndex = currentDeviceIndex; - if (deviceIndex != currentDeviceIndex) + if (broadcastDeviceChanges) { - deviceIndex = currentDeviceIndex; this.gameObject.BroadcastMessage("SetInputSource", inputSource, SendMessageOptions.DontRequireReceiver); this.gameObject.BroadcastMessage("SetDeviceIndex", deviceIndex, SendMessageOptions.DontRequireReceiver); } + + if (onDeviceIndexChanged != null) + onDeviceIndexChanged.Invoke(this, inputSource, deviceIndex); + if (onDeviceIndexChangedEvent != null) + onDeviceIndexChangedEvent.Invoke(this, inputSource, deviceIndex); } } } /// - /// Returns the device index for the device bound to the pose. + /// Returns the device index for the device bound to the pose. /// public int GetDeviceIndex() { @@ -97,45 +197,22 @@ public int GetDeviceIndex() return deviceIndex; } - protected virtual void OnEnable() - { - SteamVR.Initialize(); - - SteamVR_Input.OnPosesUpdated += SteamVR_Input_OnPosesUpdated; - poseAction.AddOnDeviceConnectedChanged(inputSource, OnDeviceConnectedChanged); - poseAction.AddOnTrackingChanged(inputSource, OnTrackingChanged); - } - - protected virtual void OnDisable() - { - SteamVR_Input.OnPosesUpdated -= SteamVR_Input_OnPosesUpdated; - poseAction.RemoveOnDeviceConnectedChanged(inputSource, OnDeviceConnectedChanged); - poseAction.RemoveOnTrackingChanged(inputSource, OnTrackingChanged); - - historyBuffer.Clear(); - } - /// Returns the current velocity of the pose (as of the last update) public Vector3 GetVelocity() { - return poseAction.GetVelocity(inputSource); + return poseAction[inputSource].velocity; } /// Returns the current angular velocity of the pose (as of the last update) public Vector3 GetAngularVelocity() { - return poseAction.GetAngularVelocity(inputSource); + return poseAction[inputSource].angularVelocity; } /// Returns the velocities of the pose at the time specified. Can predict in the future or return past values. public bool GetVelocitiesAtTimeOffset(float secondsFromNow, out Vector3 velocity, out Vector3 angularVelocity) { - return poseAction.GetVelocitiesAtTimeOffset(inputSource, secondsFromNow, out velocity, out angularVelocity); - } - - protected void UpdateHistoryBuffer() - { - historyBuffer.Update(poseAction.GetLocalPosition(inputSource), poseAction.GetLocalRotation(inputSource), poseAction.GetVelocity(inputSource), poseAction.GetAngularVelocity(inputSource)); + return poseAction[inputSource].GetVelocitiesAtTimeOffset(secondsFromNow, out velocity, out angularVelocity); } /// Uses previously recorded values to find the peak speed of the pose and returns the corresponding velocity and angular velocity @@ -146,41 +223,41 @@ public void GetEstimatedPeakVelocities(out Vector3 velocity, out Vector3 angular historyBuffer.GetAverageVelocities(out velocity, out angularVelocity, 2, top); } - private void SteamVR_Input_OnPosesUpdated(bool obj) - { - UpdateHistoryBuffer(); - Update(); - } - - protected virtual void Update() + protected int lastFrameUpdated; + protected void UpdateHistoryBuffer() { - if (poseAction == null) - return; - - CheckDeviceIndex(); - - if (origin != null) + int currentFrame = Time.frameCount; + if (lastFrameUpdated != currentFrame) { - transform.position = origin.transform.TransformPoint(poseAction.GetLocalPosition(inputSource)); - transform.rotation = origin.rotation * poseAction.GetLocalRotation(inputSource); - } - else - { - transform.localPosition = poseAction.GetLocalPosition(inputSource); - transform.localRotation = poseAction.GetLocalRotation(inputSource); - } - - if (poseAction.GetChanged(inputSource)) - { - if (onTransformChanged != null) - onTransformChanged.Invoke(poseAction); + historyBuffer.Update(poseAction[inputSource].localPosition, poseAction[inputSource].localRotation, poseAction[inputSource].velocity, poseAction[inputSource].angularVelocity); + lastFrameUpdated = currentFrame; } + } - if (onTransformUpdated != null) - onTransformUpdated.Invoke(poseAction); + /// + /// Gets the localized name of the device that the action corresponds to. + /// + /// + /// + /// VRInputString_Hand - Which hand the origin is in. E.g. "Left Hand" + /// VRInputString_ControllerType - What kind of controller the user has in that hand.E.g. "Vive Controller" + /// VRInputString_InputSource - What part of that controller is the origin. E.g. "Trackpad" + /// VRInputString_All - All of the above. E.g. "Left Hand Vive Controller Trackpad" + /// + /// + public string GetLocalizedName(params EVRInputStringBits[] localizedParts) + { + if (poseAction != null) + return poseAction.GetLocalizedOriginPart(inputSource, localizedParts); + return null; } - } - [Serializable] - public class SteamVR_Behaviour_PoseEvent : UnityEvent { } + public delegate void ActiveChangeHandler(SteamVR_Behaviour_Pose fromAction, SteamVR_Input_Sources fromSource, bool active); + public delegate void ChangeHandler(SteamVR_Behaviour_Pose fromAction, SteamVR_Input_Sources fromSource); + public delegate void UpdateHandler(SteamVR_Behaviour_Pose fromAction, SteamVR_Input_Sources fromSource); + public delegate void TrackingChangeHandler(SteamVR_Behaviour_Pose fromAction, SteamVR_Input_Sources fromSource, ETrackingResult trackingState); + public delegate void ValidPoseChangeHandler(SteamVR_Behaviour_Pose fromAction, SteamVR_Input_Sources fromSource, bool validPose); + public delegate void DeviceConnectedChangeHandler(SteamVR_Behaviour_Pose fromAction, SteamVR_Input_Sources fromSource, bool deviceConnected); + public delegate void DeviceIndexChangedHandler(SteamVR_Behaviour_Pose fromAction, SteamVR_Input_Sources fromSource, int newDeviceIndex); + } } \ No newline at end of file diff --git a/Assets/SteamVR/Input/SteamVR_Behaviour_Pose.cs.meta b/Assets/SteamVR/Input/SteamVR_Behaviour_Pose.cs.meta index f879d2f0..00772691 100644 --- a/Assets/SteamVR/Input/SteamVR_Behaviour_Pose.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_Behaviour_Pose.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 9a5fb0ca93b55ef4b8d54b512b103341 -timeCreated: 1533337559 +timeCreated: 1544852185 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: -31600 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Behaviour_Single.cs b/Assets/SteamVR/Input/SteamVR_Behaviour_Single.cs index fdf5abbd..d33682d0 100644 --- a/Assets/SteamVR/Input/SteamVR_Behaviour_Single.cs +++ b/Assets/SteamVR/Input/SteamVR_Behaviour_Single.cs @@ -23,32 +23,123 @@ public class SteamVR_Behaviour_Single : MonoBehaviour [Tooltip("The device this action should apply to. Any if the action is not device specific.")] public SteamVR_Input_Sources inputSource; - /// Fires whenever the action's value has changed since the last update. + /// Unity event that Fires whenever the action's value has changed since the last update. [Tooltip("Fires whenever the action's value has changed since the last update.")] public SteamVR_Behaviour_SingleEvent onChange; + /// Unity event that Fires whenever the action's value has been updated + [Tooltip("Fires whenever the action's value has been updated.")] + public SteamVR_Behaviour_SingleEvent onUpdate; + + /// Unity event that Fires whenever the action's value has been updated and is non-zero + [Tooltip("Fires whenever the action's value has been updated and is non-zero.")] + public SteamVR_Behaviour_SingleEvent onAxis; + + /// C# event that fires whenever the action's value has changed since the last update. + public ChangeHandler onChangeEvent; + + /// C# event that fires whenever the action's value has been updated + public UpdateHandler onUpdateEvent; + + /// C# event that fires whenever the action's value has been updated and is non-zero + public AxisHandler onAxisEvent; + /// Returns whether this action is bound and the action set is active public bool isActive { get { return singleAction.GetActive(inputSource); } } - private void OnEnable() + protected virtual void OnEnable() + { + if (singleAction == null) + { + Debug.LogError("[SteamVR] Single action not set.", this); + return; + } + + AddHandlers(); + } + + protected virtual void OnDisable() { - singleAction.AddOnChangeListener(ActionChanged, inputSource); + RemoveHandlers(); } - private void OnDisable() + protected void AddHandlers() { - singleAction.RemoveOnChangeListener(ActionChanged, inputSource); + singleAction[inputSource].onUpdate += SteamVR_Behaviour_Single_OnUpdate; + singleAction[inputSource].onChange += SteamVR_Behaviour_Single_OnChange; + singleAction[inputSource].onAxis += SteamVR_Behaviour_Single_OnAxis; } - private void ActionChanged(SteamVR_Action_In action) + protected void RemoveHandlers() + { + if (singleAction != null) + { + singleAction[inputSource].onUpdate -= SteamVR_Behaviour_Single_OnUpdate; + singleAction[inputSource].onChange -= SteamVR_Behaviour_Single_OnChange; + singleAction[inputSource].onAxis -= SteamVR_Behaviour_Single_OnAxis; + } + } + + private void SteamVR_Behaviour_Single_OnUpdate(SteamVR_Action_Single fromAction, SteamVR_Input_Sources fromSource, float newAxis, float newDelta) + { + if (onUpdate != null) + { + onUpdate.Invoke(this, fromSource, newAxis, newDelta); + } + + if (onUpdateEvent != null) + { + onUpdateEvent.Invoke(this, fromSource, newAxis, newDelta); + } + } + + private void SteamVR_Behaviour_Single_OnChange(SteamVR_Action_Single fromAction, SteamVR_Input_Sources fromSource, float newAxis, float newDelta) { if (onChange != null) { - onChange.Invoke((SteamVR_Action_Single)action); + onChange.Invoke(this, fromSource, newAxis, newDelta); + } + + if (onChangeEvent != null) + { + onChangeEvent.Invoke(this, fromSource, newAxis, newDelta); + } + } + + private void SteamVR_Behaviour_Single_OnAxis(SteamVR_Action_Single fromAction, SteamVR_Input_Sources fromSource, float newAxis, float newDelta) + { + if (onAxis != null) + { + onAxis.Invoke(this, fromSource, newAxis, newDelta); + } + + if (onAxisEvent != null) + { + onAxisEvent.Invoke(this, fromSource, newAxis, newDelta); } } - } - [Serializable] - public class SteamVR_Behaviour_SingleEvent : UnityEvent { } + + /// + /// Gets the localized name of the device that the action corresponds to. + /// + /// + /// + /// VRInputString_Hand - Which hand the origin is in. E.g. "Left Hand" + /// VRInputString_ControllerType - What kind of controller the user has in that hand.E.g. "Vive Controller" + /// VRInputString_InputSource - What part of that controller is the origin. E.g. "Trackpad" + /// VRInputString_All - All of the above. E.g. "Left Hand Vive Controller Trackpad" + /// + /// + public string GetLocalizedName(params EVRInputStringBits[] localizedParts) + { + if (singleAction != null) + return singleAction.GetLocalizedOriginPart(inputSource, localizedParts); + return null; + } + + public delegate void AxisHandler(SteamVR_Behaviour_Single fromAction, SteamVR_Input_Sources fromSource, float newAxis, float newDelta); + public delegate void ChangeHandler(SteamVR_Behaviour_Single fromAction, SteamVR_Input_Sources fromSource, float newAxis, float newDelta); + public delegate void UpdateHandler(SteamVR_Behaviour_Single fromAction, SteamVR_Input_Sources fromSource, float newAxis, float newDelta); + } } \ No newline at end of file diff --git a/Assets/SteamVR/Input/SteamVR_Behaviour_Single.cs.meta b/Assets/SteamVR/Input/SteamVR_Behaviour_Single.cs.meta index 73e16490..437b6b3b 100644 --- a/Assets/SteamVR/Input/SteamVR_Behaviour_Single.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_Behaviour_Single.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 8be882076514bc846a3ee15c689d0ac4 -timeCreated: 1532646979 +timeCreated: 1544852185 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Behaviour_Skeleton.cs b/Assets/SteamVR/Input/SteamVR_Behaviour_Skeleton.cs index b2ac6f9f..57f5a581 100644 --- a/Assets/SteamVR/Input/SteamVR_Behaviour_Skeleton.cs +++ b/Assets/SteamVR/Input/SteamVR_Behaviour_Skeleton.cs @@ -1,15 +1,17 @@ //======= Copyright (c) Valve Corporation, All rights reserved. =============== +using System; using System.Collections; using UnityEngine; +using UnityEngine.Events; using Valve.VR; namespace Valve.VR { public class SteamVR_Behaviour_Skeleton : MonoBehaviour { + [Tooltip("If not set, will try to auto assign this based on 'Skeleton' + inputSource")] /// The action this component will use to update the model. Must be a Skeleton type action. - [SteamVR_DefaultAction("Skeleton", "default", "inputSource")] public SteamVR_Action_Skeleton skeletonAction; /// The device this action should apply to. Any if the action is not device specific. @@ -37,20 +39,166 @@ public class SteamVR_Behaviour_Skeleton : MonoBehaviour public bool onlySetRotations = false; /// - /// How much of a blend to apply to the transform positions and rotations. - /// Set to 0 for the transform orientation to be set by an animation. + /// How much of a blend to apply to the transform positions and rotations. + /// Set to 0 for the transform orientation to be set by an animation. /// Set to 1 for the transform orientation to be set by the skeleton action. /// [Range(0, 1)] [Tooltip("Modify this to blend between animations setup on the hand")] public float skeletonBlend = 1f; + /// This Unity event will fire whenever the position or rotation of the bones are updated. + public SteamVR_Behaviour_SkeletonEvent onBoneTransformsUpdated; + + /// This Unity event will fire whenever the position or rotation of this transform is updated. + public SteamVR_Behaviour_SkeletonEvent onTransformUpdated; + + /// This Unity event will fire whenever the position or rotation of this transform is changed. + public SteamVR_Behaviour_SkeletonEvent onTransformChanged; + + /// This Unity event will fire whenever the device is connected or disconnected + public SteamVR_Behaviour_Skeleton_ConnectedChangedEvent onConnectedChanged; + + /// This Unity event will fire whenever the device's tracking state changes + public SteamVR_Behaviour_Skeleton_TrackingChangedEvent onTrackingChanged; + + + /// This C# event will fire whenever the position or rotation of this transform is updated. + public UpdateHandler onBoneTransformsUpdatedEvent; + + /// This C# event will fire whenever the position or rotation of this transform is updated. + public UpdateHandler onTransformUpdatedEvent; + + /// This C# event will fire whenever the position or rotation of this transform is changed. + public ChangeHandler onTransformChangedEvent; + + /// This C# event will fire whenever the device is connected or disconnected + public DeviceConnectedChangeHandler onConnectedChangedEvent; + + /// This C# event will fire whenever the device's tracking state changes + public TrackingChangeHandler onTrackingChangedEvent; + /// Can be set to mirror the bone data across the x axis [Tooltip("Is this rendermodel a mirror of another one?")] public MirrorType mirroring; + + + [Header("No Skeleton - Fallback")] + + + [Tooltip("The fallback SkeletonPoser to drive hand animation when no skeleton data is available")] + /// The fallback SkeletonPoser to drive hand animation when no skeleton data is available + public SteamVR_Skeleton_Poser fallbackPoser; + + [Tooltip("The fallback action to drive finger curl values when no skeleton data is available")] + /// The fallback SkeletonPoser to drive hand animation when no skeleton data is available + public SteamVR_Action_Single fallbackCurlAction; + + /// + /// Is the skeleton action bound? + /// + public bool skeletonAvailable { get { return skeletonAction.activeBinding; } } + + + + + + + + /// The current skeletonPoser we're getting pose data from + protected SteamVR_Skeleton_Poser blendPoser; + /// The current pose snapshot + protected SteamVR_Skeleton_PoseSnapshot blendSnapshot = null; + + /// Returns whether this action is bound and the action set is active - public bool isActive { get { return skeletonAction.GetActive(inputSource); } } + public bool isActive { get { return skeletonAction.GetActive(); } } + + + /// An array of five 0-1 values representing how curled a finger is. 0 being straight, 1 being fully curled. 0 being thumb, 4 being pinky + public float[] fingerCurls + { + get + { + if (skeletonAvailable) + { + return skeletonAction.GetFingerCurls(); + } + else + { + //fallback, return array where each finger curl is just the fallback curl action value + float[] curls = new float[5]; + for (int i = 0; i < 5; i++) + { + curls[i] = fallbackCurlAction.GetAxis(inputSource); + } + return curls; + } + } + } + + /// An 0-1 value representing how curled a finger is. 0 being straight, 1 being fully curled. + public float thumbCurl + { + get + { + if (skeletonAvailable) + return skeletonAction.GetFingerCurl(SteamVR_Skeleton_FingerIndexEnum.thumb); + else + return fallbackCurlAction.GetAxis(inputSource); + } + } + + /// An 0-1 value representing how curled a finger is. 0 being straight, 1 being fully curled. + public float indexCurl + { + get + { + if (skeletonAvailable) + return skeletonAction.GetFingerCurl(SteamVR_Skeleton_FingerIndexEnum.index); + else + return fallbackCurlAction.GetAxis(inputSource); + } + } + + /// An 0-1 value representing how curled a finger is. 0 being straight, 1 being fully curled. + public float middleCurl + { + get + { + if (skeletonAvailable) + return skeletonAction.GetFingerCurl(SteamVR_Skeleton_FingerIndexEnum.middle); + else + return fallbackCurlAction.GetAxis(inputSource); + } + } + + /// An 0-1 value representing how curled a finger is. 0 being straight, 1 being fully curled. + public float ringCurl + { + get + { + if (skeletonAvailable) + return skeletonAction.GetFingerCurl(SteamVR_Skeleton_FingerIndexEnum.ring); + else + return fallbackCurlAction.GetAxis(inputSource); + } + } + + /// An 0-1 value representing how curled a finger is. 0 being straight, 1 being fully curled. + public float pinkyCurl + { + get + { + if (skeletonAvailable) + return skeletonAction.GetFingerCurl(SteamVR_Skeleton_FingerIndexEnum.pinky); + else + return fallbackCurlAction.GetAxis(inputSource); + } + } + + public Transform root { get { return bones[SteamVR_Skeleton_JointIndexes.root]; } } public Transform wrist { get { return bones[SteamVR_Skeleton_JointIndexes.wrist]; } } @@ -102,12 +250,34 @@ public class SteamVR_Behaviour_Skeleton : MonoBehaviour protected Coroutine blendRoutine; protected Coroutine rangeOfMotionBlendRoutine; + protected Coroutine attachRoutine; protected Transform[] bones; /// The range of motion that is set temporarily (call ResetTemporaryRangeOfMotion to reset to rangeOfMotion) protected EVRSkeletalMotionRange? temporaryRangeOfMotion = null; + /// + /// Get the accuracy level of the skeletal tracking data. + /// * Estimated: Body part location can’t be directly determined by the device. Any skeletal pose provided by the device is estimated based on the active buttons, triggers, joysticks, or other input sensors. Examples include the Vive Controller and gamepads. + /// * Partial: Body part location can be measured directly but with fewer degrees of freedom than the actual body part.Certain body part positions may be unmeasured by the device and estimated from other input data.Examples include Knuckles or gloves that only measure finger curl + /// * Full: Body part location can be measured directly throughout the entire range of motion of the body part.Examples include hi-end mocap systems, or gloves that measure the rotation of each finger segment. + /// + public EVRSkeletalTrackingLevel skeletalTrackingLevel + { + get + { + if (skeletonAvailable) + { + return skeletonAction.skeletalTrackingLevel; + } + else + { + return EVRSkeletalTrackingLevel.VRSkeletalTracking_Estimated; + } + } + } + /// Returns true if we are in the process of blending the skeletonBlend field (between animation and bone data) public bool isBlending { @@ -117,8 +287,40 @@ public bool isBlending } } + /* + public float predictedSecondsFromNow + { + get + { + return skeletonAction.predictedSecondsFromNow; + } + + set + { + skeletonAction.predictedSecondsFromNow = value; + } + } + */ + public SteamVR_ActionSet actionSet + { + get + { + return skeletonAction.actionSet; + } + } + + public SteamVR_ActionDirections direction + { + get + { + return skeletonAction.direction; + } + } + protected virtual void Awake() { + SteamVR.Initialize(); + AssignBonesArray(); proximals = new Transform[] { thumbProximal, indexProximal, middleProximal, ringProximal, pinkyProximal }; @@ -126,6 +328,14 @@ protected virtual void Awake() distals = new Transform[] { thumbDistal, indexDistal, middleDistal, ringDistal, pinkyDistal }; tips = new Transform[] { thumbTip, indexTip, middleTip, ringTip, pinkyTip }; auxs = new Transform[] { thumbAux, indexAux, middleAux, ringAux, pinkyAux }; + + CheckSkeletonAction(); + } + + protected virtual void CheckSkeletonAction() + { + if (skeletonAction == null) + skeletonAction = SteamVR_Input.GetAction("Skeleton" + inputSource.ToString()); } protected virtual void AssignBonesArray() @@ -135,33 +345,68 @@ protected virtual void AssignBonesArray() protected virtual void OnEnable() { - SteamVR_Input.OnSkeletonsUpdated += SteamVR_Input_OnSkeletonsUpdated; + CheckSkeletonAction(); + SteamVR_Input.onSkeletonsUpdated += SteamVR_Input_OnSkeletonsUpdated; + + if (skeletonAction != null) + { + skeletonAction.onDeviceConnectedChanged += OnDeviceConnectedChanged; + skeletonAction.onTrackingChanged += OnTrackingChanged; + } } protected virtual void OnDisable() { - SteamVR_Input.OnSkeletonsUpdated -= SteamVR_Input_OnSkeletonsUpdated; + SteamVR_Input.onSkeletonsUpdated -= SteamVR_Input_OnSkeletonsUpdated; + + if (skeletonAction != null) + { + skeletonAction.onDeviceConnectedChanged -= OnDeviceConnectedChanged; + skeletonAction.onTrackingChanged -= OnTrackingChanged; + } + } + + private void OnDeviceConnectedChanged(SteamVR_Action_Skeleton fromAction, bool deviceConnected) + { + if (onConnectedChanged != null) + onConnectedChanged.Invoke(this, inputSource, deviceConnected); + if (onConnectedChangedEvent != null) + onConnectedChangedEvent.Invoke(this, inputSource, deviceConnected); } - protected virtual void SteamVR_Input_OnSkeletonsUpdated(bool obj) + private void OnTrackingChanged(SteamVR_Action_Skeleton fromAction, ETrackingResult trackingState) + { + if (onTrackingChanged != null) + onTrackingChanged.Invoke(this, inputSource, trackingState); + if (onTrackingChangedEvent != null) + onTrackingChangedEvent.Invoke(this, inputSource, trackingState); + } + + protected virtual void SteamVR_Input_OnSkeletonsUpdated(bool skipSendingEvents) { UpdateSkeleton(); } protected virtual void UpdateSkeleton() { - if (skeletonAction == null || skeletonAction.GetActive(inputSource) == false) + if (skeletonAction == null) return; if (updatePose) UpdatePose(); + if (blendPoser != null && skeletonBlend < 1) + { + if (blendSnapshot == null) blendSnapshot = blendPoser.GetBlendedPose(this); + blendSnapshot = blendPoser.GetBlendedPose(this); + } + if (rangeOfMotionBlendRoutine == null) { if (temporaryRangeOfMotion != null) - skeletonAction.SetRangeOfMotion(inputSource, temporaryRangeOfMotion.Value); + skeletonAction.SetRangeOfMotion(temporaryRangeOfMotion.Value); else - skeletonAction.SetRangeOfMotion(inputSource, rangeOfMotion); //this may be a frame behind + skeletonAction.SetRangeOfMotion(rangeOfMotion); //this may be a frame behind UpdateSkeletonTransforms(); } @@ -182,7 +427,7 @@ public void SetTemporaryRangeOfMotion(EVRSkeletalMotionRange newRangeOfMotion, f } /// - /// Resets the previously set temporary range of motion. + /// Resets the previously set temporary range of motion. /// Will return to the range of motion defined by the rangeOfMotion field. /// /// How long you want the blend to the standard range of motion to take (in seconds) @@ -195,8 +440,8 @@ public void ResetTemporaryRangeOfMotion(float blendOverSeconds = 0.1f) /// Permanently sets the range of motion for this component. /// /// - /// The new range of motion to be set. - /// WithController being the best estimation of where fingers are wrapped around the controller (pressing buttons, etc). + /// The new range of motion to be set. + /// WithController being the best estimation of where fingers are wrapped around the controller (pressing buttons, etc). /// WithoutController being a range between a flat hand and a fist. /// How long you want the blend to the new range of motion to take (in seconds) public void SetRangeOfMotion(EVRSkeletalMotionRange newRangeOfMotion, float blendOverSeconds = 0.1f) @@ -213,9 +458,26 @@ public void SetRangeOfMotion(EVRSkeletalMotionRange newRangeOfMotion, float blen /// How long you want the blend to take (in seconds) public void BlendToSkeleton(float overTime = 0.1f) { + if (blendPoser != null) + blendSnapshot = blendPoser.GetBlendedPose(this); + blendPoser = null; BlendTo(1, overTime); } + /// + /// Blend from the current skeletonBlend amount to pose animation. (skeletonBlend = 0) + /// Note: This will ignore the root position and rotation of the pose. + /// + /// How long you want the blend to take (in seconds) + public void BlendToPoser(SteamVR_Skeleton_Poser poser, float overTime = 0.1f) + { + if (poser == null) + return; + + blendPoser = poser; + BlendTo(0, overTime); + } + /// /// Blend from the current skeletonBlend amount to full animation data (no bone data. skeletonBlend = 0) /// @@ -228,7 +490,7 @@ public void BlendToAnimation(float overTime = 0.1f) /// /// Blend from the current skeletonBlend amount to a specified new amount. /// - /// The amount of blend you want to apply. + /// The amount of blend you want to apply. /// 0 being fully set by animations, 1 being fully set by bone data from the action. /// How long you want the blend to take (in seconds) public void BlendTo(float blendToAmount, float overTime) @@ -240,6 +502,7 @@ public void BlendTo(float blendToAmount, float overTime) blendRoutine = StartCoroutine(DoBlendRoutine(blendToAmount, overTime)); } + protected IEnumerator DoBlendRoutine(float blendToAmount, float overTime) { float startTime = Time.time; @@ -326,15 +589,15 @@ protected IEnumerator DoRangeOfMotionBlend(EVRSkeletalMotionRange oldRangeOfMoti if (skeletonBlend > 0) { - skeletonAction.SetRangeOfMotion(inputSource, oldRangeOfMotion); - skeletonAction.UpdateValue(inputSource, true); - oldBonePositions = (Vector3[])GetBonePositions(inputSource).Clone(); - oldBoneRotations = (Quaternion[])GetBoneRotations(inputSource).Clone(); + skeletonAction.SetRangeOfMotion(oldRangeOfMotion); + skeletonAction.UpdateValueWithoutEvents(); + oldBonePositions = (Vector3[])GetBonePositions().Clone(); + oldBoneRotations = (Quaternion[])GetBoneRotations().Clone(); - skeletonAction.SetRangeOfMotion(inputSource, newRangeOfMotion); - skeletonAction.UpdateValue(inputSource, true); - newBonePositions = GetBonePositions(inputSource); - newBoneRotations = GetBoneRotations(inputSource); + skeletonAction.SetRangeOfMotion(newRangeOfMotion); + skeletonAction.UpdateValueWithoutEvents(); + newBonePositions = GetBonePositions(); + newBoneRotations = GetBoneRotations(); for (int boneIndex = 0; boneIndex < bones.Length; boneIndex++) { @@ -351,8 +614,17 @@ protected IEnumerator DoRangeOfMotionBlend(EVRSkeletalMotionRange oldRangeOfMoti if (skeletonBlend < 1) { - SetBonePosition(boneIndex, Vector3.Lerp(bones[boneIndex].localPosition, blendedRangeOfMotionPosition, skeletonBlend)); - SetBoneRotation(boneIndex, Quaternion.Lerp(bones[boneIndex].localRotation, blendedRangeOfMotionRotation, skeletonBlend)); + if (blendPoser != null) + { + + SetBonePosition(boneIndex, Vector3.Lerp(blendSnapshot.bonePositions[boneIndex], blendedRangeOfMotionPosition, skeletonBlend)); + SetBoneRotation(boneIndex, Quaternion.Lerp(GetBlendPoseForBone(boneIndex, blendedRangeOfMotionRotation), blendedRangeOfMotionRotation, skeletonBlend)); + } + else + { + SetBonePosition(boneIndex, Vector3.Lerp(bones[boneIndex].localPosition, blendedRangeOfMotionPosition, skeletonBlend)); + SetBoneRotation(boneIndex, Quaternion.Lerp(bones[boneIndex].localRotation, blendedRangeOfMotionRotation, skeletonBlend)); + } } else { @@ -361,23 +633,68 @@ protected IEnumerator DoRangeOfMotionBlend(EVRSkeletalMotionRange oldRangeOfMoti } } } - } + if (onBoneTransformsUpdated != null) + onBoneTransformsUpdated.Invoke(this, inputSource); + if (onBoneTransformsUpdatedEvent != null) + onBoneTransformsUpdatedEvent.Invoke(this, inputSource); + + } rangeOfMotionBlendRoutine = null; } - protected virtual void UpdateSkeletonTransforms() + //why does this exist + protected virtual Quaternion GetBlendPoseForBone(int boneIndex, Quaternion skeletonRotation) + { + Quaternion poseRotation = blendSnapshot.boneRotations[boneIndex]; + return poseRotation; + } + + public virtual void UpdateSkeletonTransforms() { + Vector3[] bonePositions = GetBonePositions(); + Quaternion[] boneRotations = GetBoneRotations(); + if (skeletonBlend <= 0) - return; + { + if (blendPoser != null) + { + SteamVR_Skeleton_Pose_Hand mainPose = blendPoser.skeletonMainPose.GetHand(inputSource); + for (int boneIndex = 0; boneIndex < bones.Length; boneIndex++) + { + if (bones[boneIndex] == null) + continue; + + if ((boneIndex == SteamVR_Skeleton_JointIndexes.wrist && mainPose.ignoreWristPoseData) || + (boneIndex == SteamVR_Skeleton_JointIndexes.root && mainPose.ignoreRootPoseData)) + { + SetBonePosition(boneIndex, bonePositions[boneIndex]); + SetBoneRotation(boneIndex, boneRotations[boneIndex]); + } + else + { + Quaternion poseRotation = GetBlendPoseForBone(boneIndex, boneRotations[boneIndex]); - Vector3[] bonePositions = GetBonePositions(inputSource); - Quaternion[] boneRotations = GetBoneRotations(inputSource); + SetBonePosition(boneIndex, blendSnapshot.bonePositions[boneIndex]); + SetBoneRotation(boneIndex, poseRotation); + } + } + } + else + { + for (int boneIndex = 0; boneIndex < bones.Length; boneIndex++) + { + Quaternion poseRotation = GetBlendPoseForBone(boneIndex, boneRotations[boneIndex]); + SetBonePosition(boneIndex, blendSnapshot.bonePositions[boneIndex]); + SetBoneRotation(boneIndex, poseRotation); - if (skeletonBlend >= 1) + } + } + } + else if (skeletonBlend >= 1) { for (int boneIndex = 0; boneIndex < bones.Length; boneIndex++) { @@ -395,35 +712,74 @@ protected virtual void UpdateSkeletonTransforms() if (bones[boneIndex] == null) continue; - SetBonePosition(boneIndex, Vector3.Lerp(bones[boneIndex].localPosition, bonePositions[boneIndex], skeletonBlend)); - SetBoneRotation(boneIndex, Quaternion.Lerp(bones[boneIndex].localRotation, boneRotations[boneIndex], skeletonBlend)); + if (blendPoser != null) + { + SteamVR_Skeleton_Pose_Hand mainPose = blendPoser.skeletonMainPose.GetHand(inputSource); + + if ((boneIndex == SteamVR_Skeleton_JointIndexes.wrist && mainPose.ignoreWristPoseData) || + (boneIndex == SteamVR_Skeleton_JointIndexes.root && mainPose.ignoreRootPoseData)) + { + SetBonePosition(boneIndex, bonePositions[boneIndex]); + SetBoneRotation(boneIndex, boneRotations[boneIndex]); + } + else + { + //Quaternion poseRotation = GetBlendPoseForBone(boneIndex, boneRotations[boneIndex]); + + SetBonePosition(boneIndex, Vector3.Lerp(blendSnapshot.bonePositions[boneIndex], bonePositions[boneIndex], skeletonBlend)); + SetBoneRotation(boneIndex, Quaternion.Lerp(blendSnapshot.boneRotations[boneIndex], boneRotations[boneIndex], skeletonBlend)); + //SetBoneRotation(boneIndex, GetBlendPoseForBone(boneIndex, boneRotations[boneIndex])); + } + } + else + { + if (blendSnapshot == null) + { + SetBonePosition(boneIndex, Vector3.Lerp(bones[boneIndex].localPosition, bonePositions[boneIndex], skeletonBlend)); + SetBoneRotation(boneIndex, Quaternion.Lerp(bones[boneIndex].localRotation, boneRotations[boneIndex], skeletonBlend)); + } + else + { + SetBonePosition(boneIndex, Vector3.Lerp(blendSnapshot.bonePositions[boneIndex], bonePositions[boneIndex], skeletonBlend)); + SetBoneRotation(boneIndex, Quaternion.Lerp(blendSnapshot.boneRotations[boneIndex], boneRotations[boneIndex], skeletonBlend)); + } + } } } + + + if (onBoneTransformsUpdated != null) + onBoneTransformsUpdated.Invoke(this, inputSource); + if (onBoneTransformsUpdatedEvent != null) + onBoneTransformsUpdatedEvent.Invoke(this, inputSource); } - protected virtual void SetBonePosition(int boneIndex, Vector3 localPosition) + public virtual void SetBonePosition(int boneIndex, Vector3 localPosition) { if (onlySetRotations == false) //ignore position sets if we're only setting rotations bones[boneIndex].localPosition = localPosition; } - protected virtual void SetBoneRotation(int boneIndex, Quaternion localRotation) + public virtual void SetBoneRotation(int boneIndex, Quaternion localRotation) { bones[boneIndex].localRotation = localRotation; } /// - /// Gets the transform for a bone by the joint index. Joint indexes specified in: SteamVR_Skeleton_JointIndexes + /// Gets the transform for a bone by the joint index. Joint indexes specified in: SteamVR_Skeleton_JointIndexes /// /// The joint index of the bone. Specified in SteamVR_Skeleton_JointIndexes public virtual Transform GetBone(int joint) { + if (bones == null || bones.Length == 0) + Awake(); + return bones[joint]; } /// - /// Gets the position of the transform for a bone by the joint index. Joint indexes specified in: SteamVR_Skeleton_JointIndexes + /// Gets the position of the transform for a bone by the joint index. Joint indexes specified in: SteamVR_Skeleton_JointIndexes /// /// The joint index of the bone. Specified in SteamVR_Skeleton_JointIndexes /// true to get the localspace position for the joint (position relative to this joint's parent) @@ -436,7 +792,7 @@ public Vector3 GetBonePosition(int joint, bool local = false) } /// - /// Gets the rotation of the transform for a bone by the joint index. Joint indexes specified in: SteamVR_Skeleton_JointIndexes + /// Gets the rotation of the transform for a bone by the joint index. Joint indexes specified in: SteamVR_Skeleton_JointIndexes /// /// The joint index of the bone. Specified in SteamVR_Skeleton_JointIndexes /// true to get the localspace rotation for the joint (rotation relative to this joint's parent) @@ -448,49 +804,96 @@ public Quaternion GetBoneRotation(int joint, bool local = false) return bones[joint].rotation; } - protected Vector3[] GetBonePositions(SteamVR_Input_Sources inputSource) + protected Vector3[] GetBonePositions() { - Vector3[] rawSkeleton = skeletonAction.GetBonePositions(inputSource); - if (mirroring == MirrorType.LeftToRight || mirroring == MirrorType.RightToLeft) + if (skeletonAvailable) { - for (int boneIndex = 0; boneIndex < rawSkeleton.Length; boneIndex++) + Vector3[] rawSkeleton = skeletonAction.GetBonePositions(); + if (mirroring == MirrorType.LeftToRight || mirroring == MirrorType.RightToLeft) { - if (boneIndex == SteamVR_Skeleton_JointIndexes.wrist || IsMetacarpal(boneIndex)) - { - rawSkeleton[boneIndex].Scale(new Vector3(-1, 1, 1)); - } - else if (boneIndex != SteamVR_Skeleton_JointIndexes.root) + for (int boneIndex = 0; boneIndex < rawSkeleton.Length; boneIndex++) { - rawSkeleton[boneIndex] = rawSkeleton[boneIndex] * -1; + rawSkeleton[boneIndex] = MirrorPosition(boneIndex, rawSkeleton[boneIndex]); } } - } - return rawSkeleton; + return rawSkeleton; + } + else + { + //fallback to getting skeleton pose from skeletonPoser + if (fallbackPoser != null) + { + return fallbackPoser.GetBlendedPose(skeletonAction, inputSource).bonePositions; + } + else + { + Debug.LogError("Skeleton Action is not bound, and you have not provided a fallback SkeletonPoser. Please create one to drive hand animation when no skeleton data is available.", this); + return null; + } + } } - protected Quaternion rightFlipAngle = Quaternion.AngleAxis(180, Vector3.right); - protected Quaternion[] GetBoneRotations(SteamVR_Input_Sources inputSource) + protected static readonly Quaternion rightFlipAngle = Quaternion.AngleAxis(180, Vector3.right); + protected Quaternion[] GetBoneRotations() { - Quaternion[] rawSkeleton = skeletonAction.GetBoneRotations(inputSource); - if (mirroring == MirrorType.LeftToRight || mirroring == MirrorType.RightToLeft) + if (skeletonAvailable) { - for (int boneIndex = 0; boneIndex < rawSkeleton.Length; boneIndex++) + Quaternion[] rawSkeleton = skeletonAction.GetBoneRotations(); + if (mirroring == MirrorType.LeftToRight || mirroring == MirrorType.RightToLeft) { - if (boneIndex == SteamVR_Skeleton_JointIndexes.wrist) + for (int boneIndex = 0; boneIndex < rawSkeleton.Length; boneIndex++) { - rawSkeleton[boneIndex].y = rawSkeleton[boneIndex].y * -1; - rawSkeleton[boneIndex].z = rawSkeleton[boneIndex].z * -1; + rawSkeleton[boneIndex] = MirrorRotation(boneIndex, rawSkeleton[boneIndex]); } + } - if (IsMetacarpal(boneIndex)) - { - rawSkeleton[boneIndex] = rightFlipAngle * rawSkeleton[boneIndex]; - } + return rawSkeleton; + + } + else + { + //fallback to getting skeleton pose from skeletonPoser + if (fallbackPoser != null) + { + return fallbackPoser.GetBlendedPose(skeletonAction, inputSource).boneRotations; + } + else + { + Debug.LogError("Skeleton Action is not bound, and you have not provided a fallback SkeletonPoser. Please create one to drive hand animation when no skeleton data is available.", this); + return null; } } + } + + public static Vector3 MirrorPosition(int boneIndex, Vector3 rawPosition) + { + if (boneIndex == SteamVR_Skeleton_JointIndexes.wrist || IsMetacarpal(boneIndex)) + { + rawPosition.Scale(new Vector3(-1, 1, 1)); + } + else if (boneIndex != SteamVR_Skeleton_JointIndexes.root) + { + rawPosition = rawPosition * -1; + } + + return rawPosition; + } - return rawSkeleton; + public static Quaternion MirrorRotation(int boneIndex, Quaternion rawRotation) + { + if (boneIndex == SteamVR_Skeleton_JointIndexes.wrist) + { + rawRotation.y = rawRotation.y * -1; + rawRotation.z = rawRotation.z * -1; + } + + if (IsMetacarpal(boneIndex)) + { + rawRotation = rightFlipAngle * rawRotation; + } + + return rawRotation; } protected virtual void UpdatePose() @@ -498,23 +901,113 @@ protected virtual void UpdatePose() if (skeletonAction == null) return; + Vector3 skeletonPosition = skeletonAction.GetLocalPosition(); + Quaternion skeletonRotation = skeletonAction.GetLocalRotation(); if (origin == null) - skeletonAction.UpdateTransform(inputSource, this.transform); + { + if (this.transform.parent != null) + { + skeletonPosition = this.transform.parent.TransformPoint(skeletonPosition); + skeletonRotation = this.transform.parent.rotation * skeletonRotation; + } + } else { - this.transform.position = origin.TransformPoint(skeletonAction.GetLocalPosition(inputSource)); - this.transform.eulerAngles = origin.TransformDirection(skeletonAction.GetLocalRotation(inputSource).eulerAngles); + skeletonPosition = origin.TransformPoint(skeletonPosition); + skeletonRotation = origin.rotation * skeletonRotation; + } + + if (skeletonAction.poseChanged) + { + if (onTransformChanged != null) + onTransformChanged.Invoke(this, inputSource); + if (onTransformChangedEvent != null) + onTransformChangedEvent.Invoke(this, inputSource); } + + this.transform.position = skeletonPosition; + this.transform.rotation = skeletonRotation; + + if (onTransformUpdated != null) + onTransformUpdated.Invoke(this, inputSource); } - public enum MirrorType + /// + /// Returns an array of positions/rotations that represent the state of each bone in a reference pose. + /// + /// Which reference pose to return + public void ForceToReferencePose(EVRSkeletalReferencePose referencePose) { - None, - LeftToRight, - RightToLeft + bool temporarySession = false; + if (Application.isEditor && Application.isPlaying == false) + { + temporarySession = SteamVR.InitializeTemporarySession(true); + Awake(); + +#if UNITY_EDITOR + //gotta wait a bit for steamvr input to startup //todo: implement steamvr_input.isready + string title = "SteamVR"; + string text = "Getting reference pose..."; + float msToWait = 3000; + float increment = 100; + for (float timer = 0; timer < msToWait; timer += increment) + { + bool cancel = UnityEditor.EditorUtility.DisplayCancelableProgressBar(title, text, timer / msToWait); + if (cancel) + { + UnityEditor.EditorUtility.ClearProgressBar(); + + if (temporarySession) + SteamVR.ExitTemporarySession(); + return; + } + System.Threading.Thread.Sleep((int)increment); + } + UnityEditor.EditorUtility.ClearProgressBar(); +#endif + + skeletonAction.actionSet.Activate(); + + SteamVR_ActionSet_Manager.UpdateActionStates(true); + + skeletonAction.UpdateValueWithoutEvents(); + } + + if (skeletonAction.active == false) + { + Debug.LogError("[SteamVR Input] Please turn on your " + inputSource.ToString() + " controller and ensure SteamVR is open.", this); + return; + } + + SteamVR_Utils.RigidTransform[] transforms = skeletonAction.GetReferenceTransforms(EVRSkeletalTransformSpace.Parent, referencePose); + + if (transforms == null || transforms.Length == 0) + { + Debug.LogError("[SteamVR Input] Unable to get the reference transform for " + inputSource.ToString() + ". Please make sure SteamVR is open and both controllers are connected.", this); + } + + if (mirroring == MirrorType.LeftToRight || mirroring == MirrorType.RightToLeft) + { + for (int boneIndex = 0; boneIndex < transforms.Length; boneIndex++) + { + bones[boneIndex].localPosition = MirrorPosition(boneIndex, transforms[boneIndex].pos); + bones[boneIndex].localRotation = MirrorRotation(boneIndex, transforms[boneIndex].rot); + } + } + else + { + for (int boneIndex = 0; boneIndex < transforms.Length; boneIndex++) + { + bones[boneIndex].localPosition = transforms[boneIndex].pos; + bones[boneIndex].localRotation = transforms[boneIndex].rot; + } + } + + if (temporarySession) + SteamVR.ExitTemporarySession(); } - protected bool IsMetacarpal(int boneIndex) + protected static bool IsMetacarpal(int boneIndex) { return (boneIndex == SteamVR_Skeleton_JointIndexes.indexMetacarpal || boneIndex == SteamVR_Skeleton_JointIndexes.middleMetacarpal || @@ -522,79 +1015,19 @@ protected bool IsMetacarpal(int boneIndex) boneIndex == SteamVR_Skeleton_JointIndexes.pinkyMetacarpal || boneIndex == SteamVR_Skeleton_JointIndexes.thumbMetacarpal); } - } - - /// The order of the joints that SteamVR Skeleton Input is expecting. - public class SteamVR_Skeleton_JointIndexes - { - public const int root = 0; - public const int wrist = 1; - public const int thumbMetacarpal = 2; - public const int thumbProximal = 2; - public const int thumbMiddle = 3; - public const int thumbDistal = 4; - public const int thumbTip = 5; - public const int indexMetacarpal = 6; - public const int indexProximal = 7; - public const int indexMiddle = 8; - public const int indexDistal = 9; - public const int indexTip = 10; - public const int middleMetacarpal = 11; - public const int middleProximal = 12; - public const int middleMiddle = 13; - public const int middleDistal = 14; - public const int middleTip = 15; - public const int ringMetacarpal = 16; - public const int ringProximal = 17; - public const int ringMiddle = 18; - public const int ringDistal = 19; - public const int ringTip = 20; - public const int pinkyMetacarpal = 21; - public const int pinkyProximal = 22; - public const int pinkyMiddle = 23; - public const int pinkyDistal = 24; - public const int pinkyTip = 25; - public const int thumbAux = 26; - public const int indexAux = 27; - public const int middleAux = 28; - public const int ringAux = 29; - public const int pinkyAux = 30; - } + public enum MirrorType + { + None, + LeftToRight, + RightToLeft + } - public enum SteamVR_Skeleton_JointIndexEnum - { - root = SteamVR_Skeleton_JointIndexes.root, - wrist = SteamVR_Skeleton_JointIndexes.wrist, - thumbMetacarpal = SteamVR_Skeleton_JointIndexes.thumbMetacarpal, - thumbProximal = SteamVR_Skeleton_JointIndexes.thumbProximal, - thumbMiddle = SteamVR_Skeleton_JointIndexes.thumbMiddle, - thumbDistal = SteamVR_Skeleton_JointIndexes.thumbDistal, - thumbTip = SteamVR_Skeleton_JointIndexes.thumbTip, - indexMetacarpal = SteamVR_Skeleton_JointIndexes.indexMetacarpal, - indexProximal = SteamVR_Skeleton_JointIndexes.indexProximal, - indexMiddle = SteamVR_Skeleton_JointIndexes.indexMiddle, - indexDistal = SteamVR_Skeleton_JointIndexes.indexDistal, - indexTip = SteamVR_Skeleton_JointIndexes.indexTip, - middleMetacarpal = SteamVR_Skeleton_JointIndexes.middleMetacarpal, - middleProximal = SteamVR_Skeleton_JointIndexes.middleProximal, - middleMiddle = SteamVR_Skeleton_JointIndexes.middleMiddle, - middleDistal = SteamVR_Skeleton_JointIndexes.middleDistal, - middleTip = SteamVR_Skeleton_JointIndexes.middleTip, - ringMetacarpal = SteamVR_Skeleton_JointIndexes.ringMetacarpal, - ringProximal = SteamVR_Skeleton_JointIndexes.ringProximal, - ringMiddle = SteamVR_Skeleton_JointIndexes.ringMiddle, - ringDistal = SteamVR_Skeleton_JointIndexes.ringDistal, - ringTip = SteamVR_Skeleton_JointIndexes.ringTip, - pinkyMetacarpal = SteamVR_Skeleton_JointIndexes.pinkyMetacarpal, - pinkyProximal = SteamVR_Skeleton_JointIndexes.pinkyProximal, - pinkyMiddle = SteamVR_Skeleton_JointIndexes.pinkyMiddle, - pinkyDistal = SteamVR_Skeleton_JointIndexes.pinkyDistal, - pinkyTip = SteamVR_Skeleton_JointIndexes.pinkyTip, - thumbAux = SteamVR_Skeleton_JointIndexes.thumbAux, - indexAux = SteamVR_Skeleton_JointIndexes.indexAux, - middleAux = SteamVR_Skeleton_JointIndexes.middleAux, - ringAux = SteamVR_Skeleton_JointIndexes.ringAux, - pinkyAux = SteamVR_Skeleton_JointIndexes.pinkyAux, + public delegate void ActiveChangeHandler(SteamVR_Behaviour_Skeleton fromAction, SteamVR_Input_Sources inputSource, bool active); + public delegate void ChangeHandler(SteamVR_Behaviour_Skeleton fromAction, SteamVR_Input_Sources inputSource); + public delegate void UpdateHandler(SteamVR_Behaviour_Skeleton fromAction, SteamVR_Input_Sources inputSource); + public delegate void TrackingChangeHandler(SteamVR_Behaviour_Skeleton fromAction, SteamVR_Input_Sources inputSource, ETrackingResult trackingState); + public delegate void ValidPoseChangeHandler(SteamVR_Behaviour_Skeleton fromAction, SteamVR_Input_Sources inputSource, bool validPose); + public delegate void DeviceConnectedChangeHandler(SteamVR_Behaviour_Skeleton fromAction, SteamVR_Input_Sources inputSource, bool deviceConnected); } } \ No newline at end of file diff --git a/Assets/SteamVR/Input/SteamVR_Behaviour_Skeleton.cs.meta b/Assets/SteamVR/Input/SteamVR_Behaviour_Skeleton.cs.meta index 5577bd05..7fe68fca 100644 --- a/Assets/SteamVR/Input/SteamVR_Behaviour_Skeleton.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_Behaviour_Skeleton.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 00f6c0d7b5a00aa4a8d38a09a0480032 -timeCreated: 1533337559 +timeCreated: 1544852185 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: -31500 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Behaviour_SkeletonCustom.cs.meta b/Assets/SteamVR/Input/SteamVR_Behaviour_SkeletonCustom.cs.meta index 496b1ea7..06647220 100644 --- a/Assets/SteamVR/Input/SteamVR_Behaviour_SkeletonCustom.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_Behaviour_SkeletonCustom.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 9e4c0a04a2f4ee942ba9bd5d7ceb7266 -timeCreated: 1532646997 +timeCreated: 1544852185 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Behaviour_Vector2.cs b/Assets/SteamVR/Input/SteamVR_Behaviour_Vector2.cs index d4bfa95b..89688a43 100644 --- a/Assets/SteamVR/Input/SteamVR_Behaviour_Vector2.cs +++ b/Assets/SteamVR/Input/SteamVR_Behaviour_Vector2.cs @@ -22,32 +22,119 @@ public class SteamVR_Behaviour_Vector2 : MonoBehaviour [Tooltip("The device this action should apply to. Any if the action is not device specific.")] public SteamVR_Input_Sources inputSource; - /// Fires whenever the action's value has changed since the last update. + /// Unity event that fires whenever the action's value has changed since the last update. [Tooltip("Fires whenever the action's value has changed since the last update.")] public SteamVR_Behaviour_Vector2Event onChange; + /// Unity event that fires whenever the action's value has been updated + [Tooltip("Fires whenever the action's value has been updated.")] + public SteamVR_Behaviour_Vector2Event onUpdate; + + /// Unity event that fires whenever the action's value has been updated and is non-zero + [Tooltip("Fires whenever the action's value has been updated and is non-zero.")] + public SteamVR_Behaviour_Vector2Event onAxis; + + /// C# event that fires whenever the action's value has changed since the last update. + public ChangeHandler onChangeEvent; + + /// C# event that fires whenever the action's value has been updated + public UpdateHandler onUpdateEvent; + + /// C# event that fires whenever the action's value has been updated and is non-zero + public AxisHandler onAxisEvent; + /// Returns whether this action is bound and the action set is active public bool isActive { get { return vector2Action.GetActive(inputSource); } } - private void OnEnable() + protected virtual void OnEnable() { - vector2Action.AddOnChangeListener(ActionChanged, inputSource); + if (vector2Action == null) + { + Debug.LogError("[SteamVR] Vector2 action not set.", this); + return; + } + + AddHandlers(); } - private void OnDisable() + protected virtual void OnDisable() { - vector2Action.RemoveOnChangeListener(ActionChanged, inputSource); + RemoveHandlers(); } - private void ActionChanged(SteamVR_Action_In action) + protected void AddHandlers() + { + vector2Action[inputSource].onUpdate += SteamVR_Behaviour_Vector2_OnUpdate; + vector2Action[inputSource].onChange += SteamVR_Behaviour_Vector2_OnChange; + vector2Action[inputSource].onAxis += SteamVR_Behaviour_Vector2_OnAxis; + } + + protected void RemoveHandlers() + { + if (vector2Action != null) + { + vector2Action[inputSource].onUpdate -= SteamVR_Behaviour_Vector2_OnUpdate; + vector2Action[inputSource].onChange -= SteamVR_Behaviour_Vector2_OnChange; + vector2Action[inputSource].onAxis -= SteamVR_Behaviour_Vector2_OnAxis; + } + } + + private void SteamVR_Behaviour_Vector2_OnUpdate(SteamVR_Action_Vector2 fromAction, SteamVR_Input_Sources fromSource, Vector2 newAxis, Vector2 newDelta) + { + if (onUpdate != null) + { + onUpdate.Invoke(this, fromSource, newAxis, newDelta); + } + if (onUpdateEvent != null) + { + onUpdateEvent.Invoke(this, fromSource, newAxis, newDelta); + } + } + + private void SteamVR_Behaviour_Vector2_OnChange(SteamVR_Action_Vector2 fromAction, SteamVR_Input_Sources fromSource, Vector2 newAxis, Vector2 newDelta) { if (onChange != null) { - onChange.Invoke((SteamVR_Action_Vector2)action); + onChange.Invoke(this, fromSource, newAxis, newDelta); + } + if (onChangeEvent != null) + { + onChangeEvent.Invoke(this, fromSource, newAxis, newDelta); + } + } + + private void SteamVR_Behaviour_Vector2_OnAxis(SteamVR_Action_Vector2 fromAction, SteamVR_Input_Sources fromSource, Vector2 newAxis, Vector2 newDelta) + { + if (onAxis != null) + { + onAxis.Invoke(this, fromSource, newAxis, newDelta); + } + if (onAxisEvent != null) + { + onAxisEvent.Invoke(this, fromSource, newAxis, newDelta); } } - } - [Serializable] - public class SteamVR_Behaviour_Vector2Event : UnityEvent { } + /// + /// Gets the localized name of the device that the action corresponds to. + /// + /// + /// + /// VRInputString_Hand - Which hand the origin is in. E.g. "Left Hand" + /// VRInputString_ControllerType - What kind of controller the user has in that hand.E.g. "Vive Controller" + /// VRInputString_InputSource - What part of that controller is the origin. E.g. "Trackpad" + /// VRInputString_All - All of the above. E.g. "Left Hand Vive Controller Trackpad" + /// + /// + public string GetLocalizedName(params EVRInputStringBits[] localizedParts) + { + if (vector2Action != null) + return vector2Action.GetLocalizedOriginPart(inputSource, localizedParts); + return null; + } + + public delegate void AxisHandler(SteamVR_Behaviour_Vector2 fromAction, SteamVR_Input_Sources fromSource, Vector2 newAxis, Vector2 newDelta); + public delegate void ChangeHandler(SteamVR_Behaviour_Vector2 fromAction, SteamVR_Input_Sources fromSource, Vector2 newAxis, Vector2 newDelta); + public delegate void UpdateHandler(SteamVR_Behaviour_Vector2 fromAction, SteamVR_Input_Sources fromSource, Vector2 newAxis, Vector2 newDelta); + } } \ No newline at end of file diff --git a/Assets/SteamVR/Input/SteamVR_Behaviour_Vector2.cs.meta b/Assets/SteamVR/Input/SteamVR_Behaviour_Vector2.cs.meta index 63f15208..4f153282 100644 --- a/Assets/SteamVR/Input/SteamVR_Behaviour_Vector2.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_Behaviour_Vector2.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 882e9db3ae3cfdf4793461eada0f54b6 -timeCreated: 1532647008 +timeCreated: 1544852185 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Behaviour_Vector3.cs b/Assets/SteamVR/Input/SteamVR_Behaviour_Vector3.cs index 166f5006..1f42a485 100644 --- a/Assets/SteamVR/Input/SteamVR_Behaviour_Vector3.cs +++ b/Assets/SteamVR/Input/SteamVR_Behaviour_Vector3.cs @@ -19,32 +19,120 @@ public class SteamVR_Behaviour_Vector3 : MonoBehaviour [Tooltip("The device this action should apply to. Any if the action is not device specific.")] public SteamVR_Input_Sources inputSource; - /// Fires whenever the action's value has changed since the last update. + /// Unity event that fires whenever the action's value has changed since the last update. [Tooltip("Fires whenever the action's value has changed since the last update.")] public SteamVR_Behaviour_Vector3Event onChange; + /// Unity event that fires whenever the action's value has been updated + [Tooltip("Fires whenever the action's value has been updated.")] + public SteamVR_Behaviour_Vector3Event onUpdate; + + /// Unity event that fires whenever the action's value has been updated and is non-zero + [Tooltip("Fires whenever the action's value has been updated and is non-zero.")] + public SteamVR_Behaviour_Vector3Event onAxis; + + /// C# event that fires whenever the action's value has changed since the last update. + public ChangeHandler onChangeEvent; + + /// C# event that fires whenever the action's value has been updated + public UpdateHandler onUpdateEvent; + + /// C# event that fires whenever the action's value has been updated and is non-zero + public AxisHandler onAxisEvent; + + /// Returns whether this action is bound and the action set is active public bool isActive { get { return vector3Action.GetActive(inputSource); } } - private void OnEnable() + protected virtual void OnEnable() { - vector3Action.AddOnChangeListener(ActionChanged, inputSource); + if (vector3Action == null) + { + Debug.LogError("[SteamVR] Vector3 action not set.", this); + return; + } + + AddHandlers(); + } + + protected virtual void OnDisable() + { + RemoveHandlers(); + } + + protected void AddHandlers() + { + vector3Action[inputSource].onUpdate += SteamVR_Behaviour_Vector3_OnUpdate; + vector3Action[inputSource].onChange += SteamVR_Behaviour_Vector3_OnChange; + vector3Action[inputSource].onAxis += SteamVR_Behaviour_Vector3_OnAxis; + } + + protected void RemoveHandlers() + { + if (vector3Action != null) + { + vector3Action[inputSource].onUpdate -= SteamVR_Behaviour_Vector3_OnUpdate; + vector3Action[inputSource].onChange -= SteamVR_Behaviour_Vector3_OnChange; + vector3Action[inputSource].onAxis -= SteamVR_Behaviour_Vector3_OnAxis; + } } - private void OnDisable() + private void SteamVR_Behaviour_Vector3_OnUpdate(SteamVR_Action_Vector3 fromAction, SteamVR_Input_Sources fromSource, Vector3 newAxis, Vector3 newDelta) { - vector3Action.RemoveOnChangeListener(ActionChanged, inputSource); + if (onUpdate != null) + { + onUpdate.Invoke(this, fromSource, newAxis, newDelta); + } + if (onUpdateEvent != null) + { + onUpdateEvent.Invoke(this, fromSource, newAxis, newDelta); + } } - private void ActionChanged(SteamVR_Action_In action) + private void SteamVR_Behaviour_Vector3_OnChange(SteamVR_Action_Vector3 fromAction, SteamVR_Input_Sources fromSource, Vector3 newAxis, Vector3 newDelta) { if (onChange != null) { - onChange.Invoke((SteamVR_Action_Vector3)action); + onChange.Invoke(this, fromSource, newAxis, newDelta); + } + if (onChangeEvent != null) + { + onChangeEvent.Invoke(this, fromSource, newAxis, newDelta); } } - } - [Serializable] - public class SteamVR_Behaviour_Vector3Event : UnityEvent { } + private void SteamVR_Behaviour_Vector3_OnAxis(SteamVR_Action_Vector3 fromAction, SteamVR_Input_Sources fromSource, Vector3 newAxis, Vector3 newDelta) + { + if (onAxis != null) + { + onAxis.Invoke(this, fromSource, newAxis, newDelta); + } + if (onAxisEvent != null) + { + onAxisEvent.Invoke(this, fromSource, newAxis, newDelta); + } + } + + /// + /// Gets the localized name of the device that the action corresponds to. + /// + /// + /// + /// VRInputString_Hand - Which hand the origin is in. E.g. "Left Hand" + /// VRInputString_ControllerType - What kind of controller the user has in that hand.E.g. "Vive Controller" + /// VRInputString_InputSource - What part of that controller is the origin. E.g. "Trackpad" + /// VRInputString_All - All of the above. E.g. "Left Hand Vive Controller Trackpad" + /// + /// + public string GetLocalizedName(params EVRInputStringBits[] localizedParts) + { + if (vector3Action != null) + return vector3Action.GetLocalizedOriginPart(inputSource, localizedParts); + return null; + } + + public delegate void AxisHandler(SteamVR_Behaviour_Vector3 fromAction, SteamVR_Input_Sources fromSource, Vector3 newAxis, Vector3 newDelta); + public delegate void ChangeHandler(SteamVR_Behaviour_Vector3 fromAction, SteamVR_Input_Sources fromSource, Vector3 newAxis, Vector3 newDelta); + public delegate void UpdateHandler(SteamVR_Behaviour_Vector3 fromAction, SteamVR_Input_Sources fromSource, Vector3 newAxis, Vector3 newDelta); + } } \ No newline at end of file diff --git a/Assets/SteamVR/Input/SteamVR_Behaviour_Vector3.cs.meta b/Assets/SteamVR/Input/SteamVR_Behaviour_Vector3.cs.meta index 7c0a73e9..1878ddd7 100644 --- a/Assets/SteamVR/Input/SteamVR_Behaviour_Vector3.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_Behaviour_Vector3.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: a749ce0534daa1a4c9455e56191c9e93 -timeCreated: 1532647016 +timeCreated: 1544852185 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_DefaultAction.cs b/Assets/SteamVR/Input/SteamVR_DefaultAction.cs index 53f15440..e69de29b 100644 --- a/Assets/SteamVR/Input/SteamVR_DefaultAction.cs +++ b/Assets/SteamVR/Input/SteamVR_DefaultAction.cs @@ -1,264 +0,0 @@ -//======= Copyright (c) Valve Corporation, All rights reserved. =============== - -using UnityEngine; -using System.Collections; -using System; -using System.Reflection; -using System.Text; -using System.Linq; - -namespace Valve.VR -{ - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] - public class SteamVR_DefaultAction : System.Attribute - { - public string actionName; - public string actionSetName; - public string inputSourceFieldName; - public SteamVR_ActionDirections? direction; - public bool overrideExistingOnGeneration; - - /// - /// Sets up a default action to be assigned to this field or property on action generation. Must be on a prefab or in a scene in build settings. - /// - /// The name of the action to assign to this field/property - /// - /// Set to true if you want to always set this action to this field/property (even if set to something else) - /// - public SteamVR_DefaultAction(string defaultActionName, bool overrideExistingActionDuringGeneration = false) - { - actionName = defaultActionName; - overrideExistingOnGeneration = overrideExistingActionDuringGeneration; - } - - /// - /// Sets up a default action to be assigned to this field or property on action generation. Must be on a prefab or in a scene in build settings. - /// - /// The name of the action to assign to this field/property - /// - /// Set to true if you want to always set this action to this field/property (even if set to something else) - /// - /// The direction of the action (input / output) - public SteamVR_DefaultAction(string defaultActionName, SteamVR_ActionDirections defaultActionDirection, bool overrideExistingActionDuringGeneration = false) - { - actionName = defaultActionName; - direction = defaultActionDirection; - overrideExistingOnGeneration = overrideExistingActionDuringGeneration; - } - - /// - /// Sets up a default action to be assigned to this field or property on action generation. Must be on a prefab or in a scene in build settings. - /// - /// The name of the action to assign to this field/property - /// - /// Set to true if you want to always set this action to this field/property (even if set to something else) - /// - /// The name of the action set that the action to assign is a member of - public SteamVR_DefaultAction(string defaultActionName, string defaultActionSetName, bool overrideExistingActionDuringGeneration = false) - { - actionName = defaultActionName; - actionSetName = defaultActionSetName; - overrideExistingOnGeneration = overrideExistingActionDuringGeneration; - } - - /// - /// Sets up a default action to be assigned to this field or property on action generation. Must be on a prefab or in a scene in build settings. - /// - /// The name of the action to assign to this field/property - /// - /// Set to true if you want to always set this action to this field/property (even if set to something else) - /// - /// The name of the action set that the action to assign is a member of - /// The direction of the action (input / output) - public SteamVR_DefaultAction(string defaultActionName, string defaultActionSetName, SteamVR_ActionDirections defaultActionDirection, bool overrideExistingActionDuringGeneration = false) - { - actionName = defaultActionName; - actionSetName = defaultActionSetName; - direction = defaultActionDirection; - overrideExistingOnGeneration = overrideExistingActionDuringGeneration; - } - - /// - /// Sets up a default action to be assigned to this field or property on action generation. Must be on a prefab or in a scene in build settings. - /// - /// The name of the action to assign to this field/property - /// - /// Set to true if you want to always set this action to this field/property (even if set to something else) - /// - /// The name of the action set that the action to assign is a member of - /// - /// If this is an action that is handed (Skeleton actions for example) you can add the value of an input source field to the end of the name of the action. - /// ex. To match the SkeletonLeft action you put "Skeleton" as the action name and then "inputSource" as the inputSourceFieldName. - /// On generation tt will get the value for the input source and applies it to the end of the action name. - /// - public SteamVR_DefaultAction(string defaultActionName, string defaultActionSetName, string inputSourceFieldName, bool overrideExistingActionDuringGeneration = false) - { - actionName = defaultActionName; - actionSetName = defaultActionSetName; - this.inputSourceFieldName = inputSourceFieldName; - overrideExistingOnGeneration = overrideExistingActionDuringGeneration; - } - - /// - /// Sets up a default action to be assigned to this field or property on action generation. Must be on a prefab or in a scene in build settings. - /// - /// The name of the action to assign to this field/property - /// - /// Set to true if you want to always set this action to this field/property (even if set to something else) - /// - /// The name of the action set that the action to assign is a member of - /// - /// If this is an action that is handed (Skeleton actions for example) you can add the value of an input source field to the end of the name of the action. - /// ex. To match the SkeletonLeft action you put "Skeleton" as the action name and then "inputSource" as the inputSourceFieldName. - /// On generation tt will get the value for the input source and applies it to the end of the action name. - /// - /// The direction of the action (input / output) - public SteamVR_DefaultAction(string defaultActionName, string defaultActionSetName, string inputSourceFieldName, SteamVR_ActionDirections defaultActionDirection, bool overrideExistingActionDuringGeneration = false) - { - actionName = defaultActionName; - actionSetName = defaultActionSetName; - this.inputSourceFieldName = inputSourceFieldName; - direction = defaultActionDirection; - overrideExistingOnGeneration = overrideExistingActionDuringGeneration; - } - - public bool ShouldAssign(FieldInfo field, object onObject) - { - SteamVR_Action action = GetAction((MonoBehaviour)onObject); - - if (action != null) - { - var currentAction = field.GetValue(onObject); - - if (currentAction == null || overrideExistingOnGeneration) - { - if (action.GetType() != field.FieldType) - { - Debug.LogWarning("[SteamVR] Could not assign default action for " + ((MonoBehaviour)onObject).gameObject.name + "::" + ((MonoBehaviour)onObject).name + "::" + field.Name - + ". Expected type: " + field.FieldType.Name + ", found action type: " + action.GetType().Name); - } - else - { - return true; - } - } - } - - return false; - } - - public void AssignDefault(FieldInfo field, object onObject) - { - SteamVR_Action action = GetAction((MonoBehaviour)onObject); - - if (action != null) - { - if (ShouldAssign(field, onObject)) - { - field.SetValue(onObject, action); - //Debug.Log("[SteamVR] Assigned default action for " + ((MonoBehaviour)onObject).gameObject.name + "::" + ((MonoBehaviour)onObject).name + "::" + field.Name - // + ". Expected type: " + field.FieldType.Name + ", found action type: " + action.GetType().Name); - } - } - } - - public void AssignDefault(PropertyInfo property, object onObject) - { - SteamVR_Action action = GetAction((MonoBehaviour)onObject); - - if (action != null) - { - if (ShouldAssign(property, onObject)) - { - property.SetValue(onObject, action, null); - //Debug.Log("[SteamVR] Assigned default action for " + ((MonoBehaviour)onObject).gameObject.name + "::" + ((MonoBehaviour)onObject).name + "::" + property.Name - // + ". Expected type: " + property.PropertyType.Name + ", found action type: " + action.GetType().Name); - } - } - } - - public bool ShouldAssign(PropertyInfo property, object onObject) - { - SteamVR_Action action = GetAction((MonoBehaviour)onObject); - - if (action != null) - { - var currentAction = property.GetValue(onObject, null); - - if (currentAction == null || overrideExistingOnGeneration) - { - if (action.GetType() != property.PropertyType) - { - Debug.LogWarning("[SteamVR] Could not assign default action for " + ((MonoBehaviour)onObject).gameObject.name + "::" + ((MonoBehaviour)onObject).name + "::" + property.Name - + ". Expected type: " + property.PropertyType.Name + ", found action type: " + action.GetType().Name); - } - else - { - return true; - } - } - else - Debug.LogWarning("[SteamVR] Not assigning default because current action is not null. Could not assign default action for " + ((MonoBehaviour)onObject).gameObject.name + "::" + ((MonoBehaviour)onObject).name + "::" + property.Name - + ". Expected type: " + property.PropertyType.Name + ", found action type: " + action.GetType().Name + ". " + ((SteamVR_Action)currentAction).fullPath); - } - - return false; - } - - private SteamVR_Action GetAction(MonoBehaviour monobehaviour) - { - string inputSource = GetInputSource(monobehaviour, inputSourceFieldName); - string regex = GetRegex(inputSource); - - var action = SteamVR_Input_References.instance.actionObjects.FirstOrDefault(matchAction => System.Text.RegularExpressions.Regex.IsMatch(matchAction.fullPath, regex, System.Text.RegularExpressions.RegexOptions.IgnoreCase)); - - if (action == null) - Debug.LogWarning("[SteamVR Input] Could not find action matching path: " + regex.Replace("\\", "").Replace(".+", "*")); - //else Debug.Log("Looking for: " + regex + ". Found: " + action.fullPath); - - return action; - } - - private string GetInputSource(MonoBehaviour monoBehaviour, string inputSourceFieldName) - { - if (inputSourceFieldName != null) - { - Type monoBehaviourType = monoBehaviour.GetType(); - FieldInfo inputSourceField = monoBehaviourType.GetField(inputSourceFieldName); - - if (inputSourceField != null) - { - SteamVR_Input_Sources source = (SteamVR_Input_Sources)inputSourceField.GetValue(monoBehaviour); - return source.ToString(); - } - } - return null; - } - - private string GetRegex(string inputSource) - { - string regex = "\\/actions\\/"; - - if (actionSetName != null) - regex += actionSetName; - else - regex += ".+"; - - regex += "\\/"; - - if (direction != null) - regex += direction.ToString(); - else - regex += ".+"; - - regex += "\\/" + actionName; - - if (inputSource != null) - { - regex += inputSource; - } - - return regex; - } - } -} \ No newline at end of file diff --git a/Assets/SteamVR/Input/SteamVR_DefaultAction.cs.meta b/Assets/SteamVR/Input/SteamVR_DefaultAction.cs.meta index 41ff944d..77491a95 100644 --- a/Assets/SteamVR/Input/SteamVR_DefaultAction.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_DefaultAction.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 2fd04576439b81a438e44cc006d35ebb -timeCreated: 1532647026 +timeCreated: 1544852186 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_DefaultActionSet.cs b/Assets/SteamVR/Input/SteamVR_DefaultActionSet.cs index fcd7e5bc..e69de29b 100644 --- a/Assets/SteamVR/Input/SteamVR_DefaultActionSet.cs +++ b/Assets/SteamVR/Input/SteamVR_DefaultActionSet.cs @@ -1,97 +0,0 @@ -//======= Copyright (c) Valve Corporation, All rights reserved. =============== - -using UnityEngine; -using System.Collections; -using System; -using System.Reflection; -using System.Text; -using System.Linq; - -namespace Valve.VR -{ - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] - public class SteamVR_DefaultActionSet : System.Attribute - { - public string actionSetName; - public bool overrideExistingOnGeneration; - - /// - /// Sets up a default action set to be assigned to this field or property on action set generation. Must be on a prefab or in a scene in build settings. - /// - /// The name of the action set to assign to this field/property - /// - /// Set to true if you want to always set this action to this field/property (even if set to something else) - /// - public SteamVR_DefaultActionSet(string defaultActionSetName, bool overrideExistingActionDuringGeneration = false) - { - actionSetName = defaultActionSetName; - overrideExistingOnGeneration = overrideExistingActionDuringGeneration; - } - - public void AssignDefault(FieldInfo field, object onObject) - { - SteamVR_ActionSet actionSet = GetActionSet((MonoBehaviour)onObject); - - if (actionSet != null) - { - var currentActionSet = field.GetValue(onObject); - - if (currentActionSet == null || overrideExistingOnGeneration) - field.SetValue(onObject, actionSet); - } - } - - public void AssignDefault(PropertyInfo property, object onObject) - { - SteamVR_ActionSet actionSet = GetActionSet((MonoBehaviour)onObject); - - if (actionSet != null) - { - var currentActionSet = property.GetValue(onObject, null); - - if (currentActionSet == null || overrideExistingOnGeneration) - property.SetValue(onObject, actionSet, null); - } - } - - private SteamVR_ActionSet GetActionSet(MonoBehaviour monobehaviour) - { - string regex = GetRegex(); - - var actionSet = SteamVR_Input_References.instance.actionSetObjects.FirstOrDefault(matchAction => System.Text.RegularExpressions.Regex.IsMatch(matchAction.fullPath, regex, System.Text.RegularExpressions.RegexOptions.IgnoreCase)); - - if (actionSet == null) - Debug.Log("[SteamVR Input] Could not find action set matching path: " + regex.Replace("\\", "").Replace(".+", "*")); - - return actionSet; - } - - private string GetInputSource(MonoBehaviour monoBehaviour, string inputSourceFieldName) - { - if (inputSourceFieldName != null) - { - Type monoBehaviourType = monoBehaviour.GetType(); - FieldInfo inputSourceField = monoBehaviourType.GetField(inputSourceFieldName); - - if (inputSourceField != null) - { - SteamVR_Input_Sources source = (SteamVR_Input_Sources)inputSourceField.GetValue(monoBehaviour); - return source.ToString(); - } - } - return null; - } - - private string GetRegex() - { - string regex = "\\/actions\\/"; - - if (actionSetName != null) - regex += actionSetName; - else - regex += ".+"; - - return regex; - } - } -} \ No newline at end of file diff --git a/Assets/SteamVR/Input/SteamVR_DefaultActionSet.cs.meta b/Assets/SteamVR/Input/SteamVR_DefaultActionSet.cs.meta index 527f957c..b716a398 100644 --- a/Assets/SteamVR/Input/SteamVR_DefaultActionSet.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_DefaultActionSet.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 52de2eb8a319fcb4aa7dd51c4127f124 -timeCreated: 1534796288 +timeCreated: 1544852186 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Input.cs b/Assets/SteamVR/Input/SteamVR_Input.cs index fbc92dda..a30d5aea 100644 --- a/Assets/SteamVR/Input/SteamVR_Input.cs +++ b/Assets/SteamVR/Input/SteamVR_Input.cs @@ -8,6 +8,7 @@ using System.Reflection; using System.Linq; using Valve.Newtonsoft.Json; +using System.Text; namespace Valve.VR { @@ -15,7 +16,6 @@ public partial class SteamVR_Input { public const string defaultInputGameObjectName = "[SteamVR Input]"; private const string localizationKeyName = "localization"; - public static string actionsFilePath; /// True if the actions file has been initialized public static bool fileInitialized = false; @@ -32,32 +32,29 @@ public partial class SteamVR_Input /// The hash of the current action file on disk public static string actionFileHash; - /// A reference to the method that has been generated to initialize action sets - public static Action InitializeActionSets; - - /// A reference to the method that has been generated to initialize actions - public static Action InitializeActions; - - /// A reference to the method that has been generated to initialize the references to the action set objects - public static Action InitializeInstanceActionSets; - - /// A reference to the method that has been generated to initialize the references to the action objects - public static Action InitializeInstanceActions; - /// An event that fires when the non visual actions (everything except poses / skeletons) have been updated - public static event Action OnNonVisualActionsUpdated; + public static event Action onNonVisualActionsUpdated; /// An event that fires when the pose actions have been updated - public static event Action OnPosesUpdated; + public static event PosesUpdatedHandler onPosesUpdated; + public delegate void PosesUpdatedHandler(bool skipSendingEvents); /// An event that fires when the skeleton actions have been updated - public static event Action OnSkeletonsUpdated; - - - protected static Type inputType = typeof(SteamVR_Input); + public static event SkeletonsUpdatedHandler onSkeletonsUpdated; + public delegate void SkeletonsUpdatedHandler(bool skipSendingEvents); protected static bool initializing = false; + protected static int startupFrame = 0; + public static bool isStartupFrame + { + get + { + return Time.frameCount >= (startupFrame - 1) && Time.frameCount <= (startupFrame + 1); + } + } + + #region array accessors /// An array of all action sets public static SteamVR_ActionSet[] actionSets; @@ -66,10 +63,10 @@ public partial class SteamVR_Input public static SteamVR_Action[] actions; /// An array of all input actions - public static SteamVR_Action_In[] actionsIn; + public static ISteamVR_Action_In[] actionsIn; /// An array of all output actions (haptic) - public static SteamVR_Action_Out[] actionsOut; + public static ISteamVR_Action_Out[] actionsOut; /// An array of all the boolean actions public static SteamVR_Action_Boolean[] actionsBoolean; @@ -93,228 +90,148 @@ public partial class SteamVR_Input public static SteamVR_Action_Vibration[] actionsVibration; /// An array of all the input actions that are not pose or skeleton actions (boolean, single, vector2, vector3) - public static SteamVR_Action_In[] actionsNonPoseNonSkeletonIn; + public static ISteamVR_Action_In[] actionsNonPoseNonSkeletonIn; protected static Dictionary actionSetsByPath = new Dictionary(); + protected static Dictionary actionSetsByPathLowered = new Dictionary(); protected static Dictionary actionsByPath = new Dictionary(); + protected static Dictionary actionsByPathLowered = new Dictionary(); protected static Dictionary actionSetsByPathCache = new Dictionary(); protected static Dictionary actionsByPathCache = new Dictionary(); + + protected static Dictionary actionsByNameCache = new Dictionary(); + protected static Dictionary actionSetsByNameCache = new Dictionary(); #endregion - /// Tell SteamVR that we're using the actions file at the path defined in SteamVR_Settings. - public static void IdentifyActionsFile() + static SteamVR_Input() { - string currentPath = Application.dataPath; - int lastIndex = currentPath.LastIndexOf('/'); - currentPath = currentPath.Remove(lastIndex, currentPath.Length - lastIndex); - - string fullPath = System.IO.Path.Combine(currentPath, SteamVR_Settings.instance.actionsFilePath); - fullPath = fullPath.Replace("\\", "/"); - - if (File.Exists(fullPath)) - { - Debug.Log("[SteamVR] Loading actions file: " + fullPath); - - var err = OpenVR.Input.SetActionManifestPath(fullPath); - if (err != EVRInputError.None) - Debug.LogError("[SteamVR] Error loading action manifest into SteamVR: " + err.ToString()); - else - Debug.Log("[SteamVR] Successfully loaded action manifest into SteamVR"); - } - else - { - Debug.LogError("[SteamVR] Could not find actions file at: " + fullPath); - } +#if !UNITY_EDITOR + //If you want a single frame of performance increase on application start and have already generated your actions uncomment the following two lines + //SteamVR_Actions.Preinitialize(); + //return; +#endif + FindPreinitializeMethod(); } - /// Set up the dictionaries and references to methods we'll use for SteamVR Input - public static void PreInitialize() + public static void ForcePreinitialize() { - if (initialized || preInitialized) - return; - -#if UNITY_EDITOR - CheckSetup(); -#endif - - InitializeInstanceActionSets = GetMethod(SteamVR_Input_Generator_Names.initializeInstanceActionSetsMethodName) as Action; - InitializeInstanceActions = GetMethod(SteamVR_Input_Generator_Names.initializeInstanceActionsMethodName) as Action; - - InitializeInstanceActionSets(); - InitializeInstanceActions(); + FindPreinitializeMethod(); + } - for (int actionIndex = 0; actionIndex < actions.Length; actionIndex++) + private static void FindPreinitializeMethod() + { + Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); + for (int assemblyIndex = 0; assemblyIndex < assemblies.Length; assemblyIndex++) { - actions[actionIndex].PreInitialize(); + Assembly assembly = assemblies[assemblyIndex]; + Type type = assembly.GetType(SteamVR_Input_Generator_Names.fullActionsClassName); + if (type != null) + { + MethodInfo preinitMethodInfo = type.GetMethod(SteamVR_Input_Generator_Names.preinitializeMethodName); + if (preinitMethodInfo != null) + { + preinitMethodInfo.Invoke(null, null); + return; + } + } } - - preInitialized = true; } /// - /// Get all the handles for actions and action sets. - /// Initialize our dictionaries of action / action set names. + /// Get all the handles for actions and action sets. + /// Initialize our dictionaries of action / action set names. /// Setup the tracking space universe origin /// - public static void Initialize() + public static void Initialize(bool force = false) { - if (initialized) + if (initialized == true && force == false) + return; + +#if UNITY_EDITOR + CheckSetup(); + if (IsOpeningSetup()) return; +#endif - Debug.Log("Initializing steamvr input..."); + //Debug.Log("[SteamVR] Initializing SteamVR input..."); initializing = true; + startupFrame = Time.frameCount; + + SteamVR_ActionSet_Manager.Initialize(); SteamVR_Input_Source.Initialize(); - InitializeActionSets = GetMethod(SteamVR_Input_Generator_Names.initializeActionSetsMethodName) as Action; - InitializeActions = GetMethod(SteamVR_Input_Generator_Names.initializeActionsMethodName) as Action; + for (int actionIndex = 0; actionIndex < actions.Length; actionIndex++) + { + SteamVR_Action action = actions[actionIndex]; + action.Initialize(true); + } - InitializeActionSets(); + for (int actionSetIndex = 0; actionSetIndex < actionSets.Length; actionSetIndex++) + { + SteamVR_ActionSet set = actionSets[actionSetIndex]; + set.Initialize(true); + } - if (SteamVR.settings.activateFirstActionSetOnStart) + if (SteamVR_Settings.instance.activateFirstActionSetOnStart) { - if (actionSets != null) - actionSets[0].ActivatePrimary(); + if (actionSets.Length > 0) + actionSets[0].Activate(); else { - Debug.LogError("No action sets."); + Debug.LogError("[SteamVR] No action sets to activate."); } } - InitializeActions(); - SteamVR_Action_Pose.SetTrackingUniverseOrigin(SteamVR_Settings.instance.trackingSpace); - InitializeDictionaries(); - initialized = true; - initializing = false; - Debug.Log("Steamvr input initialization complete."); + //Debug.Log("[SteamVR] Input initialization complete."); } - - protected static void InitializeDictionaries() + public static void PreinitializeFinishActionSets() { - actionsByPath.Clear(); - actionSetsByPath.Clear(); - actionsByPathCache.Clear(); - actionSetsByPathCache.Clear(); - - for (int actionIndex = 0; actionIndex < actions.Length; actionIndex++) - { - SteamVR_Action action = actions[actionIndex]; - actionsByPath.Add(action.fullPath.ToLower(), action); - } - for (int actionSetIndex = 0; actionSetIndex < actionSets.Length; actionSetIndex++) { - SteamVR_ActionSet set = actionSets[actionSetIndex]; - actionSetsByPath.Add(set.fullPath.ToLower(), set); + SteamVR_ActionSet actionSet = actionSets[actionSetIndex]; + actionSet.FinishPreInitialize(); } } - /// - /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] - /// - /// The type of action you're expecting to get back - /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) - /// case sensitive searches are faster - public static T GetActionFromPath(string path, bool caseSensitive = false) where T : SteamVR_Action + public static void PreinitializeActionSetDictionaries() { - if (caseSensitive) - { - if (actionsByPath.ContainsKey(path)) - { - return (T)actionsByPath[path]; - } - } - else + actionSetsByPath.Clear(); + actionSetsByPathLowered.Clear(); + actionSetsByPathCache.Clear(); + + for (int actionSetIndex = 0; actionSetIndex < actionSets.Length; actionSetIndex++) { - if (actionsByPathCache.ContainsKey(path)) - { - return (T)actionsByPathCache[path]; - } - else - { - string loweredPath = path.ToLower(); - if (actionsByPath.ContainsKey(loweredPath)) - { - actionsByPathCache.Add(path, actionsByPath[loweredPath]); - return (T)actionsByPath[loweredPath]; - } - else - { - actionsByPathCache.Add(path, null); - } - } + SteamVR_ActionSet actionSet = actionSets[actionSetIndex]; + actionSetsByPath.Add(actionSet.fullPath, actionSet); + actionSetsByPathLowered.Add(actionSet.fullPath.ToLower(), actionSet); } - - return null; } - /// - /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] - /// - /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) - public static SteamVR_Action GetActionFromPath(string path) + public static void PreinitializeActionDictionaries() { - return GetActionFromPath(path); - } + actionsByPath.Clear(); + actionsByPathLowered.Clear(); + actionsByPathCache.Clear(); - /// - /// Get an action set by the full path to that action set. Action set paths are in the format /actions/[actionSet] - /// - /// The type of action set you're expecting to get back - /// The full path to the action set you want (Action paths are in the format /actions/[actionSet]) - /// case sensitive searches are faster - public static T GetActionSetFromPath(string path, bool caseSensitive = false) where T : SteamVR_ActionSet - { - if (caseSensitive) - { - if (actionSetsByPath.ContainsKey(path)) - { - return (T)actionSetsByPath[path]; - } - } - else + for (int actionIndex = 0; actionIndex < actions.Length; actionIndex++) { - if (actionSetsByPathCache.ContainsKey(path)) - { - return (T)actionSetsByPathCache[path]; - } - else - { - string loweredPath = path.ToLower(); - if (actionSetsByPath.ContainsKey(loweredPath)) - { - actionSetsByPathCache.Add(path, actionSetsByPath[loweredPath]); - return (T)actionSetsByPath[loweredPath]; - } - else - { - actionsByPathCache.Add(path, null); - } - } + SteamVR_Action action = actions[actionIndex]; + actionsByPath.Add(action.fullPath, action); + actionsByPathLowered.Add(action.fullPath.ToLower(), action); } - - return null; - } - - /// - /// Get an action set by the full path to that action set. Action set paths are in the format /actions/[actionSet] - /// - /// The full path to the action set you want (Action paths are in the format /actions/[actionSet]) - public static SteamVR_ActionSet GetActionSetFromPath(string path) - { - return GetActionSetFromPath(path); } /// Gets called by SteamVR_Behaviour every Update and updates actions if the steamvr settings are configured to update then. public static void Update() { - if (initialized == false) + if (initialized == false || isStartupFrame) return; if (SteamVR.settings.IsInputUpdateMode(SteamVR_UpdateModes.OnUpdate)) @@ -328,12 +245,12 @@ public static void Update() } /// - /// Gets called by SteamVR_Behaviour every LateUpdate and updates actions if the steamvr settings are configured to update then. + /// Gets called by SteamVR_Behaviour every LateUpdate and updates actions if the steamvr settings are configured to update then. /// Also updates skeletons regardless of settings are configured to so we can account for animations on the skeletons. /// public static void LateUpdate() { - if (initialized == false) + if (initialized == false || isStartupFrame) return; if (SteamVR.settings.IsInputUpdateMode(SteamVR_UpdateModes.OnLateUpdate)) @@ -356,7 +273,7 @@ public static void LateUpdate() /// Gets called by SteamVR_Behaviour every FixedUpdate and updates actions if the steamvr settings are configured to update then. public static void FixedUpdate() { - if (initialized == false) + if (initialized == false || isStartupFrame) return; if (SteamVR.settings.IsInputUpdateMode(SteamVR_UpdateModes.OnFixedUpdate)) @@ -373,7 +290,7 @@ public static void FixedUpdate() /// Gets called by SteamVR_Behaviour every OnPreCull and updates actions if the steamvr settings are configured to update then. public static void OnPreCull() { - if (initialized == false) + if (initialized == false || isStartupFrame) return; if (SteamVR.settings.IsInputUpdateMode(SteamVR_UpdateModes.OnPreCull)) @@ -395,7 +312,7 @@ public static void UpdateVisualActions(bool skipStateAndEventUpdates = false) if (initialized == false) return; - SteamVR_ActionSet.UpdateActionSetsState(); + SteamVR_ActionSet_Manager.UpdateActionStates(); UpdatePoseActions(skipStateAndEventUpdates); @@ -405,252 +322,1084 @@ public static void UpdateVisualActions(bool skipStateAndEventUpdates = false) /// /// Updates the states of all the pose actions /// - /// Controls whether or not events are fired from this update call - public static void UpdatePoseActions(bool skipStateAndEventUpdates = false) + /// Controls whether or not events are fired from this update call + public static void UpdatePoseActions(bool skipSendingEvents = false) { if (initialized == false) return; - var sources = SteamVR_Input_Source.GetUpdateSources(); - - for (int sourceIndex = 0; sourceIndex < sources.Length; sourceIndex++) + for (int actionIndex = 0; actionIndex < actionsPose.Length; actionIndex++) { - UpdatePoseActions(sources[sourceIndex], skipStateAndEventUpdates); + SteamVR_Action_Pose action = actionsPose[actionIndex]; + action.UpdateValues(skipSendingEvents); } - if (OnPosesUpdated != null) - OnPosesUpdated(false); + if (onPosesUpdated != null) + onPosesUpdated(false); } + /// - /// Updates the states of all the pose actions for a specific input source (left hand / right hand / any) + /// Updates the states of all the skeleton actions /// - /// Controls whether or not events are fired from this update call - protected static void UpdatePoseActions(SteamVR_Input_Sources inputSource, bool skipStateAndEventUpdates = false) + /// Controls whether or not events are fired from this update call + public static void UpdateSkeletonActions(bool skipSendingEvents = false) { if (initialized == false) return; - for (int actionIndex = 0; actionIndex < actionsPose.Length; actionIndex++) + for (int actionIndex = 0; actionIndex < actionsSkeleton.Length; actionIndex++) { - SteamVR_Action_Pose action = actionsPose[actionIndex] as SteamVR_Action_Pose; + SteamVR_Action_Skeleton action = actionsSkeleton[actionIndex]; - if (action != null) - { - if (action.actionSet.IsActive()) - { - action.UpdateValue(inputSource, skipStateAndEventUpdates); - } - } + action.UpdateValue(skipSendingEvents); } + + if (onSkeletonsUpdated != null) + onSkeletonsUpdated(skipSendingEvents); } /// - /// Updates the states of all the skeleton actions + /// Updates the states of all the non visual actions (boolean, single, vector2, vector3) /// - /// Controls whether or not events are fired from this update call - public static void UpdateSkeletonActions(bool skipStateAndEventUpdates = false) + public static void UpdateNonVisualActions() { if (initialized == false) return; - var sources = SteamVR_Input_Source.GetUpdateSources(); + SteamVR_ActionSet_Manager.UpdateActionStates(); - for (int sourceIndex = 0; sourceIndex < sources.Length; sourceIndex++) + for (int actionIndex = 0; actionIndex < actionsNonPoseNonSkeletonIn.Length; actionIndex++) { - UpdateSkeletonActions(sources[sourceIndex], skipStateAndEventUpdates); + ISteamVR_Action_In action = actionsNonPoseNonSkeletonIn[actionIndex]; + + action.UpdateValues(); } - if (OnSkeletonsUpdated != null) - OnSkeletonsUpdated(skipStateAndEventUpdates); + if (onNonVisualActionsUpdated != null) + onNonVisualActionsUpdated(); + } + + private static uint sizeVRActiveActionSet_t = 0; + protected static void ShowBindingHintsForSets(VRActiveActionSet_t[] sets, ulong highlightAction = 0) + { + if (sizeVRActiveActionSet_t == 0) + sizeVRActiveActionSet_t = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VRActiveActionSet_t)); + + OpenVR.Input.ShowBindingsForActionSet(sets, sizeVRActiveActionSet_t, highlightAction); } + private static VRActiveActionSet_t[] setCache = new VRActiveActionSet_t[1]; /// - /// Updates the states of all the skeleton actions for a specific input source (left hand / right hand / any) + /// Shows all the bindings for the actions in the action's set. /// - /// Controls whether or not events are fired from this update call - protected static void UpdateSkeletonActions(SteamVR_Input_Sources inputSource, bool skipStateAndEventUpdates = false) + /// Highlights the binding of the passed in action (must be in an active set) + public static bool ShowBindingHints(ISteamVR_Action_In originToHighlight) { - if (initialized == false) - return; - - for (int actionIndex = 0; actionIndex < actionsSkeleton.Length; actionIndex++) + if (originToHighlight != null) { - SteamVR_Action_Skeleton action = actionsSkeleton[actionIndex] as SteamVR_Action_Skeleton; - - if (action != null) - { - if (action.actionSet.IsActive()) - { - action.UpdateValue(inputSource, skipStateAndEventUpdates); - } - } + setCache[0].ulActionSet = originToHighlight.actionSet.handle; + ShowBindingHintsForSets(setCache, originToHighlight.activeOrigin); + return true; } - } + return false; + } /// - /// Updates the states of all the non visual actions (boolean, single, vector2, vector3) + /// Shows all the bindings for the actions in the action set. /// - public static void UpdateNonVisualActions() + public static bool ShowBindingHints(ISteamVR_ActionSet setToShow) { - if (initialized == false) - return; - - SteamVR_ActionSet.UpdateActionSetsState(); - - var sources = SteamVR_Input_Source.GetUpdateSources(); - - for (int sourceIndex = 0; sourceIndex < sources.Length; sourceIndex++) + if (setToShow != null) { - UpdateNonVisualActions(sources[sourceIndex]); + setCache[0].ulActionSet = setToShow.handle; + ShowBindingHintsForSets(setCache, 0); + return true; } - if (OnNonVisualActionsUpdated != null) - OnNonVisualActionsUpdated(); + return false; } /// - /// Updates the states of all the non visual actions (boolean, single, vector2, vector3) for a given input source (left hand / right hand / any) + /// Shows all the bindings for the actions in the active sets. /// - /// - public static void UpdateNonVisualActions(SteamVR_Input_Sources inputSource) + /// Highlights the binding of the passed in action (must be in an active set) + public static void ShowBindingHintsForActiveActionSets(ulong highlightAction = 0) { - if (initialized == false) - return; + if (sizeVRActiveActionSet_t == 0) + sizeVRActiveActionSet_t = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VRActiveActionSet_t)); - for (int actionSetIndex = 0; actionSetIndex < actionSets.Length; actionSetIndex++) - { - SteamVR_ActionSet set = actionSets[actionSetIndex]; + OpenVR.Input.ShowBindingsForActionSet(SteamVR_ActionSet_Manager.rawActiveActionSetArray, sizeVRActiveActionSet_t, highlightAction); + } - if (set.IsActive()) - { - for (int actionIndex = 0; actionIndex < set.nonVisualInActions.Length; actionIndex++) - { - SteamVR_Action_In actionIn = set.nonVisualInActions[actionIndex] as SteamVR_Action_In; + #region String accessor helpers - if (actionIn != null) - { - actionIn.UpdateValue(inputSource); - } - } - } + #region action accessors + /// + /// Get an action's action data by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static T GetActionDataFromPath(string path, bool caseSensitive = false) where T : SteamVR_Action_Source_Map + { + SteamVR_Action action = GetBaseActionFromPath(path, caseSensitive); + if (action != null) + { + T actionData = (T)action.GetSourceMap(); + return actionData; } + + return null; } /// - /// Returns all of the action sets. If we're in the editor, doesn't rely on the actionSets field being filled. + /// Get an action set's data by the full path to that action. Action set paths are in the format /actions/[actionSet] /// - public static SteamVR_ActionSet[] GetActionSets() + /// The full path to the action you want (Action set paths are in the format /actions/[actionSet]) + /// case sensitive searches are faster + public static SteamVR_ActionSet_Data GetActionSetDataFromPath(string path, bool caseSensitive = false) { - if (Application.isPlaying) + SteamVR_ActionSet actionSet = GetActionSetFromPath(path, caseSensitive); + if (actionSet != null) { - return actionSets; + return actionSet.GetActionSetData(); } - else - { -#if UNITY_EDITOR - string[] assetGuids = UnityEditor.AssetDatabase.FindAssets("t:" + typeof(SteamVR_ActionSet).FullName); - if (assetGuids.Length > 0) - { - SteamVR_ActionSet[] assets = new SteamVR_ActionSet[assetGuids.Length]; - for (int assetIndex = 0; assetIndex < assets.Length; assetIndex++) - { - string assetPath = UnityEditor.AssetDatabase.GUIDToAssetPath(assetGuids[assetIndex]); - assets[assetIndex] = UnityEditor.AssetDatabase.LoadAssetAtPath(assetPath); - } - return assets; - } - return new SteamVR_ActionSet[0]; -#else + return null; -#endif - } } /// - /// Returns all of the actions of the specified type. If we're in the editor, doesn't rely on the arrays being filled. + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] /// - /// The type of actions you want to get - public static T[] GetActions() where T : SteamVR_Action + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static T GetActionFromPath(string path, bool caseSensitive = false, bool returnNulls = false) where T : SteamVR_Action, new() { - Type type = typeof(T); + SteamVR_Action foundAction = GetBaseActionFromPath(path, caseSensitive); + if (foundAction != null) + return foundAction.GetCopy(); + + if (returnNulls) + return null; + + return CreateFakeAction(path, caseSensitive); + } - if (Application.isPlaying) + // non-copy version + public static SteamVR_Action GetBaseActionFromPath(string path, bool caseSensitive = false) + { + if (string.IsNullOrEmpty(path)) + return null; + + if (caseSensitive) { - if (type == typeof(SteamVR_Action)) + if (actionsByPath.ContainsKey(path)) { - return actions as T[]; + return actionsByPath[path]; } - else if (type == typeof(SteamVR_Action_In)) + } + else + { + if (actionsByPathCache.ContainsKey(path)) { - return actionsIn as T[]; + return actionsByPathCache[path]; } - else if (type == typeof(SteamVR_Action_Out)) + else if (actionsByPath.ContainsKey(path)) { - return actionsOut as T[]; + actionsByPathCache.Add(path, actionsByPath[path]); + return actionsByPath[path]; } - else if (type == typeof(SteamVR_Action_Boolean)) + else { - return actionsBoolean as T[]; + string loweredPath = path.ToLower(); + if (actionsByPathLowered.ContainsKey(loweredPath)) + { + actionsByPathCache.Add(path, actionsByPathLowered[loweredPath]); + return actionsByPathLowered[loweredPath]; + } + else + { + actionsByPathCache.Add(path, null); + } } - else if (type == typeof(SteamVR_Action_Single)) + } + + return null; + } + + public static bool HasActionPath(string path, bool caseSensitive = false) + { + SteamVR_Action action = GetBaseActionFromPath(path, caseSensitive); + return action != null; + } + + public static bool HasAction(string actionName, bool caseSensitive = false) + { + SteamVR_Action action = GetBaseAction(null, actionName, caseSensitive); + return action != null; + } + + public static bool HasAction(string actionSetName, string actionName, bool caseSensitive = false) + { + SteamVR_Action action = GetBaseAction(actionSetName, actionName, caseSensitive); + return action != null; + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Boolean GetBooleanActionFromPath(string path, bool caseSensitive = false) + { + return GetActionFromPath(path, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Single GetSingleActionFromPath(string path, bool caseSensitive = false) + { + return GetActionFromPath(path, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Vector2 GetVector2ActionFromPath(string path, bool caseSensitive = false) + { + return GetActionFromPath(path, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Vector3 GetVector3ActionFromPath(string path, bool caseSensitive = false) + { + return GetActionFromPath(path, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Vibration GetVibrationActionFromPath(string path, bool caseSensitive = false) + { + return GetActionFromPath(path, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Pose GetPoseActionFromPath(string path, bool caseSensitive = false) + { + return GetActionFromPath(path, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Skeleton GetSkeletonActionFromPath(string path, bool caseSensitive = false) + { + return GetActionFromPath(path, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + /// returns null if the action does not exist + public static T GetAction(string actionSetName, string actionName, bool caseSensitive = false, bool returnNulls = false) where T : SteamVR_Action, new() + { + SteamVR_Action action = GetBaseAction(actionSetName, actionName, caseSensitive); + if (action != null) + return (T)action.GetCopy(); + + if (returnNulls) + return null; + + return CreateFakeAction(actionSetName, actionName, caseSensitive); + } + + public static SteamVR_Action GetBaseAction(string actionSetName, string actionName, bool caseSensitive = false) + { + if (actions == null) + { + return null; + } + + if (string.IsNullOrEmpty(actionSetName)) + { + for (int actionIndex = 0; actionIndex < actions.Length; actionIndex++) { - return actionsSingle as T[]; + if (caseSensitive) + { + if (actions[actionIndex].GetShortName() == actionName) + return actions[actionIndex]; + } + else + { + if (string.Equals(actions[actionIndex].GetShortName(), actionName, StringComparison.CurrentCultureIgnoreCase)) + return actions[actionIndex]; + } } - else if (type == typeof(SteamVR_Action_Vector2)) + } + else + { + SteamVR_ActionSet actionSet = GetActionSet(actionSetName, caseSensitive, true); + + if (actionSet != null) { - return actionsVector2 as T[]; + for (int actionIndex = 0; actionIndex < actionSet.allActions.Length; actionIndex++) + { + if (caseSensitive) + { + if (actionSet.allActions[actionIndex].GetShortName() == actionName) + return actionSet.allActions[actionIndex]; + } + else + { + if (string.Equals(actionSet.allActions[actionIndex].GetShortName(), actionName, StringComparison.CurrentCultureIgnoreCase)) + return actionSet.allActions[actionIndex]; + } + } } - else if (type == typeof(SteamVR_Action_Vector3)) + } + + return null; + } + + private static T CreateFakeAction(string actionSetName, string actionName, bool caseSensitive) where T : SteamVR_Action, new() + { + if (typeof(T) == typeof(SteamVR_Action_Vibration)) + { + return SteamVR_Action.CreateUninitialized(actionSetName, SteamVR_ActionDirections.Out, actionName, caseSensitive); + } + else + { + return SteamVR_Action.CreateUninitialized(actionSetName, SteamVR_ActionDirections.In, actionName, caseSensitive); + } + } + + private static T CreateFakeAction(string actionPath, bool caseSensitive) where T : SteamVR_Action, new() + { + return SteamVR_Action.CreateUninitialized(actionPath, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static T GetAction(string actionName, bool caseSensitive = false) where T : SteamVR_Action, new() + { + return GetAction(null, actionName, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Boolean GetBooleanAction(string actionSetName, string actionName, bool caseSensitive = false) + { + return GetAction(actionSetName, actionName, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Boolean GetBooleanAction(string actionName, bool caseSensitive = false) + { + return GetAction(null, actionName, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Single GetSingleAction(string actionSetName, string actionName, bool caseSensitive = false) + { + return GetAction(actionSetName, actionName, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Single GetSingleAction(string actionName, bool caseSensitive = false) + { + return GetAction(null, actionName, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Vector2 GetVector2Action(string actionSetName, string actionName, bool caseSensitive = false) + { + return GetAction(actionSetName, actionName, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Vector2 GetVector2Action(string actionName, bool caseSensitive = false) + { + return GetAction(null, actionName, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Vector3 GetVector3Action(string actionSetName, string actionName, bool caseSensitive = false) + { + return GetAction(actionSetName, actionName, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Vector3 GetVector3Action(string actionName, bool caseSensitive = false) + { + return GetAction(null, actionName, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Pose GetPoseAction(string actionSetName, string actionName, bool caseSensitive = false) + { + return GetAction(actionSetName, actionName, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Pose GetPoseAction(string actionName, bool caseSensitive = false) + { + return GetAction(null, actionName, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Skeleton GetSkeletonAction(string actionSetName, string actionName, bool caseSensitive = false) + { + return GetAction(actionSetName, actionName, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Skeleton GetSkeletonAction(string actionName, bool caseSensitive = false) + { + return GetAction(null, actionName, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Vibration GetVibrationAction(string actionSetName, string actionName, bool caseSensitive = false) + { + return GetAction(actionSetName, actionName, caseSensitive); + } + + /// + /// Get an action by the full path to that action. Action paths are in the format /actions/[actionSet]/[direction]/[actionName] + /// + /// The type of action you're expecting to get back + /// The full path to the action you want (Action paths are in the format /actions/[actionSet]/[direction]/[actionName]) + /// case sensitive searches are faster + public static SteamVR_Action_Vibration GetVibrationAction(string actionName, bool caseSensitive = false) + { + return GetAction(null, actionName, caseSensitive); + } + + /// + /// Get an action set by the full path to that action set. Action set paths are in the format /actions/[actionSet] + /// + /// The type of action set you're expecting to get back + /// The name to the action set you want + /// case sensitive searches are faster + /// returns a null if the set does not exist + public static T GetActionSet(string actionSetName, bool caseSensitive = false, bool returnNulls = false) where T : SteamVR_ActionSet, new() + { + if (actionSets == null) + { + if (returnNulls) + return null; + + return SteamVR_ActionSet.CreateFromName(actionSetName); + } + + for (int actionSetIndex = 0; actionSetIndex < actionSets.Length; actionSetIndex++) + { + if (caseSensitive) { - return actionsVector3 as T[]; + if (actionSets[actionSetIndex].GetShortName() == actionSetName) + return actionSets[actionSetIndex].GetCopy(); } - else if (type == typeof(SteamVR_Action_Pose)) + else { - return actionsPose as T[]; + if (string.Equals(actionSets[actionSetIndex].GetShortName(), actionSetName, StringComparison.CurrentCultureIgnoreCase)) + return actionSets[actionSetIndex].GetCopy(); } - else if (type == typeof(SteamVR_Action_Skeleton)) + } + + if (returnNulls) + return null; + + return SteamVR_ActionSet.CreateFromName(actionSetName); + } + + /// + /// Get an action set by the full path to that action set. Action set paths are in the format /actions/[actionSet] + /// + /// The type of action set you're expecting to get back + /// The name to the action set you want + /// case sensitive searches are faster + public static SteamVR_ActionSet GetActionSet(string actionSetName, bool caseSensitive = false, bool returnsNulls = false) + { + return GetActionSet(actionSetName, caseSensitive, returnsNulls); + } + + protected static bool HasActionSet(string name, bool caseSensitive = false) + { + SteamVR_ActionSet actionSet = GetActionSet(name, caseSensitive, true); + return actionSet != null; + } + + /// + /// Get an action set by the full path to that action set. Action set paths are in the format /actions/[actionSet] + /// + /// The type of action set you're expecting to get back + /// The full path to the action set you want (Action paths are in the format /actions/[actionSet]) + /// case sensitive searches are faster + public static T GetActionSetFromPath(string path, bool caseSensitive = false, bool returnsNulls = false) where T : SteamVR_ActionSet, new() + { + if (actionSets == null || actionSets[0] == null || string.IsNullOrEmpty(path)) + { + if (returnsNulls) + return null; + + return SteamVR_ActionSet.Create(path); + } + + if (caseSensitive) + { + if (actionSetsByPath.ContainsKey(path)) { - return actionsSkeleton as T[]; + return actionSetsByPath[path].GetCopy(); } - else if (type == typeof(SteamVR_Action_Vibration)) + } + else + { + if (actionSetsByPathCache.ContainsKey(path)) { - return actionsVibration as T[]; + SteamVR_ActionSet set = actionSetsByPathCache[path]; + if (set == null) + return null; + else + return set.GetCopy(); + } + else if (actionSetsByPath.ContainsKey(path)) + { + actionSetsByPathCache.Add(path, actionSetsByPath[path]); + return actionSetsByPath[path].GetCopy(); } else { - Debug.Log("Wrong type."); + string loweredPath = path.ToLower(); + if (actionSetsByPathLowered.ContainsKey(loweredPath)) + { + actionSetsByPathCache.Add(path, actionSetsByPathLowered[loweredPath]); + return actionSetsByPath[loweredPath].GetCopy(); + } + else + { + actionSetsByPathCache.Add(path, null); + } } } + + if (returnsNulls) + return null; + + return SteamVR_ActionSet.Create(path); + } + + /// + /// Get an action set by the full path to that action set. Action set paths are in the format /actions/[actionSet] + /// + /// The full path to the action set you want (Action paths are in the format /actions/[actionSet]) + /// case sensitive searches are faster + public static SteamVR_ActionSet GetActionSetFromPath(string path, bool caseSensitive = false) + { + return GetActionSetFromPath(path, caseSensitive); + } + #endregion + + #region digital string accessors + /// + /// Get the state of an action by the action set name, action name, and input source. Optionally case sensitive (for faster results) + /// + /// The name of the action set the action is contained in + /// The name of the action to get the state of + /// The input source to get the action state from + /// Whether or not the action set and action name searches should be case sensitive (case sensitive searches are faster) + public static bool GetState(string actionSet, string action, SteamVR_Input_Sources inputSource, bool caseSensitive = false) + { + SteamVR_Action_Boolean booleanAction = GetAction(actionSet, action, caseSensitive); + if (booleanAction != null) + { + return booleanAction.GetState(inputSource); + } + + return false; + } + + /// + /// Get the state of an action by the action name and input source. Optionally case sensitive (for faster results) + /// + /// The name of the action to get the state of + /// The input source to get the action state from + /// Whether or not the action set and action name searches should be case sensitive (case sensitive searches are faster) + public static bool GetState(string action, SteamVR_Input_Sources inputSource, bool caseSensitive = false) + { + return GetState(null, action, inputSource, caseSensitive); + } + + /// + /// Get the state down of an action by the action set name, action name, and input source. Optionally case sensitive (for faster results) + /// + /// The name of the action set the action is contained in + /// The name of the action to get the state of + /// The input source to get the action state from + /// Whether or not the action set and action name searches should be case sensitive (case sensitive searches are faster) + /// True when the action was false last update and is now true. Returns false again afterwards. + public static bool GetStateDown(string actionSet, string action, SteamVR_Input_Sources inputSource, bool caseSensitive = false) + { + SteamVR_Action_Boolean booleanAction = GetAction(actionSet, action, caseSensitive); + if (booleanAction != null) + { + return booleanAction.GetStateDown(inputSource); + } + + return false; + } + + /// + /// Get the state down of an action by the action name and input source. Optionally case sensitive (for faster results) + /// + /// The name of the action to get the state of + /// The input source to get the action state from + /// Whether or not the action set and action name searches should be case sensitive (case sensitive searches are faster) + /// True when the action was false last update and is now true. Returns false again afterwards. + public static bool GetStateDown(string action, SteamVR_Input_Sources inputSource, bool caseSensitive = false) + { + return GetStateDown(null, action, inputSource, caseSensitive); + } + + /// + /// Get the state up of an action by the action set name, action name, and input source. Optionally case sensitive (for faster results) + /// + /// The name of the action set the action is contained in + /// The name of the action to get the state of + /// The input source to get the action state from + /// Whether or not the action set and action name searches should be case sensitive (case sensitive searches are faster) + /// True when the action was true last update and is now false. Returns false again afterwards. + public static bool GetStateUp(string actionSet, string action, SteamVR_Input_Sources inputSource, bool caseSensitive = false) + { + SteamVR_Action_Boolean booleanAction = GetAction(actionSet, action, caseSensitive); + if (booleanAction != null) + { + return booleanAction.GetStateUp(inputSource); + } + + return false; + } + + + /// + /// Get the state up of an action by the action name and input source. Optionally case sensitive (for faster results) + /// + /// The name of the action to get the state of + /// The input source to get the action state from + /// Whether or not the action set and action name searches should be case sensitive (case sensitive searches are faster) + /// True when the action was true last update and is now false. Returns false again afterwards. + public static bool GetStateUp(string action, SteamVR_Input_Sources inputSource, bool caseSensitive = false) + { + return GetStateUp(null, action, inputSource, caseSensitive); + } + #endregion + + #region analog string accessors + /// + /// Get the float value of an action by the action set name, action name, and input source. Optionally case sensitive (for faster results). (same as GetSingle) + /// + /// The name of the action set the action is contained in + /// The name of the action to get the state of + /// The input source to get the action state from + /// Whether or not the action set and action name searches should be case sensitive (case sensitive searches are faster) + public static float GetFloat(string actionSet, string action, SteamVR_Input_Sources inputSource, bool caseSensitive = false) + { + SteamVR_Action_Single singleAction = GetAction(actionSet, action, caseSensitive); + if (singleAction != null) + { + return singleAction.GetAxis(inputSource); + } + + return 0; + } + + /// + /// Get the float value of an action by the action name and input source. Optionally case sensitive (for faster results). (same as GetSingle) + /// + /// The name of the action to get the state of + /// The input source to get the action state from + /// Whether or not the action set and action name searches should be case sensitive (case sensitive searches are faster) + public static float GetFloat(string action, SteamVR_Input_Sources inputSource, bool caseSensitive = false) + { + return GetFloat(null, action, inputSource, caseSensitive); + } + + /// + /// Get the float value of an action by the action set name, action name, and input source. Optionally case sensitive (for faster results). (same as GetFloat) + /// + /// The name of the action set the action is contained in + /// The name of the action to get the state of + /// The input source to get the action state from + /// Whether or not the action set and action name searches should be case sensitive (case sensitive searches are faster) + public static float GetSingle(string actionSet, string action, SteamVR_Input_Sources inputSource, bool caseSensitive = false) + { + SteamVR_Action_Single singleAction = GetAction(actionSet, action, caseSensitive); + if (singleAction != null) + { + return singleAction.GetAxis(inputSource); + } + + return 0; + } + + /// + /// Get the float value of an action by the action name and input source. Optionally case sensitive (for faster results). (same as GetFloat) + /// + /// The name of the action to get the state of + /// The input source to get the action state from + /// Whether or not the action set and action name searches should be case sensitive (case sensitive searches are faster) + public static float GetSingle(string action, SteamVR_Input_Sources inputSource, bool caseSensitive = false) + { + return GetFloat(null, action, inputSource, caseSensitive); + } + + /// + /// Get the Vector2 value of an action by the action set name, action name, and input source. Optionally case sensitive (for faster results) + /// + /// The name of the action set the action is contained in + /// The name of the action to get the state of + /// The input source to get the action state from + /// Whether or not the action set and action name searches should be case sensitive (case sensitive searches are faster) + public static Vector2 GetVector2(string actionSet, string action, SteamVR_Input_Sources inputSource, bool caseSensitive = false) + { + SteamVR_Action_Vector2 vectorAction = GetAction(actionSet, action, caseSensitive); + if (vectorAction != null) + { + return vectorAction.GetAxis(inputSource); + } + + return Vector2.zero; + } + + /// + /// Get the Vector2 value of an action by the action name and input source. Optionally case sensitive (for faster results) + /// + /// The name of the action to get the state of + /// The input source to get the action state from + /// Whether or not the action set and action name searches should be case sensitive (case sensitive searches are faster) + public static Vector2 GetVector2(string action, SteamVR_Input_Sources inputSource, bool caseSensitive = false) + { + return GetVector2(null, action, inputSource, caseSensitive); + } + + /// + /// Get the Vector3 value of an action by the action set name, action name, and input source. Optionally case sensitive (for faster results) + /// + /// The name of the action set the action is contained in + /// The name of the action to get the state of + /// The input source to get the action state from + /// Whether or not the action set and action name searches should be case sensitive (case sensitive searches are faster) + public static Vector3 GetVector3(string actionSet, string action, SteamVR_Input_Sources inputSource, bool caseSensitive = false) + { + SteamVR_Action_Vector3 vectorAction = GetAction(actionSet, action, caseSensitive); + if (vectorAction != null) + { + return vectorAction.GetAxis(inputSource); + } + + return Vector3.zero; + } + + /// + /// Get the Vector3 value of an action by the action name and input source. Optionally case sensitive (for faster results) + /// + /// The name of the action to get the state of + /// The input source to get the action state from + /// Whether or not the action set and action name searches should be case sensitive (case sensitive searches are faster) + public static Vector3 GetVector3(string action, SteamVR_Input_Sources inputSource, bool caseSensitive = false) + { + return GetVector3(null, action, inputSource, caseSensitive); + } + #endregion + + #endregion + + /// + /// Returns all of the action sets. If we're in the editor, doesn't rely on the actionSets field being filled. + /// + public static SteamVR_ActionSet[] GetActionSets() + { + return actionSets; + } + + /// + /// Returns all of the actions of the specified type. If we're in the editor, doesn't rely on the arrays being filled. + /// + /// The type of actions you want to get + public static T[] GetActions() where T : SteamVR_Action + { + Type type = typeof(T); + + if (type == typeof(SteamVR_Action)) + { + return actions as T[]; + } + else if (type == typeof(ISteamVR_Action_In)) + { + return actionsIn as T[]; + } + else if (type == typeof(ISteamVR_Action_Out)) + { + return actionsOut as T[]; + } + else if (type == typeof(SteamVR_Action_Boolean)) + { + return actionsBoolean as T[]; + } + else if (type == typeof(SteamVR_Action_Single)) + { + return actionsSingle as T[]; + } + else if (type == typeof(SteamVR_Action_Vector2)) + { + return actionsVector2 as T[]; + } + else if (type == typeof(SteamVR_Action_Vector3)) + { + return actionsVector3 as T[]; + } + else if (type == typeof(SteamVR_Action_Pose)) + { + return actionsPose as T[]; + } + else if (type == typeof(SteamVR_Action_Skeleton)) + { + return actionsSkeleton as T[]; + } + else if (type == typeof(SteamVR_Action_Vibration)) + { + return actionsVibration as T[]; + } else { + Debug.Log("[SteamVR] Wrong type."); + } + + return null; + } + + internal static bool ShouldMakeCopy() + { + bool shouldMakeCopy = SteamVR_Behaviour.isPlaying == false; + + return shouldMakeCopy; + } + + /// + /// Gets the localized name of the device that the action corresponds to. + /// + /// + /// + /// + /// VRInputString_Hand - Which hand the origin is in. E.g. "Left Hand" + /// VRInputString_ControllerType - What kind of controller the user has in that hand.E.g. "Vive Controller" + /// VRInputString_InputSource - What part of that controller is the origin. E.g. "Trackpad" + /// VRInputString_All - All of the above. E.g. "Left Hand Vive Controller Trackpad" + /// + /// + public static string GetLocalizedName(ulong originHandle, params EVRInputStringBits[] localizedParts) + { + int localizedPartsMask = 0; + + for (int partIndex = 0; partIndex < localizedParts.Length; partIndex++) + localizedPartsMask |= (int)localizedParts[partIndex]; + + StringBuilder stringBuilder = new StringBuilder(500); + OpenVR.Input.GetOriginLocalizedName(originHandle, stringBuilder, 500, localizedPartsMask); + + return stringBuilder.ToString(); + } + + public static bool CheckOldLocation() + { #if UNITY_EDITOR - string[] assetGuids = UnityEditor.AssetDatabase.FindAssets("t:" + type.FullName); - if (assetGuids.Length > 0) + DirectoryInfo dataPath = new DirectoryInfo(Application.dataPath); + string projectRoot = dataPath.Parent.FullName; + + string fullOldActionsPath = Path.Combine(projectRoot, SteamVR_Settings.instance.actionsFilePath); + if (File.Exists(fullOldActionsPath)) + { + SteamVR_Input_ActionFile oldActionsFile = SteamVR_Input_ActionFile.Open(fullOldActionsPath); + string[] actionAndBindingFiles = oldActionsFile.GetFilesToCopy(true); + + string newActionsFilePath = GetActionsFilePath(true); + bool shouldCopy = true; + bool verified = false; + if (File.Exists(newActionsFilePath)) + { + shouldCopy = UnityEditor.EditorUtility.DisplayDialog("SteamVR", "SteamVR Unity Plugin detected an Action Manifest file in the legacy location (project root). You also have an Action Manifest File in the new location (streaming assets). Would you like to overwrite the files in streaming assets?", "Yes", "No"); + verified = true; + } + + if (shouldCopy) { - T[] assets = new T[assetGuids.Length]; - for (int assetIndex = 0; assetIndex < assets.Length; assetIndex++) + string newFolderPath = GetActionsFileFolder(); + + foreach (string filePath in actionAndBindingFiles) + { + FileInfo oldFile = new FileInfo(filePath); + string newFilePath = Path.Combine(newFolderPath, oldFile.Name); + + if (File.Exists(newFilePath)) + { + FileInfo newFile = new FileInfo(newFilePath); + newFile.IsReadOnly = false; + + newFile.Delete(); + } + + oldFile.IsReadOnly = false; + oldFile.MoveTo(newFilePath); + } + + if (verified == false) + { + UnityEditor.EditorUtility.DisplayDialog("SteamVR", "SteamVR Unity Plugin detected an Action Manifest file in the legacy location (project root). We've automatically moved the files to the new location (" + GetActionsFileFolder() + ").", "Ok"); + } + else { - string assetPath = UnityEditor.AssetDatabase.GUIDToAssetPath(assetGuids[assetIndex]); - assets[assetIndex] = UnityEditor.AssetDatabase.LoadAssetAtPath(assetPath); + UnityEditor.EditorUtility.DisplayDialog("SteamVR", "Moving files to the new location (" + GetActionsFileFolder() + ") is complete.", "Ok"); } - return assets; + + UnityEditor.AssetDatabase.Refresh(); + return true; } - return new T[0]; -#endif } - - return null; +#endif + return false; } - protected static Delegate GetMethod(string methodName) + + /// Tell SteamVR that we're using the actions file at the path defined in SteamVR_Settings. + public static void IdentifyActionsFile(bool showLogs = true) { - MethodInfo methodInfo = inputType.GetMethod(methodName); + string fullPath = GetActionsFilePath(); + if (File.Exists(fullPath)) + { + if (OpenVR.Input == null) + { + Debug.LogError("[SteamVR] Could not instantiate OpenVR Input interface."); + return; + } - return Delegate.CreateDelegate(typeof(T), methodInfo); + EVRInputError err = OpenVR.Input.SetActionManifestPath(fullPath); + if (err != EVRInputError.None) + Debug.LogError("[SteamVR] Error loading action manifest into SteamVR: " + err.ToString()); + else + { + int numActions = 0; + if (SteamVR_Input.actions != null) + { + numActions = SteamVR_Input.actions.Length; + + if (showLogs) + Debug.Log(string.Format("[SteamVR] Successfully loaded {0} actions from action manifest into SteamVR ({1})", numActions, fullPath)); + } + else + { + if (showLogs) + Debug.LogWarning("[SteamVR] No actions found, but the action manifest was loaded. This usually means you haven't generated actions. Window -> SteamVR Input -> Save and Generate."); + } + } + } + else + { + if (showLogs) + Debug.LogError("[SteamVR] Could not find actions file at: " + fullPath); + } } /// @@ -658,16 +1407,13 @@ protected static Delegate GetMethod(string methodName) /// public static bool HasFileInMemoryBeenModified() { - string projectPath = Application.dataPath; - int lastIndex = projectPath.LastIndexOf("/"); - projectPath = projectPath.Remove(lastIndex, projectPath.Length - lastIndex); - actionsFilePath = Path.Combine(projectPath, SteamVR_Settings.instance.actionsFilePath); + string fullPath = GetActionsFilePath(); string jsonText = null; - if (File.Exists(actionsFilePath)) + if (File.Exists(fullPath)) { - jsonText = System.IO.File.ReadAllText(actionsFilePath); + jsonText = System.IO.File.ReadAllText(fullPath); } else { @@ -683,26 +1429,59 @@ public static bool HasFileInMemoryBeenModified() return newHashFromFile != newHashFromMemory; } + public static bool CreateEmptyActionsFile(bool completelyEmpty = false) + { + string actionsFilePath = GetActionsFilePath(); + + if (File.Exists(actionsFilePath)) + { + Debug.LogErrorFormat("[SteamVR] Actions file already exists in project root: {0}", actionsFilePath); + return false; + } + + actionFile = new SteamVR_Input_ActionFile(); + + if (completelyEmpty == false) + { + actionFile.action_sets.Add(SteamVR_Input_ActionFile_ActionSet.CreateNew()); + actionFile.actions.Add(SteamVR_Input_ActionFile_Action.CreateNew(actionFile.action_sets[0].shortName, + SteamVR_ActionDirections.In, SteamVR_Input_ActionFile_ActionTypes.boolean)); + } + + string newJSON = JsonConvert.SerializeObject(actionFile, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); + + File.WriteAllText(actionsFilePath, newJSON); + + actionFile.InitializeHelperLists(); + fileInitialized = true; + return true; + } + + public static bool DoesActionsFileExist() + { + return File.Exists(GetActionsFilePath()); + } + /// /// Load from disk and deserialize the actions file /// /// Force a refresh of this file from disk - public static bool InitializeFile(bool force = false) + public static bool InitializeFile(bool force = false, bool showErrors = true) { - string projectPath = Application.dataPath; - int lastIndex = projectPath.LastIndexOf("/"); - projectPath = projectPath.Remove(lastIndex, projectPath.Length - lastIndex); - actionsFilePath = Path.Combine(projectPath, SteamVR_Settings.instance.actionsFilePath); + bool actionsFileExists = DoesActionsFileExist(); + string actionsFilePath = GetActionsFilePath(); string jsonText = null; - if (File.Exists(actionsFilePath)) + if (actionsFileExists) { jsonText = System.IO.File.ReadAllText(actionsFilePath); } else { - Debug.LogErrorFormat("[SteamVR] Actions file does not exist in project root: {0}", actionsFilePath); + if (showErrors) + Debug.LogErrorFormat("[SteamVR] Actions file does not exist in project root: {0}", actionsFilePath); + return false; } @@ -718,12 +1497,89 @@ public static bool InitializeFile(bool force = false) actionFileHash = newHash; } - actionFile = Valve.Newtonsoft.Json.JsonConvert.DeserializeObject(jsonText); - actionFile.InitializeHelperLists(); + actionFile = SteamVR_Input_ActionFile.Open(GetActionsFilePath()); fileInitialized = true; return true; } + public static string GetActionsFileFolder(bool fullPath = true) + { + string streamingAssets = Application.streamingAssetsPath; + if (Directory.Exists(streamingAssets) == false) + Directory.CreateDirectory(streamingAssets); + + string streamingAssets_SteamVR = Path.Combine(streamingAssets, "SteamVR"); + if (Directory.Exists(streamingAssets_SteamVR) == false) + Directory.CreateDirectory(streamingAssets_SteamVR); + + return streamingAssets_SteamVR; + } + + public static string GetActionsFilePath(bool fullPath = true) + { + string streamingAssets_SteamVR = GetActionsFileFolder(fullPath); + string path = Path.Combine(streamingAssets_SteamVR, SteamVR_Settings.instance.actionsFilePath); + + return SteamVR_Utils.SanitizePath(path); + } + + public static string GetActionsFileName() + { + return SteamVR_Settings.instance.actionsFilePath; + } + + + /// + /// Deletes the action manifest file and all the default bindings it had listed in the default bindings section + /// + /// True if we deleted an action file, false if not. + public static bool DeleteManifestAndBindings() + { + if (DoesActionsFileExist() == false) + return false; + + InitializeFile(); + + string[] filesToDelete = actionFile.GetFilesToCopy(); + foreach (string bindingFilePath in filesToDelete) + { + FileInfo bindingFileInfo = new FileInfo(bindingFilePath); + bindingFileInfo.IsReadOnly = false; + File.Delete(bindingFilePath); + } + + string actionsFilePath = GetActionsFilePath(); + if (File.Exists(actionsFilePath)) + { + FileInfo actionFileInfo = new FileInfo(actionsFilePath); + actionFileInfo.IsReadOnly = false; + File.Delete(actionsFilePath); + + actionFile = null; + fileInitialized = false; + + return true; + } + + return false; + } + + /// + /// Open the binding UI in the HMD. Can open to a specific controller's binding and to a specific action set. + /// + /// Optional. The action set to highlight (will default to the first set) + /// Optional. The device's binding to open (will default to right hand) + public static void OpenBindingUI(SteamVR_ActionSet actionSetToEdit = null, SteamVR_Input_Sources deviceBindingToEdit = SteamVR_Input_Sources.Any) + { + ulong deviceHandle = SteamVR_Input_Source.GetHandle(deviceBindingToEdit); + ulong actionSetHandle = 0; + + if (actionSetToEdit != null) + actionSetHandle = actionSetToEdit.handle; + + OpenVR.Input.OpenBindingUI(null, actionSetHandle, deviceHandle, false); + } + #if UNITY_EDITOR public static string GetResourcesFolderPath(bool fromAssetsDirectory = false) { @@ -754,10 +1610,14 @@ public static string GetResourcesFolderPath(bool fromAssetsDirectory = false) return path; } + + private static bool checkingSetup = false; + private static bool openingSetup = false; + public static bool IsOpeningSetup() { return openingSetup; } private static void CheckSetup() { - if (checkingSetup == false && (SteamVR_Input_References.instance.actionSetObjects == null || SteamVR_Input_References.instance.actionSetObjects.Length == 0 || SteamVR_Input_References.instance.actionSetObjects.Any(set => set != null) == false)) + if (checkingSetup == false && openingSetup == false && (SteamVR_Input.actions == null || SteamVR_Input.actions.Length == 0)) { checkingSetup = true; Debug.Break(); @@ -765,8 +1625,9 @@ private static void CheckSetup() bool open = UnityEditor.EditorUtility.DisplayDialog("[SteamVR]", "It looks like you haven't generated actions for SteamVR Input yet. Would you like to open the SteamVR Input window?", "Yes", "No"); if (open) { + openingSetup = true; UnityEditor.EditorApplication.isPlaying = false; - Type editorWindowType = FindType("Valve.VR.SteamVR_Input_EditorWindow"); + Type editorWindowType = SteamVR_Utils.FindType("Valve.VR.SteamVR_Input_EditorWindow"); if (editorWindowType != null) { var window = UnityEditor.EditorWindow.GetWindow(editorWindowType, false, "SteamVR Input", true); @@ -774,21 +1635,17 @@ private static void CheckSetup() window.Show(); } } + else + { + Debug.LogError("[SteamVR] This version of SteamVR will not work if you do not create and generate actions. Please open the SteamVR Input window or downgrade to version 1.2.3 (on github)"); + } checkingSetup = false; } } - private static Type FindType(string typeName) + public static string GetEditorAppKey() { - var type = Type.GetType(typeName); - if (type != null) return type; - foreach (var a in AppDomain.CurrentDomain.GetAssemblies()) - { - type = a.GetType(typeName); - if (type != null) - return type; - } - return null; + return SteamVR_Settings.instance.editorAppKey; } #endif } diff --git a/Assets/SteamVR/Input/SteamVR_Input.cs.meta b/Assets/SteamVR/Input/SteamVR_Input.cs.meta index 5689da9c..5275572b 100644 --- a/Assets/SteamVR/Input/SteamVR_Input.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_Input.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 36fa5b356bc9b9f4792bb2c38b8d8b5f -timeCreated: 1532647035 +timeCreated: 1544852187 licenseType: Store MonoImporter: serializedVersion: 2 @@ -65,7 +65,7 @@ MonoImporter: - instance___actions_hands_in_PinkyCurlRight: {fileID: 11400000, guid: d747312e731775548a1e5d37c1ecc872, type: 2} executionOrder: -31000 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Input_ActionFile.cs b/Assets/SteamVR/Input/SteamVR_Input_ActionFile.cs index 575c5174..cfda4aa8 100644 --- a/Assets/SteamVR/Input/SteamVR_Input_ActionFile.cs +++ b/Assets/SteamVR/Input/SteamVR_Input_ActionFile.cs @@ -13,10 +13,13 @@ namespace Valve.VR [System.Serializable] public class SteamVR_Input_ActionFile { - public List actions; - public List action_sets; - public List default_bindings; - public List> localization; + public List actions = new List(); + public List action_sets = new List(); + public List default_bindings = new List(); + public List> localization = new List>(); + + [JsonIgnore] + public string filePath; [JsonIgnore] public List localizationHelperList = new List(); @@ -27,6 +30,7 @@ public void InitializeHelperLists() { actionset.actionsInList = new List(actions.Where(action => action.path.StartsWith(actionset.name) && SteamVR_Input_ActionFile_ActionTypes.listIn.Contains(action.type))); actionset.actionsOutList = new List(actions.Where(action => action.path.StartsWith(actionset.name) && SteamVR_Input_ActionFile_ActionTypes.listOut.Contains(action.type))); + actionset.actionsList = new List(actions.Where(action => action.path.StartsWith(actionset.name))); } foreach (var item in localization) @@ -37,6 +41,14 @@ public void InitializeHelperLists() public void SaveHelperLists() { + //fix actions list + foreach (var actionset in action_sets) + { + actionset.actionsList.Clear(); + actionset.actionsList.AddRange(actionset.actionsInList); + actionset.actionsList.AddRange(actionset.actionsOutList); + } + actions.Clear(); foreach (var actionset in action_sets) @@ -104,10 +116,10 @@ public string[] GetFilesToCopy(bool throwErrors = false) { List files = new List(); - FileInfo actionFileInfo = new FileInfo(SteamVR_Input.actionsFilePath); + FileInfo actionFileInfo = new FileInfo(this.filePath); string path = actionFileInfo.Directory.FullName; - files.Add(SteamVR_Input.actionsFilePath); + files.Add(this.filePath); foreach (var binding in default_bindings) { @@ -119,24 +131,138 @@ public string[] GetFilesToCopy(bool throwErrors = false) { if (throwErrors) { - Debug.LogError("[SteamVR] Could not bind binding file specified by the actions.json manifest: " + bindingPath); + Debug.LogError("[SteamVR] Could not bind binding file specified by the actions.json manifest: " + bindingPath); } } } return files.ToArray(); } + + public void CopyFilesToPath(string toPath, bool overwrite) + { + string[] files = SteamVR_Input.actionFile.GetFilesToCopy(); + + foreach (string file in files) + { + FileInfo bindingInfo = new FileInfo(file); + string newFilePath = Path.Combine(toPath, bindingInfo.Name); + + bool exists = false; + if (File.Exists(newFilePath)) + exists = true; + + if (exists) + { + if (overwrite) + { + FileInfo existingFile = new FileInfo(newFilePath); + existingFile.IsReadOnly = false; + existingFile.Delete(); + + File.Copy(file, newFilePath); + + RemoveAppKey(newFilePath); + + Debug.Log("[SteamVR] Copied (overwrote) SteamVR Input file at path: " + newFilePath); + } + else + { + Debug.Log("[SteamVR] Skipped writing existing file at path: " + newFilePath); + } + } + else + { + File.Copy(file, newFilePath); + + RemoveAppKey(newFilePath); + + Debug.Log("[SteamVR] Copied SteamVR Input file to folder: " + newFilePath); + } + + } + } + + + private const string findString_appKeyStart = "\"app_key\""; + private const string findString_appKeyEnd = "\","; + private static void RemoveAppKey(string newFilePath) + { + if (File.Exists(newFilePath)) + { + string jsonText = System.IO.File.ReadAllText(newFilePath); + + string findString = "\"app_key\""; + int stringStart = jsonText.IndexOf(findString); + + if (stringStart == -1) + return; //no app key + + int stringEnd = jsonText.IndexOf("\",", stringStart); + + if (stringEnd == -1) + return; //no end? + + stringEnd += findString_appKeyEnd.Length; + + int stringLength = stringEnd - stringStart; + + string newJsonText = jsonText.Remove(stringStart, stringLength); + + FileInfo file = new FileInfo(newFilePath); + file.IsReadOnly = false; + + File.WriteAllText(newFilePath, newJsonText); + } + } + public static SteamVR_Input_ActionFile Open(string path) + { + if (File.Exists(path)) + { + string jsonText = File.ReadAllText(path); + + SteamVR_Input_ActionFile actionFile = Valve.Newtonsoft.Json.JsonConvert.DeserializeObject(jsonText); + actionFile.filePath = path; + actionFile.InitializeHelperLists(); + + return actionFile; + } + + return null; + } + + + public void Save(string path) + { + FileInfo existingActionsFile = new FileInfo(path); + if (existingActionsFile.Exists) + { + existingActionsFile.IsReadOnly = false; + } + + //SanitizeActionFile(); //todo: shouldn't we be doing this? + + string json = JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); + + File.WriteAllText(path, json); + } } - public enum SteamVR_Input_ActionFile_DefailtBinding_ControllerTypes + + public enum SteamVR_Input_ActionFile_DefaultBinding_ControllerTypes { - vive, - vive_pro, + vive, //hmd + vive_pro, //hmd vive_controller, generic, holographic_controller, oculus_touch, gamepad, knuckles, + index_hmd, //hmd + vive_cosmos_controller, + rift, //hmd + vive_tracker_camera, + vive_tracker, } [System.Serializable] @@ -144,6 +270,14 @@ public class SteamVR_Input_ActionFile_DefaultBinding { public string controller_type; public string binding_url; + + public SteamVR_Input_ActionFile_DefaultBinding GetCopy() + { + SteamVR_Input_ActionFile_DefaultBinding newDefaultBinding = new SteamVR_Input_ActionFile_DefaultBinding(); + newDefaultBinding.controller_type = this.controller_type; + newDefaultBinding.binding_url = this.binding_url; + return newDefaultBinding; + } } [System.Serializable] @@ -169,18 +303,63 @@ public string shortName { get { + int lastIndex = name.LastIndexOf('/'); + if (lastIndex == name.Length - 1) + return string.Empty; + return SteamVR_Input_ActionFile.GetShortName(name); } } public void SetNewShortName(string newShortName) { - name = "/actions/" + newShortName; + name = GetPathFromName(newShortName); + } + + public static string CreateNewName() + { + return GetPathFromName("NewSet"); } - public string CreateNewName() + private const string nameTemplate = "/actions/{0}"; + public static string GetPathFromName(string name) { - return "/actions/NewSet"; + return string.Format(nameTemplate, name); + } + + public static SteamVR_Input_ActionFile_ActionSet CreateNew() + { + return new SteamVR_Input_ActionFile_ActionSet() { name = CreateNewName() }; + } + + public SteamVR_Input_ActionFile_ActionSet GetCopy() + { + SteamVR_Input_ActionFile_ActionSet newSet = new SteamVR_Input_ActionFile_ActionSet(); + newSet.name = this.name; + newSet.usage = this.usage; + return newSet; + } + + public override bool Equals(object obj) + { + if (obj is SteamVR_Input_ActionFile_ActionSet) + { + SteamVR_Input_ActionFile_ActionSet set = (SteamVR_Input_ActionFile_ActionSet)obj; + if (set == this) + return true; + + if (set.name == this.name) + return true; + + return false; + } + + return base.Equals(obj); + } + + public override int GetHashCode() + { + return base.GetHashCode(); } [JsonIgnore] @@ -188,6 +367,9 @@ public string CreateNewName() [JsonIgnore] public List actionsOutList = new List(); + + [JsonIgnore] + public List actionsList = new List(); } public enum SteamVR_Input_ActionFile_Action_Requirements @@ -220,6 +402,17 @@ public static string[] requirementValues public string skeleton; public string requirement; + public SteamVR_Input_ActionFile_Action GetCopy() + { + SteamVR_Input_ActionFile_Action newAction = new SteamVR_Input_ActionFile_Action(); + newAction.name = this.name; + newAction.type = this.type; + newAction.scope = this.scope; + newAction.skeleton = this.skeleton; + newAction.requirement = this.requirement; + return newAction; + } + [JsonIgnore] public SteamVR_Input_ActionFile_Action_Requirements requirementEnum { @@ -274,9 +467,19 @@ public string path } } - public string CreateNewName(string actionSet, string direction) + private const string nameTemplate = "/actions/{0}/{1}/{2}"; + public static string CreateNewName(string actionSet, string direction) { - return string.Format("{0}/{1}/NewAction", actionSet, direction); + return string.Format(nameTemplate, actionSet, direction, "NewAction"); + } + public static string CreateNewName(string actionSet, SteamVR_ActionDirections direction, string actionName) + { + return string.Format(nameTemplate, actionSet, direction.ToString().ToLower(), actionName); + } + + public static SteamVR_Input_ActionFile_Action CreateNew(string actionSet, SteamVR_ActionDirections direction, string actionType) + { + return new SteamVR_Input_ActionFile_Action() { name = CreateNewName(actionSet, direction.ToString().ToLower()), type = actionType }; } [JsonIgnore] @@ -291,10 +494,52 @@ public SteamVR_ActionDirections direction } } + protected const string prefix = "/actions/"; + + [JsonIgnore] + public string actionSet + { + get + { + int setEnd = name.IndexOf('/', prefix.Length); + if (setEnd == -1) + return string.Empty; + + return name.Substring(0, setEnd); + } + } + + public void SetNewActionSet(string newSetName) + { + name = string.Format(nameTemplate, newSetName, direction.ToString().ToLower(), shortName); + } + public override string ToString() { return shortName; } + + public override bool Equals(object obj) + { + if (obj is SteamVR_Input_ActionFile_Action) + { + SteamVR_Input_ActionFile_Action action = (SteamVR_Input_ActionFile_Action)obj; + if (this == obj) + return true; + + if (this.name == action.name && this.type == action.type && this.skeleton == action.skeleton && this.requirement == action.requirement) + return true; + + return false; + } + + return base.Equals(obj); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } } public class SteamVR_Input_ActionFile_LocalizationItem @@ -317,7 +562,7 @@ public SteamVR_Input_ActionFile_LocalizationItem(Dictionary dict if (dictionary.ContainsKey(languageTagKeyName)) language = (string)dictionary[languageTagKeyName]; else - Debug.Log("[SteamVR] Input: Error in actions file, no language_tag in localization array item."); + Debug.Log("[SteamVR] Input: Error in actions file, no language_tag in localization array item."); foreach (KeyValuePair item in dictionary) { @@ -347,6 +592,20 @@ public class SteamVR_Input_ManifestFile_Application public Dictionary strings = new Dictionary(); } + public class SteamVR_Input_Unity_AssemblyFile_Definition + { + public string name = "SteamVR_Actions"; + public string[] references = new string[] { "SteamVR" }; + public string[] optionalUnityReferences = new string[0]; + public string[] includePlatforms = new string[0]; + public string[] excludePlatforms = new string[] { "Android" }; + public bool allowUnsafeCode = false; + public bool overrideReferences = false; + public string[] precompiledReferences = new string[0]; + public bool autoReferenced = false; + public string[] defineConstraints = new string[0]; + } + public class SteamVR_Input_ManifestFile_ApplicationString { public string name; @@ -363,6 +622,15 @@ public class SteamVR_Input_ManifestFile_Application_Binding_ControllerTypes public static string oculus_touch = "oculus_touch"; public static string vive_controller = "vive_controller"; public static string knuckles = "knuckles"; + public static string holographic_controller = "holographic_controller"; + public static string vive = "vive"; + public static string vive_pro = "vive_pro"; + public static string holographic_hmd = "holographic_hmd"; + public static string rift = "rift"; + public static string vive_tracker_camera = "vive_tracker_camera"; + public static string vive_cosmos = "vive_cosmos"; + public static string vive_cosmos_controller = "vive_cosmos_controller"; + public static string index_hmd = "index_hmd"; } static public class SteamVR_Input_ActionFile_ActionTypes diff --git a/Assets/SteamVR/Input/SteamVR_Input_ActionFile.cs.meta b/Assets/SteamVR/Input/SteamVR_Input_ActionFile.cs.meta index b4994818..5fc02c05 100644 --- a/Assets/SteamVR/Input/SteamVR_Input_ActionFile.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_Input_ActionFile.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: a46ca29bcb0df3e4ea80651c2220adbf -timeCreated: 1532647045 +timeCreated: 1544852187 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Input_ActionScopes.cs.meta b/Assets/SteamVR/Input/SteamVR_Input_ActionScopes.cs.meta index 06bb4b46..cc8ce11a 100644 --- a/Assets/SteamVR/Input/SteamVR_Input_ActionScopes.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_Input_ActionScopes.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: b8b3d557389a8d84496ba0aadf2faad5 -timeCreated: 1532647055 +timeCreated: 1544852187 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Input_ActionSetUsages.cs.meta b/Assets/SteamVR/Input/SteamVR_Input_ActionSetUsages.cs.meta index 3c26cb91..cc0a305e 100644 --- a/Assets/SteamVR/Input/SteamVR_Input_ActionSetUsages.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_Input_ActionSetUsages.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: d74d007b6f4b4674a9cfd320b9389b66 -timeCreated: 1532647063 +timeCreated: 1544852188 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Input_BindingFile.cs b/Assets/SteamVR/Input/SteamVR_Input_BindingFile.cs new file mode 100644 index 00000000..362301ee --- /dev/null +++ b/Assets/SteamVR/Input/SteamVR_Input_BindingFile.cs @@ -0,0 +1,281 @@ +//======= Copyright (c) Valve Corporation, All rights reserved. =============== + +using UnityEngine; +using System.Collections; +using System.Collections.Generic; + +using System.Linq; +using Valve.Newtonsoft.Json; +using System.IO; + +namespace Valve.VR +{ + [System.Serializable] + public class SteamVR_Input_BindingFile + { + public string app_key; + public Dictionary bindings = new Dictionary(); + public string controller_type; + public string description; + public string name; + } + + [System.Serializable] + public class SteamVR_Input_BindingFile_ActionList + { + public List chords = new List(); + public List poses = new List(); + public List haptics = new List(); + public List sources = new List(); + public List skeleton = new List(); + } + + [System.Serializable] + public class SteamVR_Input_BindingFile_Chord + { + public string output; + public List> inputs = new List>(); + + public override bool Equals(object obj) + { + if (obj is SteamVR_Input_BindingFile_Chord) + { + SteamVR_Input_BindingFile_Chord chord = (SteamVR_Input_BindingFile_Chord)obj; + + if (this.output == chord.output && this.inputs != null && chord.inputs != null) + { + if (this.inputs.Count == chord.inputs.Count) + { + for (int thisIndex = 0; thisIndex < this.inputs.Count; thisIndex++) + { + if (this.inputs[thisIndex] != null && chord.inputs[thisIndex] != null && this.inputs[thisIndex].Count == chord.inputs[thisIndex].Count) + { + for (int thisSubIndex = 0; thisSubIndex < this.inputs[thisIndex].Count; thisSubIndex++) + { + if (this.inputs[thisIndex][thisSubIndex] != chord.inputs[thisIndex][thisSubIndex]) + { + return false; + } + } + return true; + } + } + } + } + + return false; + } + + return base.Equals(obj); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + } + + [System.Serializable] + public class SteamVR_Input_BindingFile_Pose + { + public string output; + public string path; + + public override bool Equals(object obj) + { + if (obj is SteamVR_Input_BindingFile_Pose) + { + SteamVR_Input_BindingFile_Pose pose = (SteamVR_Input_BindingFile_Pose)obj; + if (pose.output == this.output && pose.path == this.path) + return true; + return false; + } + + return base.Equals(obj); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + } + + [System.Serializable] + public class SteamVR_Input_BindingFile_Haptic + { + public string output; + public string path; + + public override bool Equals(object obj) + { + if (obj is SteamVR_Input_BindingFile_Haptic) + { + SteamVR_Input_BindingFile_Haptic pose = (SteamVR_Input_BindingFile_Haptic)obj; + if (pose.output == this.output && pose.path == this.path) + return true; + return false; + } + + return base.Equals(obj); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + } + + [System.Serializable] + public class SteamVR_Input_BindingFile_Skeleton + { + public string output; + public string path; + + public override bool Equals(object obj) + { + if (obj is SteamVR_Input_BindingFile_Skeleton) + { + SteamVR_Input_BindingFile_Skeleton pose = (SteamVR_Input_BindingFile_Skeleton)obj; + if (pose.output == this.output && pose.path == this.path) + return true; + return false; + } + + return base.Equals(obj); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + } + + [System.Serializable] + public class SteamVR_Input_BindingFile_Source + { + public string path; + public string mode; + public SteamVR_Input_BindingFile_Source_Input_StringDictionary parameters = new SteamVR_Input_BindingFile_Source_Input_StringDictionary(); + public SteamVR_Input_BindingFile_Source_Input inputs = new SteamVR_Input_BindingFile_Source_Input(); + + protected const string outputKeyName = "output"; + + public string GetOutput() + { + foreach (var input in inputs) + { + foreach (var entry in input.Value) + { + if (entry.Key == outputKeyName) + { + return entry.Value; + } + } + } + + return null; + } + + public override bool Equals(object obj) + { + if (obj is SteamVR_Input_BindingFile_Source) + { + SteamVR_Input_BindingFile_Source pose = (SteamVR_Input_BindingFile_Source)obj; + if (pose.mode == this.mode && pose.path == this.path) + { + bool parametersEqual = false; + if (parameters != null && pose.parameters != null) + { + if (this.parameters.Equals(pose.parameters)) + parametersEqual = true; + } + else if (parameters == null && pose.parameters == null) + parametersEqual = true; + + if (parametersEqual) + { + bool inputsEqual = false; + if (inputs != null && pose.inputs != null) + { + if (this.inputs.Equals(pose.inputs)) + inputsEqual = true; + } + else if (inputs == null && pose.inputs == null) + inputsEqual = true; + + return inputsEqual; + } + } + + return false; + } + + return base.Equals(obj); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + } + + [System.Serializable] + public class SteamVR_Input_BindingFile_Source_Input : Dictionary + { + public override bool Equals(object obj) + { + if (obj is SteamVR_Input_BindingFile_Source_Input) + { + SteamVR_Input_BindingFile_Source_Input sourceInput = (SteamVR_Input_BindingFile_Source_Input)obj; + + if (this == sourceInput) + return true; + else + { + if (this.Count == sourceInput.Count) + { + foreach (var element in this) + { + if (sourceInput.ContainsKey(element.Key) == false) + return false; + if (this[element.Key].Equals(sourceInput[element.Key]) == false) + return false; + } + return true; + } + } + } + + return base.Equals(obj); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + } + + [System.Serializable] + public class SteamVR_Input_BindingFile_Source_Input_StringDictionary : Dictionary + { + public override bool Equals(object obj) + { + if (obj is SteamVR_Input_BindingFile_Source_Input_StringDictionary) + { + SteamVR_Input_BindingFile_Source_Input_StringDictionary stringDictionary = (SteamVR_Input_BindingFile_Source_Input_StringDictionary)obj; + + if (this == stringDictionary) + return true; + + return (this.Count == stringDictionary.Count && !this.Except(stringDictionary).Any()); + } + + return base.Equals(obj); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + } +} \ No newline at end of file diff --git a/Assets/SteamVR/Input/SteamVR_Input_BindingFile.cs.meta b/Assets/SteamVR/Input/SteamVR_Input_BindingFile.cs.meta new file mode 100644 index 00000000..9c1af0e1 --- /dev/null +++ b/Assets/SteamVR/Input/SteamVR_Input_BindingFile.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7a2acf5cecdd8444c97bc579ba230dde +timeCreated: 1544852188 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Input_Generator_Names.cs b/Assets/SteamVR/Input/SteamVR_Input_Generator_Names.cs index cf9ac748..dec025d0 100644 --- a/Assets/SteamVR/Input/SteamVR_Input_Generator_Names.cs +++ b/Assets/SteamVR/Input/SteamVR_Input_Generator_Names.cs @@ -5,15 +5,10 @@ namespace Valve.VR { public class SteamVR_Input_Generator_Names { - public const string initializeActionSetsMethodName = "Dynamic_InitializeActionSets"; - public const string initializeActionsMethodName = "Dynamic_InitializeActions"; - public const string updateActionsMethodName = "Dynamic_UpdateActions"; - public const string updateNonPoseNonSkeletonActionsMethodName = "Dynamic_UpdateNonPoseNonSkeletonActions"; - public const string updatePoseActionsMethodName = "Dynamic_UpdatePoseActions"; - public const string updateSkeletonActionsMethodName = "Dynamic_UpdateSkeletalActions"; + public const string fullActionsClassName = "Valve.VR.SteamVR_Actions"; + public const string actionsClassName = "SteamVR_Actions"; - public const string initializeInstanceActionsMethodName = "Dynamic_InitializeInstanceActions"; - public const string initializeInstanceActionSetsMethodName = "Dynamic_InitializeInstanceActionSets"; + public const string preinitializeMethodName = "PreInitialize"; public const string actionsFieldName = "actions"; public const string actionsInFieldName = "actionsIn"; diff --git a/Assets/SteamVR/Input/SteamVR_Input_Generator_Names.cs.meta b/Assets/SteamVR/Input/SteamVR_Input_Generator_Names.cs.meta index 1719db16..b5f26848 100644 --- a/Assets/SteamVR/Input/SteamVR_Input_Generator_Names.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_Input_Generator_Names.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 1178c003dbad4854a932b7bc84000ed5 -timeCreated: 1532647071 +timeCreated: 1544852188 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Input_References.cs b/Assets/SteamVR/Input/SteamVR_Input_References.cs index 67f983c5..d4cb7583 100644 --- a/Assets/SteamVR/Input/SteamVR_Input_References.cs +++ b/Assets/SteamVR/Input/SteamVR_Input_References.cs @@ -1,66 +1 @@ -//======= Copyright (c) Valve Corporation, All rights reserved. =============== - -using UnityEngine; -using System.Collections; -using System; - -namespace Valve.VR -{ - public class SteamVR_Input_References : ScriptableObject - { - [NonSerialized] - private static SteamVR_Input_References _instance; - public static SteamVR_Input_References instance - { - get - { - if (_instance == null) - { - _instance = Resources.Load("SteamVR_Input_References"); - -#if UNITY_EDITOR - if (_instance == null) - { - _instance = ScriptableObject.CreateInstance(); - - string folderPath = SteamVR_Input.GetResourcesFolderPath(true); - string assetPath = System.IO.Path.Combine(folderPath, "SteamVR_Input_References.asset"); - - UnityEditor.AssetDatabase.CreateAsset(_instance, assetPath); - UnityEditor.AssetDatabase.SaveAssets(); - } -#endif - } - - return _instance; - } - } - - public string[] actionSetNames; - public SteamVR_ActionSet[] actionSetObjects; - - public string[] actionNames; - public SteamVR_Action[] actionObjects; - - public static SteamVR_Action GetAction(string name) - { - for (int nameIndex = 0; nameIndex < instance.actionNames.Length; nameIndex++) - { - if (string.Equals(instance.actionNames[nameIndex], name, System.StringComparison.CurrentCultureIgnoreCase)) - return instance.actionObjects[nameIndex]; - } - - return null; - } - - public static SteamVR_ActionSet GetActionSet(string set) - { - for (int setIndex = 0; setIndex < instance.actionSetNames.Length; setIndex++) - { - if (string.Equals(instance.actionSetNames[setIndex], set, System.StringComparison.CurrentCultureIgnoreCase)) - return instance.actionSetObjects[setIndex]; - } - return null; - } - } -} \ No newline at end of file +//removed \ No newline at end of file diff --git a/Assets/SteamVR/Input/SteamVR_Input_References.cs.meta b/Assets/SteamVR/Input/SteamVR_Input_References.cs.meta index 50a3ac20..f505e05b 100644 --- a/Assets/SteamVR/Input/SteamVR_Input_References.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_Input_References.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 4d10323487cb44348b830bc017eb40b4 -timeCreated: 1532647081 +timeCreated: 1544852188 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Input_Source.cs b/Assets/SteamVR/Input/SteamVR_Input_Source.cs index b8e54510..e1ee2d60 100644 --- a/Assets/SteamVR/Input/SteamVR_Input_Source.cs +++ b/Assets/SteamVR/Input/SteamVR_Input_Source.cs @@ -13,25 +13,38 @@ namespace Valve.VR { public static class SteamVR_Input_Source { - private static Dictionary inputSourceHandlesBySource = new Dictionary(new SteamVR_Input_Sources_Comparer()); + public static int numSources = System.Enum.GetValues(typeof(SteamVR_Input_Sources)).Length; + + private static ulong[] inputSourceHandlesBySource; private static Dictionary inputSourceSourcesByHandle = new Dictionary(); private static Type enumType = typeof(SteamVR_Input_Sources); private static Type descriptionType = typeof(DescriptionAttribute); - private static SteamVR_Input_Sources[] updateSources = new SteamVR_Input_Sources[] { SteamVR_Input_Sources.LeftHand, SteamVR_Input_Sources.RightHand, SteamVR_Input_Sources.Any }; + private static SteamVR_Input_Sources[] allSources; public static ulong GetHandle(SteamVR_Input_Sources inputSource) { - if (inputSourceHandlesBySource.ContainsKey(inputSource)) - return inputSourceHandlesBySource[inputSource]; + int index = (int)inputSource; + if (index < inputSourceHandlesBySource.Length) + return inputSourceHandlesBySource[index]; return 0; } + public static SteamVR_Input_Sources GetSource(ulong handle) + { + if (inputSourceSourcesByHandle.ContainsKey(handle)) + return inputSourceSourcesByHandle[handle]; + + return SteamVR_Input_Sources.Any; + } - public static SteamVR_Input_Sources[] GetUpdateSources() + public static SteamVR_Input_Sources[] GetAllSources() { - return updateSources; + if (allSources == null) + allSources = (SteamVR_Input_Sources[])System.Enum.GetValues(typeof(SteamVR_Input_Sources)); + + return allSources; } private static string GetPath(string inputSourceEnumName) @@ -41,8 +54,9 @@ private static string GetPath(string inputSourceEnumName) public static void Initialize() { + List allSourcesList = new List(); string[] enumNames = System.Enum.GetNames(enumType); - inputSourceHandlesBySource = new Dictionary(new SteamVR_Input_Sources_Comparer()); + inputSourceHandlesBySource = new ulong[enumNames.Length]; inputSourceSourcesByHandle = new Dictionary(); for (int enumIndex = 0; enumIndex < enumNames.Length; enumIndex++) @@ -53,19 +67,23 @@ public static void Initialize() EVRInputError err = OpenVR.Input.GetInputSourceHandle(path, ref handle); if (err != EVRInputError.None) - Debug.LogError("GetInputSourceHandle (" + path + ") error: " + err.ToString()); + Debug.LogError("[SteamVR] GetInputSourceHandle (" + path + ") error: " + err.ToString()); if (enumNames[enumIndex] == SteamVR_Input_Sources.Any.ToString()) //todo: temporary hack { - inputSourceHandlesBySource.Add((SteamVR_Input_Sources)enumIndex, 0); + inputSourceHandlesBySource[enumIndex] = 0; inputSourceSourcesByHandle.Add(0, (SteamVR_Input_Sources)enumIndex); } else { - inputSourceHandlesBySource.Add((SteamVR_Input_Sources)enumIndex, handle); + inputSourceHandlesBySource[enumIndex] = handle; inputSourceSourcesByHandle.Add(handle, (SteamVR_Input_Sources)enumIndex); } + + allSourcesList.Add((SteamVR_Input_Sources)enumIndex); } + + allSources = allSourcesList.ToArray(); } } } \ No newline at end of file diff --git a/Assets/SteamVR/Input/SteamVR_Input_Source.cs.meta b/Assets/SteamVR/Input/SteamVR_Input_Source.cs.meta index a5738b3f..43fa6e87 100644 --- a/Assets/SteamVR/Input/SteamVR_Input_Source.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_Input_Source.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: edb9f777bb43d4d4e800dd8a82ba523c -timeCreated: 1532647090 +timeCreated: 1544852188 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Input_Sources.cs b/Assets/SteamVR/Input/SteamVR_Input_Sources.cs index e48e3c54..8b61fd88 100644 --- a/Assets/SteamVR/Input/SteamVR_Input_Sources.cs +++ b/Assets/SteamVR/Input/SteamVR_Input_Sources.cs @@ -10,7 +10,7 @@ namespace Valve.VR { public enum SteamVR_Input_Sources { - [Description("/unrestricted")] //todo: check to see if this gets exported: k_ulInvalidInputHandle + [Description("/unrestricted")] //todo: check to see if this gets exported: k_ulInvalidInputHandle Any, [Description("/user/hand/left")] @@ -18,5 +18,43 @@ public enum SteamVR_Input_Sources [Description("/user/hand/right")] RightHand, + + [Description("/user/foot/left")] + LeftFoot, + + [Description("/user/foot/right")] + RightFoot, + + [Description("/user/shoulder/left")] + LeftShoulder, + + [Description("/user/shoulder/right")] + RightShoulder, + + [Description("/user/waist")] + Waist, + + [Description("/user/chest")] + Chest, + + [Description("/user/head")] + Head, + + [Description("/user/gamepad")] + Gamepad, + + [Description("/user/camera")] + Camera, + + [Description("/user/keyboard")] + Keyboard, + + [Description("/user/treadmill")] + Treadmill, } +} + +namespace Valve.VR.InputSources +{ + using Sources = SteamVR_Input_Sources; } \ No newline at end of file diff --git a/Assets/SteamVR/Input/SteamVR_Input_Sources.cs.meta b/Assets/SteamVR/Input/SteamVR_Input_Sources.cs.meta index f296bb34..50ccef7f 100644 --- a/Assets/SteamVR/Input/SteamVR_Input_Sources.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_Input_Sources.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: c2cbd60e2aad2b7468204d5a69489739 -timeCreated: 1532647098 +timeCreated: 1544852188 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Skeleton_Pose.cs b/Assets/SteamVR/Input/SteamVR_Skeleton_Pose.cs new file mode 100644 index 00000000..b3c75701 --- /dev/null +++ b/Assets/SteamVR/Input/SteamVR_Skeleton_Pose.cs @@ -0,0 +1,145 @@ +//======= Copyright (c) Valve Corporation, All rights reserved. =============== + +using System; +using System.Collections; +using UnityEngine; +using Valve.VR; + +using System.Linq; + +namespace Valve.VR +{ + public class SteamVR_Skeleton_Pose : ScriptableObject + { + public SteamVR_Skeleton_Pose_Hand leftHand = new SteamVR_Skeleton_Pose_Hand(SteamVR_Input_Sources.LeftHand); + public SteamVR_Skeleton_Pose_Hand rightHand = new SteamVR_Skeleton_Pose_Hand(SteamVR_Input_Sources.RightHand); + + protected const int leftHandInputSource = (int)SteamVR_Input_Sources.LeftHand; + protected const int rightHandInputSource = (int)SteamVR_Input_Sources.RightHand; + + public bool applyToSkeletonRoot = true; + + public SteamVR_Skeleton_Pose_Hand GetHand(int hand) + { + if (hand == leftHandInputSource) + return leftHand; + else if (hand == rightHandInputSource) + return rightHand; + return null; + } + + public SteamVR_Skeleton_Pose_Hand GetHand(SteamVR_Input_Sources hand) + { + if (hand == SteamVR_Input_Sources.LeftHand) + return leftHand; + else if (hand == SteamVR_Input_Sources.RightHand) + return rightHand; + return null; + } + } + + [Serializable] + public class SteamVR_Skeleton_Pose_Hand + { + public SteamVR_Input_Sources inputSource; + + public SteamVR_Skeleton_FingerExtensionTypes thumbFingerMovementType = SteamVR_Skeleton_FingerExtensionTypes.Static; + public SteamVR_Skeleton_FingerExtensionTypes indexFingerMovementType = SteamVR_Skeleton_FingerExtensionTypes.Static; + public SteamVR_Skeleton_FingerExtensionTypes middleFingerMovementType = SteamVR_Skeleton_FingerExtensionTypes.Static; + public SteamVR_Skeleton_FingerExtensionTypes ringFingerMovementType = SteamVR_Skeleton_FingerExtensionTypes.Static; + public SteamVR_Skeleton_FingerExtensionTypes pinkyFingerMovementType = SteamVR_Skeleton_FingerExtensionTypes.Static; + + /// + /// Get extension type for a particular finger. Thumb is 0, Index is 1, etc. + /// + public SteamVR_Skeleton_FingerExtensionTypes GetFingerExtensionType(int finger) + { + if (finger == 0) + return thumbFingerMovementType; + if (finger == 1) + return indexFingerMovementType; + if (finger == 2) + return middleFingerMovementType; + if (finger == 3) + return ringFingerMovementType; + if (finger == 4) + return pinkyFingerMovementType; + + //default to static + Debug.LogWarning("Finger not in range!"); + return SteamVR_Skeleton_FingerExtensionTypes.Static; + } + + public bool ignoreRootPoseData = true; + public bool ignoreWristPoseData = true; + + public Vector3 position; + public Quaternion rotation; + + public Vector3[] bonePositions; + public Quaternion[] boneRotations; + + public SteamVR_Skeleton_Pose_Hand(SteamVR_Input_Sources source) + { + inputSource = source; + } + + public SteamVR_Skeleton_FingerExtensionTypes GetMovementTypeForBone(int boneIndex) + { + int fingerIndex = SteamVR_Skeleton_JointIndexes.GetFingerForBone(boneIndex); + + switch (fingerIndex) + { + case SteamVR_Skeleton_FingerIndexes.thumb: + return thumbFingerMovementType; + + case SteamVR_Skeleton_FingerIndexes.index: + return indexFingerMovementType; + + case SteamVR_Skeleton_FingerIndexes.middle: + return middleFingerMovementType; + + case SteamVR_Skeleton_FingerIndexes.ring: + return ringFingerMovementType; + + case SteamVR_Skeleton_FingerIndexes.pinky: + return pinkyFingerMovementType; + } + + return SteamVR_Skeleton_FingerExtensionTypes.Static; + } + } + + public enum SteamVR_Skeleton_FingerExtensionTypes + { + Static, + Free, + Extend, + Contract, + } + + public class SteamVR_Skeleton_FingerExtensionTypeLists + { + private SteamVR_Skeleton_FingerExtensionTypes[] _enumList; + public SteamVR_Skeleton_FingerExtensionTypes[] enumList + { + get + { + if (_enumList == null) + _enumList = (SteamVR_Skeleton_FingerExtensionTypes[])System.Enum.GetValues(typeof(SteamVR_Skeleton_FingerExtensionTypes)); + return _enumList; + } + } + + private string[] _stringList; + public string[] stringList + { + get + { + if (_stringList == null) + _stringList = enumList.Select(element => element.ToString()).ToArray(); + return _stringList; + } + } + } +} \ No newline at end of file diff --git a/Assets/SteamVR/Input/SteamVR_Action_List.cs.meta b/Assets/SteamVR/Input/SteamVR_Skeleton_Pose.cs.meta similarity index 57% rename from Assets/SteamVR/Input/SteamVR_Action_List.cs.meta rename to Assets/SteamVR/Input/SteamVR_Skeleton_Pose.cs.meta index 10c2726c..cdf06a49 100644 --- a/Assets/SteamVR/Input/SteamVR_Action_List.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_Skeleton_Pose.cs.meta @@ -1,12 +1,12 @@ -fileFormatVersion: 2 -guid: 86edd40d8c2935046b45a127f88a61b5 -timeCreated: 1532646859 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: e90911e410742a1498a167540c7865bf +timeCreated: 1547854805 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 45bc2e588f0a52e42a36572e1181cadf, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_Skeleton_Poser.cs b/Assets/SteamVR/Input/SteamVR_Skeleton_Poser.cs new file mode 100644 index 00000000..16675551 --- /dev/null +++ b/Assets/SteamVR/Input/SteamVR_Skeleton_Poser.cs @@ -0,0 +1,564 @@ +//======= Copyright (c) Valve Corporation, All rights reserved. =============== + +using System; +using System.Collections; +using UnityEngine; +using Valve.VR; +using System.Collections.Generic; +using System.Linq; + +namespace Valve.VR +{ + public class SteamVR_Skeleton_Poser : MonoBehaviour + { + #region Editor Storage + public bool poseEditorExpanded = true; + public bool blendEditorExpanded = true; + public string[] poseNames; + #endregion + + public GameObject overridePreviewLeftHandPrefab; + public GameObject overridePreviewRightHandPrefab; + + public SteamVR_Skeleton_Pose skeletonMainPose; + public List skeletonAdditionalPoses = new List(); + + [SerializeField] + protected bool showLeftPreview = false; + + [SerializeField] + protected bool showRightPreview = true; //show the right hand by default + + [SerializeField] + protected GameObject previewLeftInstance; + + [SerializeField] + protected GameObject previewRightInstance; + + [SerializeField] + protected int previewPoseSelection = 0; + + public int blendPoseCount { get { return blendPoses.Length; } } + + public List blendingBehaviours = new List(); + + public SteamVR_Skeleton_PoseSnapshot blendedSnapshotL; + public SteamVR_Skeleton_PoseSnapshot blendedSnapshotR; + + private SkeletonBlendablePose[] blendPoses; + + private int boneCount; + + private bool poseUpdatedThisFrame; + + public float scale; + + + protected void Awake() + { + if (previewLeftInstance != null) + DestroyImmediate(previewLeftInstance); + if (previewRightInstance != null) + DestroyImmediate(previewRightInstance); + + blendPoses = new SkeletonBlendablePose[skeletonAdditionalPoses.Count + 1]; + for (int i = 0; i < blendPoseCount; i++) + { + blendPoses[i] = new SkeletonBlendablePose(GetPoseByIndex(i)); + blendPoses[i].PoseToSnapshots(); + } + + boneCount = skeletonMainPose.leftHand.bonePositions.Length; + // NOTE: Is there a better way to get the bone count? idk + blendedSnapshotL = new SteamVR_Skeleton_PoseSnapshot(boneCount, SteamVR_Input_Sources.LeftHand); + blendedSnapshotR = new SteamVR_Skeleton_PoseSnapshot(boneCount, SteamVR_Input_Sources.RightHand); + } + + + + /// + /// Set the blending value of a blendingBehaviour. Works best on Manual type behaviours. + /// + public void SetBlendingBehaviourValue(string behaviourName, float value) + { + PoseBlendingBehaviour behaviour = FindBlendingBehaviour(behaviourName); + if (behaviour != null) + { + behaviour.value = value; + + if (behaviour.type != PoseBlendingBehaviour.BlenderTypes.Manual) + { + Debug.LogWarning("[SteamVR] Blending Behaviour: " + behaviourName + " is not a manual behaviour. Its value will likely be overriden.", this); + } + } + } + /// + /// Get the blending value of a blendingBehaviour. + /// + public float GetBlendingBehaviourValue(string behaviourName) + { + PoseBlendingBehaviour behaviour = FindBlendingBehaviour(behaviourName); + if (behaviour != null) + { + return behaviour.value; + } + return 0; + } + + /// + /// Enable or disable a blending behaviour. + /// + public void SetBlendingBehaviourEnabled(string behaviourName, bool value) + { + PoseBlendingBehaviour behaviour = FindBlendingBehaviour(behaviourName); + if (behaviour != null) + { + behaviour.enabled = value; + } + } + /// + /// Check if a blending behaviour is enabled. + /// + /// + /// + public bool GetBlendingBehaviourEnabled(string behaviourName) + { + PoseBlendingBehaviour behaviour = FindBlendingBehaviour(behaviourName); + if (behaviour != null) + { + return behaviour.enabled; + } + + return false; + } + /// + /// Get a blending behaviour by name. + /// + public PoseBlendingBehaviour GetBlendingBehaviour(string behaviourName) + { + return FindBlendingBehaviour(behaviourName); + } + + protected PoseBlendingBehaviour FindBlendingBehaviour(string behaviourName, bool throwErrors = true) + { + PoseBlendingBehaviour behaviour = blendingBehaviours.Find(b => b.name == behaviourName); + + if (behaviour == null) + { + if (throwErrors) + Debug.LogError("[SteamVR] Blending Behaviour: " + behaviourName + " not found on Skeleton Poser: " + gameObject.name, this); + + return null; + } + + return behaviour; + } + + + public SteamVR_Skeleton_Pose GetPoseByIndex(int index) + { + if (index == 0) { return skeletonMainPose; } + else { return skeletonAdditionalPoses[index - 1]; } + } + + private SteamVR_Skeleton_PoseSnapshot GetHandSnapshot(SteamVR_Input_Sources inputSource) + { + if (inputSource == SteamVR_Input_Sources.LeftHand) + return blendedSnapshotL; + else + return blendedSnapshotR; + } + + /// + /// Retrieve the final animated pose, to be applied to a hand skeleton + /// + /// The skeleton action you want to blend between + /// If this is for the left or right hand + public SteamVR_Skeleton_PoseSnapshot GetBlendedPose(SteamVR_Action_Skeleton skeletonAction, SteamVR_Input_Sources handType) + { + UpdatePose(skeletonAction, handType); + return GetHandSnapshot(handType); + } + + /// + /// Retrieve the final animated pose, to be applied to a hand skeleton + /// + /// The skeleton behaviour you want to get the action/input source from to blend between + public SteamVR_Skeleton_PoseSnapshot GetBlendedPose(SteamVR_Behaviour_Skeleton skeletonBehaviour) + { + return GetBlendedPose(skeletonBehaviour.skeletonAction, skeletonBehaviour.inputSource); + } + + + /// + /// Updates all pose animation and blending. Can be called from different places without performance concerns, as it will only let itself run once per frame. + /// + public void UpdatePose(SteamVR_Action_Skeleton skeletonAction, SteamVR_Input_Sources inputSource) + { + // only allow this function to run once per frame + if (poseUpdatedThisFrame) return; + + poseUpdatedThisFrame = true; + + if (skeletonAction.activeBinding) + { + // always do additive animation on main pose + blendPoses[0].UpdateAdditiveAnimation(skeletonAction, inputSource); + } + + //copy from main pose as a base + SteamVR_Skeleton_PoseSnapshot snap = GetHandSnapshot(inputSource); + snap.CopyFrom(blendPoses[0].GetHandSnapshot(inputSource)); + + ApplyBlenderBehaviours(skeletonAction, inputSource, snap); + + + if (inputSource == SteamVR_Input_Sources.RightHand) + blendedSnapshotR = snap; + if (inputSource == SteamVR_Input_Sources.LeftHand) + blendedSnapshotL = snap; + } + + protected void ApplyBlenderBehaviours(SteamVR_Action_Skeleton skeletonAction, SteamVR_Input_Sources inputSource, SteamVR_Skeleton_PoseSnapshot snapshot) + { + + // apply blending for each behaviour + for (int behaviourIndex = 0; behaviourIndex < blendingBehaviours.Count; behaviourIndex++) + { + blendingBehaviours[behaviourIndex].Update(Time.deltaTime, inputSource); + // if disabled or very low influence, skip for perf + if (blendingBehaviours[behaviourIndex].enabled && blendingBehaviours[behaviourIndex].influence * blendingBehaviours[behaviourIndex].value > 0.01f) + { + if (blendingBehaviours[behaviourIndex].pose != 0 && skeletonAction.activeBinding) + { + // update additive animation only as needed + blendPoses[blendingBehaviours[behaviourIndex].pose].UpdateAdditiveAnimation(skeletonAction, inputSource); + } + + blendingBehaviours[behaviourIndex].ApplyBlending(snapshot, blendPoses, inputSource); + } + } + + } + + protected void LateUpdate() + { + // let the pose be updated again the next frame + poseUpdatedThisFrame = false; + } + + /// Weighted average of n vector3s + protected Vector3 BlendVectors(Vector3[] vectors, float[] weights) + { + Vector3 blendedVector = Vector3.zero; + for (int i = 0; i < vectors.Length; i++) + { + blendedVector += vectors[i] * weights[i]; + } + return blendedVector; + } + + /// Weighted average of n quaternions + protected Quaternion BlendQuaternions(Quaternion[] quaternions, float[] weights) + { + Quaternion outquat = Quaternion.identity; + for (int i = 0; i < quaternions.Length; i++) + { + outquat *= Quaternion.Slerp(Quaternion.identity, quaternions[i], weights[i]); + } + return outquat; + } + + /// + /// A SkeletonBlendablePose holds a reference to a Skeleton_Pose scriptableObject, and also contains some helper functions. + /// Also handles pose-specific animation like additive finger motion. + /// + public class SkeletonBlendablePose + { + public SteamVR_Skeleton_Pose pose; + public SteamVR_Skeleton_PoseSnapshot snapshotR; + public SteamVR_Skeleton_PoseSnapshot snapshotL; + + /// + /// Get the snapshot of this pose with effects such as additive finger animation applied. + /// + public SteamVR_Skeleton_PoseSnapshot GetHandSnapshot(SteamVR_Input_Sources inputSource) + { + if (inputSource == SteamVR_Input_Sources.LeftHand) + { + return snapshotL; + } + else + { + return snapshotR; + } + } + + public void UpdateAdditiveAnimation(SteamVR_Action_Skeleton skeletonAction, SteamVR_Input_Sources inputSource) + { + if (skeletonAction.GetSkeletalTrackingLevel() == EVRSkeletalTrackingLevel.VRSkeletalTracking_Estimated) + { + //do not apply additive animation on low fidelity controllers, eg. Vive Wands and Touch + return; + } + + SteamVR_Skeleton_PoseSnapshot snapshot = GetHandSnapshot(inputSource); + SteamVR_Skeleton_Pose_Hand poseHand = pose.GetHand(inputSource); + + for (int boneIndex = 0; boneIndex < snapshotL.bonePositions.Length; boneIndex++) + { + int fingerIndex = SteamVR_Skeleton_JointIndexes.GetFingerForBone(boneIndex); + SteamVR_Skeleton_FingerExtensionTypes extensionType = poseHand.GetMovementTypeForBone(boneIndex); + + if (extensionType == SteamVR_Skeleton_FingerExtensionTypes.Free) + { + snapshot.bonePositions[boneIndex] = skeletonAction.bonePositions[boneIndex]; + snapshot.boneRotations[boneIndex] = skeletonAction.boneRotations[boneIndex]; + } + if (extensionType == SteamVR_Skeleton_FingerExtensionTypes.Extend) + { + // lerp to open pose by fingercurl + snapshot.bonePositions[boneIndex] = Vector3.Lerp(poseHand.bonePositions[boneIndex], skeletonAction.bonePositions[boneIndex], 1 - skeletonAction.fingerCurls[fingerIndex]); + snapshot.boneRotations[boneIndex] = Quaternion.Lerp(poseHand.boneRotations[boneIndex], skeletonAction.boneRotations[boneIndex], 1 - skeletonAction.fingerCurls[fingerIndex]); + } + if (extensionType == SteamVR_Skeleton_FingerExtensionTypes.Contract) + { + // lerp to closed pose by fingercurl + snapshot.bonePositions[boneIndex] = Vector3.Lerp(poseHand.bonePositions[boneIndex], skeletonAction.bonePositions[boneIndex], skeletonAction.fingerCurls[fingerIndex]); + snapshot.boneRotations[boneIndex] = Quaternion.Lerp(poseHand.boneRotations[boneIndex], skeletonAction.boneRotations[boneIndex], skeletonAction.fingerCurls[fingerIndex]); + } + } + } + + /// + /// Init based on an existing Skeleton_Pose + /// + public SkeletonBlendablePose(SteamVR_Skeleton_Pose p) + { + pose = p; + snapshotR = new SteamVR_Skeleton_PoseSnapshot(p.rightHand.bonePositions.Length, SteamVR_Input_Sources.RightHand); + snapshotL = new SteamVR_Skeleton_PoseSnapshot(p.leftHand.bonePositions.Length, SteamVR_Input_Sources.LeftHand); + } + + /// + /// Copy the base pose into the snapshots. + /// + public void PoseToSnapshots() + { + snapshotR.position = pose.rightHand.position; + snapshotR.rotation = pose.rightHand.rotation; + pose.rightHand.bonePositions.CopyTo(snapshotR.bonePositions, 0); + pose.rightHand.boneRotations.CopyTo(snapshotR.boneRotations, 0); + + snapshotL.position = pose.leftHand.position; + snapshotL.rotation = pose.leftHand.rotation; + pose.leftHand.bonePositions.CopyTo(snapshotL.bonePositions, 0); + pose.leftHand.boneRotations.CopyTo(snapshotL.boneRotations, 0); + } + + public SkeletonBlendablePose() { } + } + + /// + /// A filter applied to the base pose. Blends to a secondary pose by a certain weight. Can be masked per-finger + /// + [System.Serializable] + public class PoseBlendingBehaviour + { + public string name; + public bool enabled = true; + public float influence = 1; + public int pose = 1; + public float value = 0; + public SteamVR_Action_Single action_single; + public SteamVR_Action_Boolean action_bool; + public float smoothingSpeed = 0; + public BlenderTypes type; + public bool useMask; + public SteamVR_Skeleton_HandMask mask = new SteamVR_Skeleton_HandMask(); + + public bool previewEnabled; + + /// + /// Performs smoothing based on deltaTime parameter. + /// + public void Update(float deltaTime, SteamVR_Input_Sources inputSource) + { + if (type == BlenderTypes.AnalogAction) + { + if (smoothingSpeed == 0) + value = action_single.GetAxis(inputSource); + else + value = Mathf.Lerp(value, action_single.GetAxis(inputSource), deltaTime * smoothingSpeed); + } + if (type == BlenderTypes.BooleanAction) + { + if (smoothingSpeed == 0) + value = action_bool.GetState(inputSource) ? 1 : 0; + else + value = Mathf.Lerp(value, action_bool.GetState(inputSource) ? 1 : 0, deltaTime * smoothingSpeed); + } + } + + /// + /// Apply blending to this behaviour's pose to an existing snapshot. + /// + /// Snapshot to modify + /// List of blend poses to get the target pose + /// Which hand to receive input from + public void ApplyBlending(SteamVR_Skeleton_PoseSnapshot snapshot, SkeletonBlendablePose[] blendPoses, SteamVR_Input_Sources inputSource) + { + SteamVR_Skeleton_PoseSnapshot targetSnapshot = blendPoses[pose].GetHandSnapshot(inputSource); + if (mask.GetFinger(0) || useMask == false) + { + snapshot.position = Vector3.Lerp(snapshot.position, targetSnapshot.position, influence * value); + snapshot.rotation = Quaternion.Slerp(snapshot.rotation, targetSnapshot.rotation, influence * value); + } + + for (int boneIndex = 0; boneIndex < snapshot.bonePositions.Length; boneIndex++) + { + // verify the current finger is enabled in the mask, or if no mask is used. + if (mask.GetFinger(SteamVR_Skeleton_JointIndexes.GetFingerForBone(boneIndex) + 1) || useMask == false) + { + snapshot.bonePositions[boneIndex] = Vector3.Lerp(snapshot.bonePositions[boneIndex], targetSnapshot.bonePositions[boneIndex], influence * value); + snapshot.boneRotations[boneIndex] = Quaternion.Slerp(snapshot.boneRotations[boneIndex], targetSnapshot.boneRotations[boneIndex], influence * value); + } + } + } + + public PoseBlendingBehaviour() + { + enabled = true; + influence = 1; + } + + public enum BlenderTypes + { + Manual, AnalogAction, BooleanAction + } + } + + + //this is broken + public Vector3 GetTargetHandPosition(SteamVR_Behaviour_Skeleton hand, Transform origin) + { + Vector3 oldOrigin = origin.position; + Quaternion oldHand = hand.transform.rotation; + hand.transform.rotation = GetBlendedPose(hand).rotation; + origin.position = hand.transform.TransformPoint(GetBlendedPose(hand).position); + Vector3 offset = origin.InverseTransformPoint(hand.transform.position); + origin.position = oldOrigin; + hand.transform.rotation = oldHand; + return origin.TransformPoint(offset); + } + + public Quaternion GetTargetHandRotation(SteamVR_Behaviour_Skeleton hand, Transform origin) + { + Quaternion oldOrigin = origin.rotation; + origin.rotation = hand.transform.rotation * GetBlendedPose(hand).rotation; + Quaternion offsetRot = Quaternion.Inverse(origin.rotation) * hand.transform.rotation; + origin.rotation = oldOrigin; + return origin.rotation * offsetRot; + } + } + + /// + /// PoseSnapshots hold a skeleton pose for one hand, as well as storing which hand they contain. + /// They have several functions for combining BlendablePoses. + /// + public class SteamVR_Skeleton_PoseSnapshot + { + public SteamVR_Input_Sources inputSource; + + public Vector3 position; + public Quaternion rotation; + + public Vector3[] bonePositions; + public Quaternion[] boneRotations; + + public SteamVR_Skeleton_PoseSnapshot(int boneCount, SteamVR_Input_Sources source) + { + inputSource = source; + bonePositions = new Vector3[boneCount]; + boneRotations = new Quaternion[boneCount]; + position = Vector3.zero; + rotation = Quaternion.identity; + } + + /// + /// Perform a deep copy from one poseSnapshot to another. + /// + public void CopyFrom(SteamVR_Skeleton_PoseSnapshot source) + { + inputSource = source.inputSource; + position = source.position; + rotation = source.rotation; + for (int i = 0; i < bonePositions.Length; i++) + { + bonePositions[i] = source.bonePositions[i]; + boneRotations[i] = source.boneRotations[i]; + } + } + + + } + + + /// + /// Simple mask for fingers + /// + [System.Serializable] + public class SteamVR_Skeleton_HandMask + { + public bool palm; + public bool thumb; + public bool index; + public bool middle; + public bool ring; + public bool pinky; + public bool[] values = new bool[6]; + + public void SetFinger(int i, bool value) + { + values[i] = value; + Apply(); + } + + public bool GetFinger(int i) + { + return values[i]; + } + + public SteamVR_Skeleton_HandMask() + { + values = new bool[6]; + Reset(); + } + + /// + /// All elements on + /// + public void Reset() + { + values = new bool[6]; + for (int i = 0; i < 6; i++) + { + values[i] = true; + } + Apply(); + } + + protected void Apply() + { + palm = values[0]; + thumb = values[1]; + index = values[2]; + middle = values[3]; + ring = values[4]; + pinky = values[5]; + } + + public static readonly SteamVR_Skeleton_HandMask fullMask = new SteamVR_Skeleton_HandMask(); + }; + +} diff --git a/Assets/SteamVR/Input/SteamVR_Skeleton_Poser.cs.meta b/Assets/SteamVR/Input/SteamVR_Skeleton_Poser.cs.meta new file mode 100644 index 00000000..c519527d --- /dev/null +++ b/Assets/SteamVR/Input/SteamVR_Skeleton_Poser.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e7418c7dd8f977d4e969202d3fa7e926 +timeCreated: 1542680608 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/SteamVR/Input/SteamVR_UpdateModes.cs.meta b/Assets/SteamVR/Input/SteamVR_UpdateModes.cs.meta index 0135c3e7..c38684bb 100644 --- a/Assets/SteamVR/Input/SteamVR_UpdateModes.cs.meta +++ b/Assets/SteamVR/Input/SteamVR_UpdateModes.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 5811a8be2382cd440970c707dccb6fb0 -timeCreated: 1532647117 +timeCreated: 1544852190 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 200a36575873a1d40baa790e18dafe5d, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Prefabs/HandColliderLeft.prefab b/Assets/SteamVR/InteractionSystem/Core/Prefabs/HandColliderLeft.prefab new file mode 100644 index 00000000..e73f98ec --- /dev/null +++ b/Assets/SteamVR/InteractionSystem/Core/Prefabs/HandColliderLeft.prefab @@ -0,0 +1,811 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1000013588331694} + m_IsPrefabParent: 1 +--- !u!1 &1000010324375676 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012765033070} + - 135: {fileID: 135000014125725866} + m_Layer: 8 + m_Name: finger_ring_2_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010943680784 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012962541566} + - 135: {fileID: 135000013343303422} + m_Layer: 8 + m_Name: finger_index_1_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011220539174 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010748827216} + - 135: {fileID: 135000010226986612} + m_Layer: 8 + m_Name: finger_index_2_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011237366522 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012995160158} + - 135: {fileID: 135000012534657806} + m_Layer: 8 + m_Name: finger_middle_2_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011304683130 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011957011620} + - 33: {fileID: 33000013448054712} + - 135: {fileID: 135000010524601854} + m_Layer: 8 + m_Name: Sphere (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011613764148 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011912412668} + - 33: {fileID: 33000010571670074} + - 135: {fileID: 135000012858158250} + m_Layer: 8 + m_Name: Sphere (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011641533962 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000014196080978} + - 135: {fileID: 135000013103434970} + m_Layer: 8 + m_Name: finger_middle_0_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011917277578 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012050390454} + - 135: {fileID: 135000011157456608} + m_Layer: 8 + m_Name: finger_index_0_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012155149048 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010317872206} + - 135: {fileID: 135000013583319202} + m_Layer: 8 + m_Name: finger_ring_1_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012230303462 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013385037612} + - 33: {fileID: 33000012082552246} + - 135: {fileID: 135000013296820600} + m_Layer: 8 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012988446628 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011150399860} + - 135: {fileID: 135000011597655318} + m_Layer: 8 + m_Name: thumb_distal + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013123655998 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000014135373018} + m_Layer: 8 + m_Name: spheres + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013250311742 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013920263390} + - 135: {fileID: 135000010489002386} + m_Layer: 8 + m_Name: finger_pinky_2_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013415698584 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012788572454} + m_Layer: 8 + m_Name: fingers + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013484163102 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010973331830} + - 135: {fileID: 135000010580124084} + m_Layer: 8 + m_Name: finger_middle_1_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013588331694 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011495277878} + - 114: {fileID: 114000010572907066} + - 54: {fileID: 54000013135273658} + m_Layer: 8 + m_Name: HandColliderLeft + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013918884664 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010454108534} + - 33: {fileID: 33000012180426442} + - 135: {fileID: 135000010938669188} + m_Layer: 8 + m_Name: Sphere (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000014019763194 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000014174024032} + - 135: {fileID: 135000010608582948} + m_Layer: 8 + m_Name: finger_pinky_1_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000010317872206 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012155149048} + m_LocalRotation: {x: -0.3188958, y: -0.55838585, z: -0.6785767, w: 0.35502732} + m_LocalPosition: {x: -0.0023564696, y: -0.019656926, z: 0.11861026} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000012788572454} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000010454108534 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013918884664} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.0043, y: -0.0203, z: 0.0708} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000014135373018} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000010748827216 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011220539174} + m_LocalRotation: {x: -0.20955545, y: -0.7084194, z: -0.5972281, w: 0.31232548} + m_LocalPosition: {x: -0.018232882, y: 0.037278295, z: 0.14895564} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000012788572454} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000010973331830 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013484163102} + m_LocalRotation: {x: -0.31192344, y: -0.6383117, z: -0.6030951, w: 0.3626822} + m_LocalPosition: {x: 0.0054804683, y: 0.009177029, z: 0.12677181} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000012788572454} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000011150399860 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012988446628} + m_LocalRotation: {x: 0.048614353, y: -0.81958884, z: -0.045037244, w: 0.5691067} + m_LocalPosition: {x: -0.03928083, y: 0.060081184, z: 0.08449179} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000012788572454} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000011495277878 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013588331694} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.409, y: 0.513, z: 0.25419474} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4000014135373018} + - {fileID: 4000012788572454} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000011912412668 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011613764148} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.0013, y: 0.0236, z: 0.0762} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000014135373018} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000011957011620 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011304683130} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.0024, y: 0.0019, z: 0.0446} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000014135373018} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000012050390454 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011917277578} + m_LocalRotation: {x: -0.38396484, y: -0.6282792, z: -0.49698386, w: 0.45917684} + m_LocalPosition: {x: 0.011199772, y: 0.037356794, z: 0.085021585} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000012788572454} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000012765033070 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010324375676} + m_LocalRotation: {x: -0.2374145, y: -0.5950274, z: -0.7216289, w: 0.2623519} + m_LocalPosition: {x: -0.017869234, y: -0.023237675, z: 0.14223531} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000012788572454} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000012788572454 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013415698584} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: -1, y: 1, z: 1} + m_Children: + - {fileID: 4000011150399860} + - {fileID: 4000010748827216} + - {fileID: 4000012962541566} + - {fileID: 4000012050390454} + - {fileID: 4000012995160158} + - {fileID: 4000010973331830} + - {fileID: 4000014196080978} + - {fileID: 4000012765033070} + - {fileID: 4000010317872206} + - {fileID: 4000013920263390} + - {fileID: 4000014174024032} + m_Father: {fileID: 4000011495277878} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000012962541566 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010943680784} + m_LocalRotation: {x: -0.26381207, y: -0.6906685, z: -0.57137775, w: 0.35624114} + m_LocalPosition: {x: -0.0010700822, y: 0.03848529, z: 0.12651753} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000012788572454} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000012995160158 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011237366522} + m_LocalRotation: {x: -0.2211407, y: -0.6774029, z: -0.6470612, w: 0.27117145} + m_LocalPosition: {x: -0.012560666, y: 0.007871151, z: 0.1546902} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000012788572454} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000013385037612 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012230303462} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.008, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000014135373018} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000013920263390 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013250311742} + m_LocalRotation: {x: -0.34899983, y: -0.5114209, z: -0.73903054, w: 0.2654839} + m_LocalPosition: {x: -0.01600802, y: -0.045651913, z: 0.1192801} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000012788572454} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000014135373018 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013123655998} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4000013385037612} + - {fileID: 4000010454108534} + - {fileID: 4000011912412668} + - {fileID: 4000011957011620} + m_Father: {fileID: 4000011495277878} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000014174024032 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014019763194} + m_LocalRotation: {x: -0.39290822, y: -0.4674865, z: -0.70993227, w: 0.3508216} + m_LocalPosition: {x: -0.0080058575, y: -0.043300897, z: 0.10335302} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000012788572454} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000014196080978 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011641533962} + m_LocalRotation: {x: -0.41075897, y: -0.5825371, z: -0.5373983, w: 0.45070025} + m_LocalPosition: {x: 0.016528964, y: 0.009429038, z: 0.08510396} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000012788572454} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &33000010571670074 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011613764148} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33000012082552246 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012230303462} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33000012180426442 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013918884664} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33000013448054712 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011304683130} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!54 &54000013135273658 +Rigidbody: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013588331694} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &114000010572907066 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013588331694} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2820b584f2917744bafbfd2f8f387225, type: 3} + m_Name: + m_EditorClassIdentifier: + hand: {fileID: 0} + collisionMask: + serializedVersion: 2 + m_Bits: 4294967295 + fingerColliders: + thumbColliders: + - {fileID: 4000011150399860} + indexColliders: + - {fileID: 4000010748827216} + - {fileID: 4000012962541566} + - {fileID: 4000012050390454} + middleColliders: + - {fileID: 4000012995160158} + - {fileID: 4000010973331830} + - {fileID: 4000014196080978} + ringColliders: + - {fileID: 4000012765033070} + - {fileID: 4000010317872206} + pinkyColliders: + - {fileID: 4000013920263390} + - {fileID: 4000014174024032} + collidersInRadius: 0 +--- !u!135 &135000010226986612 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011220539174} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.015 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000010489002386 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013250311742} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.01 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000010524601854 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011304683130} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.035 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000010580124084 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013484163102} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.015 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000010608582948 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014019763194} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.01 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000010938669188 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013918884664} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.025 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000011157456608 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011917277578} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.02 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000011597655318 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012988446628} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.015 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000012534657806 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011237366522} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.015 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000012858158250 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011613764148} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.025 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000013103434970 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011641533962} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.02 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000013296820600 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012230303462} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.04 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000013343303422 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010943680784} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.015 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000013583319202 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012155149048} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.015 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000014125725866 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010324375676} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.015 + m_Center: {x: 0, y: 0, z: 0} diff --git a/Assets/SteamVR/InteractionSystem/Core/Prefabs/HandColliderLeft.prefab.meta b/Assets/SteamVR/InteractionSystem/Core/Prefabs/HandColliderLeft.prefab.meta new file mode 100644 index 00000000..fca479d2 --- /dev/null +++ b/Assets/SteamVR/InteractionSystem/Core/Prefabs/HandColliderLeft.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 73f816dd3537a4c44988f340a5da70b9 +timeCreated: 1567796930 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Prefabs/HandColliderRight.prefab b/Assets/SteamVR/InteractionSystem/Core/Prefabs/HandColliderRight.prefab new file mode 100644 index 00000000..d3326343 --- /dev/null +++ b/Assets/SteamVR/InteractionSystem/Core/Prefabs/HandColliderRight.prefab @@ -0,0 +1,811 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1000013185594350} + m_IsPrefabParent: 1 +--- !u!1 &1000010046261244 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011596294980} + - 135: {fileID: 135000012669751932} + m_Layer: 8 + m_Name: finger_pinky_1_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010420712118 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011705022212} + - 135: {fileID: 135000010522680132} + m_Layer: 8 + m_Name: finger_middle_0_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010837900952 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011395390148} + - 135: {fileID: 135000013433154566} + m_Layer: 8 + m_Name: finger_index_1_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011206655068 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012017003156} + - 135: {fileID: 135000011940042238} + m_Layer: 8 + m_Name: finger_ring_1_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011219925658 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011043040146} + - 135: {fileID: 135000012013325142} + m_Layer: 8 + m_Name: finger_middle_1_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011440127722 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013451019918} + - 135: {fileID: 135000010681374130} + m_Layer: 8 + m_Name: finger_index_2_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011721073886 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013405616328} + m_Layer: 8 + m_Name: spheres + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011822383670 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010091419658} + - 33: {fileID: 33000013054687840} + - 135: {fileID: 135000011041469328} + m_Layer: 8 + m_Name: Sphere (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011975710508 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011191249750} + - 33: {fileID: 33000010987832076} + - 135: {fileID: 135000014001595118} + m_Layer: 8 + m_Name: Sphere (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012435317680 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000014054176190} + - 135: {fileID: 135000014207960770} + m_Layer: 8 + m_Name: finger_ring_2_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013092618156 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013061167466} + m_Layer: 8 + m_Name: fingers + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013185594350 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010266578624} + - 114: {fileID: 114000013167804218} + - 54: {fileID: 54000012734507470} + m_Layer: 8 + m_Name: HandColliderRight + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013323899228 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013412041440} + - 135: {fileID: 135000012638609432} + m_Layer: 8 + m_Name: finger_index_0_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013360790954 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010492064308} + - 33: {fileID: 33000012723706334} + - 135: {fileID: 135000010572779464} + m_Layer: 8 + m_Name: Sphere (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013367065926 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011285245488} + - 135: {fileID: 135000014056040094} + m_Layer: 8 + m_Name: thumb_distal + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013436413486 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010872712740} + - 33: {fileID: 33000010664015700} + - 135: {fileID: 135000011391776234} + m_Layer: 8 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013478506826 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010144325770} + - 135: {fileID: 135000012638216756} + m_Layer: 8 + m_Name: finger_middle_2_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013822339020 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013046992402} + - 135: {fileID: 135000012264633464} + m_Layer: 8 + m_Name: finger_pinky_2_r + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000010091419658 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011822383670} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.0043, y: -0.0203, z: 0.0708} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000013405616328} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000010144325770 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013478506826} + m_LocalRotation: {x: -0.2211407, y: -0.6774029, z: -0.6470612, w: 0.27117145} + m_LocalPosition: {x: -0.012560666, y: 0.007871151, z: 0.1546902} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000013061167466} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000010266578624 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013185594350} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.6855494, y: 0.513, z: 0.25419474} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4000013405616328} + - {fileID: 4000013061167466} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000010492064308 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013360790954} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.0024, y: 0.0019, z: 0.0446} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000013405616328} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000010872712740 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013436413486} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.008, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000013405616328} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000011043040146 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011219925658} + m_LocalRotation: {x: -0.31192344, y: -0.6383117, z: -0.6030951, w: 0.3626822} + m_LocalPosition: {x: 0.0054804683, y: 0.009177029, z: 0.12677181} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000013061167466} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000011191249750 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011975710508} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.0013, y: 0.0236, z: 0.0762} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000013405616328} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000011285245488 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013367065926} + m_LocalRotation: {x: 0.048614353, y: -0.81958884, z: -0.045037244, w: 0.5691067} + m_LocalPosition: {x: -0.03928083, y: 0.060081184, z: 0.08449179} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000013061167466} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000011395390148 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010837900952} + m_LocalRotation: {x: -0.26381207, y: -0.6906685, z: -0.57137775, w: 0.35624114} + m_LocalPosition: {x: -0.0010700822, y: 0.03848529, z: 0.12651753} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000013061167466} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000011596294980 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010046261244} + m_LocalRotation: {x: -0.39290822, y: -0.4674865, z: -0.70993227, w: 0.3508216} + m_LocalPosition: {x: -0.0080058575, y: -0.043300897, z: 0.10335302} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000013061167466} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000011705022212 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010420712118} + m_LocalRotation: {x: -0.41075897, y: -0.5825371, z: -0.5373983, w: 0.45070025} + m_LocalPosition: {x: 0.016528964, y: 0.009429038, z: 0.08510396} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000013061167466} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000012017003156 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011206655068} + m_LocalRotation: {x: -0.3188958, y: -0.55838585, z: -0.6785767, w: 0.35502732} + m_LocalPosition: {x: -0.0023564696, y: -0.019656926, z: 0.11861026} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000013061167466} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000013046992402 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013822339020} + m_LocalRotation: {x: -0.34899983, y: -0.5114209, z: -0.73903054, w: 0.2654839} + m_LocalPosition: {x: -0.01600802, y: -0.045651913, z: 0.1192801} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000013061167466} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000013061167466 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013092618156} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4000011285245488} + - {fileID: 4000013451019918} + - {fileID: 4000011395390148} + - {fileID: 4000013412041440} + - {fileID: 4000010144325770} + - {fileID: 4000011043040146} + - {fileID: 4000011705022212} + - {fileID: 4000014054176190} + - {fileID: 4000012017003156} + - {fileID: 4000013046992402} + - {fileID: 4000011596294980} + m_Father: {fileID: 4000010266578624} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000013405616328 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011721073886} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4000010872712740} + - {fileID: 4000010091419658} + - {fileID: 4000011191249750} + - {fileID: 4000010492064308} + m_Father: {fileID: 4000010266578624} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000013412041440 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013323899228} + m_LocalRotation: {x: -0.38396484, y: -0.6282792, z: -0.49698386, w: 0.45917684} + m_LocalPosition: {x: 0.011199772, y: 0.037356794, z: 0.085021585} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000013061167466} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000013451019918 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011440127722} + m_LocalRotation: {x: -0.20955545, y: -0.7084194, z: -0.5972281, w: 0.31232548} + m_LocalPosition: {x: -0.018232882, y: 0.037278295, z: 0.14895564} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000013061167466} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000014054176190 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012435317680} + m_LocalRotation: {x: -0.2374145, y: -0.5950274, z: -0.7216289, w: 0.2623519} + m_LocalPosition: {x: -0.017869234, y: -0.023237675, z: 0.14223531} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000013061167466} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &33000010664015700 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013436413486} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33000010987832076 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011975710508} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33000012723706334 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013360790954} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33000013054687840 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011822383670} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!54 &54000012734507470 +Rigidbody: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013185594350} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &114000013167804218 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013185594350} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2820b584f2917744bafbfd2f8f387225, type: 3} + m_Name: + m_EditorClassIdentifier: + hand: {fileID: 0} + collisionMask: + serializedVersion: 2 + m_Bits: 4294967295 + fingerColliders: + thumbColliders: + - {fileID: 4000011285245488} + indexColliders: + - {fileID: 4000013451019918} + - {fileID: 4000011395390148} + - {fileID: 4000013412041440} + middleColliders: + - {fileID: 4000010144325770} + - {fileID: 4000011043040146} + - {fileID: 4000011705022212} + ringColliders: + - {fileID: 4000014054176190} + - {fileID: 4000012017003156} + pinkyColliders: + - {fileID: 4000013046992402} + - {fileID: 4000011596294980} + collidersInRadius: 0 +--- !u!135 &135000010522680132 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010420712118} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.02 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000010572779464 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013360790954} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.035 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000010681374130 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011440127722} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.015 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000011041469328 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011822383670} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.025 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000011391776234 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013436413486} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.04 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000011940042238 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011206655068} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.015 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000012013325142 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011219925658} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.015 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000012264633464 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013822339020} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.01 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000012638216756 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013478506826} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.015 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000012638609432 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013323899228} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.02 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000012669751932 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010046261244} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.01 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000013433154566 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010837900952} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.015 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000014001595118 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011975710508} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.025 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000014056040094 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013367065926} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.015 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000014207960770 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012435317680} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.015 + m_Center: {x: 0, y: 0, z: 0} diff --git a/Assets/SteamVR/InteractionSystem/Core/Prefabs/HandColliderRight.prefab.meta b/Assets/SteamVR/InteractionSystem/Core/Prefabs/HandColliderRight.prefab.meta new file mode 100644 index 00000000..92a15ee4 --- /dev/null +++ b/Assets/SteamVR/InteractionSystem/Core/Prefabs/HandColliderRight.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2f378ddf4e9373548a3708d26c1d75a4 +timeCreated: 1567796810 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Prefabs/LeftRenderModel Slim.prefab b/Assets/SteamVR/InteractionSystem/Core/Prefabs/LeftRenderModel Slim.prefab index dac966a2..73361082 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Prefabs/LeftRenderModel Slim.prefab +++ b/Assets/SteamVR/InteractionSystem/Core/Prefabs/LeftRenderModel Slim.prefab @@ -36,10 +36,10 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 1, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &114000013071118052 MonoBehaviour: m_ObjectHideFlags: 1 @@ -55,4 +55,4 @@ MonoBehaviour: displayHandByDefault: 1 controllerPrefab: {fileID: 1000011460529826, guid: e789c2cc0c98a4c4198a4033fb8ccf96, type: 2} - displayControllerByDefault: 1 + displayControllerByDefault: 0 diff --git a/Assets/SteamVR/InteractionSystem/Core/Prefabs/LeftRenderModel.prefab b/Assets/SteamVR/InteractionSystem/Core/Prefabs/LeftRenderModel.prefab index d3ac23ef..81b2ce50 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Prefabs/LeftRenderModel.prefab +++ b/Assets/SteamVR/InteractionSystem/Core/Prefabs/LeftRenderModel.prefab @@ -36,10 +36,10 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 1, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &114000013071118052 MonoBehaviour: m_ObjectHideFlags: 1 @@ -55,4 +55,4 @@ MonoBehaviour: displayHandByDefault: 1 controllerPrefab: {fileID: 1000011460529826, guid: e789c2cc0c98a4c4198a4033fb8ccf96, type: 2} - displayControllerByDefault: 1 + displayControllerByDefault: 0 diff --git a/Assets/SteamVR/InteractionSystem/Core/Prefabs/Player.prefab b/Assets/SteamVR/InteractionSystem/Core/Prefabs/Player.prefab index afc6a19a..1001c8c5 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Prefabs/Player.prefab +++ b/Assets/SteamVR/InteractionSystem/Core/Prefabs/Player.prefab @@ -5,9 +5,9 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 490018} + - 4: {fileID: 490018} m_Layer: 26 m_Name: ObjectAttachmentPoint m_TagString: Untagged @@ -20,10 +20,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 471722} - - component: {fileID: 8194540} + - 4: {fileID: 471722} + - 81: {fileID: 8194540} m_Layer: 0 m_Name: FollowHead m_TagString: Untagged @@ -36,9 +36,9 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 402768} + - 4: {fileID: 402768} m_Layer: 0 m_Name: NoSteamVRFallbackObjects m_TagString: Untagged @@ -51,12 +51,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 409054} - - component: {fileID: 2326430} - - component: {fileID: 3390842} - - component: {fileID: 11451472} + - 4: {fileID: 409054} + - 23: {fileID: 2326430} + - 33: {fileID: 3390842} + - 114: {fileID: 11451472} m_Layer: 0 m_Name: PlayVolume m_TagString: Untagged @@ -69,10 +69,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 447954} - - component: {fileID: 11465950} + - 4: {fileID: 447954} + - 114: {fileID: 11465950} m_Layer: 0 m_Name: Player m_TagString: Untagged @@ -85,11 +85,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 422332} - - component: {fileID: 3368578} - - component: {fileID: 2353626} + - 4: {fileID: 422332} + - 33: {fileID: 3368578} + - 23: {fileID: 2353626} m_Layer: 26 m_Name: Indicator m_TagString: Untagged @@ -102,14 +102,14 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 496744} - - component: {fileID: 2083460} - - component: {fileID: 11476190} + - 4: {fileID: 496744} + - 20: {fileID: 2083460} + - 114: {fileID: 11476190} m_Layer: 0 m_Name: FallbackObjects - m_TagString: Untagged + m_TagString: MainCamera m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -119,9 +119,9 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 494198} + - 4: {fileID: 494198} m_Layer: 0 m_Name: SteamVRObjects m_TagString: Untagged @@ -134,11 +134,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 453574} - - component: {fileID: 13533284} - - component: {fileID: 5452286} + - 4: {fileID: 453574} + - 135: {fileID: 13533284} + - 54: {fileID: 5452286} m_Layer: 26 m_Name: HeadCollider m_TagString: Untagged @@ -151,13 +151,13 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 429506} - - component: {fileID: 2014920} - - component: {fileID: 11450526} - - component: {fileID: 9215702} - - component: {fileID: 12440092} + - 4: {fileID: 429506} + - 20: {fileID: 2014920} + - 114: {fileID: 11450526} + - 92: {fileID: 9215702} + - 124: {fileID: 12440092} m_Layer: 0 m_Name: VRCamera m_TagString: MainCamera @@ -170,10 +170,10 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 495400} - - component: {fileID: 11405908} + - 4: {fileID: 495400} + - 114: {fileID: 11405908} m_Layer: 0 m_Name: ControllerHoverHighlight m_TagString: Untagged @@ -186,12 +186,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 471232} - - component: {fileID: 11461462} - - component: {fileID: 11464692} - - component: {fileID: 114000013786455312} + - 4: {fileID: 471232} + - 114: {fileID: 11461462} + - 114: {fileID: 11464692} + - 114: {fileID: 114000013786455312} m_Layer: 0 m_Name: InputModule m_TagString: Untagged @@ -204,11 +204,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 458882} - - component: {fileID: 11497470} - - component: {fileID: 5492098} + - 4: {fileID: 458882} + - 114: {fileID: 11497470} + - 54: {fileID: 5492098} m_Layer: 26 m_Name: FallbackHand m_TagString: Untagged @@ -221,11 +221,12 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 476540} - - component: {fileID: 11450312} - - component: {fileID: 114000011273627542} + - 4: {fileID: 476540} + - 114: {fileID: 11450312} + - 114: {fileID: 114000011273627542} + - 114: {fileID: 114000011734077242} m_Layer: 26 m_Name: LeftHand m_TagString: Untagged @@ -238,11 +239,12 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 485514} - - component: {fileID: 11401046} - - component: {fileID: 114000011957598740} + - 4: {fileID: 485514} + - 114: {fileID: 11401046} + - 114: {fileID: 114000011957598740} + - 114: {fileID: 114000010591715100} m_Layer: 26 m_Name: RightHand m_TagString: Untagged @@ -255,9 +257,9 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 480432} + - 4: {fileID: 480432} m_Layer: 26 m_Name: HoverPoint m_TagString: Untagged @@ -270,10 +272,10 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 451882} - - component: {fileID: 11461284} + - 4: {fileID: 451882} + - 114: {fileID: 11461284} m_Layer: 0 m_Name: ControllerHoverHighlight m_TagString: Untagged @@ -286,11 +288,12 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 472612} - - component: {fileID: 11479638} - - component: {fileID: 114000010474703086} + - 4: {fileID: 472612} + - 114: {fileID: 114000012749712888} + - 114: {fileID: 11479638} + - 114: {fileID: 114000010474703086} m_Layer: 0 m_Name: '[SteamVR]' m_TagString: Untagged @@ -303,10 +306,10 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 446772} - - component: {fileID: 11489144} + - 4: {fileID: 446772} + - 114: {fileID: 11489144} m_Layer: 26 m_Name: ControllerButtonHints m_TagString: Untagged @@ -319,10 +322,10 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 413580} - - component: {fileID: 11494192} + - 4: {fileID: 413580} + - 114: {fileID: 11494192} m_Layer: 26 m_Name: ControllerButtonHints m_TagString: Untagged @@ -335,12 +338,12 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 476076} - - component: {fileID: 13693334} - - component: {fileID: 11455280} - - component: {fileID: 5475726} + - 4: {fileID: 476076} + - 136: {fileID: 13693334} + - 114: {fileID: 11455280} + - 54: {fileID: 5475726} m_Layer: 27 m_Name: BodyCollider m_TagString: Untagged @@ -357,12 +360,12 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 496744} - {fileID: 458882} m_Father: {fileID: 447954} m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &409054 Transform: m_ObjectHideFlags: 1 @@ -372,10 +375,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 447954} m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &413580 Transform: m_ObjectHideFlags: 1 @@ -385,10 +388,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 476540} m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &422332 Transform: m_ObjectHideFlags: 1 @@ -398,10 +401,10 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.025, y: 0.025, z: 0.025} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 458882} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &429506 Transform: m_ObjectHideFlags: 1 @@ -411,10 +414,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 494198} m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &446772 Transform: m_ObjectHideFlags: 1 @@ -424,10 +427,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 485514} m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &447954 Transform: m_ObjectHideFlags: 1 @@ -437,6 +440,7 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 494198} - {fileID: 402768} @@ -444,9 +448,9 @@ Transform: - {fileID: 471232} - {fileID: 409054} - {fileID: 4000012025983752} + - {fileID: 4000011788863104} m_Father: {fileID: 0} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &451882 Transform: m_ObjectHideFlags: 1 @@ -456,10 +460,10 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1.0100001, y: 1.01, z: 1.0100001} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 476540} m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &453574 Transform: m_ObjectHideFlags: 1 @@ -469,10 +473,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 471722} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &458882 Transform: m_ObjectHideFlags: 1 @@ -482,11 +486,11 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 422332} m_Father: {fileID: 402768} m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &471232 Transform: m_ObjectHideFlags: 1 @@ -496,10 +500,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 447954} m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &471722 Transform: m_ObjectHideFlags: 1 @@ -509,11 +513,11 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 453574} m_Father: {fileID: 447954} m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &472612 Transform: m_ObjectHideFlags: 1 @@ -523,10 +527,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 494198} m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &476076 Transform: m_ObjectHideFlags: 1 @@ -536,10 +540,10 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 494198} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &476540 Transform: m_ObjectHideFlags: 1 @@ -549,6 +553,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -0.25, y: 1, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 4000012325712216} - {fileID: 4000011474053580} @@ -556,7 +561,6 @@ Transform: - {fileID: 413580} m_Father: {fileID: 494198} m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &480432 Transform: m_ObjectHideFlags: 1 @@ -566,10 +570,10 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0.051999986, y: -0.015699983, z: -0.11630082} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 485514} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &485514 Transform: m_ObjectHideFlags: 1 @@ -579,6 +583,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0.25, y: 1, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 480432} - {fileID: 490018} @@ -586,7 +591,6 @@ Transform: - {fileID: 446772} m_Father: {fileID: 494198} m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &490018 Transform: m_ObjectHideFlags: 1 @@ -596,10 +600,10 @@ Transform: m_LocalRotation: {x: 0.32650563, y: 0.212631, z: -0.6272114, w: 0.67437977} m_LocalPosition: {x: -0.05199999, y: -0.0157, z: -0.11630082} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 135, y: 170, z: 90} m_Children: [] m_Father: {fileID: 485514} m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 135, y: 170, z: 90} --- !u!4 &494198 Transform: m_ObjectHideFlags: 1 @@ -609,6 +613,7 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 476076} - {fileID: 476540} @@ -618,7 +623,6 @@ Transform: - {fileID: 472612} m_Father: {fileID: 447954} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &495400 Transform: m_ObjectHideFlags: 1 @@ -628,10 +632,10 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1.0099999, y: 1.01, z: 1.0099999} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 485514} m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &496744 Transform: m_ObjectHideFlags: 1 @@ -641,10 +645,10 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 1.75, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 402768} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!20 &2014920 Camera: m_ObjectHideFlags: 1 @@ -675,12 +679,10 @@ Camera: m_TargetDisplay: 0 m_TargetEye: 3 m_HDR: 0 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 + m_StereoMirrorMode: 0 --- !u!20 &2083460 Camera: m_ObjectHideFlags: 1 @@ -711,12 +713,10 @@ Camera: m_TargetDisplay: 0 m_TargetEye: 0 m_HDR: 0 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 + m_StereoMirrorMode: 0 --- !u!23 &2326430 MeshRenderer: m_ObjectHideFlags: 1 @@ -726,15 +726,12 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 - m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_Materials: - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 + m_SubsetIndices: m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} @@ -742,14 +739,12 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 + m_SelectedWireframeHidden: 0 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 - m_SortingLayer: 0 m_SortingOrder: 0 --- !u!23 &2353626 MeshRenderer: @@ -760,15 +755,12 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 - m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_Materials: - {fileID: 2100000, guid: 9e995e61de69d8647ae2b2d65eceab3f, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 + m_SubsetIndices: m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} @@ -776,14 +768,12 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 + m_SelectedWireframeHidden: 0 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 - m_SortingLayer: 0 m_SortingOrder: 0 --- !u!33 &3368578 MeshFilter: @@ -872,10 +862,18 @@ MonoBehaviour: otherHand: {fileID: 11450312} handType: 2 trackedObject: {fileID: 0} - grabPinchAction: {fileID: 11400000, guid: 8c890928988d8f643b6acac62a348758, type: 2} - grabGripAction: {fileID: 11400000, guid: f014c6ceb4ee4ca4ca8270e6640becf3, type: 2} - hapticAction: {fileID: 11400000, guid: ebcf2c431e823fe4986762a45ab84bbb, type: 2} - uiInteractAction: {fileID: 11400000, guid: df91b91d719fd004bbb1c6c9c6040e2f, type: 2} + grabPinchAction: + actionPath: /actions/default/in/GrabPinch + needsReinit: 0 + grabGripAction: + actionPath: /actions/default/in/GrabGrip + needsReinit: 0 + hapticAction: + actionPath: /actions/default/out/Haptic + needsReinit: 0 + uiInteractAction: + actionPath: /actions/default/in/InteractUI + needsReinit: 0 useHoverSphere: 1 hoverSphereTransform: {fileID: 480432} hoverSphereRadius: 0.075 @@ -895,6 +893,9 @@ MonoBehaviour: noSteamVRFallbackMaxDistanceWithItem: 0.5 renderModelPrefab: {fileID: 1000012617731570, guid: 837f93beb9a614743ae3a2c0ada7c388, type: 2} + renderModels: [] + mainRenderModel: {fileID: 0} + hoverhighlightRenderModel: {fileID: 0} showDebugText: 0 spewDebugText: 0 showDebugInteractables: 0 @@ -925,10 +926,18 @@ MonoBehaviour: otherHand: {fileID: 11401046} handType: 1 trackedObject: {fileID: 0} - grabPinchAction: {fileID: 11400000, guid: 8c890928988d8f643b6acac62a348758, type: 2} - grabGripAction: {fileID: 11400000, guid: f014c6ceb4ee4ca4ca8270e6640becf3, type: 2} - hapticAction: {fileID: 11400000, guid: ebcf2c431e823fe4986762a45ab84bbb, type: 2} - uiInteractAction: {fileID: 11400000, guid: df91b91d719fd004bbb1c6c9c6040e2f, type: 2} + grabPinchAction: + actionPath: /actions/default/in/GrabPinch + needsReinit: 0 + grabGripAction: + actionPath: /actions/default/in/GrabGrip + needsReinit: 0 + hapticAction: + actionPath: /actions/default/out/Haptic + needsReinit: 0 + uiInteractAction: + actionPath: /actions/default/in/InteractUI + needsReinit: 0 useHoverSphere: 1 hoverSphereTransform: {fileID: 4000012325712216} hoverSphereRadius: 0.075 @@ -948,6 +957,9 @@ MonoBehaviour: noSteamVRFallbackMaxDistanceWithItem: 0.5 renderModelPrefab: {fileID: 1000011547835092, guid: d5082f7d9f947374197e0a97786f4e40, type: 2} + renderModels: [] + mainRenderModel: {fileID: 0} + hoverhighlightRenderModel: {fileID: 0} showDebugText: 0 spewDebugText: 0 showDebugInteractables: 0 @@ -1061,6 +1073,9 @@ MonoBehaviour: rigSteamVR: {fileID: 114188} rig2DFallback: {fileID: 105336} audioListener: {fileID: 471722} + headsetOnHead: + actionPath: /actions/default/in/HeadsetOnHead + needsReinit: 0 allowToggleTo2D: 1 --- !u!114 &11476190 MonoBehaviour: @@ -1101,9 +1116,14 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: controllerMaterial: {fileID: 2100000, guid: 11b050e661ec0cf48a289a7266451e91, type: 2} + urpControllerMaterial: {fileID: 2100000, guid: 70a2eb634d7ed434b86d36f190fcf3a1, + type: 2} flashColor: {r: 1, g: 0.9170069, b: 0.453, a: 0.709} textHintPrefab: {fileID: 140952, guid: 5fa42bb9e52706a42b8a1eaf0b54326a, type: 2} - hapticFlash: {fileID: 11400000, guid: ebcf2c431e823fe4986762a45ab84bbb, type: 2} + hapticFlash: + actionPath: /actions/default/out/Haptic + needsReinit: 0 + autoSetWithControllerRangeOfMotion: 1 debugHints: 0 --- !u!114 &11494192 MonoBehaviour: @@ -1117,9 +1137,14 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: controllerMaterial: {fileID: 2100000, guid: 11b050e661ec0cf48a289a7266451e91, type: 2} + urpControllerMaterial: {fileID: 2100000, guid: 70a2eb634d7ed434b86d36f190fcf3a1, + type: 2} flashColor: {r: 1, g: 0.9170069, b: 0.453, a: 0.709} textHintPrefab: {fileID: 140952, guid: 5fa42bb9e52706a42b8a1eaf0b54326a, type: 2} - hapticFlash: {fileID: 11400000, guid: ebcf2c431e823fe4986762a45ab84bbb, type: 2} + hapticFlash: + actionPath: /actions/default/out/Haptic + needsReinit: 0 + autoSetWithControllerRangeOfMotion: 1 debugHints: 0 --- !u!114 &11497470 MonoBehaviour: @@ -1135,10 +1160,18 @@ MonoBehaviour: otherHand: {fileID: 0} handType: 0 trackedObject: {fileID: 0} - grabPinchAction: {fileID: 11400000, guid: 8c890928988d8f643b6acac62a348758, type: 2} - grabGripAction: {fileID: 11400000, guid: f014c6ceb4ee4ca4ca8270e6640becf3, type: 2} - hapticAction: {fileID: 11400000, guid: ebcf2c431e823fe4986762a45ab84bbb, type: 2} - uiInteractAction: {fileID: 11400000, guid: df91b91d719fd004bbb1c6c9c6040e2f, type: 2} + grabPinchAction: + actionPath: /actions/default/in/GrabPinch + needsReinit: 0 + grabGripAction: + actionPath: /actions/default/in/GrabGrip + needsReinit: 0 + hapticAction: + actionPath: /actions/default/out/Haptic + needsReinit: 0 + uiInteractAction: + actionPath: /actions/default/in/InteractUI + needsReinit: 0 useHoverSphere: 1 hoverSphereTransform: {fileID: 0} hoverSphereRadius: 0.05 @@ -1157,6 +1190,9 @@ MonoBehaviour: noSteamVRFallbackMaxDistanceNoItem: 10 noSteamVRFallbackMaxDistanceWithItem: 0.5 renderModelPrefab: {fileID: 0} + renderModels: [] + mainRenderModel: {fileID: 0} + hoverhighlightRenderModel: {fileID: 0} showDebugText: 0 spewDebugText: 0 showDebugInteractables: 0 @@ -1223,234 +1259,1136 @@ Prefab: m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 107946} m_IsPrefabParent: 1 ---- !u!1 &1000011498581176 +--- !u!1 &1000010010492814 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 4000012025983752} - - component: {fileID: 114000013709408034} + - 4: {fileID: 4000011546481910} m_Layer: 0 - m_Name: DebugUI + m_Name: dot_3 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000013281422588 +--- !u!1 &1000010066870806 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 4000011699137176} - - component: {fileID: 114000010777378212} - m_Layer: 8 - m_Name: Overlay + - 4: {fileID: 4000011080958820} + m_Layer: 0 + m_Name: arrow 1 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!1 &1000013428287994 + m_IsActive: 1 +--- !u!1 &1000010104029430 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 4000012325712216} - m_Layer: 26 - m_Name: HoverPoint + - 4: {fileID: 4000012245205970} + m_Layer: 0 + m_Name: dot_0 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000014277073068 +--- !u!1 &1000010477709332 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 + serializedVersion: 4 m_Component: - - component: {fileID: 4000011474053580} - m_Layer: 26 - m_Name: ObjectAttachmentPoint + - 4: {fileID: 4000013459729244} + m_Layer: 0 + m_Name: dot_4 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &4000011474053580 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014277073068} - m_LocalRotation: {x: 0.32650566, y: -0.21263102, z: 0.6272114, w: 0.67437977} - m_LocalPosition: {x: 0.051999986, y: -0.0157, z: -0.11630082} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 476540} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 135, y: -170, z: -90} ---- !u!4 &4000011699137176 -Transform: +--- !u!1 &1000010484474372 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013281422588} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 494198} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000012025983752 -Transform: + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011410624442} + m_Layer: 0 + m_Name: Armature + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010503880272 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011498581176} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 447954} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000012325712216 -Transform: + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011486474466} + m_Layer: 0 + m_Name: dot_3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010610840334 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013428287994} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.051999986, y: -0.015699983, z: -0.11630082} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 476540} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &114000010474703086 -MonoBehaviour: + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012968930180} + m_Layer: 0 + m_Name: Armature + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011040480562 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 168724} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 27991c206a5e66147bb8ee3ef31c8bac, type: 3} - m_Name: - m_EditorClassIdentifier: - actionSet: {fileID: 11400000, guid: 2f3211149c686b34992305059005bd77, type: 2} - disableAllOtherActionSets: 0 - activateOnStart: 1 - deactivateOnDestroy: 1 ---- !u!114 &114000010777378212 -MonoBehaviour: + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013071250864} + m_Layer: 0 + m_Name: dot_4 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011270389956 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013281422588} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 46fe9e0b23166454c8cb73040321d78c, type: 3} - m_Name: - m_EditorClassIdentifier: - texture: {fileID: 8400000, guid: 005ed5a6df2f5ff468efd6497d37fefa, type: 2} - curved: 1 - antialias: 1 - highquality: 1 - scale: 3 - distance: 1.25 - alpha: 1 - uvOffset: {x: 0, y: 0, z: 1, w: 1} - mouseScale: {x: 1, y: 1} - curvedRange: {x: 1, y: 2} - inputMethod: 0 ---- !u!114 &114000011273627542 -MonoBehaviour: + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012448748116} + m_Layer: 0 + m_Name: dot_0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011357411894 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 144230} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 9a5fb0ca93b55ef4b8d54b512b103341, type: 3} - m_Name: - m_EditorClassIdentifier: - poseAction: {fileID: 11400000, guid: de236ea24a8e7a84b8aa7d8f409145be, type: 2} - inputSource: 1 - origin: {fileID: 0} - onTransformUpdated: - m_PersistentCalls: - m_Calls: [] - m_TypeName: Valve.VR.SteamVR_Behaviour_PoseEvent, Assembly-CSharp, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null - onTransformChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: Valve.VR.SteamVR_Behaviour_PoseEvent, Assembly-CSharp, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null - onConnectedChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: Valve.VR.SteamVR_Behaviour_PoseEvent, Assembly-CSharp, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null - onTrackingChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: Valve.VR.SteamVR_Behaviour_PoseEvent, Assembly-CSharp, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null ---- !u!114 &114000011957598740 -MonoBehaviour: + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013208145148} + - 137: {fileID: 137000011507381152} + m_Layer: 0 + m_Name: arrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011375182220 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 160596} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 9a5fb0ca93b55ef4b8d54b512b103341, type: 3} - m_Name: - m_EditorClassIdentifier: - poseAction: {fileID: 11400000, guid: de236ea24a8e7a84b8aa7d8f409145be, type: 2} - inputSource: 2 - origin: {fileID: 0} - onTransformUpdated: - m_PersistentCalls: - m_Calls: [] - m_TypeName: Valve.VR.SteamVR_Behaviour_PoseEvent, Assembly-CSharp, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null - onTransformChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: Valve.VR.SteamVR_Behaviour_PoseEvent, Assembly-CSharp, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null - onConnectedChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: Valve.VR.SteamVR_Behaviour_PoseEvent, Assembly-CSharp, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null - onTrackingChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: Valve.VR.SteamVR_Behaviour_PoseEvent, Assembly-CSharp, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null ---- !u!114 &114000013709408034 -MonoBehaviour: + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013662614074} + m_Layer: 0 + m_Name: dot_5 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011381520856 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011498581176} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6f3bba2c36dd79242b3157dbcd876bf2, type: 3} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013350015900} + m_Layer: 0 + m_Name: dot_5 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011498581176 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012025983752} + - 114: {fileID: 114000013709408034} + m_Layer: 0 + m_Name: DebugUI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011503333666 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010885879976} + m_Layer: 0 + m_Name: dot_1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011785618742 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012936734234} + m_Layer: 0 + m_Name: Right + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011982216214 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011199904346} + m_Layer: 0 + m_Name: Left + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012112852726 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012934335342} + - 82: {fileID: 82000013955136614} + m_Layer: 0 + m_Name: Sound Effect + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012312091976 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011018851326} + - 137: {fileID: 137000011452294138} + m_Layer: 0 + m_Name: arrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012386841978 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010619905612} + m_Layer: 0 + m_Name: dot_2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012412013898 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013080145864} + m_Layer: 0 + m_Name: dot_1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012482183374 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013379094620} + - 95: {fileID: 95000010079010534} + m_Layer: 0 + m_Name: snapTurnFX + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012806303946 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012155236140} + - 95: {fileID: 95000012983632464} + m_Layer: 0 + m_Name: snapTurnFX + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013229560100 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012017034806} + m_Layer: 0 + m_Name: dot_2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013281422588 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011699137176} + - 114: {fileID: 114000010777378212} + m_Layer: 8 + m_Name: Overlay + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1000013428287994 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012325712216} + m_Layer: 26 + m_Name: HoverPoint + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013804283954 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010554899216} + m_Layer: 0 + m_Name: arrow 1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013829830258 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011788863104} + - 114: {fileID: 114000010547881750} + m_Layer: 0 + m_Name: Snap Turn + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000014277073068 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011474053580} + m_Layer: 26 + m_Name: ObjectAttachmentPoint + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000010554899216 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013804283954} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} + m_LocalPosition: {x: 0.008, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000012968930180} + m_RootOrder: 0 +--- !u!4 &4000010619905612 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012386841978} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000012968930180} + m_RootOrder: 3 +--- !u!4 &4000010885879976 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011503333666} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} + m_LocalPosition: {x: 0.003, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000011410624442} + m_RootOrder: 2 +--- !u!4 &4000011018851326 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012312091976} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000013379094620} + m_RootOrder: 1 +--- !u!4 &4000011080958820 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010066870806} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} + m_LocalPosition: {x: 0.008, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000011410624442} + m_RootOrder: 0 +--- !u!4 &4000011199904346 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011982216214} + 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 4000012155236140} + m_Father: {fileID: 4000011788863104} + m_RootOrder: 1 +--- !u!4 &4000011410624442 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010484474372} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 4000011080958820} + - {fileID: 4000012245205970} + - {fileID: 4000010885879976} + - {fileID: 4000012017034806} + - {fileID: 4000011486474466} + - {fileID: 4000013071250864} + - {fileID: 4000013350015900} + m_Father: {fileID: 4000013379094620} + m_RootOrder: 0 +--- !u!4 &4000011474053580 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014277073068} + m_LocalRotation: {x: 0.32650566, y: -0.21263102, z: 0.6272114, w: 0.67437977} + m_LocalPosition: {x: 0.051999986, y: -0.0157, z: -0.11630082} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 135, y: -170, z: -90} + m_Children: [] + m_Father: {fileID: 476540} + m_RootOrder: 1 +--- !u!4 &4000011486474466 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010503880272} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} + m_LocalPosition: {x: -0.003, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000011410624442} + m_RootOrder: 4 +--- !u!4 &4000011546481910 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010010492814} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} + m_LocalPosition: {x: -0.003, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000012968930180} + m_RootOrder: 4 +--- !u!4 &4000011699137176 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013281422588} + 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 494198} + m_RootOrder: 4 +--- !u!4 &4000011788863104 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013829830258} + 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 4000012936734234} + - {fileID: 4000011199904346} + - {fileID: 4000012934335342} + m_Father: {fileID: 447954} + m_RootOrder: 6 +--- !u!4 &4000012017034806 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013229560100} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000011410624442} + m_RootOrder: 3 +--- !u!4 &4000012025983752 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011498581176} + 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 447954} + m_RootOrder: 5 +--- !u!4 &4000012155236140 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012806303946} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 90, y: -180, z: -180} + m_Children: + - {fileID: 4000012968930180} + - {fileID: 4000013208145148} + m_Father: {fileID: 4000011199904346} + m_RootOrder: 0 +--- !u!4 &4000012245205970 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010104029430} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} + m_LocalPosition: {x: 0.006, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000011410624442} + m_RootOrder: 1 +--- !u!4 &4000012325712216 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013428287994} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.051999986, y: -0.015699983, z: -0.11630082} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 476540} + m_RootOrder: 0 +--- !u!4 &4000012448748116 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011270389956} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} + m_LocalPosition: {x: 0.006, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000012968930180} + m_RootOrder: 1 +--- !u!4 &4000012934335342 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012112852726} + 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000011788863104} + m_RootOrder: 2 +--- !u!4 &4000012936734234 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011785618742} + 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 4000013379094620} + m_Father: {fileID: 4000011788863104} + m_RootOrder: 0 +--- !u!4 &4000012968930180 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010610840334} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 4000010554899216} + - {fileID: 4000012448748116} + - {fileID: 4000013080145864} + - {fileID: 4000010619905612} + - {fileID: 4000011546481910} + - {fileID: 4000013459729244} + - {fileID: 4000013662614074} + m_Father: {fileID: 4000012155236140} + m_RootOrder: 0 +--- !u!4 &4000013071250864 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011040480562} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} + m_LocalPosition: {x: -0.006, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000011410624442} + m_RootOrder: 5 +--- !u!4 &4000013080145864 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012412013898} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} + m_LocalPosition: {x: 0.003, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000012968930180} + m_RootOrder: 2 +--- !u!4 &4000013208145148 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011357411894} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000012155236140} + m_RootOrder: 1 +--- !u!4 &4000013350015900 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011381520856} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} + m_LocalPosition: {x: -0.009000001, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000011410624442} + m_RootOrder: 6 +--- !u!4 &4000013379094620 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012482183374} + m_LocalRotation: {x: 0, y: 0.7071068, z: 0.7071068, w: -0} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 270, y: 0, z: -180} + m_Children: + - {fileID: 4000011410624442} + - {fileID: 4000011018851326} + m_Father: {fileID: 4000012936734234} + m_RootOrder: 0 +--- !u!4 &4000013459729244 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010477709332} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} + m_LocalPosition: {x: -0.006, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000012968930180} + m_RootOrder: 5 +--- !u!4 &4000013662614074 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011375182220} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} + m_LocalPosition: {x: -0.009000001, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000012968930180} + m_RootOrder: 6 +--- !u!82 &82000013955136614 +AudioSource: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012112852726} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 0 + m_Volume: 0.2 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 50 + Pan2D: 0 + rolloffMode: 2 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 +--- !u!95 &95000010079010534 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012482183374} + m_Enabled: 1 + m_Avatar: {fileID: 9000000, guid: 62dcc32f358950744a33cf3ced87eaed, type: 3} + m_Controller: {fileID: 9100000, guid: 24592bbd7bf3c5c489c70fba25d75ee0, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 +--- !u!95 &95000012983632464 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012806303946} + m_Enabled: 1 + m_Avatar: {fileID: 9000000, guid: 62dcc32f358950744a33cf3ced87eaed, type: 3} + m_Controller: {fileID: 9100000, guid: 24592bbd7bf3c5c489c70fba25d75ee0, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 +--- !u!114 &114000010474703086 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 168724} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 27991c206a5e66147bb8ee3ef31c8bac, type: 3} + m_Name: + m_EditorClassIdentifier: + actionSet: + actionSetPath: /actions/default + forSources: 0 + disableAllOtherActionSets: 0 + activateOnStart: 1 + deactivateOnDestroy: 1 +--- !u!114 &114000010547881750 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013829830258} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7434e43635fb2924583f5e0f2fb6ed3a, type: 3} + m_Name: + m_EditorClassIdentifier: + snapAngle: 45 + showTurnAnimation: 1 + snapTurnSource: {fileID: 82000013955136614} + rotateSound: {fileID: 8300000, guid: 973c016de5a1cf34ebb6b3477ca2da5c, type: 3} + rotateRightFX: {fileID: 1000011785618742} + rotateLeftFX: {fileID: 1000011982216214} + snapLeftAction: + actionPath: /actions/default/in/SnapTurnLeft + needsReinit: 0 + snapRightAction: + actionPath: /actions/default/in/SnapTurnRight + needsReinit: 0 + fadeScreen: 1 + fadeTime: 0.1 + screenFadeColor: {r: 0, g: 0, b: 0, a: 1} + distanceFromFace: 1.3 + additionalOffset: {x: 0, y: -0.3, z: 0} + canTurnEverySeconds: 0.5 +--- !u!114 &114000010591715100 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 160596} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1e75fe4b0c190eb4ba97e59f062510e9, type: 3} + m_Name: + m_EditorClassIdentifier: + handColliderPrefab: {fileID: 114000013167804218, guid: 2f378ddf4e9373548a3708d26c1d75a4, + type: 2} + handCollider: {fileID: 0} + clearanceCheckMask: + serializedVersion: 2 + m_Bits: 4294967039 + hand: {fileID: 0} +--- !u!114 &114000010777378212 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013281422588} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 46fe9e0b23166454c8cb73040321d78c, type: 3} + m_Name: + m_EditorClassIdentifier: + texture: {fileID: 8400000, guid: 005ed5a6df2f5ff468efd6497d37fefa, type: 2} + scale: 3 + distance: 1.25 + alpha: 1 + uvOffset: {x: 0, y: 0, z: 1, w: 1} + mouseScale: {x: 1, y: 1} + inputMethod: 0 +--- !u!114 &114000011273627542 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 144230} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9a5fb0ca93b55ef4b8d54b512b103341, type: 3} + m_Name: + m_EditorClassIdentifier: + poseAction: + actionPath: /actions/default/in/Pose + needsReinit: 0 + inputSource: 1 + origin: {fileID: 0} + onTransformUpdated: + m_PersistentCalls: + m_Calls: [] + m_TypeName: Valve.VR.SteamVR_Behaviour_PoseEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + onTransformChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: Valve.VR.SteamVR_Behaviour_PoseEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + onConnectedChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: Valve.VR.SteamVR_Behaviour_Pose_ConnectedChangedEvent, Assembly-CSharp, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + onTrackingChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: Valve.VR.SteamVR_Behaviour_Pose_TrackingChangedEvent, Assembly-CSharp, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + onDeviceIndexChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: Valve.VR.SteamVR_Behaviour_Pose_DeviceIndexChangedEvent, Assembly-CSharp, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + broadcastDeviceChanges: 1 +--- !u!114 &114000011734077242 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 144230} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1e75fe4b0c190eb4ba97e59f062510e9, type: 3} + m_Name: + m_EditorClassIdentifier: + handColliderPrefab: {fileID: 114000010572907066, guid: 73f816dd3537a4c44988f340a5da70b9, + type: 2} + handCollider: {fileID: 0} + clearanceCheckMask: + serializedVersion: 2 + m_Bits: 4294967039 + hand: {fileID: 0} +--- !u!114 &114000011957598740 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 160596} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9a5fb0ca93b55ef4b8d54b512b103341, type: 3} + m_Name: + m_EditorClassIdentifier: + poseAction: + actionPath: /actions/default/in/Pose + needsReinit: 0 + inputSource: 2 + origin: {fileID: 0} + onTransformUpdated: + m_PersistentCalls: + m_Calls: [] + m_TypeName: Valve.VR.SteamVR_Behaviour_PoseEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + onTransformChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: Valve.VR.SteamVR_Behaviour_PoseEvent, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + onConnectedChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: Valve.VR.SteamVR_Behaviour_Pose_ConnectedChangedEvent, Assembly-CSharp, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + onTrackingChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: Valve.VR.SteamVR_Behaviour_Pose_TrackingChangedEvent, Assembly-CSharp, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + onDeviceIndexChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: Valve.VR.SteamVR_Behaviour_Pose_DeviceIndexChangedEvent, Assembly-CSharp, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + broadcastDeviceChanges: 1 +--- !u!114 &114000012749712888 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 168724} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1aaa8a3afb932fe478757c1e89cf0cd5, type: 3} + m_Name: + m_EditorClassIdentifier: + initializeSteamVROnAwake: 1 + doNotDestroy: 1 + steamvr_render: {fileID: 0} +--- !u!114 &114000013709408034 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011498581176} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6f3bba2c36dd79242b3157dbcd876bf2, type: 3} m_Name: m_EditorClassIdentifier: --- !u!114 &114000013786455312 @@ -1471,3 +2409,99 @@ MonoBehaviour: m_InputActionsPerSecond: 10 m_RepeatDelay: 0.5 m_ForceModuleActive: 0 +--- !u!137 &137000011452294138 +SkinnedMeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012312091976} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: b1e683e8bf011f94ab3c2f6d097aa87c, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + serializedVersion: 2 + m_Quality: 0 + m_UpdateWhenOffscreen: 1 + m_SkinnedMotionVectors: 1 + m_Mesh: {fileID: 4300000, guid: 62dcc32f358950744a33cf3ced87eaed, type: 3} + m_Bones: + - {fileID: 4000012245205970} + - {fileID: 4000010885879976} + - {fileID: 4000012017034806} + - {fileID: 4000011486474466} + - {fileID: 4000013071250864} + - {fileID: 4000013350015900} + - {fileID: 4000011080958820} + m_BlendShapeWeights: [] + m_RootBone: {fileID: 4000011080958820} + m_AABB: + m_Center: {x: -0.007633208, y: 0, z: 0} + m_Extent: {x: 0.009633208, y: 1.2246467e-19, z: 0.0019999999} + m_DirtyAABB: 0 +--- !u!137 &137000011507381152 +SkinnedMeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011357411894} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: b1e683e8bf011f94ab3c2f6d097aa87c, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + serializedVersion: 2 + m_Quality: 0 + m_UpdateWhenOffscreen: 1 + m_SkinnedMotionVectors: 1 + m_Mesh: {fileID: 4300000, guid: 62dcc32f358950744a33cf3ced87eaed, type: 3} + m_Bones: + - {fileID: 4000012448748116} + - {fileID: 4000013080145864} + - {fileID: 4000010619905612} + - {fileID: 4000011546481910} + - {fileID: 4000013459729244} + - {fileID: 4000013662614074} + - {fileID: 4000010554899216} + m_BlendShapeWeights: [] + m_RootBone: {fileID: 4000010554899216} + m_AABB: + m_Center: {x: -0.007633208, y: 0, z: 0} + m_Extent: {x: 0.009633208, y: 1.2246467e-19, z: 0.0019999999} + m_DirtyAABB: 0 diff --git a/Assets/SteamVR/InteractionSystem/Core/Prefabs/RightRenderModel Slim.prefab b/Assets/SteamVR/InteractionSystem/Core/Prefabs/RightRenderModel Slim.prefab index 2eed52d1..148bf4d3 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Prefabs/RightRenderModel Slim.prefab +++ b/Assets/SteamVR/InteractionSystem/Core/Prefabs/RightRenderModel Slim.prefab @@ -36,10 +36,10 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 1, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &114000011075384662 MonoBehaviour: m_ObjectHideFlags: 1 @@ -55,4 +55,4 @@ MonoBehaviour: displayHandByDefault: 1 controllerPrefab: {fileID: 1000011460529826, guid: e789c2cc0c98a4c4198a4033fb8ccf96, type: 2} - displayControllerByDefault: 1 + displayControllerByDefault: 0 diff --git a/Assets/SteamVR/InteractionSystem/Core/Prefabs/RightRenderModel.prefab b/Assets/SteamVR/InteractionSystem/Core/Prefabs/RightRenderModel.prefab index 9e6b9c1d..4e20f872 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Prefabs/RightRenderModel.prefab +++ b/Assets/SteamVR/InteractionSystem/Core/Prefabs/RightRenderModel.prefab @@ -36,10 +36,10 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 1, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &114000011075384662 MonoBehaviour: m_ObjectHideFlags: 1 @@ -55,4 +55,4 @@ MonoBehaviour: displayHandByDefault: 1 controllerPrefab: {fileID: 1000011460529826, guid: e789c2cc0c98a4c4198a4033fb8ccf96, type: 2} - displayControllerByDefault: 1 + displayControllerByDefault: 0 diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/BodyCollider.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/BodyCollider.cs.meta index 0cb62371..6d67c011 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/BodyCollider.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/BodyCollider.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 1731d642c0b250b48bb8cdfb153d9792 -timeCreated: 1434649753 +timeCreated: 1544851959 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/CircularDrive.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/CircularDrive.cs index 4df73441..2f962f8a 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/CircularDrive.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/CircularDrive.cs @@ -93,7 +93,7 @@ public enum Axis_t private bool driving = false; - // If the drive is limited as is at min/max, angles greater than this are ignored + // If the drive is limited as is at min/max, angles greater than this are ignored private float minMaxAngularThreshold = 1.0f; private bool frozen = false; @@ -298,8 +298,8 @@ private Vector3 ComputeToTransformProjected( Transform xForm ) } else { - Debug.LogFormat( "The collider needs to be a minimum distance away from the CircularDrive GameObject {0}", gameObject.ToString() ); - Debug.Assert( false, string.Format( "The collider needs to be a minimum distance away from the CircularDrive GameObject {0}", gameObject.ToString() ) ); + Debug.LogFormat("[SteamVR Interaction] The collider needs to be a minimum distance away from the CircularDrive GameObject {0}", gameObject.ToString() ); + Debug.Assert( false, string.Format("[SteamVR Interaction] The collider needs to be a minimum distance away from the CircularDrive GameObject {0}", gameObject.ToString() ) ); } if ( debugPath && dbgPathLimit > 0 ) diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/CircularDrive.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/CircularDrive.cs.meta index 636b118a..0d56e134 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/CircularDrive.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/CircularDrive.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 1f32883eed859804dbb0c5fedac91496 -timeCreated: 1440531244 +timeCreated: 1544851960 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/ComplexThrowable.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/ComplexThrowable.cs.meta index dd9960f3..bab0333a 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/ComplexThrowable.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/ComplexThrowable.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: ad77666522338cf49ba83b80b25e6476 -timeCreated: 1440023090 +timeCreated: 1544851960 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/ControllerHoverHighlight.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/ControllerHoverHighlight.cs.meta index b95e6479..65065b5c 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/ControllerHoverHighlight.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/ControllerHoverHighlight.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 8ca2cc563cc33f542a5d9f8f661184ba -timeCreated: 1441139979 +timeCreated: 1544851960 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/CustomEvents.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/CustomEvents.cs.meta index 0c3592b1..0cf4fdd7 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/CustomEvents.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/CustomEvents.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 5f3294e06115d0047a2ac7659a11b168 -timeCreated: 1437076614 +timeCreated: 1544851960 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/DebugUI.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/DebugUI.cs index 95b991ad..7fd2a4e4 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/DebugUI.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/DebugUI.cs @@ -37,15 +37,15 @@ void Start() } - //------------------------------------------------- - private void OnGUI() +#if !HIDE_DEBUG_UI + //------------------------------------------------- + private void OnGUI() { if (Debug.isDebugBuild) { -#if !HIDE_DEBUG_UI player.Draw2DDebug(); -#endif } - } - } + } +#endif + } } diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/DebugUI.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/DebugUI.cs.meta index 2daf3588..df844678 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/DebugUI.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/DebugUI.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 6f3bba2c36dd79242b3157dbcd876bf2 -timeCreated: 1458703500 +timeCreated: 1544851961 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/DestroyOnDetachedFromHand.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/DestroyOnDetachedFromHand.cs.meta index d4c14294..89aab34d 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/DestroyOnDetachedFromHand.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/DestroyOnDetachedFromHand.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 5240357a2468cdc4291b266bee3cb9b9 -timeCreated: 1442359285 +timeCreated: 1544851961 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/DestroyOnParticleSystemDeath.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/DestroyOnParticleSystemDeath.cs.meta index 16f593c6..1737bc7a 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/DestroyOnParticleSystemDeath.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/DestroyOnParticleSystemDeath.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 69cad530c565c714491a326c21accb90 -timeCreated: 1478655595 +timeCreated: 1544851961 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/DestroyOnTriggerEnter.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/DestroyOnTriggerEnter.cs.meta index d1ec5d89..43d22201 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/DestroyOnTriggerEnter.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/DestroyOnTriggerEnter.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 7ba84888c9d4c504cb752a3904551a6c -timeCreated: 1438101498 +timeCreated: 1544851961 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/DistanceHaptics.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/DistanceHaptics.cs index 5d5552f7..5359c9ec 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/DistanceHaptics.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/DistanceHaptics.cs @@ -27,7 +27,7 @@ IEnumerator Start() Hand hand = GetComponentInParent(); if (hand != null) - { + { float pulse = distanceIntensityCurve.Evaluate( distance ); hand.TriggerHapticPulse((ushort)pulse); diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/DistanceHaptics.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/DistanceHaptics.cs.meta index 8e3554aa..a466f9d7 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/DistanceHaptics.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/DistanceHaptics.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 65ef702aaa09d3f46a75659678b1a711 -timeCreated: 1430871385 +timeCreated: 1544851961 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/DontDestroyOnLoad.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/DontDestroyOnLoad.cs.meta index 606d5f63..073eb8c9 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/DontDestroyOnLoad.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/DontDestroyOnLoad.cs.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 4d1c07a6449b0ca439ee6fac5f6f7d83 +timeCreated: 1544851961 +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: + assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/EnumFlags.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/EnumFlags.cs.meta index 5ac60098..54d1868f 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/EnumFlags.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/EnumFlags.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 88a2ccbdad9948c45b28f5e63902705b -timeCreated: 1440536338 +timeCreated: 1544851961 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/Equippable.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/Equippable.cs index 829b88a7..9e01c19b 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/Equippable.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/Equippable.cs @@ -41,13 +41,13 @@ public SteamVR_Input_Sources attachedHandType return SteamVR_Input_Sources.Any; } } - + private void Start() { initialScale = transform.localScale; interactable = GetComponent(); } - + private void Update() { if (interactable.attachedToHand) diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/Equippable.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/Equippable.cs.meta index 00a06e19..51310601 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/Equippable.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/Equippable.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: ecd73422fbc4be54a9f4d8f3972f8579 -timeCreated: 1532647157 +timeCreated: 1544851962 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/FallbackCameraController.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/FallbackCameraController.cs index a61fb198..782f73de 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/FallbackCameraController.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/FallbackCameraController.cs @@ -41,7 +41,17 @@ void Update() forward -= 1.0f; } - float right = 0.0f; + float up = 0.0f; + if (Input.GetKey(KeyCode.E)) + { + up += 1.0f; + } + if (Input.GetKey(KeyCode.Q)) + { + up -= 1.0f; + } + + float right = 0.0f; if ( Input.GetKey( KeyCode.D ) || Input.GetKey( KeyCode.RightArrow ) ) { right += 1.0f; @@ -61,7 +71,7 @@ void Update() float deltaRealTime = realTimeNow - realTime; realTime = realTimeNow; - Vector3 delta = new Vector3( right, 0.0f, forward ) * currentSpeed * deltaRealTime; + Vector3 delta = new Vector3( right, up, forward ) * currentSpeed * deltaRealTime; transform.position += transform.TransformDirection( delta ); @@ -87,7 +97,7 @@ void OnGUI() if ( showInstructions ) { GUI.Label( new Rect( 10.0f, 10.0f, 600.0f, 400.0f ), - "WASD/Arrow Keys to translate the camera\n" + + "WASD EQ/Arrow Keys to translate the camera\n" + "Right mouse click to rotate the camera\n" + "Left mouse click for standard interactions.\n" ); } diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/FallbackCameraController.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/FallbackCameraController.cs.meta index 6bc0616c..eab1b843 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/FallbackCameraController.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/FallbackCameraController.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 6043f3be9a21bd74281f9770463bea00 -timeCreated: 1436190027 +timeCreated: 1544851962 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/GrabTypes.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/GrabTypes.cs.meta index 22b2c900..c0d149aa 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/GrabTypes.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/GrabTypes.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 99eaa65760d05f74b811106b4945924e -timeCreated: 1532647168 +timeCreated: 1544851962 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs index 6401d7ea..bf74082a 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs @@ -37,7 +37,7 @@ public enum AttachmentFlags public const AttachmentFlags defaultAttachmentFlags = AttachmentFlags.ParentToHand | AttachmentFlags.DetachOthers | AttachmentFlags.DetachFromOtherHand | - AttachmentFlags.TurnOnKinematic | + AttachmentFlags.TurnOnKinematic | AttachmentFlags.SnapOnAttach; public Hand otherHand; @@ -45,17 +45,13 @@ public enum AttachmentFlags public SteamVR_Behaviour_Pose trackedObject; - [SteamVR_DefaultAction("GrabPinch")] - public SteamVR_Action_Boolean grabPinchAction; + public SteamVR_Action_Boolean grabPinchAction = SteamVR_Input.GetAction("GrabPinch"); - [SteamVR_DefaultAction("GrabGrip")] - public SteamVR_Action_Boolean grabGripAction; + public SteamVR_Action_Boolean grabGripAction = SteamVR_Input.GetAction("GrabGrip"); - [SteamVR_DefaultAction("Haptic")] - public SteamVR_Action_Vibration hapticAction; + public SteamVR_Action_Vibration hapticAction = SteamVR_Input.GetAction("Haptic"); - [SteamVR_DefaultAction("InteractUI")] - public SteamVR_Action_Boolean uiInteractAction; + public SteamVR_Action_Boolean uiInteractAction = SteamVR_Input.GetAction("InteractUI"); public bool useHoverSphere = true; public Transform hoverSphereTransform; @@ -80,9 +76,12 @@ public enum AttachmentFlags private float noSteamVRFallbackInteractorDistance = -1.0f; public GameObject renderModelPrefab; - protected List renderModels = new List(); - protected RenderModel mainRenderModel; - protected RenderModel hoverhighlightRenderModel; + [HideInInspector] + public List renderModels = new List(); + [HideInInspector] + public RenderModel mainRenderModel; + [HideInInspector] + public RenderModel hoverhighlightRenderModel; public bool showDebugText = false; public bool spewDebugText = false; @@ -104,6 +103,10 @@ public struct AttachedObject public Quaternion initialRotationalOffset; public Transform attachedOffsetTransform; public Transform handAttachmentPointTransform; + public Vector3 easeSourcePosition; + public Quaternion easeSourceRotation; + public float attachTime; + public AllowTeleportWhileAttachedToHand allowTeleportWhileAttachedToHand; public bool HasAttachFlag(AttachmentFlags flag) { @@ -125,7 +128,7 @@ public ReadOnlyCollection AttachedObjects private TextMesh debugText; private int prevOverlappingColliders = 0; - private const int ColliderArraySize = 16; + private const int ColliderArraySize = 32; private Collider[] overlappingColliders; private Player playerInstance; @@ -138,7 +141,10 @@ public bool isActive { get { - return trackedObject.isActive; + if (trackedObject != null) + return trackedObject.isActive; + + return this.gameObject.activeInHierarchy; } } @@ -226,6 +232,27 @@ public AttachedObject? currentAttachedObjectInfo } } + public AllowTeleportWhileAttachedToHand currentAttachedTeleportManager + { + get + { + if (currentAttachedObjectInfo.HasValue) + return currentAttachedObjectInfo.Value.allowTeleportWhileAttachedToHand; + return null; + } + } + + public SteamVR_Behaviour_Skeleton skeleton + { + get + { + if (mainRenderModel != null) + return mainRenderModel.GetSkeleton(); + + return null; + } + } + public void ShowController(bool permanent = false) { if (mainRenderModel != null) @@ -262,6 +289,11 @@ public void HideSkeleton(bool permanent = false) hoverhighlightRenderModel.SetHandVisibility(false, permanent); } + public bool HasSkeleton() + { + return mainRenderModel != null && mainRenderModel.GetSkeleton() != null; + } + public void Show() { SetVisibility(true); @@ -331,7 +363,7 @@ public void AttachObject(GameObject objectToAttach, GrabTypes grabbedWithType, A AttachedObject attachedObject = new AttachedObject(); attachedObject.attachmentFlags = flags; attachedObject.attachedOffsetTransform = attachmentOffset; - + attachedObject.attachTime = Time.time; if (flags == 0) { @@ -342,13 +374,14 @@ public void AttachObject(GameObject objectToAttach, GrabTypes grabbedWithType, A CleanUpAttachedObjectStack(); //Detach the object if it is already attached so that it can get re-attached at the top of the stack - if(ObjectIsAttached(objectToAttach)) + if (ObjectIsAttached(objectToAttach)) DetachObject(objectToAttach); //Detach from the other hand if requested if (attachedObject.HasAttachFlag(AttachmentFlags.DetachFromOtherHand)) { - otherHand.DetachObject(objectToAttach); + if (otherHand != null) + otherHand.DetachObject(objectToAttach); } if (attachedObject.HasAttachFlag(AttachmentFlags.DetachOthers)) @@ -367,10 +400,18 @@ public void AttachObject(GameObject objectToAttach, GrabTypes grabbedWithType, A attachedObject.attachedObject = objectToAttach; attachedObject.interactable = objectToAttach.GetComponent(); + attachedObject.allowTeleportWhileAttachedToHand = objectToAttach.GetComponent(); attachedObject.handAttachmentPointTransform = this.transform; if (attachedObject.interactable != null) { + if (attachedObject.interactable.attachEaseIn) + { + attachedObject.easeSourcePosition = attachedObject.attachedObject.transform.position; + attachedObject.easeSourceRotation = attachedObject.attachedObject.transform.rotation; + attachedObject.interactable.snapAttachEaseInCompleted = false; + } + if (attachedObject.interactable.useHandObjectAttachmentPoint) attachedObject.handAttachmentPointTransform = objectAttachmentPoint; @@ -388,6 +429,7 @@ public void AttachObject(GameObject objectToAttach, GrabTypes grabbedWithType, A if (attachedObject.interactable.setRangeOfMotionOnPickup != SkeletalMotionRangeChange.None) SetTemporarySkeletonRangeOfMotion(attachedObject.interactable.setRangeOfMotionOnPickup); + } attachedObject.originalParent = objectToAttach.transform.parent != null ? objectToAttach.transform.parent.gameObject : null; @@ -398,7 +440,7 @@ public void AttachObject(GameObject objectToAttach, GrabTypes grabbedWithType, A if (attachedObject.interactable.attachedToHand != null) //already attached to another hand { //if it was attached to another hand, get the flags from that hand - + for (int attachedIndex = 0; attachedIndex < attachedObject.interactable.attachedToHand.attachedObjects.Count; attachedIndex++) { AttachedObject attachedObjectInList = attachedObject.interactable.attachedToHand.attachedObjects[attachedIndex]; @@ -432,47 +474,67 @@ public void AttachObject(GameObject objectToAttach, GrabTypes grabbedWithType, A if (attachedObject.HasAttachFlag(AttachmentFlags.SnapOnAttach)) { - if (attachmentOffset != null) + if (attachedObject.interactable != null && attachedObject.interactable.skeletonPoser != null && HasSkeleton()) { - //offset the object from the hand by the positional and rotational difference between the offset transform and the attached object - Quaternion rotDiff = Quaternion.Inverse(attachmentOffset.transform.rotation) * objectToAttach.transform.rotation; - objectToAttach.transform.rotation = attachedObject.handAttachmentPointTransform.rotation * rotDiff; + SteamVR_Skeleton_PoseSnapshot pose = attachedObject.interactable.skeletonPoser.GetBlendedPose(skeleton); - Vector3 posDiff = objectToAttach.transform.position - attachmentOffset.transform.position; - objectToAttach.transform.position = attachedObject.handAttachmentPointTransform.position + posDiff; + //snap the object to the center of the attach point + objectToAttach.transform.position = this.transform.TransformPoint(pose.position); + objectToAttach.transform.rotation = this.transform.rotation * pose.rotation; + + attachedObject.initialPositionalOffset = attachedObject.handAttachmentPointTransform.InverseTransformPoint(objectToAttach.transform.position); + attachedObject.initialRotationalOffset = Quaternion.Inverse(attachedObject.handAttachmentPointTransform.rotation) * objectToAttach.transform.rotation; } else { - //snap the object to the center of the attach point - objectToAttach.transform.rotation = attachedObject.handAttachmentPointTransform.rotation; - objectToAttach.transform.position = attachedObject.handAttachmentPointTransform.position; - } + if (attachmentOffset != null) + { + //offset the object from the hand by the positional and rotational difference between the offset transform and the attached object + Quaternion rotDiff = Quaternion.Inverse(attachmentOffset.transform.rotation) * objectToAttach.transform.rotation; + objectToAttach.transform.rotation = attachedObject.handAttachmentPointTransform.rotation * rotDiff; + + Vector3 posDiff = objectToAttach.transform.position - attachmentOffset.transform.position; + objectToAttach.transform.position = attachedObject.handAttachmentPointTransform.position + posDiff; + } + else + { + //snap the object to the center of the attach point + objectToAttach.transform.rotation = attachedObject.handAttachmentPointTransform.rotation; + objectToAttach.transform.position = attachedObject.handAttachmentPointTransform.position; + } - Transform followPoint = objectToAttach.transform; - if (attachedObject.interactable != null && attachedObject.interactable.handFollowTransform != null) - followPoint = attachedObject.interactable.handFollowTransform; + Transform followPoint = objectToAttach.transform; - attachedObject.initialPositionalOffset = attachedObject.handAttachmentPointTransform.InverseTransformPoint(followPoint.position); - attachedObject.initialRotationalOffset = Quaternion.Inverse(attachedObject.handAttachmentPointTransform.rotation) * followPoint.rotation; + attachedObject.initialPositionalOffset = attachedObject.handAttachmentPointTransform.InverseTransformPoint(followPoint.position); + attachedObject.initialRotationalOffset = Quaternion.Inverse(attachedObject.handAttachmentPointTransform.rotation) * followPoint.rotation; + } } else { - if (attachmentOffset != null) + if (attachedObject.interactable != null && attachedObject.interactable.skeletonPoser != null && HasSkeleton()) { - //get the initial positional and rotational offsets between the hand and the offset transform - Quaternion rotDiff = Quaternion.Inverse(attachmentOffset.transform.rotation) * objectToAttach.transform.rotation; - Quaternion targetRotation = attachedObject.handAttachmentPointTransform.rotation * rotDiff; - Quaternion rotationPositionBy = targetRotation * Quaternion.Inverse(objectToAttach.transform.rotation); - - Vector3 posDiff = (rotationPositionBy * objectToAttach.transform.position) - (rotationPositionBy * attachmentOffset.transform.position); - - attachedObject.initialPositionalOffset = attachedObject.handAttachmentPointTransform.InverseTransformPoint(attachedObject.handAttachmentPointTransform.position + posDiff); - attachedObject.initialRotationalOffset = Quaternion.Inverse(attachedObject.handAttachmentPointTransform.rotation) * (attachedObject.handAttachmentPointTransform.rotation * rotDiff); + attachedObject.initialPositionalOffset = attachedObject.handAttachmentPointTransform.InverseTransformPoint(objectToAttach.transform.position); + attachedObject.initialRotationalOffset = Quaternion.Inverse(attachedObject.handAttachmentPointTransform.rotation) * objectToAttach.transform.rotation; } else { - attachedObject.initialPositionalOffset = attachedObject.handAttachmentPointTransform.InverseTransformPoint(objectToAttach.transform.position); - attachedObject.initialRotationalOffset = Quaternion.Inverse(attachedObject.handAttachmentPointTransform.rotation) * objectToAttach.transform.rotation; + if (attachmentOffset != null) + { + //get the initial positional and rotational offsets between the hand and the offset transform + Quaternion rotDiff = Quaternion.Inverse(attachmentOffset.transform.rotation) * objectToAttach.transform.rotation; + Quaternion targetRotation = attachedObject.handAttachmentPointTransform.rotation * rotDiff; + Quaternion rotationPositionBy = targetRotation * Quaternion.Inverse(objectToAttach.transform.rotation); + + Vector3 posDiff = (rotationPositionBy * objectToAttach.transform.position) - (rotationPositionBy * attachmentOffset.transform.position); + + attachedObject.initialPositionalOffset = attachedObject.handAttachmentPointTransform.InverseTransformPoint(attachedObject.handAttachmentPointTransform.position + posDiff); + attachedObject.initialRotationalOffset = Quaternion.Inverse(attachedObject.handAttachmentPointTransform.rotation) * (attachedObject.handAttachmentPointTransform.rotation * rotDiff); + } + else + { + attachedObject.initialPositionalOffset = attachedObject.handAttachmentPointTransform.InverseTransformPoint(objectToAttach.transform.position); + attachedObject.initialRotationalOffset = Quaternion.Inverse(attachedObject.handAttachmentPointTransform.rotation) * objectToAttach.transform.rotation; + } } } @@ -498,6 +560,12 @@ public void AttachObject(GameObject objectToAttach, GrabTypes grabbedWithType, A } } + if (attachedObject.interactable != null && attachedObject.interactable.attachEaseIn) + { + attachedObject.attachedObject.transform.position = attachedObject.easeSourcePosition; + attachedObject.attachedObject.transform.rotation = attachedObject.easeSourceRotation; + } + attachedObjects.Add(attachedObject); UpdateHovering(); @@ -564,7 +632,11 @@ public void DetachObject(GameObject objectToDetach, bool restoreOriginalParent = { parentTransform = attachedObjects[index].originalParent.transform; } - attachedObjects[index].attachedObject.transform.parent = parentTransform; + + if (attachedObjects[index].attachedObject != null) + { + attachedObjects[index].attachedObject.transform.parent = parentTransform; + } } if (attachedObjects[index].HasAttachFlag(AttachmentFlags.TurnOnKinematic)) @@ -578,18 +650,28 @@ public void DetachObject(GameObject objectToDetach, bool restoreOriginalParent = if (attachedObjects[index].HasAttachFlag(AttachmentFlags.TurnOffGravity)) { - if (attachedObjects[index].attachedRigidbody != null) - attachedObjects[index].attachedRigidbody.useGravity = attachedObjects[index].attachedRigidbodyUsedGravity; + if (attachedObjects[index].attachedObject != null) + { + if (attachedObjects[index].attachedRigidbody != null) + attachedObjects[index].attachedRigidbody.useGravity = attachedObjects[index].attachedRigidbodyUsedGravity; + } + } + + if (attachedObjects[index].interactable != null && attachedObjects[index].interactable.handFollowTransform && HasSkeleton()) + { + skeleton.transform.localPosition = Vector3.zero; + skeleton.transform.localRotation = Quaternion.identity; } - if (attachedObjects[index].interactable == null || (attachedObjects[index].interactable != null && attachedObjects[index].interactable.isDestroying == false)) + if (attachedObjects[index].attachedObject != null) { - attachedObjects[index].attachedObject.SetActive(true); + if (attachedObjects[index].interactable == null || (attachedObjects[index].interactable != null && attachedObjects[index].interactable.isDestroying == false)) + attachedObjects[index].attachedObject.SetActive(true); + attachedObjects[index].attachedObject.SendMessage("OnDetachedFromHand", this, SendMessageOptions.DontRequireReceiver); - attachedObjects.RemoveAt(index); } - else - attachedObjects.RemoveAt(index); + + attachedObjects.RemoveAt(index); CleanUpAttachedObjectStack(); @@ -620,6 +702,13 @@ public void DetachObject(GameObject objectToDetach, bool restoreOriginalParent = //------------------------------------------------- public Vector3 GetTrackedObjectVelocity(float timeOffset = 0) { + if (trackedObject == null) + { + Vector3 velocityTarget, angularTarget; + GetUpdatedAttachedVelocities(currentAttachedObjectInfo.Value, out velocityTarget, out angularTarget); + return velocityTarget; + } + if (isActive) { if (timeOffset == 0) @@ -629,21 +718,27 @@ public Vector3 GetTrackedObjectVelocity(float timeOffset = 0) Vector3 velocity; Vector3 angularVelocity; - bool success = trackedObject.GetVelocitiesAtTimeOffset(timeOffset, out velocity, out angularVelocity); - if (success) - return Player.instance.trackingOriginTransform.TransformVector(velocity); + trackedObject.GetVelocitiesAtTimeOffset(timeOffset, out velocity, out angularVelocity); + return Player.instance.trackingOriginTransform.TransformVector(velocity); } } return Vector3.zero; } - + //------------------------------------------------- // Get the world space angular velocity of the VR Hand. //------------------------------------------------- public Vector3 GetTrackedObjectAngularVelocity(float timeOffset = 0) { + if (trackedObject == null) + { + Vector3 velocityTarget, angularTarget; + GetUpdatedAttachedVelocities(currentAttachedObjectInfo.Value, out velocityTarget, out angularTarget); + return angularTarget; + } + if (isActive) { if (timeOffset == 0) @@ -653,9 +748,8 @@ public Vector3 GetTrackedObjectAngularVelocity(float timeOffset = 0) Vector3 velocity; Vector3 angularVelocity; - bool success = trackedObject.GetVelocitiesAtTimeOffset(timeOffset, out velocity, out angularVelocity); - if (success) - return Player.instance.trackingOriginTransform.TransformDirection(angularVelocity); + trackedObject.GetVelocitiesAtTimeOffset(timeOffset, out velocity, out angularVelocity); + return Player.instance.trackingOriginTransform.TransformDirection(angularVelocity); } } @@ -693,12 +787,23 @@ protected virtual void Awake() applicationLostFocusObject.SetActive(false); if (trackedObject == null) + { trackedObject = this.gameObject.GetComponent(); - trackedObject.onTransformUpdated.AddListener(OnTransformUpdated); + if (trackedObject != null) + trackedObject.onTransformUpdatedEvent += OnTransformUpdated; + } } - protected virtual void OnTransformUpdated(SteamVR_Action_Pose pose) + protected virtual void OnDestroy() + { + if (trackedObject != null) + { + trackedObject.onTransformUpdatedEvent -= OnTransformUpdated; + } + } + + protected virtual void OnTransformUpdated(SteamVR_Behaviour_Pose updatedPose, SteamVR_Input_Sources updatedSource) { HandFollowUpdate(); } @@ -710,9 +815,14 @@ protected virtual IEnumerator Start() playerInstance = Player.instance; if (!playerInstance) { - Debug.LogError("No player instance found in Hand Start()"); + Debug.LogError("[SteamVR Interaction] No player instance found in Hand Start()", this); } + if (this.gameObject.layer == 0) + Debug.LogWarning("[SteamVR Interaction] Hand is on default layer. This puts unnecessary strain on hover checks as it is always true for hand colliders (which are then ignored).", this); + else + hoverLayerMask &= ~(1 << this.gameObject.layer); //ignore self for hovering + // allocate array for colliders overlappingColliders = new Collider[ColliderArraySize]; @@ -724,7 +834,7 @@ protected virtual IEnumerator Start() yield break; } - //Debug.Log( "Hand - initializing connection routine" ); + //Debug.Log( "[SteamVR Interaction] Hand - initializing connection routine" ); while (true) { @@ -790,8 +900,8 @@ protected virtual bool CheckHoveringForTransform(Vector3 hoverPosition, float ho int numColliding = Physics.OverlapSphereNonAlloc(hoverPosition, hoverRadius, overlappingColliders, hoverLayerMask.value); - if (numColliding == ColliderArraySize) - Debug.LogWarning("This hand is overlapping the max number of colliders: " + ColliderArraySize + ". Some collisions may be missed. Increase ColliderArraySize on Hand.cs"); + if (numColliding >= ColliderArraySize) + Debug.LogWarning("[SteamVR Interaction] This hand is overlapping the max number of colliders: " + ColliderArraySize + ". Some collisions may be missed. Increase ColliderArraySize on Hand.cs"); // DebugVar int iActualColliderCount = 0; @@ -830,16 +940,20 @@ protected virtual bool CheckHoveringForTransform(Vector3 hoverPosition, float ho break; } } - if (hoveringOverAttached) - continue; - // Occupied by another hand, so we can't touch it - if (otherHand && otherHand.hoveringInteractable == contacting) + if (hoveringOverAttached) continue; // Best candidate so far... float distance = Vector3.Distance(contacting.transform.position, hoverPosition); - if (distance < closestDistance) + //float distance = Vector3.Distance(collider.bounds.center, hoverPosition); + bool lowerPriority = false; + if (closestInteractable != null) + { // compare to closest interactable to check priority + lowerPriority = contacting.hoverPriority < closestInteractable.hoverPriority; + } + bool isCloser = (distance < closestDistance); + if (isCloser && !lowerPriority) { closestDistance = distance; closestInteractable = contacting; @@ -999,32 +1113,63 @@ protected virtual void Update() } } + /// + /// Returns true when the hand is currently hovering over the interactable passed in + /// + public bool IsStillHovering(Interactable interactable) + { + return hoveringInteractable == interactable; + } + protected virtual void HandFollowUpdate() { GameObject attachedObject = currentAttachedObject; if (attachedObject != null) { - if (currentAttachedObjectInfo.Value.interactable != null && currentAttachedObjectInfo.Value.interactable.handFollowTransform != null) + if (currentAttachedObjectInfo.Value.interactable != null) { - if (currentAttachedObjectInfo.Value.interactable.handFollowTransformRotation) - { - Quaternion offset = Quaternion.Inverse(this.transform.rotation) * currentAttachedObjectInfo.Value.handAttachmentPointTransform.rotation; - Quaternion targetHandRotation = currentAttachedObjectInfo.Value.interactable.handFollowTransform.rotation * Quaternion.Inverse(offset); + SteamVR_Skeleton_PoseSnapshot pose = null; - if (mainRenderModel != null) - mainRenderModel.SetHandRotation(targetHandRotation); - if (hoverhighlightRenderModel != null) - hoverhighlightRenderModel.SetHandRotation(targetHandRotation); + if (currentAttachedObjectInfo.Value.interactable.skeletonPoser != null && HasSkeleton()) + { + pose = currentAttachedObjectInfo.Value.interactable.skeletonPoser.GetBlendedPose(skeleton); } - if (currentAttachedObjectInfo.Value.interactable.handFollowTransformPosition) + if (currentAttachedObjectInfo.Value.interactable.handFollowTransform) { - Vector3 worldOffset = (this.transform.position - currentAttachedObjectInfo.Value.handAttachmentPointTransform.position); + Quaternion targetHandRotation; + Vector3 targetHandPosition; - Quaternion rotationDiff = mainRenderModel.GetHandRotation() * Quaternion.Inverse(this.transform.rotation); + if (pose == null) + { + Quaternion offset = Quaternion.Inverse(this.transform.rotation) * currentAttachedObjectInfo.Value.handAttachmentPointTransform.rotation; + targetHandRotation = currentAttachedObjectInfo.Value.interactable.transform.rotation * Quaternion.Inverse(offset); - Vector3 localOffset = rotationDiff * worldOffset; - Vector3 targetHandPosition = currentAttachedObjectInfo.Value.interactable.handFollowTransform.position + localOffset; + Vector3 worldOffset = (this.transform.position - currentAttachedObjectInfo.Value.handAttachmentPointTransform.position); + Quaternion rotationDiff = mainRenderModel.GetHandRotation() * Quaternion.Inverse(this.transform.rotation); + Vector3 localOffset = rotationDiff * worldOffset; + targetHandPosition = currentAttachedObjectInfo.Value.interactable.transform.position + localOffset; + } + else + { + Transform objectT = currentAttachedObjectInfo.Value.attachedObject.transform; + Vector3 oldItemPos = objectT.position; + Quaternion oldItemRot = objectT.transform.rotation; + objectT.position = TargetItemPosition(currentAttachedObjectInfo.Value); + objectT.rotation = TargetItemRotation(currentAttachedObjectInfo.Value); + Vector3 localSkelePos = objectT.InverseTransformPoint(transform.position); + Quaternion localSkeleRot = Quaternion.Inverse(objectT.rotation) * transform.rotation; + objectT.position = oldItemPos; + objectT.rotation = oldItemRot; + + targetHandPosition = objectT.TransformPoint(localSkelePos); + targetHandRotation = objectT.rotation * localSkeleRot; + } + + if (mainRenderModel != null) + mainRenderModel.SetHandRotation(targetHandRotation); + if (hoverhighlightRenderModel != null) + hoverhighlightRenderModel.SetHandRotation(targetHandRotation); if (mainRenderModel != null) mainRenderModel.SetHandPosition(targetHandPosition); @@ -1035,7 +1180,6 @@ protected virtual void HandFollowUpdate() } } - protected virtual void FixedUpdate() { if (currentAttachedObject != null) @@ -1045,7 +1189,44 @@ protected virtual void FixedUpdate() { if (attachedInfo.HasAttachFlag(AttachmentFlags.VelocityMovement)) { - UpdateAttachedVelocity(attachedInfo); + if (attachedInfo.interactable.attachEaseIn == false || attachedInfo.interactable.snapAttachEaseInCompleted) + UpdateAttachedVelocity(attachedInfo); + + /*if (attachedInfo.interactable.handFollowTransformPosition) + { + skeleton.transform.position = TargetSkeletonPosition(attachedInfo); + skeleton.transform.rotation = attachedInfo.attachedObject.transform.rotation * attachedInfo.skeletonLockRotation; + }*/ + } + else + { + if (attachedInfo.HasAttachFlag(AttachmentFlags.ParentToHand)) + { + attachedInfo.attachedObject.transform.position = TargetItemPosition(attachedInfo); + attachedInfo.attachedObject.transform.rotation = TargetItemRotation(attachedInfo); + } + } + + + if (attachedInfo.interactable.attachEaseIn) + { + float t = Util.RemapNumberClamped(Time.time, attachedInfo.attachTime, attachedInfo.attachTime + attachedInfo.interactable.snapAttachEaseInTime, 0.0f, 1.0f); + if (t < 1.0f) + { + if (attachedInfo.HasAttachFlag(AttachmentFlags.VelocityMovement)) + { + attachedInfo.attachedRigidbody.velocity = Vector3.zero; + attachedInfo.attachedRigidbody.angularVelocity = Vector3.zero; + } + t = attachedInfo.interactable.snapAttachEaseInCurve.Evaluate(t); + attachedInfo.attachedObject.transform.position = Vector3.Lerp(attachedInfo.easeSourcePosition, TargetItemPosition(attachedInfo), t); + attachedInfo.attachedObject.transform.rotation = Quaternion.Lerp(attachedInfo.easeSourceRotation, TargetItemRotation(attachedInfo), t); + } + else if (!attachedInfo.interactable.snapAttachEaseInCompleted) + { + attachedInfo.interactable.gameObject.SendMessage("OnThrowableAttachEaseInCompleted", this, SendMessageOptions.DontRequireReceiver); + attachedInfo.interactable.snapAttachEaseInCompleted = true; + } } } } @@ -1058,24 +1239,79 @@ protected virtual void FixedUpdate() protected void UpdateAttachedVelocity(AttachedObject attachedObjectInfo) { - float scale = SteamVR_Utils.GetLossyScale(currentAttachedObjectInfo.Value.handAttachmentPointTransform); + Vector3 velocityTarget, angularTarget; + bool success = GetUpdatedAttachedVelocities(attachedObjectInfo, out velocityTarget, out angularTarget); + if (success) + { + float scale = SteamVR_Utils.GetLossyScale(currentAttachedObjectInfo.Value.handAttachmentPointTransform); + float maxAngularVelocityChange = MaxAngularVelocityChange * scale; + float maxVelocityChange = MaxVelocityChange * scale; + + attachedObjectInfo.attachedRigidbody.velocity = Vector3.MoveTowards(attachedObjectInfo.attachedRigidbody.velocity, velocityTarget, maxVelocityChange); + attachedObjectInfo.attachedRigidbody.angularVelocity = Vector3.MoveTowards(attachedObjectInfo.attachedRigidbody.angularVelocity, angularTarget, maxAngularVelocityChange); + } + } + + /// + /// Snap an attached object to its target position and rotation. Good for error correction. + /// + public void ResetAttachedTransform(AttachedObject attachedObject) + { + attachedObject.attachedObject.transform.position = TargetItemPosition(attachedObject); + attachedObject.attachedObject.transform.rotation = TargetItemRotation(attachedObject); + } + + protected Vector3 TargetItemPosition(AttachedObject attachedObject) + { + if (attachedObject.interactable != null && attachedObject.interactable.skeletonPoser != null && HasSkeleton()) + { + Vector3 tp = attachedObject.handAttachmentPointTransform.InverseTransformPoint(transform.TransformPoint(attachedObject.interactable.skeletonPoser.GetBlendedPose(skeleton).position)); + //tp.x *= -1; + return currentAttachedObjectInfo.Value.handAttachmentPointTransform.TransformPoint(tp); + } + else + { + return currentAttachedObjectInfo.Value.handAttachmentPointTransform.TransformPoint(attachedObject.initialPositionalOffset); + } + } + + protected Quaternion TargetItemRotation(AttachedObject attachedObject) + { + if (attachedObject.interactable != null && attachedObject.interactable.skeletonPoser != null && HasSkeleton()) + { + Quaternion tr = Quaternion.Inverse(attachedObject.handAttachmentPointTransform.rotation) * (transform.rotation * attachedObject.interactable.skeletonPoser.GetBlendedPose(skeleton).rotation); + return currentAttachedObjectInfo.Value.handAttachmentPointTransform.rotation * tr; + } + else + { + return currentAttachedObjectInfo.Value.handAttachmentPointTransform.rotation * attachedObject.initialRotationalOffset; + } + } + + protected bool GetUpdatedAttachedVelocities(AttachedObject attachedObjectInfo, out Vector3 velocityTarget, out Vector3 angularTarget) + { + bool realNumbers = false; + - float maxVelocityChange = MaxVelocityChange * scale; float velocityMagic = VelocityMagic; float angularVelocityMagic = AngularVelocityMagic; - float maxAngularVelocityChange = MaxAngularVelocityChange * scale; - Vector3 targetItemPosition = currentAttachedObjectInfo.Value.handAttachmentPointTransform.TransformPoint(attachedObjectInfo.initialPositionalOffset); + Vector3 targetItemPosition = TargetItemPosition(attachedObjectInfo); Vector3 positionDelta = (targetItemPosition - attachedObjectInfo.attachedRigidbody.position); - Vector3 velocityTarget = (positionDelta * velocityMagic * Time.deltaTime); + velocityTarget = (positionDelta * velocityMagic * Time.deltaTime); if (float.IsNaN(velocityTarget.x) == false && float.IsInfinity(velocityTarget.x) == false) { - attachedObjectInfo.attachedRigidbody.velocity = Vector3.MoveTowards(attachedObjectInfo.attachedRigidbody.velocity, velocityTarget, maxVelocityChange); + if (noSteamVRFallbackCamera) + velocityTarget /= 10; //hacky fix for fallback + + realNumbers = true; } + else + velocityTarget = Vector3.zero; - Quaternion targetItemRotation = currentAttachedObjectInfo.Value.handAttachmentPointTransform.rotation * attachedObjectInfo.initialRotationalOffset; + Quaternion targetItemRotation = TargetItemRotation(attachedObjectInfo); Quaternion rotationDelta = targetItemRotation * Quaternion.Inverse(attachedObjectInfo.attachedObject.transform.rotation); @@ -1088,10 +1324,17 @@ protected void UpdateAttachedVelocity(AttachedObject attachedObjectInfo) if (angle != 0 && float.IsNaN(axis.x) == false && float.IsInfinity(axis.x) == false) { - Vector3 angularTarget = angle * axis * angularVelocityMagic * Time.deltaTime; + angularTarget = angle * axis * angularVelocityMagic * Time.deltaTime; - attachedObjectInfo.attachedRigidbody.angularVelocity = Vector3.MoveTowards(attachedObjectInfo.attachedRigidbody.angularVelocity, angularTarget, maxAngularVelocityChange); + if (noSteamVRFallbackCamera) + angularTarget /= 10; //hacky fix for fallback + + realNumbers &= true; } + else + angularTarget = Vector3.zero; + + return realNumbers; } @@ -1116,25 +1359,25 @@ protected virtual void OnInputFocus(bool hasFocus) //------------------------------------------------- protected virtual void OnDrawGizmos() { - if (useHoverSphere) + if (useHoverSphere && hoverSphereTransform != null) { Gizmos.color = Color.green; float scaledHoverRadius = hoverSphereRadius * Mathf.Abs(SteamVR_Utils.GetLossyScale(hoverSphereTransform)); - Gizmos.DrawWireSphere(hoverSphereTransform.position, scaledHoverRadius/2); + Gizmos.DrawWireSphere(hoverSphereTransform.position, scaledHoverRadius / 2); } if (useControllerHoverComponent && mainRenderModel != null && mainRenderModel.IsControllerVisibile()) { Gizmos.color = Color.blue; float scaledHoverRadius = controllerHoverRadius * Mathf.Abs(SteamVR_Utils.GetLossyScale(this.transform)); - Gizmos.DrawWireSphere(mainRenderModel.GetControllerPosition(controllerHoverComponent), scaledHoverRadius/2); + Gizmos.DrawWireSphere(mainRenderModel.GetControllerPosition(controllerHoverComponent), scaledHoverRadius / 2); } if (useFingerJointHover && mainRenderModel != null && mainRenderModel.IsHandVisibile()) { Gizmos.color = Color.yellow; float scaledHoverRadius = fingerJointHoverRadius * Mathf.Abs(SteamVR_Utils.GetLossyScale(this.transform)); - Gizmos.DrawWireSphere(mainRenderModel.GetBonePosition((int)fingerJointHover), scaledHoverRadius/2); + Gizmos.DrawWireSphere(mainRenderModel.GetBonePosition((int)fingerJointHover), scaledHoverRadius / 2); } } @@ -1144,7 +1387,7 @@ private void HandDebugLog(string msg) { if (spewDebugText) { - Debug.Log("Hand (" + this.name + "): " + msg); + Debug.Log("[SteamVR Interaction] Hand (" + this.name + "): " + msg); } } @@ -1209,6 +1452,14 @@ public GrabTypes GetGrabStarting(GrabTypes explicitType = GrabTypes.None) { if (explicitType != GrabTypes.None) { + if (noSteamVRFallbackCamera) + { + if (Input.GetMouseButtonDown(0)) + return explicitType; + else + return GrabTypes.None; + } + if (explicitType == GrabTypes.Pinch && grabPinchAction.GetStateDown(handType)) return GrabTypes.Pinch; if (explicitType == GrabTypes.Grip && grabGripAction.GetStateDown(handType)) @@ -1216,9 +1467,17 @@ public GrabTypes GetGrabStarting(GrabTypes explicitType = GrabTypes.None) } else { - if (grabPinchAction.GetStateDown(handType)) + if (noSteamVRFallbackCamera) + { + if (Input.GetMouseButtonDown(0)) + return GrabTypes.Grip; + else + return GrabTypes.None; + } + + if (grabPinchAction != null && grabPinchAction.GetStateDown(handType)) return GrabTypes.Pinch; - if (grabGripAction.GetStateDown(handType)) + if (grabGripAction != null && grabGripAction.GetStateDown(handType)) return GrabTypes.Grip; } @@ -1229,6 +1488,14 @@ public GrabTypes GetGrabEnding(GrabTypes explicitType = GrabTypes.None) { if (explicitType != GrabTypes.None) { + if (noSteamVRFallbackCamera) + { + if (Input.GetMouseButtonUp(0)) + return explicitType; + else + return GrabTypes.None; + } + if (explicitType == GrabTypes.Pinch && grabPinchAction.GetStateUp(handType)) return GrabTypes.Pinch; if (explicitType == GrabTypes.Grip && grabGripAction.GetStateUp(handType)) @@ -1236,6 +1503,14 @@ public GrabTypes GetGrabEnding(GrabTypes explicitType = GrabTypes.None) } else { + if (noSteamVRFallbackCamera) + { + if (Input.GetMouseButtonUp(0)) + return GrabTypes.Grip; + else + return GrabTypes.None; + } + if (grabPinchAction.GetStateUp(handType)) return GrabTypes.Pinch; if (grabGripAction.GetStateUp(handType)) @@ -1260,6 +1535,14 @@ public bool IsGrabEnding(GameObject attachedObject) public bool IsGrabbingWithType(GrabTypes type) { + if (noSteamVRFallbackCamera) + { + if (Input.GetMouseButton(0)) + return true; + else + return false; + } + switch (type) { case GrabTypes.Pinch: @@ -1275,6 +1558,14 @@ public bool IsGrabbingWithType(GrabTypes type) public bool IsGrabbingWithOppositeType(GrabTypes type) { + if (noSteamVRFallbackCamera) + { + if (Input.GetMouseButton(0)) + return true; + else + return false; + } + switch (type) { case GrabTypes.Pinch: @@ -1295,6 +1586,14 @@ public GrabTypes GetBestGrabbingType() public GrabTypes GetBestGrabbingType(GrabTypes preferred, bool forcePreference = false) { + if (noSteamVRFallbackCamera) + { + if (Input.GetMouseButton(0)) + return preferred; + else + return GrabTypes.None; + } + if (preferred == GrabTypes.Pinch) { if (grabPinchAction.GetState(handType)) @@ -1327,7 +1626,7 @@ private void InitController() bool hadOldRendermodel = mainRenderModel != null; EVRSkeletalMotionRange oldRM_rom = EVRSkeletalMotionRange.WithController; - if(hadOldRendermodel) + if (hadOldRendermodel) oldRM_rom = mainRenderModel.GetSkeletonRangeOfMotion; @@ -1384,45 +1683,4 @@ public int GetDeviceIndex() [System.Serializable] public class HandEvent : UnityEvent { } - - -#if UNITY_EDITOR - //------------------------------------------------------------------------- - [UnityEditor.CustomEditor(typeof(Hand))] - public class HandEditor : UnityEditor.Editor - { - //------------------------------------------------- - // Custom Inspector GUI allows us to click from within the UI - //------------------------------------------------- - public override void OnInspectorGUI() - { - DrawDefaultInspector(); - - Hand hand = (Hand)target; - - if (hand.otherHand) - { - if (hand.otherHand.otherHand != hand) - { - UnityEditor.EditorGUILayout.HelpBox("The otherHand of this Hand's otherHand is not this Hand.", UnityEditor.MessageType.Warning); - } - - if (hand.handType == SteamVR_Input_Sources.LeftHand && hand.otherHand.handType != SteamVR_Input_Sources.RightHand) - { - UnityEditor.EditorGUILayout.HelpBox("This is a left Hand but otherHand is not a right Hand.", UnityEditor.MessageType.Warning); - } - - if (hand.handType == SteamVR_Input_Sources.RightHand && hand.otherHand.handType != SteamVR_Input_Sources.LeftHand) - { - UnityEditor.EditorGUILayout.HelpBox("This is a right Hand but otherHand is not a left Hand.", UnityEditor.MessageType.Warning); - } - - if (hand.handType == SteamVR_Input_Sources.Any && hand.otherHand.handType != SteamVR_Input_Sources.Any) - { - UnityEditor.EditorGUILayout.HelpBox("This is an any-handed Hand but otherHand is not an any-handed Hand.", UnityEditor.MessageType.Warning); - } - } - } - } -#endif -} +} \ No newline at end of file diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs.meta index 690bab25..3c9b4f9e 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 29e3e4511966ba94d8ba0b98c6c62f82 -timeCreated: 1484266511 +timeCreated: 1544851963 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/HandCollider.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/HandCollider.cs new file mode 100644 index 00000000..f292ac96 --- /dev/null +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/HandCollider.cs @@ -0,0 +1,284 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Valve.VR.InteractionSystem +{ + public class HandCollider : MonoBehaviour + { + private new Rigidbody rigidbody; + [HideInInspector] + public HandPhysics hand; + + public LayerMask collisionMask; + + Collider[] colliders; + + + public FingerColliders fingerColliders; + + [System.Serializable] + public class FingerColliders + { + [Tooltip("Starting at tip and going down. Max 2.")] + public Transform[] thumbColliders = new Transform[1]; + [Tooltip("Starting at tip and going down. Max 3.")] + public Transform[] indexColliders = new Transform[2]; + [Tooltip("Starting at tip and going down. Max 3.")] + public Transform[] middleColliders = new Transform[2]; + [Tooltip("Starting at tip and going down. Max 3.")] + public Transform[] ringColliders = new Transform[2]; + [Tooltip("Starting at tip and going down. Max 3.")] + public Transform[] pinkyColliders = new Transform[2]; + + public Transform[] this[int finger] + { + get + { + switch (finger) + { + case 0: + return thumbColliders; + case 1: + return indexColliders; + case 2: + return middleColliders; + case 3: + return ringColliders; + case 4: + return pinkyColliders; + default: + return null; + } + } + set + { + switch (finger) + { + case 0: + thumbColliders = value; break; + case 1: + indexColliders = value; break; + case 2: + middleColliders = value; break; + case 3: + ringColliders = value; break; + case 4: + pinkyColliders = value; break; + } + } + } + + } + + private static PhysicMaterial physicMaterial_lowfriction; + private static PhysicMaterial physicMaterial_highfriction; + + private void Awake() + { + rigidbody = GetComponent(); + rigidbody.maxAngularVelocity = 50; + } + + private void Start() + { + colliders = GetComponentsInChildren(); + + if (physicMaterial_lowfriction == null) + { + physicMaterial_lowfriction = new PhysicMaterial("hand_lowFriction"); + physicMaterial_lowfriction.dynamicFriction = 0; + physicMaterial_lowfriction.staticFriction = 0; + physicMaterial_lowfriction.bounciness = 0; + physicMaterial_lowfriction.bounceCombine = PhysicMaterialCombine.Minimum; + physicMaterial_lowfriction.frictionCombine = PhysicMaterialCombine.Minimum; + } + + if (physicMaterial_highfriction == null) + { + physicMaterial_highfriction = new PhysicMaterial("hand_highFriction"); + physicMaterial_highfriction.dynamicFriction = 1f; + physicMaterial_highfriction.staticFriction = 1f; + physicMaterial_highfriction.bounciness = 0; + physicMaterial_highfriction.bounceCombine = PhysicMaterialCombine.Minimum; + physicMaterial_highfriction.frictionCombine = PhysicMaterialCombine.Average; + } + + SetPhysicMaterial(physicMaterial_lowfriction); + + scale = SteamVR_Utils.GetLossyScale(hand.transform); + } + + void SetPhysicMaterial(PhysicMaterial mat) + { + if (colliders == null) colliders = GetComponentsInChildren(); + for (int i = 0; i < colliders.Length; i++) + { + colliders[i].sharedMaterial = mat; + } + } + + float scale; + + public void SetCollisionDetectionEnabled(bool value) + { + rigidbody.detectCollisions = value; + } + + public void MoveTo(Vector3 position, Quaternion rotation) + { + targetPosition = position; + targetRotation = rotation; + //rigidbody.MovePosition(position); + //rigidbody.MoveRotation(rotation); + + ExecuteFixedUpdate(); + } + + public void TeleportTo(Vector3 position, Quaternion rotation) + { + targetPosition = position; + targetRotation = rotation; + + MoveTo(position, rotation); + + rigidbody.position = position; + + if (rotation.x != 0 || rotation.y != 0 || rotation.z != 0 || rotation.w != 0) + rigidbody.rotation = rotation; + + //also update transform in case physics is disabled + transform.position = position; + transform.rotation = rotation; + } + + public void Reset() + { + TeleportTo(targetPosition, targetRotation); + } + + public void SetCenterPoint(Vector3 newCenter) + { + center = newCenter; + } + + private Vector3 center; + + private Vector3 targetPosition = Vector3.zero; + private Quaternion targetRotation = Quaternion.identity; + + protected const float MaxVelocityChange = 10f; + protected const float VelocityMagic = 6000f; + protected const float AngularVelocityMagic = 50f; + protected const float MaxAngularVelocityChange = 20f; + + public bool collidersInRadius; + protected void ExecuteFixedUpdate() + { + collidersInRadius = Physics.CheckSphere(center, 0.2f, collisionMask); + if (collidersInRadius == false) + { + //keep updating velocity, just in case. Otherwise you get jitter + rigidbody.velocity = Vector3.zero; + rigidbody.angularVelocity = Vector3.zero; + /* + rigidbody.velocity = (targetPosition - rigidbody.position) / Time.fixedDeltaTime; + float angle; Vector3 axis; + (targetRotation * Quaternion.Inverse(rigidbody.rotation)).ToAngleAxis(out angle, out axis); + rigidbody.angularVelocity = axis.normalized * angle / Time.fixedDeltaTime; + */ + + rigidbody.MovePosition(targetPosition); + rigidbody.MoveRotation(targetRotation); + } + else + { + Vector3 velocityTarget, angularTarget; + bool success = GetTargetVelocities(out velocityTarget, out angularTarget); + if (success) + { + float maxAngularVelocityChange = MaxAngularVelocityChange * scale; + float maxVelocityChange = MaxVelocityChange * scale; + + rigidbody.velocity = Vector3.MoveTowards(rigidbody.velocity, velocityTarget, maxVelocityChange); + rigidbody.angularVelocity = Vector3.MoveTowards(rigidbody.angularVelocity, angularTarget, maxAngularVelocityChange); + } + } + } + + + + protected bool GetTargetVelocities(out Vector3 velocityTarget, out Vector3 angularTarget) + { + bool realNumbers = false; + + float velocityMagic = VelocityMagic; + float angularVelocityMagic = AngularVelocityMagic; + + Vector3 positionDelta = (targetPosition - rigidbody.position); + velocityTarget = (positionDelta * velocityMagic * Time.deltaTime); + + if (float.IsNaN(velocityTarget.x) == false && float.IsInfinity(velocityTarget.x) == false) + { + realNumbers = true; + } + else + velocityTarget = Vector3.zero; + + + Quaternion rotationDelta = targetRotation * Quaternion.Inverse(rigidbody.rotation); + + + float angle; + Vector3 axis; + rotationDelta.ToAngleAxis(out angle, out axis); + + if (angle > 180) + angle -= 360; + + if (angle != 0 && float.IsNaN(axis.x) == false && float.IsInfinity(axis.x) == false) + { + angularTarget = angle * axis * angularVelocityMagic * Time.deltaTime; + + realNumbers &= true; + } + else + angularTarget = Vector3.zero; + + return realNumbers; + } + + + const float minCollisionEnergy = 0.1f; + const float maxCollisionEnergy = 1.0f; + + const float minCollisionHapticsTime = 0.2f; + private float lastCollisionHapticsTime; + private void OnCollisionEnter(Collision collision) + { + bool touchingDynamic = false; + if (collision.rigidbody != null) + { + if (collision.rigidbody.isKinematic == false) touchingDynamic = true; + } + + // low friction if touching static object, high friction if touching dynamic + SetPhysicMaterial(touchingDynamic ? physicMaterial_highfriction : physicMaterial_lowfriction); + + + + float energy = collision.relativeVelocity.magnitude; + + if(energy > minCollisionEnergy && Time.time - lastCollisionHapticsTime > minCollisionHapticsTime) + { + lastCollisionHapticsTime = Time.time; + + float intensity = Util.RemapNumber(energy, minCollisionEnergy, maxCollisionEnergy, 0.3f, 1.0f); + float length = Util.RemapNumber(energy, minCollisionEnergy, maxCollisionEnergy, 0.0f, 0.06f); + + hand.hand.TriggerHapticPulse(length, 100, intensity); + } + } + + } +} \ No newline at end of file diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/HandCollider.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/HandCollider.cs.meta new file mode 100644 index 00000000..3ad3f15a --- /dev/null +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/HandCollider.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2820b584f2917744bafbfd2f8f387225 +timeCreated: 1567795659 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/HandPhysics.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/HandPhysics.cs new file mode 100644 index 00000000..39fe5d67 --- /dev/null +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/HandPhysics.cs @@ -0,0 +1,237 @@ +//======= Copyright (c) Valve Corporation, All rights reserved. =============== +// +// Purpose: handles the physics of hands colliding with the world +// +//============================================================================= + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Valve.VR.InteractionSystem +{ + public class HandPhysics : MonoBehaviour + { + [Tooltip("Hand collider prefab to instantiate")] + public HandCollider handColliderPrefab; + [HideInInspector] + public HandCollider handCollider; + + [Tooltip("Layers to consider when checking if an area is clear")] + public LayerMask clearanceCheckMask; + + [HideInInspector] + public Hand hand; + + // distance at which hand will teleport back to controller + const float handResetDistance = 0.6f; + + const float collisionReenableClearanceRadius = 0.1f; + + private bool initialized = false; + + private bool collisionsEnabled = true; + + + private void Start() + { + hand = GetComponent(); + //spawn hand collider and link it to us + + handCollider = ((GameObject)Instantiate(handColliderPrefab.gameObject)).GetComponent(); + Vector3 localPosition = handCollider.transform.localPosition; + Quaternion localRotation = handCollider.transform.localRotation; + + handCollider.transform.parent = Player.instance.transform; + handCollider.transform.localPosition = localPosition; + handCollider.transform.localRotation = localRotation; + handCollider.hand = this; + + GetComponent().onTransformUpdated.AddListener(UpdateHand); + } + + // cached transformations + Matrix4x4 wristToRoot; + Matrix4x4 rootToArmature; + Matrix4x4 wristToArmature; + + Vector3 targetPosition = Vector3.zero; + Quaternion targetRotation = Quaternion.identity; + + //bones + const int wristBone = SteamVR_Skeleton_JointIndexes.wrist; + const int rootBone = SteamVR_Skeleton_JointIndexes.root; + + private void FixedUpdate() + { + if (hand.skeleton == null) return; + initialized = true; + + UpdateCenterPoint(); + + handCollider.MoveTo(targetPosition, targetRotation); + + if ((handCollider.transform.position - targetPosition).sqrMagnitude > handResetDistance * handResetDistance) + handCollider.TeleportTo(targetPosition, targetRotation); + + UpdateFingertips(); + } + + private void UpdateCenterPoint() + { + Vector3 offset = hand.skeleton.GetBonePosition(SteamVR_Skeleton_JointIndexes.middleProximal) - hand.skeleton.GetBonePosition(SteamVR_Skeleton_JointIndexes.root); + if (hand.HasSkeleton()) + { + handCollider.SetCenterPoint(hand.skeleton.transform.position + offset); + } + } + + Collider[] clearanceBuffer = new Collider[1]; + + private void UpdatePositions() + { + // disable collisions when holding something + if (hand.currentAttachedObject != null) + { + collisionsEnabled = false; + } + else + { + // wait for area to become clear before reenabling collisions + if (!collisionsEnabled) + { + clearanceBuffer[0] = null; + Physics.OverlapSphereNonAlloc(hand.objectAttachmentPoint.position, collisionReenableClearanceRadius, clearanceBuffer); + // if we don't find anything in the vicinity, reenable collisions! + if (clearanceBuffer[0] == null) + { + collisionsEnabled = true; + } + } + } + + handCollider.SetCollisionDetectionEnabled(collisionsEnabled); + + if (hand.skeleton == null) return; + initialized = true; + + // get the desired pose of the wrist in world space. Can't get the wrist bone transform, as this is affected by the resulting physics. + + wristToRoot = Matrix4x4.TRS(ProcessPos(wristBone, hand.skeleton.GetBone(wristBone).localPosition), + ProcessRot(wristBone, hand.skeleton.GetBone(wristBone).localRotation), + Vector3.one).inverse; + + rootToArmature = Matrix4x4.TRS(ProcessPos(rootBone, hand.skeleton.GetBone(rootBone).localPosition), + ProcessRot(rootBone, hand.skeleton.GetBone(rootBone).localRotation), + Vector3.one).inverse; + + wristToArmature = (wristToRoot * rootToArmature).inverse; + + // step up through virtual transform hierarchy and into world space + targetPosition = transform.TransformPoint(wristToArmature.MultiplyPoint3x4(Vector3.zero)); + + targetRotation = transform.rotation * wristToArmature.GetRotation(); + + + //bypass physics when game paused + if (Time.timeScale == 0) + { + handCollider.TeleportTo(targetPosition, targetRotation); + } + } + + Transform wrist; + + const int thumbBone = SteamVR_Skeleton_JointIndexes.thumbDistal; + const int indexBone = SteamVR_Skeleton_JointIndexes.indexDistal; + const int middleBone = SteamVR_Skeleton_JointIndexes.middleDistal; + const int ringBone = SteamVR_Skeleton_JointIndexes.ringDistal; + const int pinkyBone = SteamVR_Skeleton_JointIndexes.pinkyDistal; + + void UpdateFingertips() + { + wrist = hand.skeleton.GetBone(SteamVR_Skeleton_JointIndexes.wrist); + + // set finger tip positions in wrist space + + for(int finger = 0; finger < 5; finger++) + { + int tip = SteamVR_Skeleton_JointIndexes.GetBoneForFingerTip(finger); + int bone = tip; + for(int i = 0; i < handCollider.fingerColliders[finger].Length; i++) + { + bone = tip - 1 - i; // start at distal and go down + if (handCollider.fingerColliders[finger][i] != null) + handCollider.fingerColliders[finger][i].localPosition = wrist.InverseTransformPoint(hand.skeleton.GetBone(bone).position); + } + } + /* + if(handCollider.tip_thumb != null) + handCollider.tip_thumb.localPosition = wrist.InverseTransformPoint(hand.skeleton.GetBone(thumbBone).position); + + if(handCollider.tip_index != null) + handCollider.tip_index.localPosition = wrist.InverseTransformPoint(hand.skeleton.GetBone(indexBone).position); + + if(handCollider.tip_middle != null) + handCollider.tip_middle.localPosition = wrist.InverseTransformPoint(hand.skeleton.GetBone(middleBone).position); + + if(handCollider.tip_ring != null) + handCollider.tip_ring.localPosition = wrist.InverseTransformPoint(hand.skeleton.GetBone(ringBone).position); + + if (handCollider.tip_pinky != null) + handCollider.tip_pinky.localPosition = wrist.InverseTransformPoint(hand.skeleton.GetBone(pinkyBone).position); + */ + } + + void UpdateHand(SteamVR_Behaviour_Pose pose, SteamVR_Input_Sources inputSource) + { + if (!initialized) return; + + UpdateCenterPoint(); + + UpdatePositions(); + + Quaternion offsetRotation = handCollider.transform.rotation * wristToArmature.inverse.GetRotation(); + + hand.mainRenderModel.transform.rotation = offsetRotation; + + Vector3 offsetPosition = handCollider.transform.TransformPoint(wristToArmature.inverse.MultiplyPoint3x4(Vector3.zero)); + + hand.mainRenderModel.transform.position = offsetPosition; + + /* + Vector3 wristPointInArmatureSpace = transform.InverseTransformPoint(handCollider.transform.position); + + Vector3 handTargetPosition = + + hand.mainRenderModel.transform.position = handTargetPosition; + + //Quaternion handTargetRotation = transform.rotation * (wristToArmature.inverse.rotation * (Quaternion.Inverse(transform.rotation) * handCollider.transform.rotation)); + + //hand.mainRenderModel.transform.rotation = handTargetRotation; + */ + } + + Vector3 ProcessPos(int boneIndex, Vector3 pos) + { + if(hand.skeleton.mirroring != SteamVR_Behaviour_Skeleton.MirrorType.None) + { + return SteamVR_Behaviour_Skeleton.MirrorPosition(boneIndex, pos); + } + + return pos; + } + + Quaternion ProcessRot(int boneIndex, Quaternion rot) + { + if (hand.skeleton.mirroring != SteamVR_Behaviour_Skeleton.MirrorType.None) + { + return SteamVR_Behaviour_Skeleton.MirrorRotation(boneIndex, rot); + } + + return rot; + } + + + } +} \ No newline at end of file diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/HandPhysics.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/HandPhysics.cs.meta new file mode 100644 index 00000000..2c74f868 --- /dev/null +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/HandPhysics.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1e75fe4b0c190eb4ba97e59f062510e9 +timeCreated: 1567795659 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/HapticRack.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/HapticRack.cs.meta index ba758991..081f7f31 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/HapticRack.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/HapticRack.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 817521c5973e4ee45905ee97df3c38ad -timeCreated: 1433796170 +timeCreated: 1544851962 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/HideOnHandFocusLost.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/HideOnHandFocusLost.cs.meta index ef47944e..6997b3ff 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/HideOnHandFocusLost.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/HideOnHandFocusLost.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: eb6d6653511aff5409d0827d4e3b79ea -timeCreated: 1439254899 +timeCreated: 1544851962 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/HoverButton.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/HoverButton.cs.meta index 5e30e5d9..0e4979d4 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/HoverButton.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/HoverButton.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 2c0e35ef0cc211b408d2d7e7eb0f850d -timeCreated: 1434650764 +timeCreated: 1544851963 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/IgnoreHovering.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/IgnoreHovering.cs.meta index 81f57159..35c40141 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/IgnoreHovering.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/IgnoreHovering.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: f5a1be5da1c87864582d778e52de4e9b -timeCreated: 1444166650 +timeCreated: 1544851963 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/InputModule.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/InputModule.cs.meta index 63b5111e..8a23a810 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/InputModule.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/InputModule.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: c9e05292e0d62b542ac5bba92674a86d -timeCreated: 1429055028 +timeCreated: 1544851963 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs index bd9ce883..1b436f79 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs @@ -11,8 +11,8 @@ namespace Valve.VR.InteractionSystem { - //------------------------------------------------------------------------- - public class Interactable : MonoBehaviour + //------------------------------------------------------------------------- + public class Interactable : MonoBehaviour { [Tooltip("Activates an action set on attach and deactivates on detach")] public SteamVR_ActionSet activateActionSetOnAttach; @@ -32,63 +32,101 @@ public class Interactable : MonoBehaviour [Tooltip("The range of motion to set on the skeleton. None for no change.")] public SkeletalMotionRangeChange setRangeOfMotionOnPickup = SkeletalMotionRangeChange.None; - public delegate void OnAttachedToHandDelegate( Hand hand ); - public delegate void OnDetachedFromHandDelegate( Hand hand ); + public delegate void OnAttachedToHandDelegate(Hand hand); + public delegate void OnDetachedFromHandDelegate(Hand hand); - [HideInInspector] - public event OnAttachedToHandDelegate onAttachedToHand; - [HideInInspector] - public event OnDetachedFromHandDelegate onDetachedFromHand; + public event OnAttachedToHandDelegate onAttachedToHand; + public event OnDetachedFromHandDelegate onDetachedFromHand; [Tooltip("Specify whether you want to snap to the hand's object attachment point, or just the raw hand")] public bool useHandObjectAttachmentPoint = true; - [Tooltip("If you want the hand to stick to an object while attached, set the transform to stick to here")] - public Transform handFollowTransform; - public bool handFollowTransformPosition = true; - public bool handFollowTransformRotation = true; + public bool attachEaseIn = false; + [HideInInspector] + public AnimationCurve snapAttachEaseInCurve = AnimationCurve.EaseInOut(0.0f, 0.0f, 1.0f, 1.0f); + public float snapAttachEaseInTime = 0.15f; + + public bool snapAttachEaseInCompleted = false; + + + // [Tooltip("The skeleton pose to apply when grabbing. Can only set this or handFollowTransform.")] + [HideInInspector] + public SteamVR_Skeleton_Poser skeletonPoser; + + [Tooltip("Should the rendered hand lock on to and follow the object")] + public bool handFollowTransform= true; [Tooltip("Set whether or not you want this interactible to highlight when hovering over it")] public bool highlightOnHover = true; - private MeshRenderer[] highlightRenderers; - private MeshRenderer[] existingRenderers; - private GameObject highlightHolder; - private SkinnedMeshRenderer[] highlightSkinnedRenderers; - private SkinnedMeshRenderer[] existingSkinnedRenderers; - private static Material highlightMat; + protected MeshRenderer[] highlightRenderers; + protected MeshRenderer[] existingRenderers; + protected GameObject highlightHolder; + protected SkinnedMeshRenderer[] highlightSkinnedRenderers; + protected SkinnedMeshRenderer[] existingSkinnedRenderers; + protected static Material highlightMat; [Tooltip("An array of child gameObjects to not render a highlight for. Things like transparent parts, vfx, etc.")] public GameObject[] hideHighlight; + [Tooltip("Higher is better")] + public int hoverPriority = 0; [System.NonSerialized] public Hand attachedToHand; - public bool isDestroying { get; protected set; } + [System.NonSerialized] + public List hoveringHands = new List(); + public Hand hoveringHand + { + get + { + if (hoveringHands.Count > 0) + return hoveringHands[0]; + return null; + } + } + + public bool isDestroying { get; protected set; } public bool isHovering { get; protected set; } public bool wasHovering { get; protected set; } - private void Start() + + private void Awake() { - highlightMat = (Material)Resources.Load("SteamVR_HoverHighlight", typeof(Material)); + skeletonPoser = GetComponent(); + } + protected virtual void Start() + { if (highlightMat == null) - Debug.LogError("Hover Highlight Material is missing. Please create a material named 'SteamVR_HoverHighlight' and place it in a Resources folder"); - +#if UNITY_URP + highlightMat = (Material)Resources.Load("SteamVR_HoverHighlight_URP", typeof(Material)); +#else + highlightMat = (Material)Resources.Load("SteamVR_HoverHighlight", typeof(Material)); +#endif + + if (highlightMat == null) + Debug.LogError("[SteamVR Interaction] Hover Highlight Material is missing. Please create a material named 'SteamVR_HoverHighlight' and place it in a Resources folder", this); + + if (skeletonPoser != null) + { + if (useHandObjectAttachmentPoint) + { + //Debug.LogWarning("[SteamVR Interaction] SkeletonPose and useHandObjectAttachmentPoint both set at the same time. Ignoring useHandObjectAttachmentPoint."); + useHandObjectAttachmentPoint = false; + } + } } - private bool ShouldIgnoreHighlight(Component component) + protected virtual bool ShouldIgnoreHighlight(Component component) { return ShouldIgnore(component.gameObject); } - private bool ShouldIgnore(GameObject check) + + protected virtual bool ShouldIgnore(GameObject check) { - if (hideHighlight == null) - { - return false; - } for (int ignoreIndex = 0; ignoreIndex < hideHighlight.Length; ignoreIndex++) { if (check == hideHighlight[ignoreIndex]) @@ -98,7 +136,7 @@ private bool ShouldIgnore(GameObject check) return false; } - private void CreateHighlightRenderers() + protected virtual void CreateHighlightRenderers() { existingSkinnedRenderers = this.GetComponentsInChildren(true); highlightHolder = new GameObject("Highlighter"); @@ -159,7 +197,7 @@ private void CreateHighlightRenderers() } } - private void UpdateHighlightRenderers() + protected virtual void UpdateHighlightRenderers() { if (highlightHolder == null) return; @@ -205,68 +243,101 @@ private void UpdateHighlightRenderers() } } - private void HandHoverUpdate() + /// + /// Called when a Hand starts hovering over this object + /// + protected virtual void OnHandHoverBegin(Hand hand) { - if (highlightOnHover == true) - { - if (wasHovering == false) - { - isHovering = true; - CreateHighlightRenderers(); - UpdateHighlightRenderers(); - } + wasHovering = isHovering; + isHovering = true; + + hoveringHands.Add(hand); + if (highlightOnHover == true && wasHovering == false) + { + CreateHighlightRenderers(); + UpdateHighlightRenderers(); } - isHovering = true; } - private void Update() + /// + /// Called when a Hand stops hovering over this object + /// + protected virtual void OnHandHoverEnd(Hand hand) { wasHovering = isHovering; + hoveringHands.Remove(hand); + + if (hoveringHands.Count == 0) + { + isHovering = false; + + if (highlightOnHover && highlightHolder != null) + Destroy(highlightHolder); + } + } + + protected virtual void Update() + { if (highlightOnHover) { UpdateHighlightRenderers(); - if (wasHovering == false && isHovering == false && highlightHolder != null) + if (isHovering == false && highlightHolder != null) Destroy(highlightHolder); - - isHovering = false; } } - - private void OnAttachedToHand( Hand hand ) + + + protected float blendToPoseTime = 0.1f; + protected float releasePoseBlendTime = 0.2f; + + protected virtual void OnAttachedToHand(Hand hand) { if (activateActionSetOnAttach != null) - activateActionSetOnAttach.ActivatePrimary(); + activateActionSetOnAttach.Activate(hand.handType); - if ( onAttachedToHand != null ) - { - onAttachedToHand.Invoke( hand ); - } + if (onAttachedToHand != null) + { + onAttachedToHand.Invoke(hand); + } + + if (skeletonPoser != null && hand.skeleton != null) + { + hand.skeleton.BlendToPoser(skeletonPoser, blendToPoseTime); + } attachedToHand = hand; } - private void OnDetachedFromHand( Hand hand ) + protected virtual void OnDetachedFromHand(Hand hand) { if (activateActionSetOnAttach != null) { - if (hand.otherHand.currentAttachedObjectInfo.HasValue == false || (hand.otherHand.currentAttachedObjectInfo.Value.interactable != null && - hand.otherHand.currentAttachedObjectInfo.Value.interactable.activateActionSetOnAttach != this.activateActionSetOnAttach)) + if (hand.otherHand == null || hand.otherHand.currentAttachedObjectInfo.HasValue == false || + (hand.otherHand.currentAttachedObjectInfo.Value.interactable != null && + hand.otherHand.currentAttachedObjectInfo.Value.interactable.activateActionSetOnAttach != this.activateActionSetOnAttach)) { - activateActionSetOnAttach.Deactivate(); + activateActionSetOnAttach.Deactivate(hand.handType); } } - if ( onDetachedFromHand != null ) - { - onDetachedFromHand.Invoke( hand ); - } + if (onDetachedFromHand != null) + { + onDetachedFromHand.Invoke(hand); + } + + + if (skeletonPoser != null) + { + if (hand.skeleton != null) + hand.skeleton.BlendToSkeleton(releasePoseBlendTime); + } attachedToHand = null; - } + } protected virtual void OnDestroy() { @@ -274,9 +345,27 @@ protected virtual void OnDestroy() if (attachedToHand != null) { - attachedToHand.ForceHoverUnlock(); attachedToHand.DetachObject(this.gameObject, false); + attachedToHand.skeleton.BlendToSkeleton(0.1f); + } + + if (highlightHolder != null) + Destroy(highlightHolder); + + } + + + protected virtual void OnDisable() + { + isDestroying = true; + + if (attachedToHand != null) + { + attachedToHand.ForceHoverUnlock(); } + + if (highlightHolder != null) + Destroy(highlightHolder); } } } diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs.meta index 0cd9af22..522d6ebf 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: b93b6a877adcbf94c89a9d6e0c0e844d -timeCreated: 1430943024 +timeCreated: 1544851963 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/InteractableDebug.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/InteractableDebug.cs index f18cc6a3..9dd9a808 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/InteractableDebug.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/InteractableDebug.cs @@ -79,7 +79,7 @@ protected virtual void HandAttachedUpdate(Hand hand) lastColor = grabbedColor; } - + private void OnDetachedFromHand( Hand hand ) { if (isThrowable) diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/InteractableDebug.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/InteractableDebug.cs.meta index 2145adfb..2379e18b 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/InteractableDebug.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/InteractableDebug.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 78549ac336d4d37418a4d4e0d981f91f -timeCreated: 1430943024 +timeCreated: 1544851963 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/InteractableHoverEvents.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/InteractableHoverEvents.cs.meta index 5a437198..9af3a25b 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/InteractableHoverEvents.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/InteractableHoverEvents.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: c4153b26428ccf041950b92c057812a3 -timeCreated: 1432689386 +timeCreated: 1544852179 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackage.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackage.cs.meta index abffa45e..1cce18ae 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackage.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackage.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: c9f83db71b9a6764abf964ab7679f035 -timeCreated: 1436836633 +timeCreated: 1544852179 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackageReference.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackageReference.cs.meta index cbe4e72a..68f81577 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackageReference.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackageReference.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 57468e6cbae21894fa42c90413c294ff -timeCreated: 1436997098 +timeCreated: 1544852179 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackageSpawner.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackageSpawner.cs index 67058370..90081b53 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackageSpawner.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackageSpawner.cs @@ -33,12 +33,12 @@ public ItemPackage itemPackage public ItemPackage _itemPackage; - private bool useItemPackagePreview = true; - private bool useFadedPreview = false; + public bool useItemPackagePreview = true; + private bool useFadedPreview = false; private GameObject previewObject; - public bool requireTriggerPressToTake = false; - public bool requireTriggerPressToReturn = false; + public bool requireGrabActionToTake = false; + public bool requireReleaseActionToReturn = false; public bool showTriggerHint = false; [EnumFlags] @@ -121,7 +121,7 @@ private void VerifyItemPackage() //------------------------------------------------- private void ItemPackageNotValid() { - Debug.LogError( "ItemPackage assigned to " + gameObject.name + " is not valid. Destroying this game object." ); + Debug.LogError("[SteamVR Interaction] ItemPackage assigned to " + gameObject.name + " is not valid. Destroying this game object.", this); Destroy( gameObject ); } @@ -163,18 +163,18 @@ private void OnHandHoverBegin( Hand hand ) if ( currentAttachedItemPackage == itemPackage ) // the item at the top of the hand's stack has an associated ItemPackage { - if ( takeBackItem && !requireTriggerPressToReturn ) // if we want to take back matching items and aren't waiting for a trigger press + if ( takeBackItem && !requireReleaseActionToReturn ) // if we want to take back matching items and aren't waiting for a trigger press { TakeBackItem( hand ); } } - if ( !requireTriggerPressToTake ) // we don't require trigger press for pickup. Spawn and attach object. + if (!requireGrabActionToTake) // we don't require trigger press for pickup. Spawn and attach object. { SpawnAndAttachObject( hand, GrabTypes.Scripted ); } - if ( requireTriggerPressToTake && showTriggerHint ) + if (requireGrabActionToTake && showTriggerHint ) { hand.ShowGrabHint("PickUp"); } @@ -218,7 +218,7 @@ private ItemPackage GetAttachedItemPackage( Hand hand ) //------------------------------------------------- private void HandHoverUpdate( Hand hand ) { - if ( takeBackItem && requireTriggerPressToReturn ) + if ( takeBackItem && requireReleaseActionToReturn ) { if (hand.isActive) { @@ -231,13 +231,13 @@ private void HandHoverUpdate( Hand hand ) } } - if ( requireTriggerPressToTake ) + if ( requireGrabActionToTake ) { GrabTypes startingGrab = hand.GetGrabStarting(); if (startingGrab != GrabTypes.None) { - SpawnAndAttachObject( hand, startingGrab); + SpawnAndAttachObject( hand, GrabTypes.Scripted); } } } @@ -246,7 +246,7 @@ private void HandHoverUpdate( Hand hand ) //------------------------------------------------- private void OnHandHoverEnd( Hand hand ) { - if ( !justPickedUpItem && requireTriggerPressToTake && showTriggerHint ) + if ( !justPickedUpItem && requireGrabActionToTake && showTriggerHint ) { hand.HideGrabHint(); } @@ -258,6 +258,9 @@ private void OnHandHoverEnd( Hand hand ) //------------------------------------------------- private void RemoveMatchingItemsFromHandStack( ItemPackage package, Hand hand ) { + if (hand == null) + return; + for ( int i = 0; i < hand.AttachedObjects.Count; i++ ) { ItemPackageReference packageReference = hand.AttachedObjects[i].attachedObject.GetComponent(); @@ -314,8 +317,8 @@ private void SpawnAndAttachObject( Hand hand, GrabTypes grabType ) { if ( hand.otherHand.hoverLocked ) { - //Debug.Log( "Not attaching objects because other hand is hoverlocked and we can't deliver both items." ); - return; + Debug.Log( "[SteamVR Interaction] Not attaching objects because other hand is hoverlocked and we can't deliver both items." ); + return; } } diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackageSpawner.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackageSpawner.cs.meta index 5bcc7ce7..4865c83e 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackageSpawner.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackageSpawner.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 43e53a985809f0949b9a42cc2a6888c9 -timeCreated: 1436915041 +timeCreated: 1544852179 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimation.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimation.cs index 8e93fd57..d64437de 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimation.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimation.cs @@ -19,7 +19,7 @@ public class LinearAnimation : MonoBehaviour private float animLength; private float lastValue; - + //------------------------------------------------- void Awake() { diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimation.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimation.cs.meta index 0cf014ba..629aee1f 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimation.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimation.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 49a60120b932b59409171f5ff611b639 -timeCreated: 1433799038 +timeCreated: 1544852180 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimator.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimator.cs index c8b34159..48e24a43 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimator.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimator.cs @@ -18,7 +18,7 @@ public class LinearAnimator : MonoBehaviour private float currentLinearMapping = float.NaN; private int framesUnchanged = 0; - + //------------------------------------------------- void Awake() { diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimator.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimator.cs.meta index 8cf1bb5f..73a18baa 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimator.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimator.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 634b98c3ef8bc6d4f834f80a4613a4a4 -timeCreated: 1435864149 +timeCreated: 1544852180 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAudioPitch.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAudioPitch.cs index f3923826..8fcf66e1 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAudioPitch.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAudioPitch.cs @@ -21,7 +21,7 @@ public class LinearAudioPitch : MonoBehaviour private AudioSource audioSource; - + //------------------------------------------------- void Awake() { diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAudioPitch.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAudioPitch.cs.meta index f02cbe14..c7a9967d 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAudioPitch.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAudioPitch.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: bb07dbf09f9933e49b22c82d8428c53b -timeCreated: 1436834777 +timeCreated: 1544852180 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearBlendshape.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearBlendshape.cs.meta index a9fe05ad..d1a75490 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearBlendshape.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearBlendshape.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 5a3622562855c9a40a14846ffdc8bfe4 -timeCreated: 1447859480 +timeCreated: 1544852180 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearDisplacement.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearDisplacement.cs.meta index 69075f88..c073524b 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearDisplacement.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearDisplacement.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 13d876e5d485004448f3e7b57eece9ab -timeCreated: 1433730007 +timeCreated: 1544852180 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearDrive.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearDrive.cs index 1d83e827..d46c0fb7 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearDrive.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearDrive.cs @@ -128,7 +128,7 @@ protected float CalculateLinearMapping( Transform updateTransform ) return Vector3.Dot( displacement, direction ) / length; } - + protected virtual void Update() { if ( maintainMomemntum && mappingChangeRate != 0.0f ) diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearDrive.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearDrive.cs.meta index a89740aa..c229ecf1 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearDrive.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearDrive.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 8c81a27fd18a29444be92481fe681f4b -timeCreated: 1434650764 +timeCreated: 1544852180 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearMapping.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearMapping.cs.meta index 2718e5b5..b833d31a 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearMapping.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearMapping.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 46f8e9e70f68ee3418ad85992778c116 -timeCreated: 1433728353 +timeCreated: 1544852180 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/ModalThrowable.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/ModalThrowable.cs index da94562d..07e2d922 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/ModalThrowable.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/ModalThrowable.cs @@ -17,7 +17,7 @@ public class ModalThrowable : Throwable [Tooltip("The local point which acts as a positional and rotational offset to use while held with a pinch type grab")] public Transform pinchOffset; - + protected override void HandHoverUpdate(Hand hand) { GrabTypes startingGrabType = hand.GetGrabStarting(); @@ -40,5 +40,14 @@ protected override void HandHoverUpdate(Hand hand) hand.HideGrabHint(); } } + protected override void HandAttachedUpdate(Hand hand) + { + if (interactable.skeletonPoser != null) + { + interactable.skeletonPoser.SetBlendingBehaviourEnabled("PinchPose", hand.currentAttachedObjectInfo.Value.grabbedWithType == GrabTypes.Pinch); + } + + base.HandAttachedUpdate(hand); + } } } \ No newline at end of file diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/ModalThrowable.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/ModalThrowable.cs.meta index 04693f56..4364f66f 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/ModalThrowable.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/ModalThrowable.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: d9172bbb2e6dd7e4a86c0d1ea19b7e49 -timeCreated: 1432687610 +timeCreated: 1544852181 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/PlaySound.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/PlaySound.cs.meta index aeda5521..0dcdcfd4 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/PlaySound.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/PlaySound.cs.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 guid: 1a125d9df683e2a49b12babced273360 +timeCreated: 1544852181 +licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: + assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/Player.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/Player.cs index ff303feb..f77af3af 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/Player.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/Player.cs @@ -37,6 +37,9 @@ public class Player : MonoBehaviour [Tooltip( "The audio listener for this player" )] public Transform audioListener; + [Tooltip("This action lets you know when the player has placed the headset on their head")] + public SteamVR_Action_Boolean headsetOnHead = SteamVR_Input.GetBooleanAction("HeadsetOnHead"); + public bool allowToggleTo2D = true; @@ -247,14 +250,23 @@ public Vector3 bodyDirectionGuess //------------------------------------------------- - void Awake() + private void Awake() { - SteamVR.Initialize(true); //force openvr - if ( trackingOriginTransform == null ) { trackingOriginTransform = this.transform; } + +#if OPENVR_XR_API && UNITY_LEGACY_INPUT_HELPERS + if (hmdTransforms != null) + { + foreach (var hmd in hmdTransforms) + { + if (hmd.GetComponent() == null) + hmd.gameObject.AddComponent(); + } + } +#endif } @@ -263,7 +275,7 @@ private IEnumerator Start() { _instance = this; - while (SteamVR_Behaviour.instance.forcingInitialization) + while (SteamVR.initializedState == SteamVR.InitializedStates.None || SteamVR.initializedState == SteamVR.InitializedStates.Initializing) yield return null; if ( SteamVR.instance != null ) @@ -276,8 +288,25 @@ private IEnumerator Start() ActivateRig( rig2DFallback ); #endif } - } + } + protected virtual void Update() + { + if (SteamVR.initializedState != SteamVR.InitializedStates.InitializeSuccess) + return; + + if (headsetOnHead != null) + { + if (headsetOnHead.GetStateDown(SteamVR_Input_Sources.Head)) + { + Debug.Log("SteamVR Interaction System Headset placed on head"); + } + else if (headsetOnHead.GetStateUp(SteamVR_Input_Sources.Head)) + { + Debug.Log("SteamVR Interaction System Headset removed"); + } + } + } //------------------------------------------------- void OnDrawGizmos() diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/RenderModel.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/RenderModel.cs index 24716ec3..842042e9 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/RenderModel.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/RenderModel.cs @@ -52,13 +52,22 @@ protected void InitializeHand() handInstance.transform.localRotation = Quaternion.identity; handInstance.transform.localScale = handPrefab.transform.localScale; handSkeleton = handInstance.GetComponent(); + handSkeleton.origin = Player.instance.trackingOriginTransform; handSkeleton.updatePose = false; + handSkeleton.skeletonAction.onActiveChange += OnSkeletonActiveChange; handRenderers = handInstance.GetComponentsInChildren(); if (displayHandByDefault == false) SetHandVisibility(false); handAnimator = handInstance.GetComponentInChildren(); + + if (handSkeleton.skeletonAction.activeBinding == false && handSkeleton.fallbackPoser == null) + { + Debug.LogWarning("Skeleton action: " + handSkeleton.skeletonAction.GetPath() + " is not bound. Your controller may not support SteamVR Skeleton Input. " + + "Please add a fallback skeleton poser to your skeleton if you want hands to be visible"); + DestroyHand(); + } } } @@ -75,18 +84,11 @@ protected void InitializeController() } } - protected virtual void Update() - { - if (handSkeleton != null && handSkeleton.isActive == false) - { - handSkeleton.skeletonAction.RemoveOnActiveChangeListener(OnSkeletonActiveChange, handSkeleton.inputSource); - handSkeleton.skeletonAction.AddOnActiveChangeListener(OnSkeletonActiveChange, handSkeleton.inputSource); //watch for if it gets activated later - DestroyHand(); - } - } - protected virtual void DestroyHand() { + if (handSkeleton != null) + handSkeleton.skeletonAction.onActiveChange -= OnSkeletonActiveChange; + if (handInstance != null) { Destroy(handInstance); @@ -97,12 +99,16 @@ protected virtual void DestroyHand() } } - protected virtual void OnSkeletonActiveChange(SteamVR_Action_In action, bool newState) + protected virtual void OnSkeletonActiveChange(SteamVR_Action_Skeleton changedAction, bool newState) { if (newState) { InitializeHand(); } + else + { + DestroyHand(); + } } protected void OnEnable() @@ -115,6 +121,16 @@ protected void OnDisable() renderModelLoadedAction.enabled = false; } + protected void OnDestroy() + { + DestroyHand(); + } + + public SteamVR_Behaviour_Skeleton GetSkeleton() + { + return handSkeleton; + } + public virtual void SetInputSource(SteamVR_Input_Sources newInputSource) { inputSource = newInputSource; @@ -343,7 +359,10 @@ public EVRSkeletalMotionRange GetSkeletonRangeOfMotion { get { - return handSkeleton.rangeOfMotion; + if (handSkeleton != null) + return handSkeleton.rangeOfMotion; + else + return EVRSkeletalMotionRange.WithController; } } @@ -405,6 +424,6 @@ private bool CheckAnimatorInit() return handAnimatorStateId != -1 && handAnimator != null && handAnimator.isInitialized; } - + } } \ No newline at end of file diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/RenderModel.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/RenderModel.cs.meta index 29c87b13..748b76c8 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/RenderModel.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/RenderModel.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 847a4fd831847974bb8d16b469b643e3 -timeCreated: 1532647182 +timeCreated: 1544852181 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/SeeThru.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/SeeThru.cs.meta index 7437c202..79b4ae30 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/SeeThru.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/SeeThru.cs.meta @@ -1,13 +1,13 @@ fileFormatVersion: 2 guid: 7d623a50b67320940b97e93e31d0a21b -timeCreated: 1456716277 +timeCreated: 1544852181 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: - seeThruMaterial: {fileID: 2100000, guid: 3bbb445147c574240a8b87a1193788b5, type: 2} executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/SleepOnAwake.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/SleepOnAwake.cs.meta index db2ffdb9..414c6ab7 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/SleepOnAwake.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/SleepOnAwake.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 0584375ad2f33ef4da0b276de8507487 -timeCreated: 1430167006 +timeCreated: 1544852181 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/SoundDeparent.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/SoundDeparent.cs index d0b6f6cf..90d8bf79 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/SoundDeparent.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/SoundDeparent.cs @@ -28,7 +28,7 @@ void Awake() //------------------------------------------------- void Start() { - // move the sound object out from under the parent + // move the sound object out from under the parent gameObject.transform.parent = null; if ( destroyAfterPlayOnce ) diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/SoundDeparent.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/SoundDeparent.cs.meta index cee51d05..b6178e73 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/SoundDeparent.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/SoundDeparent.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: f53662f45a4454944a06629fec9c941e -timeCreated: 1457503214 +timeCreated: 1544852182 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/SoundPlayOneshot.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/SoundPlayOneshot.cs.meta index f61851ae..ce37ba53 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/SoundPlayOneshot.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/SoundPlayOneshot.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 32c1c9a5bbab2e54280027c0ecaf42db -timeCreated: 1436566670 +timeCreated: 1544852182 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/SpawnAndAttachAfterControllerIsTracking.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/SpawnAndAttachAfterControllerIsTracking.cs index 650ce055..3a6ee36e 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/SpawnAndAttachAfterControllerIsTracking.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/SpawnAndAttachAfterControllerIsTracking.cs @@ -16,7 +16,7 @@ public class SpawnAndAttachAfterControllerIsTracking : MonoBehaviour private Hand hand; public GameObject itemPrefab; - + //------------------------------------------------- void Start() { diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/SpawnAndAttachAfterControllerIsTracking.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/SpawnAndAttachAfterControllerIsTracking.cs.meta index be5c5219..1a08de48 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/SpawnAndAttachAfterControllerIsTracking.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/SpawnAndAttachAfterControllerIsTracking.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 6ad167161b0bf8e4d9c038db358e0a28 -timeCreated: 1441826311 +timeCreated: 1544852182 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/SpawnAndAttachToHand.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/SpawnAndAttachToHand.cs.meta index 308c994a..91301a79 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/SpawnAndAttachToHand.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/SpawnAndAttachToHand.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: f4a03a51c550b92478a559cf694ce118 -timeCreated: 1437097962 +timeCreated: 1544852182 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/Throwable.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/Throwable.cs index cf882cda..21e1cd03 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/Throwable.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/Throwable.cs @@ -13,7 +13,6 @@ namespace Valve.VR.InteractionSystem //------------------------------------------------------------------------- [RequireComponent( typeof( Interactable ) )] [RequireComponent( typeof( Rigidbody ) )] - [RequireComponent( typeof(VelocityEstimator))] public class Throwable : MonoBehaviour { [EnumFlags] @@ -33,12 +32,15 @@ public class Throwable : MonoBehaviour public float scaleReleaseVelocity = 1.1f; - [Tooltip( "When detaching the object, should it return to its original parent?" )] + [Tooltip("The release velocity magnitude representing the end of the scale release velocity curve. (-1 to disable)")] + public float scaleReleaseVelocityThreshold = -1.0f; + [Tooltip("Use this curve to ease into the scaled release velocity based on the magnitude of the measured release velocity. This allows greater differentiation between a drop, toss, and throw.")] + public AnimationCurve scaleReleaseVelocityCurve = AnimationCurve.EaseInOut(0.0f, 0.1f, 1.0f, 1.0f); + + [Tooltip( "When detaching the object, should it return to its original parent?" )] public bool restoreOriginalParent = false; - public bool attachEaseIn = false; - public AnimationCurve snapAttachEaseInCurve = AnimationCurve.EaseInOut( 0.0f, 0.0f, 1.0f, 1.0f ); - public float snapAttachEaseInTime = 0.15f; + protected VelocityEstimator velocityEstimator; protected bool attached = false; @@ -48,10 +50,10 @@ public class Throwable : MonoBehaviour protected Transform attachEaseInTransform; public UnityEvent onPickUp; - public UnityEvent onDetachFromHand; + public UnityEvent onDetachFromHand; + public HandEvent onHeldUpdate; + - public bool snapAttachEaseInCompleted = false; - protected RigidbodyInterpolation hadInterpolation = RigidbodyInterpolation.None; protected new Rigidbody rigidbody; @@ -66,10 +68,7 @@ protected virtual void Awake() velocityEstimator = GetComponent(); interactable = GetComponent(); - if ( attachEaseIn ) - { - attachmentFlags &= ~Hand.AttachmentFlags.SnapOnAttach; - } + rigidbody = GetComponent(); rigidbody.maxAngularVelocity = 50.0f; @@ -77,7 +76,8 @@ protected virtual void Awake() if(attachmentOffset != null) { - interactable.handFollowTransform = attachmentOffset; + // remove? + //interactable.handFollowTransform = attachmentOffset; } } @@ -125,7 +125,7 @@ protected virtual void OnHandHoverEnd( Hand hand ) protected virtual void HandHoverUpdate( Hand hand ) { GrabTypes startingGrabType = hand.GetGrabStarting(); - + if (startingGrabType != GrabTypes.None) { hand.AttachObject( gameObject, startingGrabType, attachmentFlags, attachmentOffset ); @@ -136,7 +136,7 @@ protected virtual void HandHoverUpdate( Hand hand ) //------------------------------------------------- protected virtual void OnAttachedToHand( Hand hand ) { - //Debug.Log("Pickup: " + hand.GetGrabStarting().ToString()); + //Debug.Log("[SteamVR Interaction] Pickup: " + hand.GetGrabStarting().ToString()); hadInterpolation = this.rigidbody.interpolation; @@ -145,21 +145,16 @@ protected virtual void OnAttachedToHand( Hand hand ) onPickUp.Invoke(); hand.HoverLock( null ); - + rigidbody.interpolation = RigidbodyInterpolation.None; - - velocityEstimator.BeginEstimatingVelocity(); + + if (velocityEstimator != null) + velocityEstimator.BeginEstimatingVelocity(); attachTime = Time.time; attachPosition = transform.position; attachRotation = transform.rotation; - if ( attachEaseIn ) - { - attachEaseInTransform = hand.objectAttachmentPoint; - } - - snapAttachEaseInCompleted = false; } @@ -171,7 +166,7 @@ protected virtual void OnDetachedFromHand(Hand hand) onDetachFromHand.Invoke(); hand.HoverUnlock(null); - + rigidbody.interpolation = hadInterpolation; Vector3 velocity; @@ -186,12 +181,25 @@ protected virtual void OnDetachedFromHand(Hand hand) public virtual void GetReleaseVelocities(Hand hand, out Vector3 velocity, out Vector3 angularVelocity) { + if (hand.noSteamVRFallbackCamera && releaseVelocityStyle != ReleaseStyle.NoChange) + releaseVelocityStyle = ReleaseStyle.ShortEstimation; // only type that works with fallback hand is short estimation. + switch (releaseVelocityStyle) { case ReleaseStyle.ShortEstimation: - velocityEstimator.FinishEstimatingVelocity(); - velocity = velocityEstimator.GetVelocityEstimate(); - angularVelocity = velocityEstimator.GetAngularVelocityEstimate(); + if (velocityEstimator != null) + { + velocityEstimator.FinishEstimatingVelocity(); + velocity = velocityEstimator.GetVelocityEstimate(); + angularVelocity = velocityEstimator.GetAngularVelocityEstimate(); + } + else + { + Debug.LogWarning("[SteamVR Interaction System] Throwable: No Velocity Estimator component on object but release style set to short estimation. Please add one or change the release style."); + + velocity = rigidbody.velocity; + angularVelocity = rigidbody.angularVelocity; + } break; case ReleaseStyle.AdvancedEstimation: hand.GetEstimatedPeakVelocities(out velocity, out angularVelocity); @@ -208,27 +216,21 @@ public virtual void GetReleaseVelocities(Hand hand, out Vector3 velocity, out Ve } if (releaseVelocityStyle != ReleaseStyle.NoChange) - velocity *= scaleReleaseVelocity; + { + float scaleFactor = 1.0f; + if (scaleReleaseVelocityThreshold > 0) + { + scaleFactor = Mathf.Clamp01(scaleReleaseVelocityCurve.Evaluate(velocity.magnitude / scaleReleaseVelocityThreshold)); + } + + velocity *= (scaleFactor * scaleReleaseVelocity); + } } //------------------------------------------------- protected virtual void HandAttachedUpdate(Hand hand) { - if (attachEaseIn) - { - float t = Util.RemapNumberClamped(Time.time, attachTime, attachTime + snapAttachEaseInTime, 0.0f, 1.0f); - if (t < 1.0f) - { - t = snapAttachEaseInCurve.Evaluate(t); - transform.position = Vector3.Lerp(attachPosition, attachEaseInTransform.position, t); - transform.rotation = Quaternion.Lerp(attachRotation, attachEaseInTransform.rotation, t); - } - else if (!snapAttachEaseInCompleted) - { - gameObject.SendMessage("OnThrowableAttachEaseInCompleted", hand, SendMessageOptions.DontRequireReceiver); - snapAttachEaseInCompleted = true; - } - } + if (hand.IsGrabEnding(this.gameObject)) { @@ -242,6 +244,9 @@ protected virtual void HandAttachedUpdate(Hand hand) // to teleport behind the hand when the player releases it. //StartCoroutine( LateDetach( hand ) ); } + + if (onHeldUpdate != null) + onHeldUpdate.Invoke(hand); } @@ -258,7 +263,9 @@ protected virtual IEnumerator LateDetach( Hand hand ) protected virtual void OnHandFocusAcquired( Hand hand ) { gameObject.SetActive( true ); - velocityEstimator.BeginEstimatingVelocity(); + + if (velocityEstimator != null) + velocityEstimator.BeginEstimatingVelocity(); } @@ -266,7 +273,9 @@ protected virtual void OnHandFocusAcquired( Hand hand ) protected virtual void OnHandFocusLost( Hand hand ) { gameObject.SetActive( false ); - velocityEstimator.FinishEstimatingVelocity(); + + if (velocityEstimator != null) + velocityEstimator.FinishEstimatingVelocity(); } } diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/Throwable.cs.meta b/Assets/SteamVR/InteractionSystem/Core/Scripts/Throwable.cs.meta index dcd1c8cc..863902a6 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/Throwable.cs.meta +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/Throwable.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: ffefbea063cab884ca33e5a449e5c22c -timeCreated: 1432687610 +timeCreated: 1544852191 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: b93fe5c516cf6ed4b9153ec790f856e2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/UIElement.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/UIElement.cs index 4e421b5b..217803f6 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/UIElement.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/UIElement.cs @@ -17,10 +17,10 @@ public class UIElement : MonoBehaviour { public CustomEvents.UnityEventHand onHandClick; - private Hand currentHand; + protected Hand currentHand; //------------------------------------------------- - void Awake() + protected virtual void Awake() { Button button = GetComponent