Advertisement
amigojapan

Untitled

Mar 22nd, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function rt(name : String, x : float, y : float, z : float){
  2.     //rotate
  3.     //example
  4.     //Declarations
  5.     //qb("cars",0,0,0);qb("cars",2,0,0);qb("planes",4,0,0);cl("cars",Color.red);
  6.     //Update function
  7.     //rt("cars",10,10,10);
  8.     if(name=="camera") {
  9.         var theCamera : GameObject = Camera.main.gameObject;
  10.         theCamera.transform.transform.Rotate(x*Time.deltaTime,y*Time.deltaTime,z*Time.deltaTime);
  11.         return;
  12.     }
  13.     for (var cube :GameObject in cubes) {//this for loop doesnt behave as the regular browser one which woudl return the index, it acutally returns the object
  14.         if(cube.transform.name==name) cube.transform.Rotate(x*Time.deltaTime,y*Time.deltaTime,z*Time.deltaTime);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement