Inverted player death direction
Cause Unity Transform was bugging out
This commit is contained in:
@@ -162,6 +162,7 @@ MonoBehaviour:
|
|||||||
m_Behaviour: {fileID: 0}
|
m_Behaviour: {fileID: 0}
|
||||||
m_SpinSpeed: 0
|
m_SpinSpeed: 0
|
||||||
m_Renderer: {fileID: 104400500}
|
m_Renderer: {fileID: 104400500}
|
||||||
|
m_Transform: {fileID: 104400498}
|
||||||
--- !u!4 &104400498
|
--- !u!4 &104400498
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -19,5 +19,5 @@ public class GlobalOrbitalSettings : MonoBehaviour
|
|||||||
[SerializeField] GameObject m_EnemyPrefab;
|
[SerializeField] GameObject m_EnemyPrefab;
|
||||||
public static GameObject EnemyPrefab => Instance.m_EnemyPrefab;
|
public static GameObject EnemyPrefab => Instance.m_EnemyPrefab;
|
||||||
|
|
||||||
void Start() => Instance = this;
|
private void Start() => Instance = this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ public class PlayerController : OrbitalPositionBehaviour
|
|||||||
public static void AttachPlayer() { s_Instance.m_OrbitalPosition.m_IsAttachedToRings = true; }
|
public static void AttachPlayer() { s_Instance.m_OrbitalPosition.m_IsAttachedToRings = true; }
|
||||||
|
|
||||||
private Vector3 m_SuicidePoint;
|
private Vector3 m_SuicidePoint;
|
||||||
private bool m_KillingItself = false;
|
private bool m_KillingItself;
|
||||||
private float m_DeathLerp = 0f;
|
private float m_DeathLerp;
|
||||||
|
|
||||||
public MeshRenderer m_Renderer;
|
public MeshRenderer m_Renderer;
|
||||||
|
|
||||||
@@ -31,10 +31,9 @@ public class PlayerController : OrbitalPositionBehaviour
|
|||||||
|
|
||||||
if (!m_KillingItself)
|
if (!m_KillingItself)
|
||||||
return;
|
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;
|
m_DeathLerp += Time.deltaTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnCollision(OrbitalPositionBehaviour other)
|
public override void OnCollision(OrbitalPositionBehaviour other)
|
||||||
@@ -52,6 +51,8 @@ public class PlayerController : OrbitalPositionBehaviour
|
|||||||
{
|
{
|
||||||
m_KillingItself = false;
|
m_KillingItself = false;
|
||||||
m_Renderer.enabled = true;
|
m_Renderer.enabled = true;
|
||||||
|
|
||||||
|
m_Renderer.material.color = Color.green;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnReachCentre()
|
public override void OnReachCentre()
|
||||||
|
|||||||
Reference in New Issue
Block a user