Last active
February 9, 2016 06:23
-
-
Save anzfactory/a0370593d32f6328ee33 to your computer and use it in GitHub Desktop.
Script C# Templete For Unity => symbol replace https://gist.github.com/anzfactory/0f6d6c961d52e7651ff3
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
/********************************* | |
#CREATED# | |
*********************************/ | |
using UnityEngine; | |
namespace #NAMESPACE# | |
{ | |
public class #SCRIPTNAME# : MonoBehaviour | |
{ | |
#region "Serialize Fields" | |
#endregion | |
#region "Fields" | |
#endregion | |
#region "Properties" | |
#endregion | |
#region "Events" | |
private void Awake() | |
{ | |
} | |
private void Start () | |
{ | |
} | |
private void Update () | |
{ | |
} | |
private void FixedUpdate() | |
{ | |
} | |
private void OnDestroy() | |
{ | |
} | |
#endregion | |
#region "Public Methods" | |
#endregion | |
#region "Private Methods" | |
#endregion | |
} | |
} |
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
/********************************* | |
#CREATED# | |
*********************************/ | |
using UnityEngine; | |
namespace #NAMESPACE# | |
{ | |
public class #SCRIPTNAME# : MonoBehaviour | |
{ | |
#region "Singleton Pattern" | |
private static #SCRIPTNAME# sInstance; | |
public static #SCRIPTNAME# Instance | |
{ | |
get { return #SCRIPTNAME#.GetInstance(); } | |
} | |
private static #SCRIPTNAME# GetInstance() | |
{ | |
if (sInstance != null) { | |
return sInstance; | |
} | |
sInstance = FindObjectOfType<#SCRIPTNAME#>(); | |
if (sInstance == null) { | |
GameObject gameObject = new GameObject("#SCRIPTNAME#"); | |
sInstance = gameObject.AddComponent<#SCRIPTNAME#>(); | |
} | |
return sInstance; | |
} | |
#endregion | |
#region "Serialize Fields" | |
#endregion | |
#region "Fields" | |
#endregion | |
#region "Properties" | |
#endregion | |
#region "Events" | |
private void Awake() | |
{ | |
if (sInstance == null) { | |
sInstance = this; | |
DontDestroyOnLoad(this); | |
} else { | |
Destroy(this); | |
Destroy(this.gameObject); | |
} | |
} | |
private void Update() | |
{ | |
} | |
private void FixedUpdate() | |
{ | |
} | |
private void OnDestroy() | |
{ | |
} | |
#endregion | |
#region "Public Methods" | |
#endregion | |
#region "Private Methods" | |
#endregion | |
} | |
} |
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
/********************************* | |
#CREATED# | |
*********************************/ | |
namespace #NAMESPACE# | |
{ | |
public class #SCRIPTNAME# | |
{ | |
#region "Fields" | |
#endregion | |
#region "Properties" | |
#endregion | |
#region "Constructor/Destructor" | |
public #SCRIPTNAME#() | |
{ | |
} | |
~#SCRIPTNAME#() | |
{ | |
} | |
#endregion | |
#region "Public Methods" | |
#endregion | |
#region "Private Methods" | |
#endregion | |
} | |
} |
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
/********************************* | |
#CREATED# | |
*********************************/ | |
namespace #NAMESPACE# | |
{ | |
public class #SCRIPTNAME# | |
{ | |
#region "Singleton Pattern" | |
private static #SCRIPTNAME# instance = new #SCRIPTNAME#(); | |
public static #SCRIPTNAME# Instance | |
{ | |
get { return instance; } | |
} | |
#endregion | |
#region "Fields" | |
#endregion | |
#region "Properties" | |
#endregion | |
#region "Constructor/Destructor" | |
private #SCRIPTNAME#() | |
{ | |
} | |
~#SCRIPTNAME#() | |
{ | |
} | |
#endregion | |
#region "Public Methods" | |
#endregion | |
#region "Private Methods" | |
#endregion | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment