This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var paused : boolean = false; | |
function Update () { | |
if(Input.GetButtonUp("Jump")){ | |
if(!paused){ | |
Time.timeScale = 0; | |
paused=true; | |
}else{ | |
Time.timeScale = 1; | |
paused=false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Update () { | |
var xMove : float = Input.GetAxis("Horizontal") * Time.deltaTime * 20; | |
transform.Translate(Vector3(xMove,0,0)); | |
transform.position.x = Mathf.Clamp(transform.position.x, -10, 10); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var normalTex : Texture2D; | |
var hoverTex : Texture2D; | |
function OnMouseEnter () { | |
guiTexture.texture = hoverTex; | |
} | |
function OnMouseExit(){ | |
guiTexture.texture = normalTex; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myPrefab : Rigidbody; | |
var distanceMultiplier : float = 2; | |
function Start(){ | |
var i : int = 0; | |
var pos : Vector3 = transform.position; | |
for(i=0; i<=3; i++){ | |
Instantiate(myPrefab, Vector3(pos.x+i*distanceMultiplier, pos.y, pos.z), transform.rotation); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stars : ParticleEmitter; | |
function OnCollisionEnter (col : Collision) { | |
Instantiate(stars, transform.position, transform.rotation); | |
Destroy(gameObject); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var box : GameObject; | |
var readynow : boolean = true; | |
function Update () { | |
if(readynow){ | |
MakeBox(); | |
} | |
} | |
function MakeBox(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var box : Transform; | |
function Update () { | |
var dist : float = Vector3.Distance(box.position, transform.position); | |
Debug.Log(dist); | |
if(dist <= 10){ | |
light.enabled = true; | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myCheck : boolean = true; | |
function Update () { | |
if(myCheck){ | |
guiText.text = "Its on!"; | |
}else{ | |
guiText.text = "Its Off!"; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myTransform : Transform; | |
function Update () { | |
transform.LookAt(myTransform); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Update () { | |
//transform.Translate(Vector3(0,0,1) * Time.deltaTime); | |
var fwd = transform.forward * 100; | |
rigidbody.AddForce(fwd); | |
} |
NewerOlder