コード例 #1
0
 private void OnGlobalEvent(MyGuiControlButton sender)
 {
     if (MyGuiScreenGamePlay.Static != null)
     {
         var globalEventEnum = (MyGlobalEventEnum)sender.UserData;
         MyGlobalEvents.StartGlobalEvent(globalEventEnum);
     }
 }
コード例 #2
0
        void OnEvent(ref MyEventEvent msg)
        {
            var eventType = (MyGlobalEventEnum)msg.EventTypeEnum;

            if (!MyMwcEnums.IsValidValue(eventType))
            {
                Alert("Invalid global event type", msg.SenderEndpoint, msg.EventType);
            }

            // TODO: When required, add position and seed
            MyGlobalEvents.StartGlobalEvent(eventType);
        }