Menu Start

This commit is contained in:
GamerClassN7 2022-01-29 12:21:42 +01:00
parent db767d7a9d
commit 7b26149531
5 changed files with 2809 additions and 25 deletions

View File

@ -8,16 +8,14 @@ Material:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Particle m_Name: Particle
m_Shader: {fileID: 210, guid: 0000000000000000f000000000000000, type: 0} m_Shader: {fileID: 10750, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON m_ShaderKeywords: _ALPHAPREMULTIPLY_ON
m_LightmapFlags: 0 m_LightmapFlags: 0
m_EnableInstancingVariants: 0 m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0 m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000 m_CustomRenderQueue: -1
stringTagMap: stringTagMap: {}
RenderType: Transparent disabledShaderPasses: []
disabledShaderPasses:
- ALWAYS
m_SavedProperties: m_SavedProperties:
serializedVersion: 3 serializedVersion: 3
m_TexEnvs: m_TexEnvs:
@ -92,7 +90,7 @@ Material:
- _ZWrite: 0 - _ZWrite: 0
m_Colors: m_Colors:
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 0, g: 1, b: 1, a: 1} - _Color: {r: 196.33743, g: 28.762808, b: 48.77172, a: 0.49803922}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}
m_BuildTextureStacks: [] m_BuildTextureStacks: []

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -30,6 +30,11 @@ public class PlayerController : MonoBehaviour
void Start() void Start()
{ {
rb = GetComponent<Rigidbody>(); rb = GetComponent<Rigidbody>();
jump = new Vector3(0.0f, 2.0f, 0.0f);
}
public void disableCursor()
{
Cursor.lockState = CursorLockMode.Locked; Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false; Cursor.visible = false;
} }
@ -84,7 +89,8 @@ public class PlayerController : MonoBehaviour
} }
} }
void OnCollisionStay(Collision other){ void OnCollisionStay(Collision other)
{
if (other.gameObject.tag != "platform") return; if (other.gameObject.tag != "platform") return;
PlatformManager platform = other.gameObject.GetComponent<PlatformManager>(); PlatformManager platform = other.gameObject.GetComponent<PlatformManager>();
if (platform == null) if (platform == null)
@ -109,6 +115,7 @@ public class PlayerController : MonoBehaviour
{ {
return; return;
} }
Physics.gravity = this.downDirection * 9.81f;
// if (platform.type == PlatformManager.PlatformType.SpeedUp) // if (platform.type == PlatformManager.PlatformType.SpeedUp)
// { // {
angle = Mathf.Atan2(Vector3.Magnitude(axis), Vector3.Dot(-transform.up, -other.GetContact(0).normal)); angle = Mathf.Atan2(Vector3.Magnitude(axis), Vector3.Dot(-transform.up, -other.GetContact(0).normal));
@ -148,8 +155,9 @@ public class PlayerController : MonoBehaviour
Vector3 gDirection; Vector3 gDirection;
PlatformManager platform = other.gameObject.GetComponent<PlatformManager>(); PlatformManager platform = other.gameObject.GetComponent<PlatformManager>();
gDirection = -other.GetContact(0).normal; gDirection = -transform.up;
if (platform == null){ if (platform == null)
{
// FIXME: remove // FIXME: remove
this.downDirection = -transform.up; this.downDirection = -transform.up;
return; return;

View File

@ -16,6 +16,8 @@ public class UiController : MonoBehaviour
void Start() void Start()
{ {
startPosition = this.player.transform.position; startPosition = this.player.transform.position;
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
} }
// Update is called once per frame // Update is called once per frame
@ -25,8 +27,14 @@ public class UiController : MonoBehaviour
distance = Vector3.Distance(this.startPosition, this.playerPosition); distance = Vector3.Distance(this.startPosition, this.playerPosition);
if (oldDistance < distance) if (oldDistance < distance)
{ {
uiDistance.text = "Score : " + distance.ToString("0"); uiDistance.text = "Distance : " + distance.ToString("0");
oldDistance = distance; oldDistance = distance;
} }
} }
//MENU
public void exitGame()
{
Application.Quit();
}
} }