Xavier314 eb22bf7e8b test
2015-11-03 23:27:13 -05:00

38 lines
651 B
C#

using UnityEngine;
using System.Collections;
public class Jump : MonoBehaviour {
public int timeJump;
public Transform player;
private bool isJumping; //
// Use this for initialization
void Start () {
isJumping = false;
timeJump = 0;
}
// Update is called once per frame
void Update () {
if (Input.GetButton("Fire1") && isJumping == false)
{
timeJump = 50;
isJumping = true;
}
if (timeJump > 0) {
player.Translate(0, 0.5f, 0);
timeJump--;
}
else
{
isJumping = false;
}
}
}