Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        loadingController.Show();

        Debug.Log(LoggedInUser.Instance.currentGameId);

        // Start api call to get match info
        string apiEndpoint = apiEndpointHost + getGameStateEndpointFormat;
        string apiCall     = string.Format(apiEndpoint, LoggedInUser.Instance.currentGameId);

        StartCoroutine(MakeApiCall(apiCall, HandleStartGame, ErrorStartingGame));

        gridController.OnStateUpdate += HandlePiecePlaced; // State change happens when piece is placed;
    }
        void IInitializable.Initialize()
        {
            Observable
            .EveryUpdate()
            .Where(_ => Input.GetKeyDown(KeyCode.S))
            .Subscribe(_ => _controller.Show(SocialGame.Loading.LoadingType.Sample))
            .AddTo(_disposable);

            Observable
            .EveryUpdate()
            .Where(_ => Input.GetKeyDown(KeyCode.H))
            .Subscribe(_ => _controller.Hide())
            .AddTo(_disposable);
        }
 public void OnPlayButtonClick()
 {
     Hide();
     loadingController.Show();
     StartCoroutine("LoadNextScene");
 }