public void Awake()
{
if (instance == null)
{
instance = this;
DontDestroyOnLoad(this.gameObject);
}
else if (instance != this)
{
Debug.LogWarning("Destroying duplicate instance of "+this.gameObject+". ChatGui applies DontDestroyOnLoad() to this GameObject.");
Destroy(this.gameObject);
}
}