The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled Javascript Code
Posted by: KingDutka | March 9, 2011 @ 12:41pm
Javascript Code
[
Download
]
if(canTeleport){ var count = 0; var yPos = 100; var towers : GameObject[]; towers = GameObject.FindGameObjectsWithTag("Tower"); if(!spawnedRadii){ SpawnRadii(); } GUI.Label(Rect((Screen.width/2)-100,(Screen.height/2)-100, 200, 220), "Teleport Panel","box"); scrollPosition = GUI.BeginScrollView (Rect((Screen.width/2)-90,(Screen.height/2)-80,190,180), scrollPosition, Rect((Screen.width/2)-90,(Screen.height/2)-80,0,towers.length*20)); for(var tower : GameObject in towers){ count++; yPos -= 20; if(GUI.Button(Rect((Screen.width/2)-50,(Screen.height/2)-yPos, 100, 20), tower.GetComponent("Name").myName+" "+count,"button")){ if(canSummon){ selected = tower; var targetPos = selected.transform.position; targetPos.y += selected.transform.localScale.y; Instantiate(selectron,targetPos,selected.transform.rotation); } } } GUI.EndScrollView (); if(GUI.Button(Rect((Screen.width/2)-50,(Screen.height/2)+100, 100, 20), "Teleport","button")){ selected.transform.position = player.transform.position + (Vector3.up * (selected.transform.localScale.z/2)); canTeleport=0; //selected=; } }
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.47 / 8
73 Votes
http://codebin.yi.org/1157
page generated in 0.01 seconds