Example #1
0
 private void OnGUI()
 {
     if (GUI.Button(_shutdownButtonRect, "Shutdown") && BoltNetwork.IsRunning)
     {
         BoltNetwork.Shutdown();
     }
 }
Example #2
0
        void OnGUI()
        {
            Rect tex  = new Rect(10, 10, 140, 75);
            Rect area = new Rect(10, 90, Screen.width - 20, Screen.height - 100);

            GUI.Box(tex, Resources.Load("BoltLogo") as Texture2D);

            if (BoltNetwork.IsRunning)
            {
                tex = new Rect(160, 10, 140, 75);
                GUILayout.BeginArea(tex);
                if (GUILayout.Button("Shutdown", GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)))
                {
                    BoltNetwork.Shutdown();
                }
                GUILayout.EndArea();
            }

            GUILayout.BeginArea(area);

            switch (state)
            {
            case State.SelectMode: State_SelectMode(); break;

            case State.SelectMap: State_SelectMap(); break;

            case State.SelectRoom: State_SelectRoom(); break;

            case State.StartClient: State_StartClient(); break;

            case State.StartServer: State_StartServer(); break;
            }

            GUILayout.EndArea();
        }
Example #3
0
 public void ShutDownBolt()
 {
     if (BoltNetwork.IsRunning)           // if there is a boltnetwork instance, shutdown.
     {
         BoltNetwork.Shutdown();
     }
 }
Example #4
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.S))
     {
         BoltNetwork.Shutdown();
     }
 }
Example #5
0
    void Start()
    {
        SettingsPopup.instance.Hide();

        GameState.instance.CurrentState = GameState.State.mainMenu;

        BoltNetwork.Shutdown(); //just in case bolt was running, shut it down
    }
Example #6
0
        private void Start()
        {
            _config = BoltRuntimeSettings.instance.GetConfigCopy();

            if (BoltNetwork.IsRunning)
            {
                BoltNetwork.Shutdown();
            }
        }
Example #7
0
 private void LateUpdate()
 {
     if (BoltNetwork.Frame % 60 == 0 &&         // every 60 frame
         _hadClients &&                         // someone has connected before
         BoltNetwork.Clients.Any() == false)    // and there is no one now
     {
         BoltLog.Error("Shutting down: not clients left");
         BoltNetwork.Shutdown();
     }
 }
Example #8
0
    public override void OnEvent(DisconnectEvent evnt)
    {
        //Camera[] cam = FindObjectsOfType<Camera>();
        //foreach (var VARIABLE in cam)
        //{
        //   BoltNetwork.Destroy(VARIABLE.gameObject);
        //}

        BoltNetwork.Shutdown();

        SceneManager.LoadScene(0, LoadSceneMode.Single);
    }
 private void HealthCallBack()
 {
     localCampfireHealth = state.CampfireHealth;
     if (localCampfireHealth <= 0)
     {
         BoltNetwork.Destroy(gameObject);
         if (loseTimeLeft < 0)
         {
             BoltNetwork.Shutdown();
         }
     }
 }
Example #10
0
 private void EstadoConfirmarsalir()
 {
     Debug.Log("EstadoConfirmarsalir() no implementado, salimos directamente");
     if (BoltNetwork.IsServer)
     {
         BoltNetwork.LoadScene("Menu");
     }
     else
     {
         SceneManager.LoadScene("Menu");
     }
     if (BoltNetwork.IsConnected)
     {
         BoltNetwork.Shutdown();
     }
 }
Example #11
0
    // aquĆ­ ponemos lo que pasa localmente cada vez que se carga una nueva escena
    public override void SceneLoadLocalDone(string scene)
    {
        Debug.Log("Ponemos las conexiones a cero");
        numeroConexiones = 0;

        if (scene == "Juego Libre")
        {
            //GameObject.FindGameObjectWithTag("CreaCartas").GetComponent<CreaCartas>().CrearCartas();
        }

        if (scene == "Menu")
        {
            //cerramos todas las conexiones posibles al inicio para poder crear nuevas partidas
            BoltNetwork.Shutdown();
        }
    }
Example #12
0
    // Update is called once per frame
    void Update()
    {
        m_timeOutCountdown -= Time.deltaTime;

        int timeOutInt = Mathf.RoundToInt(m_timeOutCountdown);

        timeOutCountdownDisplay.text = timeOutInt.ToString();


        if (!BoltNetwork.IsConnected || BoltMatchmaking.CurrentSession.ConnectionsCurrent != BoltMatchmaking.CurrentSession.ConnectionsMax)
        {
            if (m_timeOutCountdown < 0f)
            {
                BoltNetwork.Shutdown();
                GameState.instance.TransitionToMainMenu();
            }
        }
    }
Example #13
0
    public void TransitionToMainMenu()
    {
        if (CurrentState == State.mainSettings || CurrentState == State.mainControls || CurrentState == State.playMenu)
        {
            MainMenu menu = FindObjectOfType <MainMenu>();
            menu.ShowMainMenu();
        }
        else
        {
            SceneManager.LoadScene("MainMenu");

            if (BoltNetwork.IsRunning)
            {
                BoltNetwork.Shutdown();
            }
        }

        CurrentState = State.mainMenu;
    }
    /*
     * private void HealthCallBack()
     * {
     * player2Health = state.Health2;
     *
     * if (player2Health <= 0)
     * {
     *     BoltNetwork.Destroy(gameObject);
     *     BoltNetwork.Shutdown();
     *
     * }
     * } */


    public void Update()
    {
        /* if (Input.GetKeyDown(KeyCode.Space))
         * {
         *   state.Health2 -= 1;
         * } */

        if (player2Health <= 0)
        {
            SceneManager.LoadScene(2);

            BoltNetwork.Shutdown();
        }

        if (player2Kill >= 3)
        {
            SceneManager.LoadScene(3);

            BoltNetwork.Shutdown();
        }
    }
Example #15
0
 public void QuitGame()
 {
     BoltNetwork.Shutdown();
     SceneManager.LoadSceneAsync("Menu");
 }
Example #16
0
 /// <summary>
 /// Shutdown this Bolt instance.
 /// </summary>
 public static void Shutdown()
 {
     BoltNetwork.Shutdown();
 }
Example #17
0
 public override void Shutdown(OperationResultDelegate onComplete)
 {
     _operationCallbackShutdown = onComplete;
     State = NetworkState.ShuttingDown;
     BoltNetwork.Shutdown();
 }
 public void ShutDownBolt()
 {
     BoltNetwork.Shutdown();
 }
Example #19
0
 public override void OnEvent(LobbyPlayerKick evnt)
 {
     BoltNetwork.Shutdown();
 }