transitions imparfaites lorsque nous appuyons sur X(ATTAQUE) et que nous bougeons par la suite

This commit is contained in:
Xavier314 2015-11-04 21:36:56 -05:00
parent eb22bf7e8b
commit 7f57e57a1e
16 changed files with 85 additions and 5 deletions

9
Assets/Animations.meta Normal file
View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 0be5178eda42c884b910fd35e0bd7ef1
folderAsset: yes
timeCreated: 1446671881
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Animations/Idle.anim Normal file

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a5953cc6b2350a04aa578af74d1740a3
timeCreated: 1446674697
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 90df11971c9d126429f338c1cfc08ac3
timeCreated: 1446674724
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fa93b95d117b58a43b3a34cc2f860e8b
timeCreated: 1446687352
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4435a97212c21a447a54fac1ff9a76ed
timeCreated: 1446674697
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,39 @@
using UnityEngine;
using System.Collections;
public class Animations : MonoBehaviour {
private Animator anim;
private bool isShooting;
// Use this for initialization
void Start () {
anim = GetComponent<Animator>();
isShooting = false;
}
// Update is called once per frame
void Update () {
float mouvementX = Input.GetAxis("Horizontal");
if (Input.GetKeyDown(KeyCode.X))
{
isShooting = true;
} // if
if (Input.GetKeyUp(KeyCode.X))
{
isShooting = false;
} // if
anim.SetFloat("SpeedX", Mathf.Abs(mouvementX));
anim.SetBool("isShooting", isShooting);
}
}

View File

@ -28,6 +28,7 @@ public class Character{
public void setTouchingTheFloor(bool touchFloor){ public void setTouchingTheFloor(bool touchFloor){
this.touchingTheFloor = touchFloor; this.touchingTheFloor = touchFloor;
} }
public bool isTouchingTheFloor() public bool isTouchingTheFloor()
{ {
return touchingTheFloor; return touchingTheFloor;

View File

@ -7,8 +7,7 @@ public class Jump : MonoBehaviour {
public Transform player; public Transform player;
private bool isJumping; // private bool isJumping;
// Use this for initialization // Use this for initialization
void Start () { void Start () {
isJumping = false; isJumping = false;
@ -20,12 +19,12 @@ public class Jump : MonoBehaviour {
if (Input.GetButton("Fire1") && isJumping == false) if (Input.GetButton("Fire1") && isJumping == false)
{ {
timeJump = 50; timeJump = 10;
isJumping = true; isJumping = true;
} }
if (timeJump > 0) { if (timeJump > 0) {
player.Translate(0, 0.5f, 0); player.Translate(0, 0.4f, 0);
timeJump--; timeJump--;
} }
else else

View File

@ -1,2 +1,2 @@
m_EditorVersion: 5.2.2f1 m_EditorVersion: 5.2.1f1
m_StandardAssetsVersion: 0 m_StandardAssetsVersion: 0

Binary file not shown.