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