0
using UnityEngine;
using System.Collections;
public class Lift : MonoBehaviour {
private bool pressedButton = false;
private bool isElevatorUp = false;
public GameObject target;
void OnMouseOver()
{
pressedButton = true;
}
void OnMouseExit()
{
pressedButton = false;
}
void OnMouseDown()
{
if(isElevatorUp == false)
{
target = GameObject.Find("Elevator");
}
}
void OnGUI()
{
if(pressedButton == true)
{
GUI.Box(new Rect(300, 300, 200, 20), "Press to use lift!");
}
}
}
当我键入target.animation。 然后在最后一点后,我看到一些属性,但不玩。为什么GameObject.animation没有play属性?
它应该是:target.animation.Play但Play不存在。
实际上GameObject.animation属性已被弃用 – luizcarlosfx