mirror of
https://github.com/ConjureETS/Labo_2_Equ_1_a15.git
synced 2026-03-24 01:50:58 +00:00
transitions imparfaites lorsque nous appuyons sur X(ATTAQUE) et que nous bougeons par la suite
This commit is contained in:
parent
eb22bf7e8b
commit
7f57e57a1e
9
Assets/Animations.meta
Normal file
9
Assets/Animations.meta
Normal 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
BIN
Assets/Animations/Idle.anim
Normal file
Binary file not shown.
8
Assets/Animations/Idle.anim.meta
Normal file
8
Assets/Animations/Idle.anim.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a5953cc6b2350a04aa578af74d1740a3
|
||||||
|
timeCreated: 1446674697
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Animations/Running.anim
Normal file
BIN
Assets/Animations/Running.anim
Normal file
Binary file not shown.
8
Assets/Animations/Running.anim.meta
Normal file
8
Assets/Animations/Running.anim.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 90df11971c9d126429f338c1cfc08ac3
|
||||||
|
timeCreated: 1446674724
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Animations/ShotingWhileRunning.anim
Normal file
BIN
Assets/Animations/ShotingWhileRunning.anim
Normal file
Binary file not shown.
8
Assets/Animations/ShotingWhileRunning.anim.meta
Normal file
8
Assets/Animations/ShotingWhileRunning.anim.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fa93b95d117b58a43b3a34cc2f860e8b
|
||||||
|
timeCreated: 1446687352
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Animations/megaman.controller
Normal file
BIN
Assets/Animations/megaman.controller
Normal file
Binary file not shown.
8
Assets/Animations/megaman.controller.meta
Normal file
8
Assets/Animations/megaman.controller.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4435a97212c21a447a54fac1ff9a76ed
|
||||||
|
timeCreated: 1446674697
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
39
Assets/Scripts/Animations.cs
Normal file
39
Assets/Scripts/Animations.cs
Normal 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);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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;
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Binary file not shown.
@ -1,2 +1,2 @@
|
|||||||
m_EditorVersion: 5.2.2f1
|
m_EditorVersion: 5.2.1f1
|
||||||
m_StandardAssetsVersion: 0
|
m_StandardAssetsVersion: 0
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user