コード例 #1
0
ファイル: MoveCamera.cs プロジェクト: S1510237010/ARProject
 // Reacts to keyboard input and moves the camera around.
 void Update()
 {
     if (Input.GetKey(KeyCode.LeftArrow))
     {
         rotation++;
         transform.rotation = Quaternion.Euler(0, rotation, 0);
     }
     if (Input.GetKey(KeyCode.UpArrow))
     {
         position          += 0.1f;
         transform.position = new Vector3(0, position, 0);
     }
     if (Input.GetKey(KeyCode.DownArrow))
     {
         position          -= 0.1f;
         transform.position = new Vector3(0, position, 0);
     }
     if (Input.GetKey(KeyCode.RightArrow))
     {
         rotation--;
         Camera.main.transform.rotation = Quaternion.Euler(0, rotation, 0);
     }
     if (Input.GetKeyDown(KeyCode.Space))
     {
         Placeable place = FindObjectOfType <Placeable> ();
         if (place != null)
         {
             place.OnSelect();
         }
     }
 }