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