diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 8149f21..0c63483 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -162,6 +162,7 @@ MonoBehaviour: m_Behaviour: {fileID: 0} m_SpinSpeed: 0 m_Renderer: {fileID: 104400500} + m_Transform: {fileID: 104400498} --- !u!4 &104400498 Transform: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/GlobalOrbitalSettings.cs b/Assets/Scripts/GlobalOrbitalSettings.cs index ffd860b..893d1b8 100644 --- a/Assets/Scripts/GlobalOrbitalSettings.cs +++ b/Assets/Scripts/GlobalOrbitalSettings.cs @@ -19,5 +19,5 @@ public class GlobalOrbitalSettings : MonoBehaviour [SerializeField] GameObject m_EnemyPrefab; public static GameObject EnemyPrefab => Instance.m_EnemyPrefab; - void Start() => Instance = this; + private void Start() => Instance = this; } diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index fba1f54..0fed058 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -7,8 +7,8 @@ public class PlayerController : OrbitalPositionBehaviour public static void AttachPlayer() { s_Instance.m_OrbitalPosition.m_IsAttachedToRings = true; } private Vector3 m_SuicidePoint; - private bool m_KillingItself = false; - private float m_DeathLerp = 0f; + private bool m_KillingItself; + private float m_DeathLerp; public MeshRenderer m_Renderer; @@ -31,10 +31,9 @@ public class PlayerController : OrbitalPositionBehaviour if (!m_KillingItself) return; - - transform.position = Vector3.Lerp(m_SuicidePoint, Vector3.zero, m_DeathLerp); + + transform.position = Vector3.Lerp(m_SuicidePoint, m_SuicidePoint.normalized * 20f, m_DeathLerp); m_DeathLerp += Time.deltaTime; - } public override void OnCollision(OrbitalPositionBehaviour other) @@ -52,6 +51,8 @@ public class PlayerController : OrbitalPositionBehaviour { m_KillingItself = false; m_Renderer.enabled = true; + + m_Renderer.material.color = Color.green; } public override void OnReachCentre()