From ea232431889e67a2de9cce40b63ca7b3fc798dba Mon Sep 17 00:00:00 2001 From: chungchunwang <62127500+chungchunwang@users.noreply.github.com> Date: Wed, 27 Dec 2023 17:00:43 +0800 Subject: [PATCH] Added Comments --- project/Assets/Sword/Sliceable.cs | 225 +++++----- project/Assets/Sword/Slicer.cs | 83 ++-- project/UserSettings/EditorUserSettings.asset | 10 +- .../UserSettings/Layouts/default-2021.dwlt | 396 +++++++++--------- 4 files changed, 372 insertions(+), 342 deletions(-) diff --git a/project/Assets/Sword/Sliceable.cs b/project/Assets/Sword/Sliceable.cs index adb927e..8023554 100644 --- a/project/Assets/Sword/Sliceable.cs +++ b/project/Assets/Sword/Sliceable.cs @@ -154,121 +154,140 @@ private void OnEnable() { sliced = false; } - public void slice(Vector3 enterHandle, Vector3 enterTip, Vector3 exitTip, Vector3[] pastPositions, Func> getPositionsFromNow, Vector3[] collisionEnterPoints, Vector3[] collisionExitPoints, string otherTag){ - if (sliced) return; - sliced = true; - sfxSystem.playSliceAudio(); - //Maintain world space copies of variables. - Vector3 worldSpaceEnterHandle = enterHandle; - Vector3 worldSpaceEnterTip = enterTip; - Vector3 worldSpaceExitTip = exitTip; - - //Transform all inputs from world space to local space. - enterHandle = collisionEnterMatrix.inverse.MultiplyPoint3x4(enterHandle); - enterTip = collisionEnterMatrix.inverse.MultiplyPoint3x4(enterTip); - exitTip = transform.InverseTransformPoint(exitTip); - for (int i = 0; i < pastPositions.Length; i++) { - pastPositions[i] = transform.InverseTransformPoint(pastPositions[i]); - } - for (int i = 0; i < collisionEnterPoints.Length; i++) - { - collisionEnterPoints[i] = transform.InverseTransformPoint(collisionEnterPoints[i]); - } - for (int i = 0; i < collisionExitPoints.Length; i++) - { - collisionExitPoints[i] = transform.InverseTransformPoint(collisionExitPoints[i]); - } - //Calculate normal of slice. - Vector3 normal = Vector3.Cross(enterHandle - enterTip, enterHandle - exitTip).normalized; - //Vector3 worldSpaceNormal = Vector3.Cross(worldSpaceEnterHandle - worldSpaceEnterTip, worldSpaceEnterHandle - worldSpaceExitTip).normalized; - - //Check if slice is valid. - //** Note that in object space a correct slice is downwards ** - bool isValid = true; - - float xOffset = exitTip.x - enterTip.x; - float yOffset = exitTip.y - enterTip.y; - if (Mathf.Abs(yOffset) < 0.01f || Mathf.Abs(xOffset) < 0.01f) - return; - if (!isAll && (yOffset > 0.6f || (Mathf.Abs(xOffset) -1f) > Mathf.Abs(yOffset))) - isValid = false; - if (noteType == MapSystem.NoteType.LeftNote && otherTag == "Right Sword") isValid = false; - if (noteType == MapSystem.NoteType.RightNote && otherTag == "Left Sword") isValid = false; - if (noteType == MapSystem.NoteType.Bomb) isValid = false; - //Calculate point score. - if (isValid) { - int addedPoints = 0; - - //Add slice accuracy points. - float averageDistanceFromCenter = 0; - foreach (Vector3 point in collisionEnterPoints) { - averageDistanceFromCenter += Mathf.Abs(point.x); - } - foreach (Vector3 point in collisionExitPoints) - { - averageDistanceFromCenter += Mathf.Abs(point.x); - } - averageDistanceFromCenter /= (collisionEnterPoints.Length + collisionExitPoints.Length); - - averageDistanceFromCenter = averageDistanceFromCenter * Mathf.Sqrt(averageDistanceFromCenter); //Creating a curved falloff curve + making getting points easier - - addedPoints += Mathf.RoundToInt(((Mathf.Clamp01(averageDistanceFromCenter/ accuracyZoneRadius)-1)*-1)*15); - //Add enter and exit angle points. - UnityEngine.Plane plane = new UnityEngine.Plane(); - plane.SetNormalAndPosition(normal, enterHandle); - addedPoints += CalculateMaxPastPosAngleOnPlane(plane,pastPositions,enterHandle, exitTip, 100, 70); - getPositionsFromNow.Invoke().ContinueWith((getPosTask) => { - UnityMainThreadDispatcher.Instance().Enqueue(() => { - Vector3[] futurePositions = getPosTask.Result; - addedPoints += CalculateMaxPastPosAngleOnPlane(plane, pastPositions, enterHandle, exitTip, 60, 30); - pointSystem.logPoints(addedPoints, note); - }); - }); - } - else - { - if (noteType == MapSystem.NoteType.Bomb) pointSystem.logBombHit(); - else pointSystem.logBadCut(); - sfxSystem.playBadCutAudio(); - } + public void slice(Vector3 enterHandle, Vector3 enterTip, Vector3 exitTip, Vector3[] pastPositions, Func> getPositionsFromNow, Vector3[] collisionEnterPoints, Vector3[] collisionExitPoints, string otherTag) + { + if (sliced) return; //If the object was sliced already, we do not slice it again. + sliced = true; //Set sliced to true so that we do not slice it again. + sfxSystem.playSliceAudio(); //Play slice sound effect. + + //Maintain world space copies of sword position variables. + Vector3 worldSpaceEnterHandle = enterHandle; + Vector3 worldSpaceEnterTip = enterTip; + Vector3 worldSpaceExitTip = exitTip; + + //Transform all inputs from world space to local space (relative to the object being sliced). + enterHandle = collisionEnterMatrix.inverse.MultiplyPoint3x4(enterHandle); //Transforms the enterHandle to the local space (relative to the position of the object when the collision first occured). Why? Because the object will have moved since the collision occured. + enterTip = collisionEnterMatrix.inverse.MultiplyPoint3x4(enterTip); //Same thing here. + exitTip = transform.InverseTransformPoint(exitTip); //Transforms the exitTip to the local space (relative to the position of the object currently). Why? Because this method is called when collision ends with the slicing object. + for (int i = 0; i < pastPositions.Length; i++) + { + pastPositions[i] = transform.InverseTransformPoint(pastPositions[i]); //Transforms the pastPositions to the local space (relative to the position of the object currently). + } + for (int i = 0; i < collisionEnterPoints.Length; i++) + { + collisionEnterPoints[i] = collisionEnterMatrix.inverse.MultiplyPoint3x4(collisionEnterPoints[i]); //Transforms the collisionEnterPoints to the local space (relative to the position of the object when the collision first occured). + } + for (int i = 0; i < collisionExitPoints.Length; i++) + { + collisionExitPoints[i] = transform.InverseTransformPoint(collisionExitPoints[i]); //Transforms the collisionExitPoints to the local space (relative to the position of the object currently). + } + //Calculate normal of slice (cross product). This vector is perpendicular to the slice plane (and thus is representative of it). + Vector3 normal = Vector3.Cross(enterHandle - enterTip, enterHandle - exitTip).normalized; + + + //Check if slice is valid. + //** Note that in object space a correct slice is downwards - horizontal slices, etc. are all just rotated. ** + bool isValid = true; //Assume slice is valid. + + float xOffset = exitTip.x - enterTip.x; //Calculate how much the sword moved horizontally. + float yOffset = exitTip.y - enterTip.y; //Calculate how much the sword moved vertically. + if (Mathf.Abs(yOffset) < 0.01f || Mathf.Abs(xOffset) < 0.01f) //If the sword barely moved horizontally or vertically, this slice is like a false trigger. We exit here. + return; + if (!isAll && (yOffset > 0.6f || (Mathf.Abs(xOffset) - 1f) > Mathf.Abs(yOffset))) //If the sword moved upwards (by a margin) or moved more horizontally than vertically (by a margin), this slice is invalid. + isValid = false; + if (noteType == MapSystem.NoteType.LeftNote && otherTag == "Right Sword") isValid = false; //If the note is a left note and the sword is a right sword, this slice is invalid. + if (noteType == MapSystem.NoteType.RightNote && otherTag == "Left Sword") isValid = false; //If the note is a right note and the sword is a left sword, this slice is invalid. + if (noteType == MapSystem.NoteType.Bomb) isValid = false; //If the note is a bomb, this slice is invalid. + + if (isValid) + { //If the slice is valid, we calculate the points earned for the slice. + int addedPoints = 0; //The points earned for the slice. + + //Add slice accuracy points. This is based on how close the slice was to the center of the object. We do this based on the points where the sword entered and exited the object. + float averageDistanceFromCenter = 0; //The average distance from the center of the object. + foreach (Vector3 point in collisionEnterPoints) + { + averageDistanceFromCenter += Mathf.Abs(point.x); //Add the distance from the center of the object of all of the points in collisionEnterPoints. + } + foreach (Vector3 point in collisionExitPoints) + { + averageDistanceFromCenter += Mathf.Abs(point.x); //Add the distance from the center of the object of all of the points in collisionExitPoints. + } + averageDistanceFromCenter /= (collisionEnterPoints.Length + collisionExitPoints.Length); //Divide by the total number of points to get the average distance of each point from the center of the object. + averageDistanceFromCenter = averageDistanceFromCenter * Mathf.Sqrt(averageDistanceFromCenter); //Creating a curved falloff curve for the distance, making getting points easier. + + //Get a value between 0 and 1 based on how close the slice was to the center of the object. We then invert this value so that 1 means a closer slice (this is the -1 then *-1 thing). Then, multiply by 15 to get the points earned for the slice. 15 is the maximum number of points that can be earned for slice accuracy. + addedPoints += Mathf.RoundToInt(((Mathf.Clamp01(averageDistanceFromCenter / accuracyZoneRadius) - 1) * -1) * 15); + + + + //Add enter and exit angle points. + UnityEngine.Plane plane = new UnityEngine.Plane(); + plane.SetNormalAndPosition(normal, enterHandle); //Create a plane that is representative of the slice. + //CalculateMaxPastPsAngleOnPlane: Calculate and give points based on the magnitude of the angle swung by the sword up to the collision where the sword was in line with the slice plane. + //If other words, how much of an angle did the sword swing for this particular cut. + //100 is the maximum angle that can be earned points for. 70 is the maximum number of points that can be earned for angle. + //I wrote the function, and it features some calculations - you can check it out in the source if you want, but im omitting as it will make this snippet too long. + addedPoints += CalculateMaxPastPosAngleOnPlane(plane, pastPositions, enterHandle, exitTip, 100, 70); + getPositionsFromNow.Invoke().ContinueWith((getPosTask) => { //Additional points can be earned if the sword continues along the slice plane after the slice. + UnityMainThreadDispatcher.Instance().Enqueue(() => { + Vector3[] futurePositions = getPosTask.Result; //Get the future positions of the sword. + for (int i = 0; i < futurePositions.Length; i++) + { + futurePositions[i] = transform.InverseTransformPoint(futurePositions[i]); //Transforms the furturePositions to the local space + } + addedPoints += CalculateMaxPastPosAngleOnPlane(plane, futurePositions, enterHandle, exitTip, 60, 30); //The same points calculation is done here, but with a different angle and point cap. + pointSystem.logPoints(addedPoints, note); //Log the points earned. + }); + }); + } + else //If the slice is invalid, we log the appropriate point deficit and play the appropriate sound effect. + { + if (noteType == MapSystem.NoteType.Bomb) pointSystem.logBombHit(); + else pointSystem.logBadCut(); + sfxSystem.playBadCutAudio(); + } - //Slice mesh and add physics to fragments. - //Ezy-Slice uses world space for slice planes! - GameObject[] fragments = SliceObjectRecursive(worldSpaceExitTip, normal, sliceableMesh, crossSectionMaterial); - if (fragments == null) { - fragments = SliceObjectRecursive(transform.position, normal, sliceableMesh, crossSectionMaterial); + //Slice mesh and add physics to fragments. + //We use the package Ezy-Slice in SliceObjectRecursive to slice the meshes. However, I wrote the recursive portion (basically also slices children of the object being sliced). + //Note that Ezy-Slice uses world space for slice planes! + GameObject[] fragments = SliceObjectRecursive(worldSpaceExitTip, normal, sliceableMesh, crossSectionMaterial); //Slice the mesh alongside the slice plane recursively. This function is pretty cool, but I feel would make this snippet too long. + if (fragments == null) + { + fragments = SliceObjectRecursive(transform.position, normal, sliceableMesh, crossSectionMaterial); //If the slice failed along the slice plane, we try again along the center of the object. if (fragments == null) { - Destroy(gameObject); + Destroy(gameObject); //If the slice failed again, we just destroy the object. return; } } - + Vector3 centerPosition = Vector3.zero; - foreach(GameObject fragment in fragments){ - fragment.transform.SetParent(transform, false); //readjust position - fragment.transform.SetParent(debrisParent); - fragment.layer = ghostLayer; + foreach (GameObject fragment in fragments) + { + fragment.transform.SetParent(transform, false); //Re-adjust the position of the fragments to be on the block. + fragment.transform.SetParent(debrisParent); //Set the parent of the fragments to the debris parent (just an empty object that holds all the debris pieces). + fragment.layer = ghostLayer; //Set the layer of the fragments to the ghost layer (this is so that the fragments do not collide with the sword). - fragment.AddComponent().startFadeWithLifespanRecursive(fragmentFade); + fragment.AddComponent().startFadeWithLifespanRecursive(fragmentFade); //Add a FragmentManager to the fragments. This is a script that causes the fragments to disintegrate with a shader and eventually destroys the GameObject. - MeshCollider fragmentCollider = fragment.AddComponent(); - fragmentCollider.convex = true; - centerPosition += fragment.transform.position; + MeshCollider fragmentCollider = fragment.AddComponent(); //Add a mesh collider to the fragments. + fragmentCollider.convex = true; //Set the mesh collider to be convex (this is required for physics). + centerPosition += fragment.transform.position; //Add the position of the fragment to the centerPosition (this is used to calculate the approx. center of mass of the fragments). } - centerPosition /= fragments.Length; - foreach(GameObject fragment in fragments){ - fragment.AddComponent(); - Rigidbody rb = fragment.GetComponent(); - rb.angularDrag = fragmentAngularDrag; - rb.AddForce(0, 0, rb.mass * mover.currentVelocity.z * fragmentVelocityTransfer, ForceMode.Impulse); - rb.AddExplosionForce(sliceExplosionForce, centerPosition, sliceExplosionRadius,upwardsModifier); - rb.AddForce((exitTip - enterTip).normalized * slashForceMultiplier); - //StartCoroutine(forceAxisVelocityAfterForces(Axis.Z, mover.currentVelocity.z, rb)); + centerPosition /= fragments.Length; //Divide the centerPosition by the number of fragments to get the approx. center of mass of the fragments. + foreach (GameObject fragment in fragments) + { + fragment.AddComponent(); //For each fragment, we give it a rigidbody, which enables physics. + Rigidbody rb = fragment.GetComponent(); //Get the rigidbody of the fragment. + rb.angularDrag = fragmentAngularDrag; //Set the angular drag of the fragment. + rb.AddForce(0, 0, rb.mass * mover.currentVelocity.z * fragmentVelocityTransfer, ForceMode.Impulse); //Adds an force to the fragment in the z direction of the velocity of the original object. This is so that the fragments maintain part of the momentum of the original object. Should probably allow for other axes if I want Sliceable to be generalizable, but this is ok for now. + rb.AddExplosionForce(sliceExplosionForce, centerPosition, sliceExplosionRadius, upwardsModifier); //Adds an explosion force at the approx. center of mass to the fragment. This is so that the fragments fly apart from each other. + rb.AddForce((exitTip - enterTip).normalized * slashForceMultiplier); //Adds a force in the direction of the slice. This is so that the fragments fly in the direction of the slice (to give the illusion that the blade had friction). } - LeanPool.Despawn(gameObject); + LeanPool.Despawn(gameObject); //Despawn the original (unsliced) object. We use a pool here as the blocks that are sliced are loaded multiple times throughout a game. LeanPool hides them instead of deleting them so that we don't have to instantiate and destroy blocks all the time (this saves the garbage collector from having to do work, which is good for performance). } - /* + /* * Ignore, this is if you want the blocks' forward movement to be not affected by slices IEnumerator forceAxisVelocityAfterForces(Axis axis, float velocity, Rigidbody rb) { diff --git a/project/Assets/Sword/Slicer.cs b/project/Assets/Sword/Slicer.cs index 6629f23..ab3d244 100644 --- a/project/Assets/Sword/Slicer.cs +++ b/project/Assets/Sword/Slicer.cs @@ -32,63 +32,72 @@ private void OnDestroy() { gameSystem.onPause -= onPauseGame; } + //Logs the position of the tip of the sword every positionLoggingFrequency seconds. IEnumerator positionLogger() { while (true) { - if (pastPositions.Count == positionLoggingSaveCount) pastPositions.Dequeue(); - pastPositions.Enqueue(tip.position); - yield return new WaitForSeconds(positionLoggingFrequency); + //We maintain a queue of the latest positions. If the queue is full, remove the oldest position. + if (pastPositions.Count == positionLoggingSaveCount) pastPositions.Dequeue(); + pastPositions.Enqueue(tip.position); //Add the current position to the queue. + yield return new WaitForSeconds(positionLoggingFrequency); //Wait positionLoggingFrequency for the next position logging event. } } - private void OnCollisionEnter(Collision collision) + //This method extracts the contact points from a collision and returns them as an array of Vector3s. + private Vector3[] extractContactPointsAsArray(Collision collision) { - if (collision.gameObject.layer == LayerMask.NameToLayer("Sword")) + ContactPoint[] contactPoints = new ContactPoint[collision.contactCount]; //Create an array of ContactPoints to store the contact points. + Vector3[] array = new Vector3[collision.contactCount]; //Create an array of Vector3s to store the output. + collision.GetContacts(contactPoints); //Get the contact points from the collision. + for (int i = 0; i < contactPoints.Length; i++) { - sparksParticleSystem.SetActive(true); - sparksParticleSystem.transform.position = collision.contacts[0].point; + array[i] = contactPoints[i].point; //Extract the Vector3 for each contact point and add it to the output array. } - if (collision.gameObject.GetComponent() == null) return; - enterTip = tip.position; - enterHandle = handle.position; - collisionEnterPoints = extractContactPointsAsArray(collision); - controller.SendHapticImpulse(1, .1f); + return array; } - private void OnCollisionStay(Collision collision) + //This method is called when the sword initially collides with something. + private void OnCollisionEnter(Collision collision) { - if (collision.gameObject.layer == LayerMask.NameToLayer("Ghost")) return; - controller.SendHapticImpulse(1f, .1f); - if (collision.gameObject.layer == LayerMask.NameToLayer("Sword")) { - sparksParticleSystem.transform.position = collision.contacts[0].point; + if (collision.gameObject.layer == LayerMask.NameToLayer("Ghost")) return; //We want to completely ignore anything on the Ghost layer, as they should be invisible. + controller.SendHapticImpulse(1, .1f); //Otherwise, we send haptic feedback to show that the sword is slicing something. + if (collision.gameObject.layer == LayerMask.NameToLayer("Sword")) //If the sword collides with another sword, we want to show sparks. + { + sparksParticleSystem.SetActive(true); //Show the sparks. + sparksParticleSystem.transform.position = collision.contacts[0].point; //Move the sparks to the point of collision. } + if (collision.gameObject.GetComponent() == null) return; //If the object we collided with is not sliceable, we don't need to do anything. + enterTip = tip.position; //Store the position of the tip of the sword as it enters the sliceable object. + enterHandle = handle.position; //Store the postion of the handle of the sword as it enters the sliceable object. + collisionEnterPoints = extractContactPointsAsArray(collision); //Store the contact positions as the sword enters the sliceable object. } - void onPauseGame() - { - sparksParticleSystem.SetActive(false); - } - private Vector3[] extractContactPointsAsArray(Collision collision) + //This method is called whenever the sword continues to collide with something. + private void OnCollisionStay(Collision collision) { - ContactPoint[] contactPoints = new ContactPoint[collision.contactCount]; - Vector3[] array = new Vector3[collision.contactCount]; - collision.GetContacts(contactPoints); - for (int i = 0; i < contactPoints.Length; i++) - { - array[i] = contactPoints[i].point; + if (collision.gameObject.layer == LayerMask.NameToLayer("Ghost")) return; //We want to completely ignore anything on the Ghost layer, as they should be invisible. + controller.SendHapticImpulse(1f, .1f); //Otherwise, we send haptic feedback to show that the sword is slicing something. + if (collision.gameObject.layer == LayerMask.NameToLayer("Sword")) { //If the swords are intersecting each other, we should update the position of the sparks. + sparksParticleSystem.transform.position = collision.contacts[0].point; //Move the sparks to the point of collision. } - return array; } - + //This method is called whenever the sword stops colliding with something. private void OnCollisionExit(Collision collision) { - if (collision.gameObject.layer == LayerMask.NameToLayer("Sword")) + if (collision.gameObject.layer == LayerMask.NameToLayer("Ghost")) return; //We want to completely ignore anything on the Ghost layer, as they should be invisible. + controller.SendHapticImpulse(1, .1f);//Otherwise, we send haptic feedback to show that the sword is slicing something. + if (collision.gameObject.layer == LayerMask.NameToLayer("Sword")) //If the swords are no longer intersecting with one another, then we should no longer have the sparks. { - sparksParticleSystem.SetActive(false); + sparksParticleSystem.SetActive(false); //Hide the sparks. } - controller.SendHapticImpulse(1, .1f); - if (collision.gameObject.GetComponent() == null) return; - exitTip = tip.position; - collisionExitPoints = extractContactPointsAsArray(collision); - collision.gameObject.GetComponent().slice(enterHandle, enterTip, exitTip, pastPositions.ToArray(), getPositionsFromNow, collisionEnterPoints, collisionExitPoints, gameObject.tag); + if (collision.gameObject.GetComponent() == null) return; //If the object we collided with is not sliceable, we don't need to do anything. + exitTip = tip.position; //Store the position of the tip of the sword as it exits the sliceable object. + collisionExitPoints = extractContactPointsAsArray(collision); //Get the collision points for when the sword exits the sliceable. + //We send all of the following collision data we have acquired to the sliceable for it to chop up its mesh. + collision.gameObject.GetComponent().slice(enterHandle, enterTip, exitTip, pastPositions.ToArray(), getPositionsFromNow, collisionEnterPoints, collisionExitPoints, gameObject.tag); + //getPositionsFromNow is an async task that returns future positions. + } + void onPauseGame() + { + sparksParticleSystem.SetActive(false); } public async Task getPositionsFromNow() diff --git a/project/UserSettings/EditorUserSettings.asset b/project/UserSettings/EditorUserSettings.asset index a383c12..aaea996 100644 --- a/project/UserSettings/EditorUserSettings.asset +++ b/project/UserSettings/EditorUserSettings.asset @@ -9,19 +9,19 @@ EditorUserSettings: value: 0553015152015a0e5f595d7143720f4412151c7c2a7876607b284a6abbb3623d flags: 0 RecentlyUsedSceneGuid-1: - value: 5152075f00065b590c0d557314275944414f1a78287c74317f791f61e6b13239 + value: 5200015455045f090e5a597613770844134f4c737e2e74687e7b1836bbe26c3d flags: 0 RecentlyUsedSceneGuid-2: - value: 5705045e03065e095e595c2449225e44454e40782f7872637c2f4964e4e2326f + value: 5152075f00065b590c0d557314275944414f1a78287c74317f791f61e6b13239 flags: 0 RecentlyUsedSceneGuid-3: - value: 5200015455045f090e5a597613770844134f4c737e2e74687e7b1836bbe26c3d + value: 5705045e03065e095e595c2449225e44454e40782f7872637c2f4964e4e2326f flags: 0 RecentlyUsedSceneGuid-4: - value: 5a08575f5207595a0f5d59741173094444164f7d7d2a23317c7a4465bbe1646d + value: 00000d5155545b5a08565a70437008444e4f1c72742d743228711f6ab7b9616e flags: 0 RecentlyUsedSceneGuid-5: - value: 00000d5155545b5a08565a70437008444e4f1c72742d743228711f6ab7b9616e + value: 5a08575f5207595a0f5d59741173094444164f7d7d2a23317c7a4465bbe1646d flags: 0 UnityEditor.ShaderGraph.Blackboard: value: 18135939215a0a5004000b0e15254b524c030a3f2964643d120d1230e9e93a3fd6e826abbd2e2d293c4ead313b08042de6030a0afa240c0d020be94c4ba65e435d8715fa32c70d15d11612dacc11fee5d3c5d1fe9ab1bf968e93e2ffcbc3e7e2f0b3ffe0e8b0be9af9faaeffff8e85dd8390e3949c8899daa7 diff --git a/project/UserSettings/Layouts/default-2021.dwlt b/project/UserSettings/Layouts/default-2021.dwlt index 9ae3b35..959b37e 100644 --- a/project/UserSettings/Layouts/default-2021.dwlt +++ b/project/UserSettings/Layouts/default-2021.dwlt @@ -14,16 +14,16 @@ MonoBehaviour: m_EditorClassIdentifier: m_PixelRect: serializedVersion: 2 - x: 8 - y: 51 - width: 2544 - height: 1333 + x: 2560 + y: 43 + width: 2560 + height: 1349 m_ShowMode: 4 m_Title: Project m_RootView: {fileID: 2} m_MinSize: {x: 875, y: 421} m_MaxSize: {x: 10000, y: 10000} - m_Maximized: 0 + m_Maximized: 1 --- !u!114 &2 MonoBehaviour: m_ObjectHideFlags: 52 @@ -44,8 +44,8 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 2544 - height: 1333 + width: 2560 + height: 1349 m_MinSize: {x: 875, y: 300} m_MaxSize: {x: 10000, y: 10000} m_UseTopView: 1 @@ -69,7 +69,7 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 2544 + width: 2560 height: 30 m_MinSize: {x: 0, y: 0} m_MaxSize: {x: 0, y: 0} @@ -90,8 +90,8 @@ MonoBehaviour: m_Position: serializedVersion: 2 x: 0 - y: 1313 - width: 2544 + y: 1329 + width: 2560 height: 20 m_MinSize: {x: 0, y: 0} m_MaxSize: {x: 0, y: 0} @@ -114,12 +114,12 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 30 - width: 2544 - height: 1283 + width: 2560 + height: 1299 m_MinSize: {x: 300, y: 200} m_MaxSize: {x: 24288, y: 16192} vertical: 0 - controlID: 24 + controlID: 105 --- !u!114 &6 MonoBehaviour: m_ObjectHideFlags: 52 @@ -139,12 +139,12 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 2080 - height: 1283 + width: 2093 + height: 1299 m_MinSize: {x: 200, y: 200} m_MaxSize: {x: 16192, y: 16192} vertical: 1 - controlID: 144 + controlID: 111 --- !u!114 &7 MonoBehaviour: m_ObjectHideFlags: 52 @@ -164,12 +164,12 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 2080 - height: 852 + width: 2093 + height: 873 m_MinSize: {x: 200, y: 100} m_MaxSize: {x: 16192, y: 8096} vertical: 0 - controlID: 145 + controlID: 112 --- !u!114 &8 MonoBehaviour: m_ObjectHideFlags: 52 @@ -187,8 +187,8 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 496 - height: 852 + width: 500 + height: 873 m_MinSize: {x: 201, y: 221} m_MaxSize: {x: 4001, y: 4021} m_ActualView: {fileID: 16} @@ -211,19 +211,19 @@ MonoBehaviour: m_Children: [] m_Position: serializedVersion: 2 - x: 496 + x: 500 y: 0 - width: 1584 - height: 852 + width: 1593 + height: 873 m_MinSize: {x: 202, y: 221} m_MaxSize: {x: 4002, y: 4021} m_ActualView: {fileID: 15} m_Panes: - {fileID: 15} - {fileID: 17} - - {fileID: 18} + - {fileID: 23} m_Selected: 0 - m_LastSelected: 1 + m_LastSelected: 2 --- !u!114 &10 MonoBehaviour: m_ObjectHideFlags: 52 @@ -242,13 +242,13 @@ MonoBehaviour: m_Position: serializedVersion: 2 x: 0 - y: 852 - width: 2080 - height: 431 + y: 873 + width: 2093 + height: 426 m_MinSize: {x: 200, y: 100} m_MaxSize: {x: 16192, y: 8096} vertical: 0 - controlID: 31 + controlID: 54 --- !u!114 &11 MonoBehaviour: m_ObjectHideFlags: 52 @@ -259,24 +259,24 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 1 m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} - m_Name: ConsoleWindow + m_Name: ProjectBrowser m_EditorClassIdentifier: m_Children: [] m_Position: serializedVersion: 2 x: 0 y: 0 - width: 1034 - height: 431 - m_MinSize: {x: 101, y: 121} - m_MaxSize: {x: 4001, y: 4021} - m_ActualView: {fileID: 20} + width: 1040 + height: 426 + m_MinSize: {x: 231, y: 271} + m_MaxSize: {x: 10001, y: 10021} + m_ActualView: {fileID: 18} m_Panes: + - {fileID: 18} - {fileID: 19} - - {fileID: 20} - {fileID: 14} - m_Selected: 1 - m_LastSelected: 0 + m_Selected: 0 + m_LastSelected: 1 --- !u!114 &12 MonoBehaviour: m_ObjectHideFlags: 52 @@ -292,15 +292,15 @@ MonoBehaviour: m_Children: [] m_Position: serializedVersion: 2 - x: 1034 + x: 1040 y: 0 - width: 1046 - height: 431 + width: 1053 + height: 426 m_MinSize: {x: 232, y: 271} m_MaxSize: {x: 10002, y: 10021} - m_ActualView: {fileID: 21} + m_ActualView: {fileID: 20} m_Panes: - - {fileID: 21} + - {fileID: 20} m_Selected: 0 m_LastSelected: 0 --- !u!114 &13 @@ -318,16 +318,16 @@ MonoBehaviour: m_Children: [] m_Position: serializedVersion: 2 - x: 2080 + x: 2093 y: 0 - width: 464 - height: 1283 + width: 467 + height: 1299 m_MinSize: {x: 276, y: 71} m_MaxSize: {x: 4001, y: 4021} - m_ActualView: {fileID: 22} + m_ActualView: {fileID: 21} m_Panes: + - {fileID: 21} - {fileID: 22} - - {fileID: 23} m_Selected: 0 m_LastSelected: 1 --- !u!114 &14 @@ -528,10 +528,10 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 504 - y: 81 - width: 1582 - height: 831 + x: 3060 + y: 73 + width: 1591 + height: 852 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: m_LastAppliedPresetName: Default @@ -733,9 +733,9 @@ MonoBehaviour: m_PlayAudio: 0 m_AudioPlay: 0 m_Position: - m_Target: {x: 265.49808, y: -252.37164, z: 569.5713} + m_Target: {x: -154.2139, y: -279.62265, z: 278.06793} speed: 2 - m_Value: {x: 265.49808, y: -252.37164, z: 569.5713} + m_Value: {x: -154.2139, y: -279.62265, z: 278.06793} m_RenderMode: 0 m_CameraMode: drawMode: 0 @@ -782,20 +782,20 @@ MonoBehaviour: m_GridAxis: 1 m_gridOpacity: 0.5 m_Rotation: - m_Target: {x: -0.19085442, y: -0.20736168, z: 0.0411824, w: -0.95862365} + m_Target: {x: -0.34235892, y: 0.23453484, z: -0.0888527, w: -0.9055442} speed: 2 - m_Value: {x: -0.1908544, y: -0.20736167, z: 0.0411824, w: -0.95862365} + m_Value: {x: -0.34233814, y: 0.23452061, z: -0.08884731, w: -0.90548927} m_Size: - m_Target: 355.15256 + m_Target: 220.71765 speed: 2 - m_Value: 355.15256 + m_Value: 220.71765 m_Ortho: m_Target: 0 speed: 2 m_Value: 0 m_CameraSettings: - m_Speed: 0.94053 - m_SpeedNormalized: 0.47 + m_Speed: 1.06047 + m_SpeedNormalized: 0.53 m_SpeedMin: 0.001 m_SpeedMax: 2 m_EasingEnabled: 1 @@ -834,10 +834,10 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 8 - y: 81 - width: 495 - height: 831 + x: 2560 + y: 73 + width: 499 + height: 852 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: m_LastAppliedPresetName: Default @@ -845,9 +845,9 @@ MonoBehaviour: m_SceneHierarchy: m_TreeViewState: scrollPos: {x: 0, y: 0} - m_SelectedIDs: + m_SelectedIDs: 06740000 m_LastClickedID: 0 - m_ExpandedIDs: 2afbffffe8710000 + m_ExpandedIDs: 0e92feff54d1feff1ed5feffd8effeff5afafeff4024ffff7829ffff0a72ffffc879ffff109fffff9ea2ffffbaa5fffffecfffff64d8ffff4af5ffff2afbffff82950000a09800000699000062990000569c0000dc9c0000009d0000fa9d0000189e0000c29f00009ebb000016bd0000f8cf00001cd0000054d000001cd2000088d200003ad30000a0d30000fcd30000 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -872,99 +872,6 @@ MonoBehaviour: m_CurrentSortingName: TransformSorting m_WindowGUID: 4c969a2b90040154d917609493e03593 --- !u!114 &17 -MonoBehaviour: - m_ObjectHideFlags: 52 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 1 - m_Script: {fileID: 12015, guid: 0000000000000000e000000000000000, type: 0} - m_Name: - m_EditorClassIdentifier: - m_MinSize: {x: 200, y: 200} - m_MaxSize: {x: 4000, y: 4000} - m_TitleContent: - m_Text: Game - m_Image: {fileID: -6423792434712278376, guid: 0000000000000000d000000000000000, - type: 0} - m_Tooltip: - m_Pos: - serializedVersion: 2 - x: 500 - y: 73 - width: 1591 - height: 842 - m_ViewDataDictionary: {fileID: 0} - m_OverlayCanvas: - m_LastAppliedPresetName: Default - m_SaveData: [] - m_SerializedViewNames: [] - m_SerializedViewValues: [] - m_PlayModeViewName: GameView - m_ShowGizmos: 0 - m_TargetDisplay: 0 - m_ClearColor: {r: 0, g: 0, b: 0, a: 0} - m_TargetSize: {x: 1591, y: 821} - m_TextureFilterMode: 0 - m_TextureHideFlags: 61 - m_RenderIMGUI: 1 - m_EnterPlayModeBehavior: 0 - m_UseMipMap: 0 - m_VSyncEnabled: 0 - m_Gizmos: 0 - m_Stats: 0 - m_SelectedSizes: 00000000000000000000000000000000000000000000000000000000000000000000000000000000 - m_ZoomArea: - m_HRangeLocked: 0 - m_VRangeLocked: 0 - hZoomLockedByDefault: 0 - vZoomLockedByDefault: 0 - m_HBaseRangeMin: -795.5 - m_HBaseRangeMax: 795.5 - m_VBaseRangeMin: -410.5 - m_VBaseRangeMax: 410.5 - m_HAllowExceedBaseRangeMin: 1 - m_HAllowExceedBaseRangeMax: 1 - m_VAllowExceedBaseRangeMin: 1 - m_VAllowExceedBaseRangeMax: 1 - m_ScaleWithWindow: 0 - m_HSlider: 0 - m_VSlider: 0 - m_IgnoreScrollWheelUntilClicked: 0 - m_EnableMouseInput: 0 - m_EnableSliderZoomHorizontal: 0 - m_EnableSliderZoomVertical: 0 - m_UniformScale: 1 - m_UpDirection: 1 - m_DrawArea: - serializedVersion: 2 - x: 0 - y: 21 - width: 1591 - height: 821 - m_Scale: {x: 1, y: 1} - m_Translation: {x: 795.5, y: 410.5} - m_MarginLeft: 0 - m_MarginRight: 0 - m_MarginTop: 0 - m_MarginBottom: 0 - m_LastShownAreaInsideMargins: - serializedVersion: 2 - x: -795.5 - y: -410.5 - width: 1591 - height: 821 - m_MinimalGUI: 1 - m_defaultScale: 1 - m_LastWindowPixelSize: {x: 1591, y: 842} - m_ClearInEditMode: 1 - m_NoCameraWarning: 1 - m_LowResolutionForAspectRatios: 01000000000000000000 - m_XRRenderMode: -1 - m_RenderTexture: {fileID: 0} ---- !u!114 &18 MonoBehaviour: m_ObjectHideFlags: 52 m_CorrespondingSourceObject: {fileID: 0} @@ -984,10 +891,10 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 391 + x: 3059 y: 73 - width: 1222 - height: 766 + width: 1592 + height: 852 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: m_LastAppliedPresetName: Default @@ -1968,7 +1875,7 @@ MonoBehaviour: []\n },\n \"m_SerializedDescriptor\": \"VertexDescription.Tangent\"\n}\n\n" m_AssetMaybeChangedOnDisk: 0 m_AssetMaybeDeleted: 0 ---- !u!114 &19 +--- !u!114 &18 MonoBehaviour: m_ObjectHideFlags: 52 m_CorrespondingSourceObject: {fileID: 0} @@ -1989,10 +1896,10 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 0 - y: 936 + x: 2560 + y: 946 width: 1039 - height: 415 + height: 405 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: m_LastAppliedPresetName: Default @@ -2010,22 +1917,22 @@ MonoBehaviour: m_SkipHidden: 1 m_SearchArea: 1 m_Folders: - - Assets + - Assets/Scenes m_Globs: [] m_OriginalText: m_ViewMode: 1 m_StartGridSize: 16 m_LastFolders: - - Assets + - Assets/Scenes m_LastFoldersGridSize: 16 m_LastProjectPath: C:\Users\jason\Desktop\Unity Projects\Light-Sword-VR\project m_LockTracker: m_IsLocked: 1 m_FolderTreeState: - scrollPos: {x: 0, y: 23} - m_SelectedIDs: 5e810000 - m_LastClickedID: 33118 - m_ExpandedIDs: 000000009a7600009c7600009e760000a0760000a2760000a4760000 + scrollPos: {x: 0, y: 53} + m_SelectedIDs: a0760000 + m_LastClickedID: 30368 + m_ExpandedIDs: 000000009a7600009c7600009e760000a0760000a2760000a476000000ca9a3b m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -2078,9 +1985,9 @@ MonoBehaviour: m_Icon: {fileID: 0} m_ResourceFile: m_ListAreaState: - m_SelectedInstanceIDs: 8c810000 - m_LastClickedInstanceID: 33164 - m_HadKeyboardFocusLastEvent: 0 + m_SelectedInstanceIDs: + m_LastClickedInstanceID: 0 + m_HadKeyboardFocusLastEvent: 1 m_ExpandedInstanceIDs: c6230000ce75feffcac3000000000000fed2f6ff m_RenameOverlay: m_UserAcceptedRename: 0 @@ -2109,7 +2016,7 @@ MonoBehaviour: m_GridSize: 16 m_SkipHiddenPackages: 1 m_DirectoriesAreaWidth: 207 ---- !u!114 &20 +--- !u!114 &19 MonoBehaviour: m_ObjectHideFlags: 52 m_CorrespondingSourceObject: {fileID: 0} @@ -2130,15 +2037,15 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 8 - y: 933 - width: 1033 - height: 410 + x: 2560 + y: 946 + width: 1039 + height: 405 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: m_LastAppliedPresetName: Default m_SaveData: [] ---- !u!114 &21 +--- !u!114 &20 MonoBehaviour: m_ObjectHideFlags: 52 m_CorrespondingSourceObject: {fileID: 0} @@ -2159,10 +2066,10 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 1042 - y: 933 - width: 1044 - height: 410 + x: 3600 + y: 946 + width: 1051 + height: 405 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: m_LastAppliedPresetName: Default @@ -2180,21 +2087,21 @@ MonoBehaviour: m_SkipHidden: 0 m_SearchArea: 1 m_Folders: - - Assets/maps + - Assets/Blocks/Blue Block m_Globs: [] m_OriginalText: m_ViewMode: 1 m_StartGridSize: 96 m_LastFolders: - - Assets/maps + - Assets/Blocks/Blue Block m_LastFoldersGridSize: 96 m_LastProjectPath: C:\Users\jason\Desktop\Unity Projects\Light-Sword-VR\project m_LockTracker: m_IsLocked: 1 m_FolderTreeState: - scrollPos: {x: 0, y: 79} - m_SelectedIDs: 02770000 - m_LastClickedID: 30466 + scrollPos: {x: 0, y: 0} + m_SelectedIDs: b2760000 + m_LastClickedID: 30386 m_ExpandedIDs: 000000009a7600009c7600009e760000a0760000a2760000a476000000ca9a3b m_RenameOverlay: m_UserAcceptedRename: 0 @@ -2279,7 +2186,7 @@ MonoBehaviour: m_GridSize: 96 m_SkipHiddenPackages: 0 m_DirectoriesAreaWidth: 320 ---- !u!114 &22 +--- !u!114 &21 MonoBehaviour: m_ObjectHideFlags: 52 m_CorrespondingSourceObject: {fileID: 0} @@ -2300,10 +2207,10 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 2088 - y: 81 - width: 463 - height: 1262 + x: 4653 + y: 73 + width: 466 + height: 1278 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: m_LastAppliedPresetName: Default @@ -2321,7 +2228,7 @@ MonoBehaviour: m_LockTracker: m_IsLocked: 0 m_PreviewWindow: {fileID: 0} ---- !u!114 &23 +--- !u!114 &22 MonoBehaviour: m_ObjectHideFlags: 52 m_CorrespondingSourceObject: {fileID: 0} @@ -2350,3 +2257,98 @@ MonoBehaviour: m_OverlayCanvas: m_LastAppliedPresetName: Default m_SaveData: [] +--- !u!114 &23 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12015, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_MinSize: {x: 200, y: 200} + m_MaxSize: {x: 4000, y: 4000} + m_TitleContent: + m_Text: Game + m_Image: {fileID: -6423792434712278376, guid: 0000000000000000d000000000000000, + type: 0} + m_Tooltip: + m_Pos: + serializedVersion: 2 + x: 3060 + y: 73 + width: 1591 + height: 852 + m_ViewDataDictionary: {fileID: 0} + m_OverlayCanvas: + m_LastAppliedPresetName: Default + m_SaveData: [] + m_SerializedViewNames: + - UnityEditor.DeviceSimulation.SimulatorWindow + m_SerializedViewValues: + - C:\Users\jason\Desktop\Unity Projects\Light-Sword-VR\project\Library\PlayModeViewStates\2e631391e18858d4599828023dfbca17 + m_PlayModeViewName: GameView + m_ShowGizmos: 0 + m_TargetDisplay: 0 + m_ClearColor: {r: 0, g: 0, b: 0, a: 0} + m_TargetSize: {x: 1591, y: 831} + m_TextureFilterMode: 0 + m_TextureHideFlags: 61 + m_RenderIMGUI: 1 + m_EnterPlayModeBehavior: 0 + m_UseMipMap: 0 + m_VSyncEnabled: 0 + m_Gizmos: 0 + m_Stats: 0 + m_SelectedSizes: 00000000000000000000000000000000000000000000000000000000000000000000000000000000 + m_ZoomArea: + m_HRangeLocked: 0 + m_VRangeLocked: 0 + hZoomLockedByDefault: 0 + vZoomLockedByDefault: 0 + m_HBaseRangeMin: -795.5 + m_HBaseRangeMax: 795.5 + m_VBaseRangeMin: -415.5 + m_VBaseRangeMax: 415.5 + m_HAllowExceedBaseRangeMin: 1 + m_HAllowExceedBaseRangeMax: 1 + m_VAllowExceedBaseRangeMin: 1 + m_VAllowExceedBaseRangeMax: 1 + m_ScaleWithWindow: 0 + m_HSlider: 0 + m_VSlider: 0 + m_IgnoreScrollWheelUntilClicked: 0 + m_EnableMouseInput: 0 + m_EnableSliderZoomHorizontal: 0 + m_EnableSliderZoomVertical: 0 + m_UniformScale: 1 + m_UpDirection: 1 + m_DrawArea: + serializedVersion: 2 + x: 0 + y: 21 + width: 1591 + height: 831 + m_Scale: {x: 1, y: 1} + m_Translation: {x: 795.5, y: 415.5} + m_MarginLeft: 0 + m_MarginRight: 0 + m_MarginTop: 0 + m_MarginBottom: 0 + m_LastShownAreaInsideMargins: + serializedVersion: 2 + x: -795.5 + y: -415.5 + width: 1591 + height: 831 + m_MinimalGUI: 1 + m_defaultScale: 1 + m_LastWindowPixelSize: {x: 1591, y: 852} + m_ClearInEditMode: 1 + m_NoCameraWarning: 1 + m_LowResolutionForAspectRatios: 01000000000000000000 + m_XRRenderMode: -1 + m_RenderTexture: {fileID: 0}