Exemple #1
0
        protected override void OnTick(float deltaTime)
        {
            try
            {
                if (_photonClient.ClientState == PlayGen.Photon.Unity.Client.ClientState.Disconnected)
                {
                    _photonClient.Connect();
                }

                _stateController.Tick(deltaTime);
            }
            catch (Exception exception)
            {
                LogProxy.Error(exception.ToString());
                LogProxy.Debug(exception.StackTrace);
                OnException(exception);
            }
        }
Exemple #2
0
        protected override void OnEnter()
        {
            _photonClient?.Dispose();
            _photonClient = new ITAlertPhotonClient(GamePlugin, GameVersion, new ITAlertMessageSerializationHandler());
            _photonClient.ExceptionEvent += OnClientException;
            _photonClient.ConnectedEvent += OnConnected;

            PlayerCommands.PhotonClient = _photonClient;
            DebugCommands.PhotonClient  = _photonClient;

            _stateController = _stateControllerFactory.Create(_photonClient);
            _stateController.Initialize();

            if (!GameExceptionHandler.HasException)
            {
                _stateController.EnterState(LoadingState.StateName);
                _photonClient.Connect();
            }
        }