/ Published in: C#

Singleton pattern for Unity
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
using UnityEngine; using System.Collections; public class Singleton<T> : MonoBehaviour where T : MonoBehaviour { protected static T instance; public static T Instance { get { if (instance == null) { if (instance == null) { } } return instance; } } } public class Player : Singleton<Player>{}
URL: http://devmag.org.za/2012/07/12/50-tips-for-working-with-unity-best-practices/
Comments
