コード例 #1
0
        public static void CreateFracturedBlock(MyObjectBuilder_FracturedBlock fracturedBlock, long grid, Vector3I position)
        {
            var msg = new CreateFractureBlockMsg();

            msg.FracturedBlock = fracturedBlock;
            msg.Grid           = grid;
            msg.Position       = position;
            MySession.Static.SyncLayer.SendMessageToAll(ref msg);
        }
コード例 #2
0
        static void OnCreateFracturedBlockMessage(ref CreateFractureBlockMsg msg, MyNetworkClient sender)
        {
            MyCubeGrid grid;

            if (MyEntities.TryGetEntityById(msg.Grid, out grid))
            {
                grid.EnableGenerators(false, true);
                grid.CreateFracturedBlock(msg.FracturedBlock, msg.Position);
                grid.EnableGenerators(true, true);
            }
        }
コード例 #3
0
        static void OnCreateFracturedBlockMessage(ref CreateFractureBlockMsg msg, MyNetworkClient sender)
        {
            Debug.Assert(!Sync.IsServer);

            MyCubeGrid grid;
            if (MyEntities.TryGetEntityById(msg.Grid, out grid))
            {
                grid.EnableGenerators(false, true);
                grid.CreateFracturedBlock(msg.FracturedBlock, msg.Position);
                grid.EnableGenerators(true, true);
            }
        }
コード例 #4
0
        public static void CreateFracturedBlock(MyObjectBuilder_FracturedBlock fracturedBlock, long grid, Vector3I position)
        {
            Debug.Assert(Sync.IsServer);

            var msg = new CreateFractureBlockMsg();
            msg.FracturedBlock = fracturedBlock;
            msg.Grid = grid;
            msg.Position = position;
            MySession.Static.SyncLayer.SendMessageToAll(ref msg);
        }