// Use this for initialization void Start() { InvokeRepeating("CheckForThree", .1f, .1f); InvokeRepeating("CheckWin", .1f, .1f); BallBasketO = GameObject.Find("BallBasket"); ballbasket = BallBasketO.GetComponent <BallBasket> (); id = ballbasket.nextid; color = ballbasket.NextColor; SpriteRenderer rend = gameObject.GetComponent <SpriteRenderer> (); switch (color) { case 0: rend.sprite = Red; break; case 1: rend.sprite = Blue; break; case 2: rend.sprite = Green; break; case 3: rend.sprite = Purple; break; case 4: rend.sprite = Yellow; break; case 5: rend.sprite = Orange; break; default: rend.sprite = Red; break; } ballbasket.reset(); }
// Use this for initialization void Start() { BallBasketO = GameObject.Find("BallBasket"); ballbasket = BallBasketO.GetComponent <BallBasket> (); ChangeColor(); }