diff --git a/Assets/Animations.meta b/Assets/Animations.meta new file mode 100644 index 0000000..89b8a5f --- /dev/null +++ b/Assets/Animations.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0be5178eda42c884b910fd35e0bd7ef1 +folderAsset: yes +timeCreated: 1446671881 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Animations/Idle.anim b/Assets/Animations/Idle.anim new file mode 100644 index 0000000..ebe77ec Binary files /dev/null and b/Assets/Animations/Idle.anim differ diff --git a/Assets/Animations/Idle.anim.meta b/Assets/Animations/Idle.anim.meta new file mode 100644 index 0000000..ffee318 --- /dev/null +++ b/Assets/Animations/Idle.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a5953cc6b2350a04aa578af74d1740a3 +timeCreated: 1446674697 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Animations/Running.anim b/Assets/Animations/Running.anim new file mode 100644 index 0000000..db4697d Binary files /dev/null and b/Assets/Animations/Running.anim differ diff --git a/Assets/Animations/Running.anim.meta b/Assets/Animations/Running.anim.meta new file mode 100644 index 0000000..9da1e2c --- /dev/null +++ b/Assets/Animations/Running.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 90df11971c9d126429f338c1cfc08ac3 +timeCreated: 1446674724 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Animations/ShotingWhileRunning.anim b/Assets/Animations/ShotingWhileRunning.anim new file mode 100644 index 0000000..4d6c545 Binary files /dev/null and b/Assets/Animations/ShotingWhileRunning.anim differ diff --git a/Assets/Animations/ShotingWhileRunning.anim.meta b/Assets/Animations/ShotingWhileRunning.anim.meta new file mode 100644 index 0000000..7a6f065 --- /dev/null +++ b/Assets/Animations/ShotingWhileRunning.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fa93b95d117b58a43b3a34cc2f860e8b +timeCreated: 1446687352 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Animations/megaman.controller b/Assets/Animations/megaman.controller new file mode 100644 index 0000000..483473e Binary files /dev/null and b/Assets/Animations/megaman.controller differ diff --git a/Assets/Animations/megaman.controller.meta b/Assets/Animations/megaman.controller.meta new file mode 100644 index 0000000..bc75bed --- /dev/null +++ b/Assets/Animations/megaman.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4435a97212c21a447a54fac1ff9a76ed +timeCreated: 1446674697 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/XavierScene.unity b/Assets/Scenes/XavierScene.unity index 5144b82..7be720b 100644 Binary files a/Assets/Scenes/XavierScene.unity and b/Assets/Scenes/XavierScene.unity differ diff --git a/Assets/Scripts/Animations.cs b/Assets/Scripts/Animations.cs new file mode 100644 index 0000000..ef4ed7b --- /dev/null +++ b/Assets/Scripts/Animations.cs @@ -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(); + 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); + + } +} diff --git a/Assets/Scripts/Class/Character.cs b/Assets/Scripts/Class/Character.cs index 7bd42a3..f3984b1 100644 --- a/Assets/Scripts/Class/Character.cs +++ b/Assets/Scripts/Class/Character.cs @@ -28,6 +28,7 @@ public class Character{ public void setTouchingTheFloor(bool touchFloor){ this.touchingTheFloor = touchFloor; } + public bool isTouchingTheFloor() { return touchingTheFloor; diff --git a/Assets/Scripts/Jump.cs b/Assets/Scripts/Jump.cs index 1b0fa84..617a8f5 100644 --- a/Assets/Scripts/Jump.cs +++ b/Assets/Scripts/Jump.cs @@ -7,8 +7,7 @@ public class Jump : MonoBehaviour { public Transform player; - private bool isJumping; // - + private bool isJumping; // Use this for initialization void Start () { isJumping = false; @@ -20,12 +19,12 @@ public class Jump : MonoBehaviour { if (Input.GetButton("Fire1") && isJumping == false) { - timeJump = 50; + timeJump = 10; isJumping = true; } if (timeJump > 0) { - player.Translate(0, 0.5f, 0); + player.Translate(0, 0.4f, 0); timeJump--; } else diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 490011e..2ca7e66 100644 Binary files a/ProjectSettings/ProjectSettings.asset and b/ProjectSettings/ProjectSettings.asset differ diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index b11ab9b..8a062e6 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 5.2.2f1 +m_EditorVersion: 5.2.1f1 m_StandardAssetsVersion: 0 diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 7f9c39d..071b29b 100644 Binary files a/ProjectSettings/TagManager.asset and b/ProjectSettings/TagManager.asset differ