Пример #1
0
 // Use this for initialization
 void Start()
 {
     PilloController.ConfigureSensorRange(0x50, 0x6f);
     grav             = this.GetComponent <Rigidbody> ();
     controller       = GameControllerObj.GetComponent <gameControler> ();
     ballScr          = ball.GetComponent <collision> ();
     grav.isKinematic = true;
 }
    private int AllStarsCollected()
    {
        gameControler gameKontroler = GameObject.FindGameObjectWithTag("GameController").GetComponent <gameControler>();

        int starsColected = 0;

        starsColected += gameKontroler.AllStarsForLevel(1);
        starsColected += gameKontroler.AllStarsForLevel(2);
        starsColected += gameKontroler.AllStarsForLevel(3);
        starsColected += gameKontroler.AllStarsForLevel(4);
        starsColected += gameKontroler.AllStarsForLevel(5);

        return(starsColected);
    }