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
using UnityEngine; | |
using System.Collections; | |
public class DragWithMouse : MonoBehaviour { | |
private Vector3 offset; | |
void OnMouseDown () { | |
Vector3 mousePos = new Vector3(Input.mousePosition.x, Input.mousePosition.y, 0); | |
offset = transform.position - Camera.main.ScreenToWorldPoint(mousePos); |
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
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.UI; | |
using DG.Tweening; | |
public class DriftingText : MonoBehaviour { | |
public GameObject canvas; | |
public GameObject textPrefab; | |
public float driftTime = 1f; |
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 () | |
{ |
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
--============================================================== | |
-- pass in a lily pad number and get back a | |
-- table containing all the neighbors for | |
-- that lily pad. | |
local numCols = 11 | |
local numRows = 7 | |
local function getNeighbors(padNum) |
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 gObj : GameObject; | |
public var minX : float; | |
public var maxX : float; | |
public var minY : float; | |
public var maxY : float; | |
public var startDelay : float = 0f; |
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 showDelay : float = 0.2; | |
public var startHidden : bool = true; | |
function Awake() | |
{ | |
if (startHidden) | |
gameObject.renderer.enabled = 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 coinEffect : GameObject; | |
private var soundFX : AudioSource; | |
function Start() | |
{ | |
soundFX = GetComponent.<AudioSource>(); | |
} |