跟随鼠标旋转
Vector3 mousePos=Camera.main.ScreenToWorldPoint(Input.mousePosition);
Vector3 direction=mousePos-transform.position;
transform.up=direction;
资源文件Resources的使用
private string[ ] Name;
void Start( ){
Name=new string [ ]{ "1","2","3"};
}
//从资源文件夹获取预设体
GameObject prefabs=Resources.Load(Name[number]) as GameObject;
网友评论