Menu Start
This commit is contained in:
		| @@ -8,16 +8,14 @@ Material: | ||||
|   m_PrefabInstance: {fileID: 0} | ||||
|   m_PrefabAsset: {fileID: 0} | ||||
|   m_Name: Particle | ||||
|   m_Shader: {fileID: 210, guid: 0000000000000000f000000000000000, type: 0} | ||||
|   m_Shader: {fileID: 10750, guid: 0000000000000000f000000000000000, type: 0} | ||||
|   m_ShaderKeywords: _ALPHAPREMULTIPLY_ON | ||||
|   m_LightmapFlags: 0 | ||||
|   m_EnableInstancingVariants: 0 | ||||
|   m_DoubleSidedGI: 0 | ||||
|   m_CustomRenderQueue: 3000 | ||||
|   stringTagMap: | ||||
|     RenderType: Transparent | ||||
|   disabledShaderPasses: | ||||
|   - ALWAYS | ||||
|   m_CustomRenderQueue: -1 | ||||
|   stringTagMap: {} | ||||
|   disabledShaderPasses: [] | ||||
|   m_SavedProperties: | ||||
|     serializedVersion: 3 | ||||
|     m_TexEnvs: | ||||
| @@ -92,7 +90,7 @@ Material: | ||||
|     - _ZWrite: 0 | ||||
|     m_Colors: | ||||
|     - _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} | ||||
|     - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} | ||||
|   m_BuildTextureStacks: [] | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -30,6 +30,11 @@ public class PlayerController : MonoBehaviour | ||||
|     void Start() | ||||
|     { | ||||
|         rb = GetComponent<Rigidbody>(); | ||||
|         jump = new Vector3(0.0f, 2.0f, 0.0f); | ||||
|     } | ||||
|  | ||||
|     public void disableCursor() | ||||
|     { | ||||
|         Cursor.lockState = CursorLockMode.Locked; | ||||
|         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; | ||||
|         PlatformManager platform = other.gameObject.GetComponent<PlatformManager>(); | ||||
|         if (platform == null) | ||||
| @@ -101,18 +107,19 @@ public class PlayerController : MonoBehaviour | ||||
|             || other.GetContact(0).normal == -other.transform.forward | ||||
|             || ( | ||||
|                     other.GetContact(0).normal != -other.transform.up | ||||
|                 &&  other.GetContact(0).normal != other.transform.up | ||||
|                 &&  other.GetContact(0).normal != -other.transform.right | ||||
|                 &&  other.GetContact(0).normal != other.transform.right | ||||
|                 && other.GetContact(0).normal != other.transform.up | ||||
|                 && other.GetContact(0).normal != -other.transform.right | ||||
|                 && other.GetContact(0).normal != other.transform.right | ||||
|                 ) | ||||
|             ) | ||||
|             { | ||||
|                 return; | ||||
|             } | ||||
|         { | ||||
|             return; | ||||
|         } | ||||
|         Physics.gravity = this.downDirection * 9.81f; | ||||
|         // if (platform.type == PlatformManager.PlatformType.SpeedUp) | ||||
|         // { | ||||
|             angle = Mathf.Atan2(Vector3.Magnitude(axis), Vector3.Dot(-transform.up, -other.GetContact(0).normal)); | ||||
|             transform.RotateAround(axis, angle); | ||||
|         angle = Mathf.Atan2(Vector3.Magnitude(axis), Vector3.Dot(-transform.up, -other.GetContact(0).normal)); | ||||
|         transform.RotateAround(axis, angle); | ||||
|         // } | ||||
|         // TODO: Handle other PlatformTypes | ||||
|         Physics.gravity = -other.GetContact(0).normal * 9.81f; | ||||
| @@ -128,9 +135,9 @@ public class PlayerController : MonoBehaviour | ||||
|             || other.GetContact(0).normal == -other.transform.forward | ||||
|             || ( | ||||
|                     other.GetContact(0).normal != -other.transform.up | ||||
|                 &&  other.GetContact(0).normal != other.transform.up | ||||
|                 &&  other.GetContact(0).normal != -other.transform.right | ||||
|                 &&  other.GetContact(0).normal != other.transform.right | ||||
|                 && other.GetContact(0).normal != other.transform.up | ||||
|                 && other.GetContact(0).normal != -other.transform.right | ||||
|                 && other.GetContact(0).normal != other.transform.right | ||||
|                 ) | ||||
|             ) | ||||
|             { | ||||
| @@ -148,8 +155,9 @@ public class PlayerController : MonoBehaviour | ||||
|  | ||||
|             Vector3 gDirection; | ||||
|             PlatformManager platform = other.gameObject.GetComponent<PlatformManager>(); | ||||
|             gDirection = -other.GetContact(0).normal; | ||||
|             if (platform == null){ | ||||
|             gDirection = -transform.up; | ||||
|             if (platform == null) | ||||
|             { | ||||
|                 // FIXME: remove | ||||
|                 this.downDirection = -transform.up; | ||||
|                 return; | ||||
|   | ||||
| @@ -16,6 +16,8 @@ public class UiController : MonoBehaviour | ||||
|     void Start() | ||||
|     { | ||||
|         startPosition = this.player.transform.position; | ||||
|         Cursor.lockState = CursorLockMode.None; | ||||
|         Cursor.visible = true; | ||||
|     } | ||||
|  | ||||
|     // Update is called once per frame | ||||
| @@ -25,8 +27,14 @@ public class UiController : MonoBehaviour | ||||
|         distance = Vector3.Distance(this.startPosition, this.playerPosition); | ||||
|         if (oldDistance < distance) | ||||
|         { | ||||
|             uiDistance.text = "Score : " + distance.ToString("0"); | ||||
|             uiDistance.text = "Distance : " + distance.ToString("0"); | ||||
|             oldDistance = distance; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     //MENU | ||||
|     public void exitGame() | ||||
|     { | ||||
|         Application.Quit(); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user