diff --git a/Assets/Scripts/OpenTS2/Scenes/ParticleEffects/SwarmDecal.cs b/Assets/Scripts/OpenTS2/Scenes/ParticleEffects/SwarmDecal.cs index 0263b38..f4b75a7 100644 --- a/Assets/Scripts/OpenTS2/Scenes/ParticleEffects/SwarmDecal.cs +++ b/Assets/Scripts/OpenTS2/Scenes/ParticleEffects/SwarmDecal.cs @@ -61,31 +61,6 @@ public void Initialize() transform.localScale = Vector3.one; } - private Vector2 RotateUV(Vector2 uv, float angle) - { - var cos = Mathf.Cos(angle); - var sin = Mathf.Sin(angle); - var x = uv.x * cos - uv.y * sin; - var y = uv.x * sin + uv.y * cos; - return new Vector2(x, y); - } - - private Vector2 GetUV(Vector3 point) - { - var radius = 80f; - var radiusHalf = radius * 0.5f; - var minPos = _position; - minPos -= new Vector3(radiusHalf, radiusHalf, radiusHalf); - var maxPos = minPos + new Vector3(radius, radius, radius); - - point -= minPos; - point /= radius; - - var uv = new Vector2(point.x - 0.5f, point.z - 0.5f); - uv = RotateUV(GetUV(uv), _rotation.y * Mathf.Deg2Rad); - uv += new Vector2(0.5f, 0.5f); - return uv; - } private void BuildDecalMesh(Mesh terrainMesh) { _decalMesh = new Mesh(); @@ -98,7 +73,7 @@ private void BuildDecalMesh(Mesh terrainMesh) var radius = 80f; var radiusHalf = radius * 0.5f; var decalPositionMatrix = Matrix4x4.Translate(new Vector3(-_position.x + radiusHalf, 0f, -_position.z + radiusHalf)); - var decalRotationMatrix = Matrix4x4.Rotate(Quaternion.Euler(0f, _rotation.y, 0f)); + var decalRotationMatrix = Matrix4x4.Rotate(Quaternion.Euler(0f, -_rotation.y, 0f)); for(var i = 0; i < vertices.Length; i++) { diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset index 1cb23b1..a6405a5 100644 --- a/ProjectSettings/GraphicsSettings.asset +++ b/ProjectSettings/GraphicsSettings.asset @@ -30,7 +30,7 @@ GraphicsSettings: m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} m_VideoShadersIncludeMode: 2 m_AlwaysIncludedShaders: - - {fileID: 4800000, guid: 2517862c6cef84541b911933144f8371, type: 3} + - {fileID: 4800000, guid: cd1c2fe69305d6340a8e116e63955e26, type: 3} - {fileID: 4800000, guid: 75e0683a765caef42b3b3feffe1eee77, type: 3} - {fileID: 4800000, guid: 687258d81ac22d0468c2f8b31c25f43d, type: 3} - {fileID: 4800000, guid: 4d0461340a185194c81b99c57ca9c084, type: 3}