Unity3D 脚本:依顺序点击物体移动脚本
Posted on 2013 年 02 月 04 日 by U3d / Unity3D 脚本/插件/被围观 182 次
RaycastHit hit;
int num=1;
void Update () {
if ( Input.GetMouseButtonDown(0) )
{
if (Physics.Raycast(Camera.mainCamera.ScreenPointToRay(Input.mousePosition),
out hit, 100f))
{
if (hit.collider.name == "Cube" + num)
{
//这里播放动画
print(hit.collider.name);