This file contains hidden or 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
/// Usage: | |
/// | |
/// There's no need to do any special setup of any kind. | |
/// | |
/// Instead of calling Instantiate(), use this: | |
/// SimplePool.Spawn(somePrefab, somePosition, someRotation); | |
/// | |
/// Instead of destroying an object, use this: | |
/// SimplePool.Despawn(myGameObject); | |
/// |
This file contains hidden or 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.Generic; | |
using System.Linq; | |
using UnityEditor; | |
public class AnimatedUnitCompressor : EditorWindow { | |
Vector2 scrollPos = Vector2.zero; | |
public List<GameObject> UnitPrefabs; | |
public static string BonePrefix; | |
private SerializedObject _serializedObject; |
This file contains hidden or 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
// Let's talk about memory conservation | |
// If a Unity API returns an array, it allocates a new copy. | |
// Every time it is accessed, Even if the values do not change. | |
// Bad Sample 1: this code allocate too many Arrays | |
for ( int i = 0;i < Input.touches.Length; i++ ) // Get() accessor call + creating copy | |
{ | |
Touch touch = Input.touches[i]; // Creating copy | |
// … | |
} |
This file contains hidden or 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
/// <summary> | |
/// Performance utility code | |
/// </summary> | |
public class Utils_Perf | |
{ | |
/// <summary> | |
/// Static values with no accessor functions to slow them down. | |
/// Actually calling Vector3.zero is like calling New Vector3(0,0,0) | |
/// About 4x faster than Vector3.zero |
This file contains hidden or 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; | |
namespace GokUtil.UpdateManager | |
{ | |
public class UpdateManager : MonoBehaviour | |
{ | |
const int InitialSize = 16; | |
private int tail = 0; |
This file contains hidden or 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; | |
using System.Collections.Generic; | |
/* | |
* AWESOME UTILS TO SAVE YOUR DAY | |
* These codes were aggregated from personnal codebase as well | |
* as some Stack / Unity threads |
This file contains hidden or 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 NonSenseGenerator : MonoBehaviour { | |
string[] n = new string[71]; | |
string[] v = new string[71]; | |
// Use this for initialization | |
void Start () { | |
SetNoun(); | |
SetVerb(); | |
} |
This file contains hidden or 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; | |
using System.IO; | |
/// <summary> | |
/// | |
/// </summary> | |
public class TextureCache | |
{ |
This file contains hidden or 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 class ToastMessage : MonoBehaviour | |
{ | |
string toastString; | |
string input; | |
AndroidJavaObject currentActivity; | |
AndroidJavaClass UnityPlayer; | |
AndroidJavaObject context; |
This file contains hidden or 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; | |
//---------------------------- | |
// Some interesting shit is going on here | |
// We have a non-generic abstract base class which serves only the purpose of storing all the generic | |
// subclasses inside a common list (you'll see one in the GlobalEventSystemMaitenance class). | |
// Different events inside the EventSystem.Events namespace (and folder) are just statically typed | |
// entities used to differentiate the events one from another | |
//---------------------------- |
NewerOlder