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