当前位置: 首页>>代码示例>>C#>>正文


C# MyCubeGrid类代码示例

本文整理汇总了C#中MyCubeGrid的典型用法代码示例。如果您正苦于以下问题:C# MyCubeGrid类的具体用法?C# MyCubeGrid怎么用?C# MyCubeGrid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MyCubeGrid类属于命名空间,在下文中一共展示了MyCubeGrid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MyGridShape

        public MyGridShape(MyCubeGrid grid)
        {
            m_grid = grid;
            if (MyPerGameSettings.Destruction)
                return;
            if (MyPerGameSettings.UseGridSegmenter)
                m_segmenter = new MyVoxelSegmentation();
            if (!grid.IsStatic)
            {
                m_massElements = new Dictionary<Vector3I, HkMassElement>();
            }

            try
            {
                m_blockCollector.Collect(grid, m_segmenter, MyVoxelSegmentationType.Simple, m_massElements);
                m_root = new HkGridShape(m_grid.GridSize, HkReferencePolicy.None);

                AddShapesFromCollector();

                if (!m_grid.IsStatic)
                {
                    UpdateMassProperties();
                }
            }
            finally
            {
                m_blockCollector.Clear();
            }
        }
开发者ID:avivbeeri,项目名称:SpaceEngineers,代码行数:29,代码来源:MyGridShape.cs

示例2: Init

        public override void Init(MyObjectBuilder_CubeBlock objectBuilder, MyCubeGrid cubeGrid)
        {
            base.Init(objectBuilder, cubeGrid);
            var def = BlockDefinition as MyPoweredCargoContainerDefinition;
            var ob = objectBuilder as MyObjectBuilder_Collector;
            m_inventory = new MyInventory(def.InventorySize.Volume, def.InventorySize, MyInventoryFlags.CanSend, this);
            m_inventory.Init(ob.Inventory);
            m_inventory.ContentsChanged += Inventory_ContentChangedCallback;
            if (Sync.IsServer && CubeGrid.CreatePhysics)
                LoadDummies();

			var sinkComp = new MyResourceSinkComponent();
            sinkComp.Init(
                MyStringHash.GetOrCompute(def.ResourceSinkGroup),
                MyEnergyConstants.MAX_REQUIRED_POWER_COLLECTOR,
                () => base.CheckIsWorking() ? ResourceSink.MaxRequiredInput : 0f);
	        ResourceSink = sinkComp;
			ResourceSink.Update();
			ResourceSink.IsPoweredChanged += Receiver_IsPoweredChanged;
            AddDebugRenderComponent(new Components.MyDebugRenderComponentDrawPowerReciever(ResourceSink,this));

            SlimBlock.ComponentStack.IsFunctionalChanged += UpdateReceiver;
            base.EnabledChanged += UpdateReceiver;

            m_useConveyorSystem = ob.UseConveyorSystem;
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:26,代码来源:MyCollector.cs

示例3: MyCubeGridSystems

        public MyCubeGridSystems(MyCubeGrid grid)
        {
            m_cubeGrid = grid;

            m_terminalSystem_GroupAdded = TerminalSystem_GroupAdded;
            m_terminalSystem_GroupRemoved = TerminalSystem_GroupRemoved;

            ThrustSystem = new MyGridThrustSystem(m_cubeGrid);
            GyroSystem = new MyGridGyroSystem(m_cubeGrid);
            WeaponSystem = new MyGridWeaponSystem();
            ReflectorLightSystem = new MyGridReflectorLightSystem(m_cubeGrid);
            if (MyFakes.ENABLE_WHEEL_CONTROLS_IN_COCKPIT)
            {
                WheelSystem = new MyGridWheelSystem(m_cubeGrid);
            }
            ConveyorSystem = new MyGridConveyorSystem(m_cubeGrid);
            LandingSystem = new MyGridLandingSystem();
            ControlSystem = new MyGroupControlSystem();
            CameraSystem = new MyGridCameraSystem(m_cubeGrid);

            if (MySession.Static.Settings.EnableOxygen)
            {
                OxygenSystem = new MyGridOxygenSystem(m_cubeGrid);
            }
            JumpSystem = new MyGridJumpDriveSystem(m_cubeGrid);

            m_cubeGrid.SyncObject.PowerProducerStateChanged += SyncObject_PowerProducerStateChanged;

            m_blocksRegistered = true;
        }
开发者ID:avivbeeri,项目名称:SpaceEngineers,代码行数:30,代码来源:MyCubeGridSystems.cs

示例4: Init

        public override void Init(MyObjectBuilder_CubeBlock objectBuilder, MyCubeGrid cubeGrid)
        {
            m_cameraDummy = Matrix.Identity;
            m_characterDummy = Matrix.Identity;

            base.Init(objectBuilder, cubeGrid);

            var chamberOb = objectBuilder as MyObjectBuilder_CryoChamber;

            if (chamberOb.SteamId != null && chamberOb.SerialId != null)
            {
                m_currentPlayerId = new MyPlayer.PlayerId(chamberOb.SteamId.Value, chamberOb.SerialId.Value);
            }
            else
            {
                m_currentPlayerId = null;
            }

            var overlayTexture = BlockDefinition.OverlayTexture;
            if (!string.IsNullOrEmpty(overlayTexture))
            {
                m_overlayTextureName = overlayTexture;
            }

            var sinkComp = new MyResourceSinkComponent();
			sinkComp.Init(
                MyStringHash.GetOrCompute(BlockDefinition.ResourceSinkGroup),
                BlockDefinition.IdlePowerConsumption,
                this.CalculateRequiredPowerInput);
            sinkComp.IsPoweredChanged += Receiver_IsPoweredChanged;
	        ResourceSink = sinkComp;

            NeedsUpdate |= MyEntityUpdateEnum.BEFORE_NEXT_FRAME;
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:34,代码来源:MyCryoChamber.cs

示例5: Init

        public override void Init(MyObjectBuilder_CubeBlock objectBuilder, MyCubeGrid cubeGrid)
        {
            m_cameraDummy = Matrix.Identity;
            m_characterDummy = Matrix.Identity;

            base.Init(objectBuilder, cubeGrid);

            var chamberOb = objectBuilder as MyObjectBuilder_CryoChamber;

            if (chamberOb.SteamId != null && chamberOb.SerialId != null)
            {
                m_currentPlayerId = new MyPlayer.PlayerId(chamberOb.SteamId.Value, chamberOb.SerialId.Value);
            }
            else
            {
                m_currentPlayerId = null;
            }

            var overlayTexture = BlockDefinition.OverlayTexture;
            if (!string.IsNullOrEmpty(overlayTexture))
            {
                m_overlayTextureName = overlayTexture;
            }

            PowerReceiver = new MyPowerReceiver(
                MyConsumerGroupEnum.Utility,
                false,
                BlockDefinition.IdlePowerConsumption,
                this.CalculateRequiredPowerInput);
            PowerReceiver.IsPoweredChanged += Receiver_IsPoweredChanged;

            NeedsUpdate |= Common.MyEntityUpdateEnum.BEFORE_NEXT_FRAME;
        }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:33,代码来源:MyCryoChamber.cs

示例6: Init

        public override void Init(MyObjectBuilder_CubeBlock objectBuilder, MyCubeGrid cubeGrid)
        {
            base.Init(objectBuilder, cubeGrid);

            MyDebug.AssertDebug(BlockDefinition is MyRefineryDefinition);
            m_refineryDef = BlockDefinition as MyRefineryDefinition;

            InputInventory.Constraint = m_refineryDef.InputInventoryConstraint;
            bool removed = InputInventory.FilterItemsUsingConstraint();
            Debug.Assert(!removed, "Inventory filter removed items which were present in the object builder.");
            InputInventory.ContentsChanged += inventory_OnContentsChanged;

            OutputInventory.Constraint = m_refineryDef.OutputInventoryConstraint;
            removed = OutputInventory.FilterItemsUsingConstraint();
            Debug.Assert(!removed, "Inventory filter removed items which were present in the object builder.");
            OutputInventory.ContentsChanged += inventory_OnContentsChanged;

            m_queueNeedsRebuild = true;

            UpgradeValues.Add("Productivity", 0f);
            UpgradeValues.Add("Effectiveness", 1f);
            UpgradeValues.Add("PowerEfficiency", 1f);

            PowerReceiver.RequiredInputChanged += PowerReceiver_RequiredInputChanged;
            OnUpgradeValuesChanged += UpdateDetailedInfo;

            UpdateDetailedInfo();
        }
开发者ID:caomw,项目名称:SpaceEngineers,代码行数:28,代码来源:MyRefinery.cs

示例7: MyCubeGridSystems

        public MyCubeGridSystems(MyCubeGrid grid)
        {
            m_cubeGrid = grid;

            m_terminalSystem_GroupAdded = TerminalSystem_GroupAdded;
            m_terminalSystem_GroupRemoved = TerminalSystem_GroupRemoved;

            GyroSystem = new MyGridGyroSystem(m_cubeGrid);
            WeaponSystem = new MyGridWeaponSystem();
            ReflectorLightSystem = new MyGridReflectorLightSystem(m_cubeGrid);
            if (MyFakes.ENABLE_WHEEL_CONTROLS_IN_COCKPIT)
            {
                WheelSystem = new MyGridWheelSystem(m_cubeGrid);
            }
            ConveyorSystem = new MyGridConveyorSystem(m_cubeGrid);
            LandingSystem = new MyGridLandingSystem();
            ControlSystem = new MyGroupControlSystem();
            CameraSystem = new MyGridCameraSystem(m_cubeGrid);

            if (MySession.Static.Settings.EnableOxygen)
            {
                GasSystem = new MyGridGasSystem(m_cubeGrid);
            }
            if (MyPerGameSettings.EnableJumpDrive)
            {
                JumpSystem = new MyGridJumpDriveSystem(m_cubeGrid);
            }
            if (MyPerGameSettings.EnableShipSoundSystem && (MyFakes.ENABLE_NEW_SMALL_SHIP_SOUNDS || MyFakes.ENABLE_NEW_LARGE_SHIP_SOUNDS) && MySandboxGame.IsDedicated == false)
            {
                ShipSoundComponent = new MyShipSoundComponent();
            }

            m_blocksRegistered = true;
        }
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:34,代码来源:MyCubeGridSystems.cs

示例8: MyCubeGridSystems

        public MyCubeGridSystems(MyCubeGrid grid)
        {
            m_cubeGrid = grid;

            m_terminalSystem_GroupAdded = TerminalSystem_GroupAdded;
            m_terminalSystem_GroupRemoved = TerminalSystem_GroupRemoved;

            GyroSystem = new MyGridGyroSystem(m_cubeGrid);
            WeaponSystem = new MyGridWeaponSystem();
            ReflectorLightSystem = new MyGridReflectorLightSystem(m_cubeGrid);
            if (MyFakes.ENABLE_WHEEL_CONTROLS_IN_COCKPIT)
            {
                WheelSystem = new MyGridWheelSystem(m_cubeGrid);
            }
            ConveyorSystem = new MyGridConveyorSystem(m_cubeGrid);
            LandingSystem = new MyGridLandingSystem();
            ControlSystem = new MyGroupControlSystem();
            CameraSystem = new MyGridCameraSystem(m_cubeGrid);

            if (MySession.Static.Settings.EnableOxygen)
            {
                GasSystem = new MyGridGasSystem(m_cubeGrid);
            }
            if (MyPerGameSettings.EnableJumpDrive)
            {
                JumpSystem = new MyGridJumpDriveSystem(m_cubeGrid);
            }

            m_blocksRegistered = true;
        }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:30,代码来源:MyCubeGridSystems.cs

示例9: CubeGrid_OnGridSplit

 protected void CubeGrid_OnGridSplit(MyCubeGrid grid1, MyCubeGrid grid2)
 {
     if (m_statorBlock != null)
     {
         m_statorBlock.OnGridSplit();
     }
 }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:7,代码来源:MyMotorRotor.cs

示例10: Init

        public override void Init(MyObjectBuilder_CubeBlock builder, MyCubeGrid cubeGrid)
        {
            base.Init(builder, cubeGrid);

            var ob = builder as MyObjectBuilder_PistonTop;
            m_pistonBlockId = ob.PistonBlockId;
            NeedsUpdate |= MyEntityUpdateEnum.BEFORE_NEXT_FRAME;
        }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:8,代码来源:MyPistonTop.cs

示例11: Init

        public override void Init(MyObjectBuilder_CubeBlock builder, MyCubeGrid cubeGrid)
        {
            var rotorOb = builder as MyObjectBuilder_MotorRotor;

            base.Init(builder, cubeGrid);

            LoadDummies();
        }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:8,代码来源:MyMotorRotor.cs

示例12: Init

        public override void Init(MyObjectBuilder_CubeBlock objectBuilder, MyCubeGrid cubeGrid)
        {
            base.Init(objectBuilder, cubeGrid);

            var ob = (MyObjectBuilder_FunctionalBlock)objectBuilder;

            m_enabled = ob.Enabled;
            IsWorkingChanged += CubeBlock_IsWorkingChanged;
        }
开发者ID:austusross,项目名称:SpaceEngineers,代码行数:9,代码来源:MyFunctionalBlock.cs

示例13: MyGridContactInfo

 public MyGridContactInfo(ref HkContactPointEvent evnt, MyCubeGrid grid)
 {
     Event = evnt;
     ContactPosition = grid.Physics.ClusterToWorld(evnt.ContactPoint.Position); 
     m_currentEntity = grid;
     m_collidingEntity = Event.GetOtherEntity(grid) as MyEntity;
     m_currentBlock = null;
     m_otherBlock = null;
     ImpulseMultiplier = 1;
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:10,代码来源:MyGridContactInfo.cs

示例14: Init

        public override void Init(MyObjectBuilder_CubeBlock objectBuilder, MyCubeGrid cubeGrid)
        {
            base.Init(objectBuilder, cubeGrid);

            var ob = (MyObjectBuilder_FunctionalBlock)objectBuilder;

            m_enabled = ob.Enabled;
            IsWorkingChanged += CubeBlock_IsWorkingChanged;
            m_baseIdleSound = BlockDefinition.PrimarySound;
            m_actionSound = BlockDefinition.ActionSound;
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:11,代码来源:MyFunctionalBlock.cs

示例15: Init

        public override void Init(MyObjectBuilder_CubeBlock objectBuilder, MyCubeGrid cubeGrid)
        {
            base.Init(objectBuilder, cubeGrid);

            var ob = (MyObjectBuilder_FunctionalBlock)objectBuilder;
            m_soundEmitter = new MyEntity3DSoundEmitter(this, true);

            m_enabled.Value = ob.Enabled;
            IsWorkingChanged += CubeBlock_IsWorkingChanged;
            m_baseIdleSound = BlockDefinition.PrimarySound;
            m_actionSound = BlockDefinition.ActionSound;
        }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:12,代码来源:MyFunctionalBlock.cs


注:本文中的MyCubeGrid类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。