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
//Based on a brilliant idea by Matthew Wegner - https://twitter.com/mwegner/status/355147544818495488 | |
//Code for drawing the base PropertyDrawers is from here: http://forum.unity3d.com/threads/173401-Getting-Default-SerializedProperty-Drawing-within-a-PropertyDrawer?p=1186347&viewfull=1#post1186347 | |
//My implementation is super lazy with magic numbers everywhere! :D | |
#if UNITY_EDITOR | |
using System; | |
using UnityEngine; | |
using System.Collections.Generic; | |
using UnityEditor; |
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 System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Scroller | |
{ | |
public float maxDragSpeed = 20.0f; //maximum drag speed | |
public float edgeSquish = 60.0f; //how far to go past the end | |
public float edgeBounce = 0.19f; //how much force to use to bounce back | |
public float strongFriction = 0.75f; //used to bring it to a stop quicker |
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 System.Collections.Generic; | |
using System; | |
using System.Linq; | |
using System.Text; | |
using System.Reflection; | |
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 System; | |
using UnityEngine; | |
public class HealthBar : FContainer | |
{ | |
private const float INSET = 1.0f; | |
private const float DOUBLE_INSET = INSET*2.0f; | |
private static Color BAD_COLOR = Color.red; | |
private static Color OKAY_COLOR = Color.yellow; |
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
//These have *identical* performance | |
Car myCar = new Car(); | |
//STYLE A: with declaration outside loop | |
Car tempCarA; | |
for(int c = 0; c<1000; c++) | |
{ | |
tempCarA = myCar; | |
tempCarA.Honk(); |
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
[SWF (backgroundColor=0, width=800,height=600, frameRate=60)] | |
////////////////////////////////////////// | |
//ROCK MUSIC featuring THE ROLLING STONE// | |
////////////////////////////////////////// | |
//By Matt Rix // | |
////////////////////////////////////////// | |
//Hold down your mouse on the left and // | |
//right sides of the screen to move // |
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; | |
using System.Collections.Generic; | |
public class DenomMaker | |
{ | |
public static List<int> GetDenoms(int[] denoms, int totalValue, int numCoins) | |
{ | |
List<int> resultCoins = new List<int>(numCoins+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
<?xml version="1.0" encoding="UTF-8"?> | |
<tutorials> | |
<tutorial slug="welcome" name="Welcome!"> | |
<!--welcome and explain goal of the game--> | |
<step> | |
<create_box xy="160,260">Welcome to TRAINYARD!</create_box> | |
<delay time="2" /> | |
<reset_allActions /> | |
<create_box xy="160,300">This tutorial will explain[br]how to solve puzzles</create_box> |
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 System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class RXScroller | |
{ | |
//note: these are not static in case you want to set them on a per-scroller basis | |
public float MAX_DRAG_SPEED = 20.0f; //maximum drag speed in pixels-per-update | |
public float EDGE_SQUISH = 60.0f; //how far to go past the end in pixels |