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); }
public void SendEvent(Vector3 position, MyGlobalEventEnum eventType, int seed, Vector3 up, Vector3 forward) { var msg = new MyEventEvent(); msg.Position = new MyMwcPositionAndOrientation(position, forward, up); msg.EventTypeEnum = (int)eventType; msg.Seed = seed; Peers.SendToAll(ref msg, NetDeliveryMethod.ReliableOrdered); }