Esempio n. 1
0
 private void OnMessage(GameEventMessage message)
 {
     if (ListenForAllGameEvents || GameEvent.Equals(message.EventName))
     {
         InvokeEvent(message);
     }
 }
Esempio n. 2
0
 private void OnGameEventReceived(Doozy.Engine.GameEventMessage message)
 {
     if (message.EventName.Equals(exitMatchPlayerGameEvent))
     {
         CloseCurrentMatch();
     }
 }
 private void OnGameEventReceived(Doozy.Engine.GameEventMessage message)
 {
     if (message.EventName.Equals("Show3DMap"))
     {
         ExploreMap(true);
     }
     else if (message.EventName.Equals("Hide3DMap"))
     {
         ExploreMap(false);
     }
 }
Esempio n. 4
0
 private void InvokeEvent(GameEventMessage message)
 {
     if (!message.HasGameEvent)
     {
         return;
     }
     if (Event == null)
     {
         return;
     }
     Event.Invoke(message.EventName);
     if (DebugComponent)
     {
         DDebug.Log("[" + name + "] Triggered Event: " + message.EventName, this);
     }
 }
 private void OnGameEventReceived(Doozy.Engine.GameEventMessage message)
 {
     if (message.EventName.Equals("EnableNavigator"))
     {
         SetNavigatorDraggable(true);
     }
     else if (message.EventName.Equals("DisableNavigator"))
     {
         SetNavigatorDraggable(false);
     }
     if (message.EventName.Equals("EnableDebugView"))
     {
         SetDebugDraggable(true);
     }
     else if (message.EventName.Equals("DisableDebugView"))
     {
         SetDebugDraggable(false);
     }
 }
Esempio n. 6
0
        /// <summary>
        ///     Checks to see if the message contains a system event and, if it does, it triggers a predefined action.
        ///     <para />
        ///     A game event string is considered to be a system event if it is contained in the SystemGameEvent enum values.
        ///     <para />
        ///     This method is automatically called every time a GameEventMessage is sent.
        /// </summary>
        /// <param name="message"> Target GameEvent message </param>
        /// <param name="debug"> Print info debug messages to console? </param>
        public static void ProcessGameEvent(GameEventMessage message, bool debug = false)
        {
            if (message == null)
            {
                return;
            }
            if (Instance.DebugComponent || debug && !message.IsSystemEvent)
            {
                DDebug.Log("Received '" + message.EventName + "' game event.", Instance);
            }
            if (!message.IsSystemEvent)
            {
                return;
            }
            var @event = (SystemGameEvent)Enum.Parse(typeof(SystemGameEvent), message.EventName);

            if (Instance.DebugComponent || debug)
            {
                DDebug.Log("Received '" + @event + "' system game event.", Instance);
            }

            switch (@event)
            {
            case SystemGameEvent.Back:
                BackButton.Instance.Execute();
                break;

            case SystemGameEvent.ApplicationQuit:
#if UNITY_EDITOR
                EditorApplication.isPlaying = false;
#else
                Application.Quit();
#endif
                break;

            case SystemGameEvent.ActivateLoadedScenes:
                SceneLoader.ActivateLoadedScenes();
                break;
            }
        }
Esempio n. 7
0
 private static void SendEvent(GameEventMessage gameEventMessage)
 {
     GameEventManager.ProcessGameEvent(gameEventMessage);
     Send(gameEventMessage.EventName, gameEventMessage);
     Send(gameEventMessage);
 }