Menu Start
This commit is contained in:
parent
db767d7a9d
commit
7b26149531
@ -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
@ -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)
|
||||||
@ -101,18 +107,19 @@ public class PlayerController : MonoBehaviour
|
|||||||
|| other.GetContact(0).normal == -other.transform.forward
|
|| 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.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.right
|
&& other.GetContact(0).normal != other.transform.right
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
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));
|
||||||
transform.RotateAround(axis, angle);
|
transform.RotateAround(axis, angle);
|
||||||
// }
|
// }
|
||||||
// TODO: Handle other PlatformTypes
|
// TODO: Handle other PlatformTypes
|
||||||
Physics.gravity = -other.GetContact(0).normal * 9.81f;
|
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.forward
|
||||||
|| (
|
|| (
|
||||||
other.GetContact(0).normal != -other.transform.up
|
other.GetContact(0).normal != -other.transform.up
|
||||||
&& 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.right
|
&& other.GetContact(0).normal != other.transform.right
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -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;
|
||||||
|
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user