Merge remote-tracking branch 'origin/main' into main

main
Ivy 4 years ago
commit 8d813777cc

@ -17,6 +17,7 @@ GameObject:
- component: {fileID: 4796302867346557188}
- component: {fileID: 971613887410275354}
- component: {fileID: 7510283663755342960}
- component: {fileID: 9001604349646828647}
m_Layer: 0
m_Name: Player
m_TagString: Player
@ -140,8 +141,8 @@ CapsuleCollider2D:
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0.0020841956, y: 0}
m_Size: {x: 0.48391044, y: 1.28}
m_Offset: {x: 0.00000011920929, y: 0}
m_Size: {x: 0.5297587, y: 1.28}
m_Direction: 0
--- !u!50 &4572441351392969366
Rigidbody2D:
@ -292,3 +293,29 @@ AudioSource:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!61 &9001604349646828647
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 374150667840124763}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0.0020840168, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 1.28, y: 1.28}
newSize: {x: 9.75, y: 11.35}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 0.53392696, y: 1.28}
m_EdgeRadius: 0

@ -36,6 +36,11 @@ public class movement : MonoBehaviour
// Update is called once per frame
void Update()
{
if (rb2d.velocity.y == 0)
{
isGrounded = true;
}
if (Input.GetKeyDown("space") && numJumps > 0)
{
rb2d.velocity = new Vector2(rb2d.velocity.x, 0);
@ -125,12 +130,7 @@ public class movement : MonoBehaviour
private void OnCollisionEnter2D(Collision2D collision)
{
if(collision.gameObject.tag == "Floor")
{
numJumps = maxJumps;
isGrounded = true;
Debug.Log("Able to Jump");
}
}
private void JumpAnimation()

Loading…
Cancel
Save