void OnMusicTransition(ref MyEventMusicTransition msg)
        {
            switch (msg.MusicEventType)
            {
                case MyMusicEventEnum.STOP_MUSIC:
                    MyScriptWrapper.StopMusic();
                    break;

                case MyMusicEventEnum.STOP_TRANSITION:
                    MyScriptWrapper.StopTransition(msg.Priority);
                    break;

                case MyMusicEventEnum.APPLY_TRANSITION:
                    {
                        var transition = (MyMusicTransitionEnum)msg.TransitionEnum;

                        if (!MyMwcEnums.IsValidValue(transition))
                        {
                            Alert("Invalid MyMusicTransitionEnum", msg.SenderEndpoint, msg.EventType);
                            return;
                        }

                        MyScriptWrapper.ApplyTransition(transition, msg.Priority, msg.Category);
                    }
                    break;

                default:
                    Alert("Unknown music transition type", msg.SenderEndpoint, msg.EventType);
                    break;
            }
        }
        private void SendMusicTransition(MyMusicEventEnum musicEventType, int? priority, MyMusicTransitionEnum? transitionEnum, string category, bool loop)
        {
            var msg = new MyEventMusicTransition();
            msg.MusicEventType = musicEventType;
            msg.TransitionEnum = transitionEnum.HasValue ? (int)transitionEnum.Value : 0;
            msg.Priority = priority ?? 0;
            msg.Category = category;
            msg.Loop = loop;

            Peers.SendToAll(ref msg, NetDeliveryMethod.ReliableOrdered);
        }