• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UseActionEnum类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Use

        public override void Use(UseActionEnum actionEnum, IMyEntity entity)
        {
            var user = entity as MyCharacter;
            var block = Entity as MyCubeBlock;

            if (block != null)
            {
                var relation = block.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId);
                if (!relation.IsFriendly())
                {
                    if (user.ControllerInfo.IsLocallyHumanControlled())
                    {
                        MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied);
                    }
                    return;
                }
            }

            switch (actionEnum)
            {
                case UseActionEnum.OpenInventory:
                case UseActionEnum.OpenTerminal:
                    MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Entity);
                    break;
                default:
                    //MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Block);
                    break;
            }
        }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:29,代码来源:MyUseObjectInventory.cs


示例2: Use

 public void Use(UseActionEnum actionEnum, Character.MyCharacter user)
 {
     switch(actionEnum)
     {
         case UseActionEnum.Manipulate:
             if (!m_buttonPanel.IsWorking)
                 return;
             if (!m_buttonPanel.AnyoneCanUse && !m_buttonPanel.HasLocalPlayerAccess())
             {
                 MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied);
                 return;
             }
             m_buttonPanel.Toolbar.UpdateItem(m_index);
             m_buttonPanel.Toolbar.ActivateItemAtIndex(m_index);
             m_buttonPanel.PressButton(m_index);
             break;
         case UseActionEnum.OpenTerminal:
             if (!m_buttonPanel.HasLocalPlayerAccess())
                 return;
             MyToolbarComponent.CurrentToolbar = m_buttonPanel.Toolbar;
             MyGuiScreenBase screen = MyGuiScreenCubeBuilder.Static;
             if (screen == null)
                 screen = MyGuiSandbox.CreateScreen(MyPerGameSettings.GUI.ToolbarConfigScreen, 0, m_buttonPanel);
             MyToolbarComponent.AutoUpdate = false;
             screen.Closed += (source) => MyToolbarComponent.AutoUpdate = true;
             MyGuiSandbox.AddScreen(screen);
             break;
         default:
             break;
     }
 }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:31,代码来源:MyUseObjectPanelButton.cs


示例3: switch

        MyActionDescription IMyUseObject.GetActionInfo(UseActionEnum actionEnum)
        {
            switch (actionEnum)
            {
                case UseActionEnum.Manipulate:
                    return new MyActionDescription()
                    {
                        Text = MySpaceTexts.NotificationHintPressToRechargeInMedicalRoom,
                        FormatParams = new object[] { MyInput.Static.GetGameControl(MyControlsSpace.USE) },
                        IsTextControlHint = true,
                        JoystickFormatParams = new object[] { MyControllerHelper.GetCodeForControl(MySpaceBindingCreator.CX_CHARACTER, MyControlsSpace.USE) },
                    };

                case UseActionEnum.OpenTerminal:
                    return new MyActionDescription()
                    {
                        Text = MySpaceTexts.NotificationHintPressToOpenTerminal,
                        FormatParams = new object[] { MyInput.Static.GetGameControl(MyControlsSpace.TERMINAL) },
                        IsTextControlHint = true,
                        JoystickText = MySpaceTexts.NotificationHintJoystickPressToOpenTerminal,
                    };

                default:
                    Debug.Fail("Invalid branch reached.");
                    return new MyActionDescription()
                    {
                        Text = MySpaceTexts.NotificationHintPressToOpenTerminal,
                        FormatParams = new object[] { MyInput.Static.GetGameControl(MyControlsSpace.TERMINAL) },
                        IsTextControlHint = true
                    };
            }
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:32,代码来源:MyUseObjectMedicalRoom.cs


示例4: MyActionDescription

 MyActionDescription IMyUseObject.GetActionInfo(UseActionEnum actionEnum)
 {
     return new MyActionDescription()
     {
         Text = MySpaceTexts.NotificationHintPressToUseWardrobe,
         FormatParams = new object[] { MyInput.Static.GetGameControl(MyControlsSpace.USE) },
         IsTextControlHint = true,
         JoystickFormatParams = new object[] { MyControllerHelper.GetCodeForControl(MySpaceBindingCreator.CX_CHARACTER, MyControlsSpace.USE) },
     };
 }
开发者ID:avivbeeri,项目名称:SpaceEngineers,代码行数:10,代码来源:MyUseObjectWardrobe.cs


示例5: MyActionDescription

 MyActionDescription IMyUseObject.GetActionInfo(UseActionEnum actionEnum)
 {
     return new MyActionDescription()
     {
         Text = MySpaceTexts.NotificationHintPressToEnterCockpit,
         FormatParams = new object[] { MyGuiSandbox.GetKeyName(MyControlsSpace.USE) },
         IsTextControlHint = true,
         JoystickFormatParams = new object[] { MyControllerHelper.GetCodeForControl(MySpaceBindingCreator.CX_CHARACTER, MyControlsSpace.USE) },
     };
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:10,代码来源:MyUseObjectCockpitDoor.cs


示例6: RequestUse

            public void RequestUse(UseActionEnum actionEnum, MyCharacter user)
            {
                var msg = new UseMsg();

                msg.EntityId = m_block.EntityId;
                msg.UsedByEntityId = user.EntityId;
                msg.ActionEnum = actionEnum;

                Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);

            }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:11,代码来源:MyMedicalRoom.cs


示例7: MyActionDescription

 MyActionDescription IMyUseObject.GetActionInfo(UseActionEnum actionEnum)
 {
     return new MyActionDescription()
     {
         Text = MySpaceTexts.NotificationHintPressToOpenControlPanel,
         FormatParams = new object[] { MyInput.Static.GetGameControl(MyControlsSpace.TERMINAL), Block.DefinitionDisplayNameText },
         IsTextControlHint = true,
         JoystickText = MySpaceTexts.NotificationHintJoystickPressToOpenControlPanel,
         JoystickFormatParams = new object[] { Block.DefinitionDisplayNameText },
     };
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:11,代码来源:MyUseObjectTerminal.cs


示例8:

        void IMyUseObject.Use(UseActionEnum actionEnum, MyCharacter user)
        {
            // How to distinct between server sending message?
            // - it's response...always

            // This is request
            // 1) use - server call
            // -- on server: take control of entity
            // -- -- on success, use it, broadcast
            // -- -- on failure, don't use it, report back

            // Something like:
            // -- extension method IControllableEntity.RequestUse(actionEnum, user, handler)
            if(Cockpit is MyCockpit)
                (Cockpit as MyCockpit).RequestUse(actionEnum, user);
        }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:16,代码来源:MyUseObjectCockpitDoor.cs


示例9: switch

        void IMyUseObject.Use(UseActionEnum actionEnum, MyCharacter user)
        {
            var relation = Block.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId);
            if (relation != Common.MyRelationsBetweenPlayerAndBlock.Owner && relation != Common.MyRelationsBetweenPlayerAndBlock.FactionShare)
            {
                if (user.ControllerInfo.IsLocallyHumanControlled())
                {
                    MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied);
                }
                return;
            }

            switch (actionEnum)
            {
                case UseActionEnum.Manipulate:
                    MyGuiSandbox.AddScreen(MyGuiScreenGamePlay.ActiveGameplayScreen = new MyGuiScreenWardrobe(user));
                    break;
            }
        }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:19,代码来源:MyUseObjectWardrobe.cs


示例10: switch

        void IMyUseObject.Use(UseActionEnum actionEnum, IMyEntity entity)
        {
            var user = entity as MyCharacter;
            var relation = Block.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId);
            if (!relation.IsFriendly())
            {
                if (user.ControllerInfo.IsLocallyHumanControlled())
                {
                    MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied);
                }
                return;
            }

            switch (actionEnum)
            {
                case UseActionEnum.Manipulate:
                    MyGuiSandbox.AddScreen(MyGuiScreenGamePlay.ActiveGameplayScreen = new MyGuiScreenWardrobe(user));
                    break;
            }
        }
开发者ID:avivbeeri,项目名称:SpaceEngineers,代码行数:20,代码来源:MyUseObjectWardrobe.cs


示例11: Use

        public override void Use(UseActionEnum actionEnum, IMyEntity entity)
        {
            var user = entity as MyCharacter;
            var block = Entity as MyCubeBlock;

            if (block != null)
            {
                var relation = block.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId);
                if (!relation.IsFriendly())
                {
                    if (user.ControllerInfo.IsLocallyHumanControlled())
                    {
                        MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied);
                    }
                    return;
                }
            }

            //by Gregory: on use action the button pressed should be checked because on use action we will always get only Inventory TODO: refactor somehow
            if (MyInput.Static.IsNewGameControlPressed(MyControlsSpace.TERMINAL))
                MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, user, Entity);
            else
                MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Entity);
            
            /*
            switch (actionEnum)
            {
                case UseActionEnum.OpenInventory:
                    MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Entity);
                    break;
                case UseActionEnum.OpenTerminal:
                    MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Entity);
                    break;
                default:
                    //MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Entity);
                    break;
            }
            */
        }
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:39,代码来源:MyUseObjectInventory.cs


示例12: switch

        void IMyUseObject.Use(UseActionEnum actionEnum, MyCharacter user)
        {
            var relation = Door.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId);
            if (relation != Common.MyRelationsBetweenPlayerAndBlock.Owner && relation != Common.MyRelationsBetweenPlayerAndBlock.FactionShare)
            {
                if (user.ControllerInfo.IsLocallyHumanControlled())
                {
                    MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied);
                }
                return;
            }

            switch (actionEnum)
            {
                case UseActionEnum.Manipulate:
                    Door.SetOpenRequest(!Door.Open, user.ControllerInfo.ControllingIdentityId);
                    break;

                case UseActionEnum.OpenTerminal:
                    MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, user, Door);
                    break;
            }
        }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:23,代码来源:MyUseObjectDoorTerminal.cs


示例13: switch

        void IMyUseObject.Use(UseActionEnum actionEnum, MyCharacter user)
        {
            var relation = Block.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId);
            if (relation != Common.MyRelationsBetweenPlayerAndBlock.Owner && relation != Common.MyRelationsBetweenPlayerAndBlock.FactionShare)
            {
                if (user.ControllerInfo.IsLocallyHumanControlled())
                {
                    MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied);
                }
                return;
            }

            switch (actionEnum)
            {
                case UseActionEnum.OpenTerminal:
                    MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, user, Block);
                    break;
                case UseActionEnum.OpenInventory:
                    if (Block as IMyInventoryOwner != null)
                        MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Block);
                    break;
            }
        }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:23,代码来源:MyUseObjectTerminal.cs


示例14: Use

        public override void Use(UseActionEnum actionEnum, IMyEntity entity)
        {
            var user = entity as MyCharacter;
            var relation = Door.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId);
            if (!relation.IsFriendly())
            {
                if (user.ControllerInfo.IsLocallyHumanControlled())
                {
                    MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied);
                }
                return;
            }

            switch (actionEnum)
            {
                case UseActionEnum.Manipulate:
                    Door.ChangeOpenClose(!Door.Open);
                    break;

                case UseActionEnum.OpenTerminal:
                    MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, user, Door);
                    break;
            }
        }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:24,代码来源:MyUseObjectAirtightDoors.cs


示例15: Use

        public override void Use(UseActionEnum actionEnum, IMyEntity entity)
        {
            var user = entity as MyCharacter;
            var relation = Block.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId);
            if (!relation.IsFriendly())
            {
                if (user.ControllerInfo.IsLocallyHumanControlled())
                {
                    MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied);
                }
                return;
            }

            switch (actionEnum)
            {
                case UseActionEnum.Manipulate:
                    if (Block is MyMedicalRoom)
                    {
                        MyMedicalRoom medRoom = (MyMedicalRoom)Block;
                        if (!medRoom.SuitChangeAllowed)
                        {
                            MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied);
                            break;
                        }

                        if (medRoom.CustomWardrobesEnabled)
                        {
                            MyGuiSandbox.AddScreen(MyGuiScreenGamePlay.ActiveGameplayScreen = new MyGuiScreenWardrobe(user, medRoom.CustomWardrobeNames));
                            break;
                        }
                    }
 
                    MyGuiSandbox.AddScreen(MyGuiScreenGamePlay.ActiveGameplayScreen = new MyGuiScreenWardrobe(user));
                    break;
            }
        }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:36,代码来源:MyUseObjectWardrobe.cs


示例16: switch

        void IMyUseObject.Use(UseActionEnum actionEnum, IMyEntity entity)
        {
            var user = entity as MyCharacter;
            var relation = Block.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId);
            if (!relation.IsFriendly())
            {
                if (user.ControllerInfo.IsLocallyHumanControlled())
                {
                    MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied);
                }
                return;
            }

            switch (actionEnum)
            {
                case UseActionEnum.OpenTerminal:
                    MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, user, Block);
                    break;
                case UseActionEnum.OpenInventory:
                    if (Block as IMyInventoryOwner != null)
                        MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Block);
                    break;
            }
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:24,代码来源:MyUseObjectTerminal.cs


示例17: switch

        void IMyUseObject.Use(UseActionEnum actionEnum, IMyEntity entity)
        {
            var user = entity as MyCharacter;
            var relation = Block.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId);
            if (relation != Sandbox.Common.MyRelationsBetweenPlayerAndBlock.Owner && relation != Sandbox.Common.MyRelationsBetweenPlayerAndBlock.FactionShare)
            {
                if (user.ControllerInfo.IsLocallyHumanControlled())
                {
                    MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied);
                }
                return;
            }

            switch (actionEnum)
            {
                case UseActionEnum.OpenInventory:
                case UseActionEnum.OpenTerminal:
                    MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Block);
                    break;
                default:
                    //MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Block);
                    break;
            }
        }
开发者ID:austusross,项目名称:SpaceEngineers,代码行数:24,代码来源:MyUseObjectInventory.cs


示例18:

 void IMyUseObject.Use(UseActionEnum actionEnum, IMyEntity entity)
 {
     var user = entity as MyCharacter;
     m_medicalRoom.Use(actionEnum, user);
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:5,代码来源:MyUseObjectMedicalRoom.cs


示例19: MyActionDescription

 /// <summary>
 /// Gets action text
 /// Caller calls this method only on supported actions
 /// </summary>
 MyActionDescription IMyUseObject.GetActionInfo(UseActionEnum actionEnum)
 {
     return new MyActionDescription()
     {
         Text = MySpaceTexts.NotificationHintPressToOpenInventory,
         FormatParams = new object[] { MyInput.Static.GetGameControl(MyControlsSpace.INVENTORY), DisplayName },
         IsTextControlHint = true,
         JoystickText = MyCommonTexts.NotificationHintJoystickPressToOpenInventory,
         JoystickFormatParams = new object[] { DisplayName },
     };
 }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:15,代码来源:MyCharacter.cs


示例20:

 /// <summary>
 /// Uses object by specified action
 /// Caller calls this method only on supported actions
 /// </summary>
 void IMyUseObject.Use(UseActionEnum actionEnum, IMyEntity entity)
 {
     var user = entity as MyCharacter;
     if (MyPerGameSettings.TerminalEnabled)
     {
         MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, this);
     }
     if (MyPerGameSettings.GUI.InventoryScreen != null && IsDead)
     {
         var inventory = Components.Get<MyInventoryAggregate>();
         if (inventory != null)
         {
             var screen = user.ShowAggregateInventoryScreen(inventory);
         }
     }
 }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:20,代码来源:MyCharacter.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# User类代码示例发布时间:2022-05-24
下一篇:
C# UsageVector类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap