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; | |
//Drop this on the parent of a 2dToolkit TileMap to animate some of the child sprites. | |
//The name of each sprite must be hardcoded into the Start() fxn. | |
public class AnimateTileMapScript : MonoBehaviour { | |
public tk2dSpriteCollectionData spriteCollection; |
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
public class ActionDispatcher { | |
protected void Dispatch(Action action) { | |
if (action != null) { | |
action(); | |
} | |
} | |
protected void Dispatch<T0>(Action<T0> action, T0 param0) { | |
if (action != null) { | |
action(param0); | |
} |
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; | |
public class StringHash<T> { | |
Dictionary<string, T> dictionary = new Dictionary<string, T>(); | |
public void Set(string key, T value) { | |
if (HasKey(key)) { |
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 InControl; | |
/** Attach this to some persistent object in your scene **/ | |
public class SimpleTouchManager : MonoBehaviour | |
{ | |
void Update() { | |
//All Buttons should exist on the UI layer to avoid collisions with other GameObjects. | |
int UILayerMask = 1 << LayerMask.NameToLayer("UI"); |
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.Linq; | |
using UnityEditor; | |
using System.Collections.Generic; | |
public class LargeTexturePackerPolicy : UnityEditor.Sprites.IPackerPolicy | |
{ | |
protected class Entry |
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; | |
public static class ParticleExtensions | |
{ | |
/// Add Extension to the native ParticleSystem class. | |
/// eg: myParticleSystem.Scale(2); | |
public static void Scale(this ParticleSystem particles, float scale, bool includeChildren = true) { | |
ParticleScaler.Scale(particles, scale, includeChildren); | |
} |