/// <summary>
        /// This is called on the remote when a state is entered.
        /// </summary>
        /// <param name="stateName"></param>
        /// <param name="key"></param>
        private void RemoteEnterState(string stateName, int key)
        {
            Logging.Log(this, stateName + " instanced Enter event received!", debugLog);

            bool success;
            var  state = CachedResources.Load <State>(stateName, out success);

            if (!success)
            {
                return;
            }

            state.stateManager.MuteNetworkBroadcasting = true;
            if (key == -1)
            {
                state.Enter();            //non-instanced
            }
            else
            {
                state.Enter(state.stateManager.GetByKeyId(key));  //instanced. Getting the right key by network key
            }
            state.stateManager.MuteNetworkBroadcasting = false;
        }
예제 #2
0
        /// <summary>
        /// This is called on the remote when a Events.GameEvent is fired.
        /// </summary>
        /// <param name="eventName"></param>
        /// <param name="key"></param>
        private void RemoteGameEvent(string eventName, int key)
        {
            Logging.Log(this, eventName + " GameEvent received! key: " + key, debugLog);

            bool success;
            var  gameEvent = CachedResources.Load <GameEvent>(eventName, out success);

            if (!success)
            {
                return;
            }

            gameEvent.MuteNetworkBroadcasting = true;
            if (key == -1)
            {
                gameEvent.Raise();            //non-instanced
            }
            else
            {
                gameEvent.Raise(gameEvent.GetByKeyId(key));  //instanced. Getting the right key by network key
            }
            gameEvent.MuteNetworkBroadcasting = false;
        }
        /// <summary>
        /// This is called on the remote when a Events.ParameterEvent is fired.
        /// </summary>
        /// <param name="eventName"></param>
        /// <param name="key"></param>
        private void RemoteParameterEvent <T, TS>(string eventName, int key, T value) where TS : ParameterEvent <T, TS>
        {
            Logging.Log(this, eventName + " " + typeof(TS) + " received! key: " + key, debugLog);

            bool success;
            var  paramEvent = CachedResources.Load <TS>(eventName, out success);

            if (!success)
            {
                return;
            }

            paramEvent.MuteNetworkBroadcasting = true;
            if (key == -1)
            {
                paramEvent.Raise(value);            //non-instanced
            }
            else
            {
                paramEvent.Raise(value, paramEvent.GetByKeyId(key));  //instanced. Getting the right key by network key
            }
            paramEvent.MuteNetworkBroadcasting = false;
        }
예제 #4
0
 public Sprite GetImage()
 {
     return(CachedResources.Load <Sprite>(GetTextureKey()));
 }