}
else if(GUI.Button(Rect(20,370,60,60),text6))
{
animation.Play("attack");
}
else if(GUI.Button(Rect(20,440,60,60),text7))
{
animation.Play("attack_combo");
}
else if(GUI.Button(Rect(20,510,60,60),text8))
{
animation.Play("dead");
}
}
4.2.2 摄像机跟随代码
using UnityEngine;
public class MouseFollowRotation : MonoBehaviour {
public Transform target;
public float xSpeed=200, ySpeed=200, mSpeed=10;
public float yMinLimit=-50, yMaxLimit=50;
public float distance=2, minDistance=2, maxDistance=30;
//bool needDamping = false;
public bool needDamping =true;
float damping = 5.0f;
public float x = 0.0f;
public float y = 0.0f;
public void SetTarget( GameObject go )
{
target = go.transform;
}
// Use this for initialization
void Start () {
Vector3 angles = transform.eulerAngles; Unity3D科幻风格游戏角色设计与动作演示(9):http://www.youerw.com/yishu/lunwen_2646.html