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


C# MyTerminalControlOnOffSwitch.EnableToggleAction方法代码示例

本文整理汇总了C#中MyTerminalControlOnOffSwitch.EnableToggleAction方法的典型用法代码示例。如果您正苦于以下问题:C# MyTerminalControlOnOffSwitch.EnableToggleAction方法的具体用法?C# MyTerminalControlOnOffSwitch.EnableToggleAction怎么用?C# MyTerminalControlOnOffSwitch.EnableToggleAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MyTerminalControlOnOffSwitch的用法示例。


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

示例1: MyCollector

 static MyCollector()
 {
     var useConvSystem = new MyTerminalControlOnOffSwitch<MyCollector>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
     useConvSystem.Getter = (x) => (x as IMyInventoryOwner).UseConveyorSystem;
     useConvSystem.Setter = (x, v) => MySyncConveyors.SendChangeUseConveyorSystemRequest(x.EntityId, v);
     useConvSystem.EnableToggleAction();
     MyTerminalControlFactory.AddControl(useConvSystem);
 }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:8,代码来源:MyCollector.cs

示例2: MyReactor

 static MyReactor()
 {
     var useConveyorSystem = new MyTerminalControlOnOffSwitch<MyReactor>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
     useConveyorSystem.Getter = (x) => (x).UseConveyorSystem;
     useConveyorSystem.Setter = (x, v) => (x).UseConveyorSystem = v;
     useConveyorSystem.EnableToggleAction();
     MyTerminalControlFactory.AddControl(useConveyorSystem);
 }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:8,代码来源:MyReactor.cs

示例3: MySmallMissileLauncher

 static MySmallMissileLauncher()
 {
     var useConveyor = new MyTerminalControlOnOffSwitch<MySmallMissileLauncher>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
     useConveyor.Getter = (x) => x.m_useConveyorSystem;
     useConveyor.Setter = (x, v) => MySyncConveyors.SendChangeUseConveyorSystemRequest(x.EntityId, v);
     useConveyor.Visible = (x) => x.CubeGrid.GridSizeEnum == MyCubeSize.Large; // Only large missile launchers can use conveyor system
     useConveyor.EnableToggleAction();
     MyTerminalControlFactory.AddControl(useConveyor);
 }
开发者ID:notten,项目名称:SpaceEngineers,代码行数:9,代码来源:MySmallMissileLauncher.cs

示例4: MySmallMissileLauncherReload

 static MySmallMissileLauncherReload()
 {
     var useConveyor = new MyTerminalControlOnOffSwitch<MySmallMissileLauncher>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
     useConveyor.Getter = (x) => x.UseConveyorSystem;
     useConveyor.Setter = (x, v) => MySyncConveyors.SendChangeUseConveyorSystemRequest(x.EntityId, v);
     useConveyor.Visible = (x) => (true);
     useConveyor.EnableToggleAction();
     MyTerminalControlFactory.AddControl(useConveyor);
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:9,代码来源:MySmallMissileLauncherReload.cs

示例5: MyAirtightDoorGeneric

 static MyAirtightDoorGeneric()
 {
     var open = new MyTerminalControlOnOffSwitch<MyAirtightDoorGeneric>("Open", MySpaceTexts.Blank, on: MySpaceTexts.BlockAction_DoorOpen, off: MySpaceTexts.BlockAction_DoorClosed);
     open.Getter = (x) => x.Open;
     open.Setter = (x, v) => x.m_open.Value = v;
     open.EnableToggleAction();
     open.EnableOnOffActions();
     MyTerminalControlFactory.AddControl(open);
 }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:9,代码来源:MyAirtightDoorGeneric.cs

示例6: CreateTerminalControls

        static void CreateTerminalControls()
        {
            if (MyTerminalControlFactory.AreControlsCreated<MyReactor>())
                return;

            var useConveyorSystem = new MyTerminalControlOnOffSwitch<MyReactor>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
            useConveyorSystem.Getter = (x) => (x).UseConveyorSystem;
            useConveyorSystem.Setter = (x, v) => (x).UseConveyorSystem = v;
            useConveyorSystem.EnableToggleAction();
            MyTerminalControlFactory.AddControl(useConveyorSystem);
        }
开发者ID:rem02,项目名称:SpaceEngineers,代码行数:11,代码来源:MyReactor.cs

示例7: MyFunctionalBlock

        static MyFunctionalBlock()
        {
            var onOffSwitch = new MyTerminalControlOnOffSwitch<MyFunctionalBlock>("OnOff", MySpaceTexts.BlockAction_Toggle);
            onOffSwitch.Getter = (x) => x.Enabled;
            onOffSwitch.Setter = (x, v) => x.RequestEnable(v);
            onOffSwitch.EnableToggleAction();
            onOffSwitch.EnableOnOffActions();
            MyTerminalControlFactory.AddControl(0, onOffSwitch);

            MyTerminalControlFactory.AddControl(1, new MyTerminalControlSeparator<MyTerminalBlock>());
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:11,代码来源:MyFunctionalBlock.cs

示例8: CreateTerminalControls

        static void CreateTerminalControls()
        {
            if (MyTerminalControlFactory.AreControlsCreated<MySmallMissileLauncher>())
                return;

            var useConveyor = new MyTerminalControlOnOffSwitch<MySmallMissileLauncher>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
            useConveyor.Getter = (x) => x.UseConveyorSystem;
            useConveyor.Setter = (x, v) => x.UseConveyorSystem = v;
            useConveyor.Visible = (x) => (true);
            useConveyor.EnableToggleAction();
            MyTerminalControlFactory.AddControl(useConveyor);
        }
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:12,代码来源:MySmallMissileLauncherReload.cs

示例9: CreateTerminalControls

 protected override void CreateTerminalControls()
 {
     if (MyTerminalControlFactory.AreControlsCreated<MyDoorBase>())
         return;
     base.CreateTerminalControls();
     var open = new MyTerminalControlOnOffSwitch<MyDoorBase>("Open", MySpaceTexts.Blank, on: MySpaceTexts.BlockAction_DoorOpen, off: MySpaceTexts.BlockAction_DoorClosed);
     open.Getter = (x) => x.Open;
     open.Setter = (x, v) => x.SetOpenRequest(v, x.OwnerId);
     open.EnableToggleAction();
     open.EnableOnOffActions();
     MyTerminalControlFactory.AddControl(open);
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:12,代码来源:MyDoorBase.cs

示例10: CreateTerminalControls

 protected override void CreateTerminalControls()
 {
     if (MyTerminalControlFactory.AreControlsCreated<MyLargeConveyorTurretBase>())
         return;
     base.CreateTerminalControls();
     var separator = new MyTerminalControlSeparator<MyLargeConveyorTurretBase>();
     MyTerminalControlFactory.AddControl(separator);
     var useConvSystem = new MyTerminalControlOnOffSwitch<MyLargeConveyorTurretBase>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
     useConvSystem.Getter = (x) => (x).UseConveyorSystem;
     useConvSystem.Setter = (x, v) => x.UseConveyorSystem = v;
     useConvSystem.EnableToggleAction();
     MyTerminalControlFactory.AddControl(useConvSystem);
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:13,代码来源:MyLargeConveyorTurretBase.cs

示例11: CreateTerminalControls

        static void CreateTerminalControls()
        {
            if (MyTerminalControlFactory.AreControlsCreated<MyFunctionalBlock>())
                return;

            var onOffSwitch = new MyTerminalControlOnOffSwitch<MyFunctionalBlock>("OnOff", MySpaceTexts.BlockAction_Toggle);
            onOffSwitch.Getter = (x) => x.Enabled;
            onOffSwitch.Setter = (x, v) => x.Enabled = v;
            onOffSwitch.EnableToggleAction();
            onOffSwitch.EnableOnOffActions();
            MyTerminalControlFactory.AddControl(0, onOffSwitch);

            MyTerminalControlFactory.AddControl(1, new MyTerminalControlSeparator<MyFunctionalBlock>());
        }
开发者ID:rem02,项目名称:SpaceEngineers,代码行数:14,代码来源:MyFunctionalBlock.cs

示例12: MyUserControllableGun

        static MyUserControllableGun()
        {
            if (MyFakes.ENABLE_WEAPON_TERMINAL_CONTROL)
            {
                var shootOnce = new MyTerminalControlButton<MyUserControllableGun>("ShootOnce", MySpaceTexts.Terminal_ShootOnce, MySpaceTexts.Blank, (b) => b.OnShootOncePressed());
                shootOnce.EnableAction();
                MyTerminalControlFactory.AddControl(shootOnce);

                var shoot = new MyTerminalControlOnOffSwitch<MyUserControllableGun>("Shoot", MySpaceTexts.Terminal_Shoot);
                shoot.Getter = (x) => x.m_isShooting;
                shoot.Setter = (x, v) => x.OnShootPressed(v);
                shoot.EnableToggleAction();
                shoot.EnableOnOffActions();
                MyTerminalControlFactory.AddControl(shoot);
                MyTerminalControlFactory.AddControl(new MyTerminalControlSeparator<MyUserControllableGun>());
            }
        }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:17,代码来源:MyUserControllableGun.cs

示例13: MyOxygenGenerator

        static MyOxygenGenerator()
        {
            var useConveyorSystem = new MyTerminalControlOnOffSwitch<MyOxygenGenerator>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
            useConveyorSystem.Getter = (x) => (x as IMyInventoryOwner).UseConveyorSystem;
            useConveyorSystem.Setter = (x, v) => MySyncConveyors.SendChangeUseConveyorSystemRequest(x.EntityId, v);
            useConveyorSystem.EnableToggleAction();
            MyTerminalControlFactory.AddControl(useConveyorSystem);

            var refillButton = new MyTerminalControlButton<MyOxygenGenerator>("Refill", MySpaceTexts.BlockPropertyTitle_Refill, MySpaceTexts.BlockPropertyTitle_Refill, OnRefillButtonPressed);
            refillButton.Enabled = (x) => x.CanRefill();
            refillButton.EnableAction();
            MyTerminalControlFactory.AddControl(refillButton);

            var autoRefill = new MyTerminalControlCheckbox<MyOxygenGenerator>("Auto-Refill", MySpaceTexts.BlockPropertyTitle_AutoRefill, MySpaceTexts.BlockPropertyTitle_AutoRefill);
            autoRefill.Getter = (x) => x.m_autoRefill;
            autoRefill.Setter = (x, v) => x.m_autoRefill = v;
            autoRefill.EnableAction();
            MyTerminalControlFactory.AddControl(autoRefill);
        }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:19,代码来源:MyOxygenGenerator.cs

示例14: MyGasGenerator

        static MyGasGenerator()
        {
            var useConveyorSystem = new MyTerminalControlOnOffSwitch<MyGasGenerator>("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem);
            useConveyorSystem.Getter = (x) => x.UseConveyorSystem;
            useConveyorSystem.Setter = (x, v) => x.UseConveyorSystem = v ;
            useConveyorSystem.EnableToggleAction();
            MyTerminalControlFactory.AddControl(useConveyorSystem);

            var refillButton = new MyTerminalControlButton<MyGasGenerator>("Refill", MySpaceTexts.BlockPropertyTitle_Refill, MySpaceTexts.BlockPropertyTitle_Refill, OnRefillButtonPressed);
            refillButton.Enabled = (x) => x.CanRefill();
            refillButton.EnableAction();
            MyTerminalControlFactory.AddControl(refillButton);

            var autoRefill = new MyTerminalControlCheckbox<MyGasGenerator>("Auto-Refill", MySpaceTexts.BlockPropertyTitle_AutoRefill, MySpaceTexts.BlockPropertyTitle_AutoRefill);
            autoRefill.Getter = (x) => x.AutoRefill;
            autoRefill.Setter = (x, v) => x.ChangeAutoRefill(v);
            autoRefill.EnableAction();
            MyTerminalControlFactory.AddControl(autoRefill);
        }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:19,代码来源:MyGasGenerator.cs

示例15: MyOxygenTank

        static MyOxygenTank()
        {
            var isStockpiling = new MyTerminalControlOnOffSwitch<MyOxygenTank>("Stockpile", MySpaceTexts.BlockPropertyTitle_Stockpile, MySpaceTexts.BlockPropertyDescription_Stockpile);
            isStockpiling.Getter = (x) => x.IsStockpiling;
            isStockpiling.Setter = (x, v) => x.SyncObject.ChangeStockpileMode(v);
            isStockpiling.EnableToggleAction();
            isStockpiling.EnableOnOffActions();
            MyTerminalControlFactory.AddControl(isStockpiling);

            var refillButton = new MyTerminalControlButton<MyOxygenTank>("Refill", MySpaceTexts.BlockPropertyTitle_Refill, MySpaceTexts.BlockPropertyTitle_Refill, OnRefillButtonPressed);
            refillButton.Enabled = (x) => x.CanRefill();
            refillButton.EnableAction();
            MyTerminalControlFactory.AddControl(refillButton);

            var autoRefill = new MyTerminalControlCheckbox<MyOxygenTank>("Auto-Refill", MySpaceTexts.BlockPropertyTitle_AutoRefill, MySpaceTexts.BlockPropertyTitle_AutoRefill);
            autoRefill.Getter = (x) => x.m_autoRefill;
            autoRefill.Setter = (x, v) => x.SyncObject.ChangeAutoRefill(v);
            autoRefill.EnableAction();
            MyTerminalControlFactory.AddControl(autoRefill);
        }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:20,代码来源:MyOxygenTank.cs


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