31 lines
737 B
C#
31 lines
737 B
C#
using UnityEngine;
|
|
|
|
public class PlayerController : OrbitalPositionBehaviour
|
|
{
|
|
protected override void OnStart()
|
|
{
|
|
GlobalOrbitalPositionManager.SetPlayer(m_OrbitalPosition);
|
|
|
|
m_OrbitalPosition.m_ObjectRadius = 0.4f;
|
|
m_OrbitalPosition.m_SpinSpeed = 0.1f;
|
|
}
|
|
|
|
public void Update()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.Space) && GlobalOrbitalPositionManager.AllowPlayerInput)
|
|
{
|
|
m_OrbitalPosition.m_AttachedRing += 1;
|
|
}
|
|
}
|
|
|
|
public override void OnCollision(OrbitalPositionBehaviour other)
|
|
{
|
|
Debug.Log("HIT OBSTACLE IG");
|
|
}
|
|
|
|
public override void OnReachCentre()
|
|
{
|
|
GlobalOrbitalPositionManager.RestartSimulation();
|
|
}
|
|
}
|