[unity]JavaScrpt遊戲物件基本操作
gameObject.transform.position = Vector3(x,y,z);
gameObject.transform.Translate(x,y,z);
gameObject.transform.Rotate(0,30*Time.deltaTime,0);
gameObject.transform.rotation = Quaternion.Euler(0,30,0);
public var Camera3 : GameObject;Camera1.active = true;
Input.GetMouseButtonDown(1)
- 動態生成物件(Instantiate) : 先製造prefab,經過某個事件後才生成物件
var prefabObj : GameObject;Instantiate(prefabObj,transform.position,transform.rotation);
- 切換場景:可以場景檔名或引數呼叫(需在Sences In Build建立順序)
Application.LoadLevel("Sence2")
Application.LoadLevel(0);
Refence
Application.OpenURL("www.google.com");
建立空元件,並加上audiosource component,將mp3拉進audiosource
var audio_A : AduioSource;
aduio.play();
more
Application.CaptureScreenShot("filename.png");
CG數位學習網
彥霖實驗筆記
沒有留言:
張貼留言