You've already forked taptap2024_GJ_chidouren
init
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class CharacterAnimation : MonoBehaviour {
|
||||
|
||||
private CharacterController cc;
|
||||
private Animation anim;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
|
||||
cc= GetComponentInChildren<CharacterController>();
|
||||
anim = GetComponentInChildren<Animation>();
|
||||
}
|
||||
|
||||
|
||||
// Wait end of frame to manage charactercontroller, because gravity is managed by virtual controller
|
||||
void LateUpdate(){
|
||||
if (cc.isGrounded && (ETCInput.GetAxis("Vertical")!=0)){
|
||||
anim.CrossFade("soldierRun");
|
||||
}
|
||||
|
||||
if (cc.isGrounded && ETCInput.GetAxis("Vertical")==0 && ETCInput.GetAxis("Horizontal")==0){
|
||||
anim.CrossFade("soldierIdleRelaxed");
|
||||
}
|
||||
|
||||
if (!cc.isGrounded){
|
||||
anim.CrossFade("soldierFalling");
|
||||
}
|
||||
|
||||
if (cc.isGrounded && ETCInput.GetAxis("Vertical")==0 && ETCInput.GetAxis("Horizontal")>0){
|
||||
anim.CrossFade("soldierSpinRight");
|
||||
}
|
||||
|
||||
if (cc.isGrounded && ETCInput.GetAxis("Vertical")==0 && ETCInput.GetAxis("Horizontal")<0){
|
||||
anim.CrossFade("soldierSpinLeft");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 665cc9d4bda6c7b48a7c4a6a9b1f0812
|
||||
timeCreated: 1453706718
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,32 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class CharacterAnimationDungeon : MonoBehaviour {
|
||||
|
||||
private CharacterController cc;
|
||||
private Animation anim;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
|
||||
cc= GetComponentInChildren<CharacterController>();
|
||||
anim = GetComponentInChildren<Animation>();
|
||||
}
|
||||
|
||||
|
||||
// Wait end of frame to manage charactercontroller, because gravity is managed by virtual controller
|
||||
void LateUpdate(){
|
||||
if (cc.isGrounded && (ETCInput.GetAxis("Vertical")!=0 || ETCInput.GetAxis("Horizontal")!=0)){
|
||||
anim.CrossFade("soldierRun");
|
||||
}
|
||||
|
||||
if (cc.isGrounded && ETCInput.GetAxis("Vertical")==0 && ETCInput.GetAxis("Horizontal")==0){
|
||||
anim.CrossFade("soldierIdleRelaxed");
|
||||
}
|
||||
|
||||
if (!cc.isGrounded){
|
||||
anim.CrossFade("soldierFalling");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f8434a6b91f9c745acd5f2a89161cc0
|
||||
timeCreated: 1453711933
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user