Exemplo n.º 1
0
 void Awake()
 {
     Instance = this;
     if (Players.Count != 0)
     {
         Players.Clear();
     }
 }
Exemplo n.º 2
0
    //CONVERTED
    void restart(GameObject handHit)
    {
        if (isServer)
        {
            SaveLoad.Save();
            RpcClearBabies();
            foreach (GameObject baby in Babies)
            {
                NetworkServer.Destroy(baby);
            }
            BabyIDs.Clear();
            Babies.Clear();
            score = 0;

            blarpSound.Play();
            RpcPlayBlarpSound();

            addHighScoreBalls();
            RpcAddHighScoreBalls();

            setHighScoreBalls(Game.current.highScore);
            RpcSetHighScoreBalls(Game.current.highScore);

            Title.GetComponent <MeshRenderer>().enabled = true;
            RpcEnableTitle(true);

            StartButton.GetComponent <MeshRenderer>().enabled = true;
            StartButton.GetComponent <BoxCollider>().enabled  = true;
            RpcEnableStartButton(true);


            Momma.GetComponent <MeshRenderer>().enabled = false;
            Momma.GetComponent <Collider>().enabled     = false;
            RpcEnableMomma(true, 1);

            Momma.transform.position = new Vector3(0, -1000000.0f, 0);

            Room.GetComponent <RoomNetworked>().active = false;
            RpcSetRoomActive(false);
            resizeRoomLarge();

            menuBaby.SetActive(true);
            RpcSetMenuBabyActive(true);
            menuBaby.transform.position = new Vector3(0, 1, 2);
            menuBaby.GetComponent <Rigidbody>().velocity = new Vector3(0, 0, 0);

            isPlaying = false;
        }

        /*
         * LearningBlarp.SetActive(true);
         * LearningBlarp.transform.position = new Vector3(0, 1, 2);//transform.position = new Vector3( 0 , 1 , -2);
         * LearningBlarp.GetComponent<Rigidbody>().velocity = new Vector3(0, 0, 0);
         * //      LearningBlarp.GetComponent<MeshRenderer>().enabled = true;
         *
         * if (tutorialFinished == true)
         * {
         *  addTutorialButton(); addHighScoreBalls();
         *  Title.GetComponent<MeshRenderer>().enabled = true;
         * };*/
        //      Title.GetComponent<BoxCollider>().enabled = false;};


        //startGame( handHit );
    }