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