working on player move up animation.

This commit is contained in:
shakurass 2014-04-27 13:54:38 -06:00
commit c5899be38c
6 changed files with 217 additions and 24 deletions

View file

@ -468,6 +468,7 @@ MonoBehaviour:
shankSpawn: {fileID: 57666823} shankSpawn: {fileID: 57666823}
vvAura: {fileID: 100000, guid: 54b915706f095a04ebcad7cd6fe3550c, type: 2} vvAura: {fileID: 100000, guid: 54b915706f095a04ebcad7cd6fe3550c, type: 2}
swigCounter: 2 swigCounter: 2
playerSprite: {fileID: 1605196873}
--- !u!54 &146718574 --- !u!54 &146718574
Rigidbody: Rigidbody:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1127,7 +1128,7 @@ Light:
m_SpotAngle: 30 m_SpotAngle: 30
m_CookieSize: 10 m_CookieSize: 10
m_Shadows: m_Shadows:
m_Type: 2 m_Type: 0
m_Resolution: 3 m_Resolution: 3
m_Strength: 1 m_Strength: 1
m_Bias: .0500000007 m_Bias: .0500000007

View file

@ -66,12 +66,22 @@ public class PlayerController : MonoBehaviour {
float moveHorizontal = Input.GetAxis ("Horizontal"); float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical"); float moveVertical = Input.GetAxis ("Vertical");
if (Mathf.Approximately(moveHorizontal, 0) && // if (Mathf.Approximately(moveHorizontal, 0) &&
Mathf.Approximately(moveVertical, 0)) { // Mathf.Approximately(moveVertical, 0)) {
animator.SetBool("isWalking", false); // animator.SetBool("isWalking", false);
} else { // } else {
animator.SetBool("isWalking", true); // animator.SetBool("isWalking", true);
} // }
if (!Mathf.Approximately (moveHorizontal, 0)) {
animator.SetBool("isWalking", true);
}
else if (!Mathf.Approximately(moveVertical, 0)) {
animator.SetBool("isWalkingUp", true);
}
else {
animator.SetBool("isWalking", false);
animator.SetBool("isWalkingUp", false);
}
if (moveHorizontal < 0) { if (moveHorizontal < 0) {
playerAngle.eulerAngles = new Vector3(0f, -180f, 0f); playerAngle.eulerAngles = new Vector3(0f, -180f, 0f);

View file

@ -14,6 +14,12 @@ AnimatorController:
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
m_Controller: {fileID: 9100000} m_Controller: {fileID: 9100000}
- m_Name: isWalkingUp
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_AnimatorLayers: m_AnimatorLayers:
- serializedVersion: 3 - serializedVersion: 3
m_Name: Base Layer m_Name: Base Layer
@ -62,6 +68,28 @@ Transition:
m_Atomic: 1 m_Atomic: 1
m_Solo: 0 m_Solo: 0
m_Mute: 0 m_Mute: 0
--- !u!1101 &110108368
Transition:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_SrcState: {fileID: 110295956}
m_DstState: {fileID: 110239256}
m_TransitionDuration: 0
m_TransitionOffset: 0
m_Conditions:
- m_ConditionMode: 5
m_ConditionEvent:
m_EventTreshold: 0
m_ExitTime: 1
- m_ConditionMode: 1
m_ConditionEvent: isWalkingUp
m_EventTreshold: 0
m_ExitTime: 1
m_Atomic: 1
m_Solo: 0
m_Mute: 0
--- !u!1101 &110125491 --- !u!1101 &110125491
Transition: Transition:
m_ObjectHideFlags: 3 m_ObjectHideFlags: 3
@ -74,7 +102,7 @@ Transition:
m_TransitionOffset: 0 m_TransitionOffset: 0
m_Conditions: m_Conditions:
- m_ConditionMode: 5 - m_ConditionMode: 5
m_ConditionEvent: m_ConditionEvent: isWalkingUp
m_EventTreshold: 0 m_EventTreshold: 0
m_ExitTime: 1 m_ExitTime: 1
- m_ConditionMode: 1 - m_ConditionMode: 1
@ -84,6 +112,24 @@ Transition:
m_Atomic: 1 m_Atomic: 1
m_Solo: 0 m_Solo: 0
m_Mute: 0 m_Mute: 0
--- !u!1101 &110125891
Transition:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_SrcState: {fileID: 110200000}
m_DstState: {fileID: 110239256}
m_TransitionDuration: 0
m_TransitionOffset: 0
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: isWalkingUp
m_EventTreshold: 0
m_ExitTime: 1
m_Atomic: 1
m_Solo: 0
m_Mute: 0
--- !u!1101 &110148545 --- !u!1101 &110148545
Transition: Transition:
m_ObjectHideFlags: 3 m_ObjectHideFlags: 3
@ -146,6 +192,24 @@ Transition:
m_Atomic: 1 m_Atomic: 1
m_Solo: 0 m_Solo: 0
m_Mute: 0 m_Mute: 0
--- !u!1101 &110174095
Transition:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_SrcState: {fileID: 110239256}
m_DstState: {fileID: 110200000}
m_TransitionDuration: 0
m_TransitionOffset: 0
m_Conditions:
- m_ConditionMode: 5
m_ConditionEvent:
m_EventTreshold: 0
m_ExitTime: 1
m_Atomic: 1
m_Solo: 0
m_Mute: 0
--- !u!1101 &110177869 --- !u!1101 &110177869
Transition: Transition:
m_ObjectHideFlags: 3 m_ObjectHideFlags: 3
@ -158,7 +222,7 @@ Transition:
m_TransitionOffset: 0 m_TransitionOffset: 0
m_Conditions: m_Conditions:
- m_ConditionMode: 5 - m_ConditionMode: 5
m_ConditionEvent: m_ConditionEvent: isWalkingUp
m_EventTreshold: 0 m_EventTreshold: 0
m_ExitTime: 1 m_ExitTime: 1
- m_ConditionMode: 1 - m_ConditionMode: 1
@ -223,6 +287,21 @@ State:
m_IKOnFeet: 0 m_IKOnFeet: 0
m_Mirror: 0 m_Mirror: 0
m_Tag: m_Tag:
--- !u!1102 &110239256
State:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: player_walk_up
m_Speed: 1
m_CycleOffset: 0
m_Motions:
- {fileID: 7400000, guid: d85335db0ae5f934489da2c4ead84b5d, type: 2}
m_ParentStateMachine: {fileID: 110700000}
m_Position: {x: 360, y: 180, z: 0}
m_IKOnFeet: 0
m_Mirror: 0
m_Tag:
--- !u!1102 &110292038 --- !u!1102 &110292038
State: State:
m_ObjectHideFlags: 3 m_ObjectHideFlags: 3
@ -281,9 +360,14 @@ StateMachine:
- {fileID: 110297756} - {fileID: 110297756}
- {fileID: 110295956} - {fileID: 110295956}
- {fileID: 110292038} - {fileID: 110292038}
- {fileID: 110239256}
m_ChildStateMachine: [] m_ChildStateMachine: []
m_ChildStateMachinePosition: [] m_ChildStateMachinePosition: []
m_OrderedTransitions: m_OrderedTransitions:
data:
first: {fileID: 110239256}
second:
- {fileID: 110174095}
data: data:
first: {fileID: 0} first: {fileID: 0}
second: second:
@ -294,20 +378,22 @@ StateMachine:
first: {fileID: 110200000} first: {fileID: 110200000}
second: second:
- {fileID: 110107977} - {fileID: 110107977}
- {fileID: 110125891}
data: data:
first: {fileID: 110297756} first: {fileID: 110292038}
second: second:
- {fileID: 110155252} - {fileID: 110100000}
- {fileID: 110125491}
data: data:
first: {fileID: 110295956} first: {fileID: 110295956}
second: second:
- {fileID: 110179342} - {fileID: 110179342}
- {fileID: 110177869} - {fileID: 110177869}
- {fileID: 110108368}
data: data:
first: {fileID: 110292038} first: {fileID: 110297756}
second: second:
- {fileID: 110100000} - {fileID: 110155252}
- {fileID: 110125491}
m_MotionSetCount: 1 m_MotionSetCount: 1
m_AnyStatePosition: {x: 72, y: -252, z: 0} m_AnyStatePosition: {x: 72, y: -252, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}

View file

@ -0,0 +1,56 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: player_walk_up
serializedVersion: 4
m_AnimationType: 2
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 21300000, guid: 8c3b17ba25bd3c342bcc3f8f68d00593, type: 3}
- time: .0833333358
value: {fileID: 21300002, guid: 8c3b17ba25bd3c342bcc3f8f68d00593, type: 3}
- time: .166666672
value: {fileID: 21300004, guid: 8c3b17ba25bd3c342bcc3f8f68d00593, type: 3}
- time: .25
value: {fileID: 21300006, guid: 8c3b17ba25bd3c342bcc3f8f68d00593, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_AnimationClipSettings:
serializedVersion: 2
m_StartTime: 0
m_StopTime: .266666681
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_Events: []

View file

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: d85335db0ae5f934489da2c4ead84b5d
NativeFormatImporter:
userData:

View file

@ -4,7 +4,7 @@ TextureImporter:
serializedVersion: 2 serializedVersion: 2
mipmaps: mipmaps:
mipMapMode: 0 mipMapMode: 0
enableMipMap: 1 enableMipMap: 0
linearTexture: 0 linearTexture: 0
correctGamma: 0 correctGamma: 0
fadeOut: 0 fadeOut: 0
@ -20,26 +20,62 @@ TextureImporter:
grayScaleToAlpha: 0 grayScaleToAlpha: 0
generateCubemap: 0 generateCubemap: 0
seamlessCubemap: 0 seamlessCubemap: 0
textureFormat: -1 textureFormat: -3
maxTextureSize: 1024 maxTextureSize: 1024
textureSettings: textureSettings:
filterMode: -1 filterMode: 0
aniso: -1 aniso: 1
mipBias: -1 mipBias: -1
wrapMode: -1 wrapMode: 1
nPOTScale: 1 nPOTScale: 0
lightmap: 0 lightmap: 0
compressionQuality: 50 compressionQuality: 50
spriteMode: 0 spriteMode: 2
spriteExtrude: 1 spriteExtrude: 1
spriteMeshType: 1 spriteMeshType: 1
alignment: 0 alignment: 0
spritePivot: {x: .5, y: .5} spritePivot: {x: .5, y: .5}
spritePixelsToUnits: 100 spritePixelsToUnits: 100
alphaIsTransparency: 0 alphaIsTransparency: 1
textureType: -1 textureType: 8
buildTargetSettings: [] buildTargetSettings: []
spriteSheet: spriteSheet:
sprites: [] sprites:
- name: demon-hero-walk-up_0
rect:
serializedVersion: 2
x: 0
y: 32
width: 32
height: 32
alignment: 0
pivot: {x: 0, y: 0}
- name: demon-hero-walk-up_1
rect:
serializedVersion: 2
x: 32
y: 32
width: 32
height: 32
alignment: 0
pivot: {x: 0, y: 0}
- name: demon-hero-walk-up_2
rect:
serializedVersion: 2
x: 0
y: 0
width: 32
height: 32
alignment: 0
pivot: {x: 0, y: 0}
- name: demon-hero-walk-up_3
rect:
serializedVersion: 2
x: 32
y: 0
width: 32
height: 32
alignment: 0
pivot: {x: 0, y: 0}
spritePackingTag: spritePackingTag:
userData: userData: