嘿,伙计们,我的动画师有问题,我制作了一个可以转换的播放器(播放器动画 = 空闲;运行;滑动;跳转 ===plus=== 播放器 trasform 动画 = trasform;idlePlayerAfterTransform;runPlayerAfterTransform;slidPlayerAfterTransform;jumpPlayerAfterTransform)和我添加了测试攻击动画和攻击空闲。问题是我遵循了一个教程,我使用 ANYSTATE 作为所有动画之间关系的基础,当我添加 trasform 动画时,它们也不起作用并攻击动画我不知道该怎么做我真的卡住了这是动画管理器的脚本
using UnityEngine;
using System.Collections;
public class PlayerManager : MonoBehaviour {
private inputStates inputSs;
private walk walkB;
private Animator anim;
private CollisionState CS;
private wallJump wallj;
private Jump longJ;
public bool attack;
public int lastPressed = 0;
void Awake()
{
inputSs = GetComponent<inputStates> ();
walkB = GetComponent<walk> ();
anim = GetComponent<Animator> ();
CS = GetComponent<CollisionState> ();
wallj = GetComponent<wallJump> ();
longJ = GetComponent<Jump> ();
}
void Start () {
}
void Update () {
//DOZENT WORK =====================================================
if (CS.standing && Input.GetKeyDown (KeyCode.Alpha1)) {
attack = true;
AnimState (2);
if (CS.standing && attack) {
attack = false;
}
}
//==================================================
anim.SetFloat ("Vspeed", GetComponent<Rigidbody2D> ().velocity.y);
//IDLE=========================
if (CS.standing && !attack) {
AnimState(0);
}
//=============================
//run animation=====================
if (inputSs.absX > 0 && !attack) {
AnimState(1);
}
//==================================
//slid============================
if (!CS.standing && CS.wall) {
AnimState(3);
}
//================================
//falling & jump =========================
if (!CS.standing && !CS.wall && !attack) {
AnimState(5);
}
//================================
//run animation speed=======================
anim.speed = walkB.running ? walkB.runM : 1;
//=========================================
}
void AnimState(int value){
anim.SetInteger ("animS", value);
}
}