void Awake() { if (instance != null) { Debug.Log ("Wrong"); Destroy (gameObject); return; } instance = this; }
public static WarpHoleBehavior GetInstance() { if (instance == null) { GameObject go = new GameObject("WarpHoleBehavior"); go.AddComponent<WarpHoleBehavior>(); instance = go.GetComponent<WarpHoleBehavior>(); } return instance; }