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; | |
/// <summary> | |
/// This is a generic Singleton implementation for Monobehaviours. | |
/// Create a derived class where the type T is the script you want to "Singletonize" | |
/// Upon loading it will call DontDestroyOnLoad on the gameobject where this script is contained | |
/// so it persists upon scene changes. | |
/// </summary> | |
/// <remarks> |
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.Linq; | |
using System.Text.RegularExpressions; | |
public static class IdentifierExtensions | |
{ | |
// definition of a valid C# identifier: http://msdn.microsoft.com/en-us/library/aa664670(v=vs.71).aspx | |
private const string FORMATTING_CHARACTER = @"\p{Cf}"; | |
private const string CONNECTING_CHARACTER = @"\p{Pc}"; | |
private const string DECIMAL_DIGIT_CHARACTER = @"\p{Nd}"; |