Nextrek
@ 168
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#pragma strict var type:int; private var cam:Camera; function Start(){ // Getting the main camera cam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent.<Camera>(); if (type==1) transform.position = cam.ScreenToWorldPoint( Vector3( 0, 0,8)); else if (type==2) transform.position = cam.ScreenToWorldPoint( Vector3( Screen.width, 0,8)); } |