public void Disruption() { if (number < 7) { GameObject newObject = Instantiate(gameObject, transform.position, transform.rotation) as GameObject; GameObject newObject2 = Instantiate(gameObject, transform.position, transform.rotation) as GameObject; newObject.GetComponent <Ball>().StartMove(); newObject2.GetComponent <Ball>().StartMove(); GameStatic.SetBalls((byte)(GameStatic.GetBalls() + 2)); } }
void OnDestroy() { --number; GameStatic.SetBalls(GameStatic.GetBalls() - 1); }