From 4fe81326562229d507713c8aaf09fa41264683b7 Mon Sep 17 00:00:00 2001 From: Pasha Bibko <156938226+PashaBibko@users.noreply.github.com> Date: Tue, 25 Nov 2025 13:18:18 +0000 Subject: [PATCH] Updated rendering Made +1 score on ring destruction --- Assets/Materials/GreenMat.mat | 10 +++++++++- Assets/Materials/RedMat.mat | 10 +++++++++- Assets/Scenes/SampleScene.unity | 4 ++-- Assets/Scripts/OrbitalPosition.cs | 12 +++++++++++- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/Assets/Materials/GreenMat.mat b/Assets/Materials/GreenMat.mat index 8300f51..05935cc 100644 --- a/Assets/Materials/GreenMat.mat +++ b/Assets/Materials/GreenMat.mat @@ -8,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: GreenMat - m_Shader: {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: [] @@ -23,6 +23,10 @@ Material: m_SavedProperties: serializedVersion: 3 m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - _BumpMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} @@ -61,11 +65,13 @@ Material: m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: + - PixelSnap: 0 - _BumpScale: 1 - _ColorMask: 15 - _Cutoff: 0.5 - _DetailNormalMapScale: 1 - _DstBlend: 0 + - _EnableExternalAlpha: 0 - _GlossMapScale: 1 - _Glossiness: 0.5 - _GlossyReflections: 1 @@ -87,4 +93,6 @@ Material: m_Colors: - _Color: {r: 0, g: 1, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Materials/RedMat.mat b/Assets/Materials/RedMat.mat index 0a66b50..2aacc60 100644 --- a/Assets/Materials/RedMat.mat +++ b/Assets/Materials/RedMat.mat @@ -8,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: RedMat - m_Shader: {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: [] @@ -23,6 +23,10 @@ Material: m_SavedProperties: serializedVersion: 3 m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - _BumpMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} @@ -61,11 +65,13 @@ Material: m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: + - PixelSnap: 0 - _BumpScale: 1 - _ColorMask: 15 - _Cutoff: 0.5 - _DetailNormalMapScale: 1 - _DstBlend: 0 + - _EnableExternalAlpha: 0 - _GlossMapScale: 1 - _Glossiness: 0.5 - _GlossyReflections: 1 @@ -87,4 +93,6 @@ Material: m_Colors: - _Color: {r: 1, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index db83445..71e3dad 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -288,7 +288,7 @@ Camera: width: 1 height: 1 near clip plane: 0.3 - far clip plane: 1000 + far clip plane: 25 field of view: 60 orthographic: 1 orthographic size: 5 @@ -571,7 +571,7 @@ MonoBehaviour: m_HorizontalOverflow: 1 m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: 65536 + m_Text: 0 --- !u!222 &1501855169 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/OrbitalPosition.cs b/Assets/Scripts/OrbitalPosition.cs index 25b7475..5c82f31 100644 --- a/Assets/Scripts/OrbitalPosition.cs +++ b/Assets/Scripts/OrbitalPosition.cs @@ -142,13 +142,23 @@ public class GlobalOrbitalPositionManager : MonoBehaviour LineRenderer lineRenderer = ring.GetComponentInChildren(); for (int vert = 0; vert < CirclePoints; vert++) { - lineRenderer.SetPosition(vert, m_PrecalculatedPositions[vert] * ring.transform.localScale.x); + lineRenderer.SetPosition(vert, new Vector3 + ( + x: m_PrecalculatedPositions[vert].x * ring.transform.localScale.x, + y: m_PrecalculatedPositions[vert].y * ring.transform.localScale.y, + z: 10 + )); } float lerp = (ring.transform.localScale.x - 0.5f) / 4f; Color c = Color.Lerp(Color.black, Color.white, Mathf.Clamp01(lerp)); if (ring.transform.localScale.x < 0.5f) + { + if (IsSimulationRunning) + PlayerController.PlayerScore++; + toRemove.Add(ring); + } lineRenderer.startColor = c; lineRenderer.endColor = c;