投篮球
using UnityEngine;
using System.Collections;
public class SportManAni : MonoBehaviour {
// Use this for initialization
void Start () {
}
bool CanControl = true; //当键盘弹起的时候,篮球运动员是否处于可控状态
// Update is called once per frame
void Update () {
if(Input.GetButtonDown("Play"))
{
gameObject.animation.PlayQueued("Aim");
}
else if(Input.GetButtonUp("Play") && CanControl)
{
gameObject.animation.PlayQueued("Fire");
gameObject.animation.PlayQueued("Idle");
CanControl = false;
}
CanControl = true;
}
}