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
#pragma strict | |
private var aSource : AudioSource; | |
function Start () | |
{ | |
aSource = GetComponent.<AudioSource>(); | |
} | |
function OnTriggerEnter2D () |
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
#pragma strict | |
public var coinEffect : GameObject; | |
function OnTriggerEnter2D (other : Collider2D) | |
{ | |
if (coinEffect) | |
Instantiate(coinEffect, 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
General | |
Duration 0.20 | |
Looping Off | |
Start Lifetime 1 | |
Start Speed 10 | |
Start Rotation 0-360 | |
Emission | |
Rate 70 | |
Shape | |
Shape Sphere |
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
#pragma strict | |
public var expl : GameObject; | |
function OnTriggerEnter2D (other : Collider2D) | |
{ | |
var newPos : Vector3 = new Vector3(gameObject.transform.position.x, gameObject.transform.position.y, 0); | |
Instantiate(expl, newPos, Quaternion.identity); | |
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
#pragma strict | |
public var speed : float = 10f; | |
function Update () { | |
var move = Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0); | |
transform.position += move * speed * Time.deltaTime; | |
} |
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
#pragma strict | |
public var xSpeed : int; | |
public var ySpeed : int; | |
public var randomX : boolean = false; | |
public var minXSpeed : int = 100; | |
public var maxXSpeed : int = 200; | |
public var randomY : boolean = 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
#pragma strict | |
public var speed : int; | |
function Start () | |
{ | |
var newSpeed : Vector2; | |
newSpeed.x = speed; | |
newSpeed.y = 0; | |
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
#pragma strict | |
public var layerName : String = "Foreground"; // the layer in which the particle should be placed | |
public var orderInLayer : int = -1; // -1 to go behind the parent object, 1 to go in front of it | |
public var destroyAfterTime : float = 0; | |
private var pSys : ParticleSystem; | |
function Start () { |
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
#pragma strict | |
public var liveTime : float = 0.5f; // how long to wait before ditching the explosion | |
public var killWithTag : String = "Enemy"; // kills these tagged objects in the blast radius | |
function Start () | |
{ | |
Invoke("DeleteMe", liveTime); | |
} |
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
#pragma strict | |
public var rocket : GameObject; // object to push | |
public var xSpeed : float = 0; // horizontal speed | |
public var ySpeed : float = 400; // vertical speed | |
private var rb2D : Rigidbody2D; | |
function Start () | |
{ |