Esempio n. 1
0
 void startSinglePlayer()
 {
     FindObjectOfType <GameCode>().playSound(GameCode.Sound.Button);
     Multiplayer.type       = Multiplayer.GameType.Single;
     Multiplayer.connection = Multiplayer.Connection.Offline;
     menuPanel.SetActive(false);
     UIPanel2.SetActive(false);
     UIPanel.SetActive(true);
     startingGame = true;
 }
Esempio n. 2
0
 public void startRoyalRumbleMatch()
 {
     FindObjectOfType <GameCode>().playSound(GameCode.Sound.Button);
     Debug.Log("STARTING ROYAL RUMBLE");
     Multiplayer.type       = Multiplayer.GameType.Royal;
     Multiplayer.connection = Multiplayer.Connection.Client;
     menuPanel.SetActive(false);
     UIPanel2.SetActive(false);
     UIPanel.SetActive(true);
     confirmPanel.SetActive(false);
     RoyalPanel.SetActive(false);
     Multiplayer.spawnIndex = 0;
     startingGame           = true;
 }
Esempio n. 3
0
 public void startMultiPlayer()
 {
     FindObjectOfType <GameCode>().playSound(GameCode.Sound.Button);
     multiPairPanel.SetActive(false);
     startingGame = true;
     UIPanel2.SetActive(true);
     UIPanel.SetActive(false);
     p1GameName.text = Multiplayer.userName;
     p2GameName.text = Multiplayer.oppName;
     p1life.texture  = lifeImages[GameCode.life];
     p2life.texture  = lifeImages[Multiplayer.oppLife];
     if (!oppSpawned)
     {
         Instantiate(opponent, new Vector3((Screen.width / 2), (float)(Screen.height / 1.28), 0), Quaternion.identity, GameObject.FindGameObjectWithTag("Panel").transform);
     }
     oppSpawned             = true;
     Multiplayer.ready      = false;
     Multiplayer.restarting = false;
     Multiplayer.winnerSet  = false;
 }
Esempio n. 4
0
    void Menu()
    {
        FindObjectOfType <GameCode>().playSound(GameCode.Sound.Button);
        multiPairPanel.SetActive(false);
        multiMenuPanel.SetActive(false);
        UIPanel2.SetActive(false);

        Multiplayer.connection = Multiplayer.Connection.Offline;
        Multiplayer.type       = Multiplayer.GameType.Single;

        Multiplayer.state     = Multiplayer.State.Searching;
        Multiplayer.ready     = false;
        Multiplayer.retreived = false;
        Multiplayer.winner    = false;
        Multiplayer.stake     = 100;
        Multiplayer.pending   = false;
        oppSpawned            = false;

        GameCode.running = false;
        GameCode.game.resetElements();


        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);

        if (Multiplayer.state != Multiplayer.State.Finished)
        {
            // GameCode.mp.cancelPair();
            Debug.Log("Cancelling and deleting database");
        }
        else
        {
            Debug.Log("Cancelling only");
        }

        GameCode.mp.matchID = "";
    }