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