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

C# MyStringId类代码示例

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

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



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

示例1: MyGuiScreenTriggerTime

        public MyGuiScreenTriggerTime(MyTrigger trg, MyStringId labelText)
            : base(trg, new Vector2(WINSIZEX + 0.1f, WINSIZEY))
        {
            float left = m_textboxMessage.Position.X-m_textboxMessage.Size.X/2;
            float top = -WINSIZEY / 2f + MIDDLE_PART_ORIGIN.Y;
            m_labelTime = new MyGuiControlLabel(
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                position: new Vector2(left, top),
                size: new Vector2(0.013f, 0.035f),
                text: MyTexts.Get(labelText).ToString()//text: MyTexts.Get(MySpaceTexts.GuiTriggerTimeLimit).ToString()
            );
            left += m_labelTime.Size.X + spacingH;
            m_textboxTime = new MyGuiControlTextbox()
            {
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                Position = new Vector2(left, top),
                Size = new Vector2(0.05f, 0.035f),
                Type = MyGuiControlTextboxType.DigitsOnly,
                Name = "time"
            };
            m_textboxTime.TextChanged += OnTimeChanged;

            Controls.Add(m_labelTime);
            Controls.Add(m_textboxTime);

        }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:26,代码来源:MyGuiScreenTriggerTime.cs


示例2: Construct

        public override void Construct(MyObjectBuilder_BehaviorTreeNode nodeDefinition, MyBehaviorTree.MyBehaviorTreeDesc treeDesc)
        {
            base.Construct(nodeDefinition, treeDesc);

            var ob = (MyObjectBuilder_BehaviorTreeActionNode)nodeDefinition;
            Debug.Assert(!string.IsNullOrEmpty(ob.ActionName), "Action name was not provided");
            if (!string.IsNullOrEmpty(ob.ActionName))
            {
                m_actionName = MyStringId.GetOrCompute(ob.ActionName);
                treeDesc.ActionIds.Add(m_actionName);
            }

            if (ob.Parameters != null)
            {
                var obParameters = ob.Parameters;
                m_parameters = new object[obParameters.Length];
                for (int i = 0; i < m_parameters.Length; i++)
                {
                    var obParam = obParameters[i];
                    if (obParam is MyObjectBuilder_BehaviorTreeActionNode.MemType)
                    {
                        string value = (string)obParam.GetValue();
                        m_parameters[i] = (Boxed<MyStringId>)MyStringId.GetOrCompute(value);
                    }
                    else
                    {
                        m_parameters[i] = obParam.GetValue();
                    }
                }
            }
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:31,代码来源:MyBehaviorTreeActionNode.cs


示例3: AddId

 private static void AddId(Type type, MyStringId id)
 {
     Debug.Assert(!m_idToType.ContainsKey(id));
     Debug.Assert(!m_typeToId.ContainsKey(type));
     m_idToType[id] = type;
     m_typeToId[type] = id;
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:7,代码来源:MyComponentTypeFactory.cs


示例4: MyGuiScreenProgressAsync

 public MyGuiScreenProgressAsync(MyStringId text, MyStringId? cancelText, Func<IMyAsyncResult> beginAction, Action<IMyAsyncResult, MyGuiScreenProgressAsync> endAction)
     : base(text, cancelText)
 {
     FriendlyName = "MyGuiScreenProgressAsync";
     m_beginAction = beginAction;
     m_endAction = endAction;
 }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:7,代码来源:MyGuiScreenProgressAsync.cs


示例5: MyGuiScreenProgress

 public MyGuiScreenProgress(StringBuilder text, MyStringId? cancelText = null)
     : base(MySpaceTexts.Blank, cancelText)
 {
     // Copy
     Text = new StringBuilder(text.Length);
     Text.AppendStringBuilder(text);
 }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:7,代码来源:MyGuiScreenProgress.cs


示例6: AddAction

        public void AddAction(MyStringId actionId, MethodInfo methodInfo, bool returnsRunning, Func<IMyBot, object[], MyBehaviorTreeState> action)
        {
            if (!m_actions.ContainsKey(actionId))
                AddBotActionDesc(actionId);

            Debug.Assert(m_actions[actionId].Action == null, "Adding a bot action under the same name!");

            var actionDesc = m_actions[actionId];
            var parameters = methodInfo.GetParameters();
            actionDesc.Action = action;
            actionDesc.ActionParams = new object[parameters.Length];
            actionDesc.ParametersDesc = new Dictionary<int, MyTuple<Type, MyMemoryParameterType>>();
            actionDesc.ReturnsRunning = returnsRunning;
            for (int i = 0; i < parameters.Length; i++)
            {
                var paramAttrs = Attribute.GetCustomAttributes(parameters[i], true);
                foreach (var paramAttr in paramAttrs)
                {
                    if (paramAttr is BTMemParamAttribute)
                    {
                        var memParam = paramAttr as BTMemParamAttribute;
                        actionDesc.ParametersDesc.Add(i, new MyTuple<Type, MyMemoryParameterType>(parameters[i].ParameterType.GetElementType(), memParam.MemoryType));
                    }
                }
            }
        }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:26,代码来源:ActionCollection.cs


示例7: AddItemDefinition

        public void AddItemDefinition(MyStringId definition)
        {
            System.Diagnostics.Debug.Assert(!m_itemDefinitions.Contains(definition));
            if (m_itemDefinitions.Contains(definition)) return;

            m_itemDefinitions.Add(definition);
            m_definitionList.Add(definition);
        }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:8,代码来源:MyEnvironmentItemsDefinition.cs


示例8: GetGameControlHelper

 public static MyGuiDescriptor GetGameControlHelper(MyStringId controlHelper)
 {
     MyGuiDescriptor ret;
     if (m_gameControlHelpers.TryGetValue(controlHelper, out ret))
         return ret;
     else
         return null;
 }
开发者ID:austusross,项目名称:SpaceEngineers,代码行数:8,代码来源:MyGuiGameControlsHelpers.cs


示例9: MyGuiScreenDialogText

 public MyGuiScreenDialogText(string initialValue = null, MyStringId? caption = null)
 {
     m_value = initialValue ?? string.Empty;
     CanHideOthers = false;
     EnabledBackgroundFade = true;
     m_caption = caption ?? MySpaceTexts.DialogAmount_SetValueCaption;
     RecreateControls(true);
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:8,代码来源:MyGuiScreenDialogText.cs


示例10: LocalizationFileInfo

 public LocalizationFileInfo(string language, string path, ulong id, bool isDefault, MyStringId bundle)
 {
     Language = language;
     Path = path;
     Bundle = bundle;
     Id = id;
     IsDefault = isDefault;
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:8,代码来源:MyLocalizationContext.cs


示例11: AddInitAction

        public void AddInitAction(MyStringId actionName, Action<IMyBot> action)
        {
            if (!m_actions.ContainsKey(actionName))
                AddBotActionDesc(actionName);

            Debug.Assert(m_actions[actionName].InitAction == null, "Adding a bot init action under the same name!");

            m_actions[actionName].InitAction = action;
        }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:9,代码来源:ActionCollection.cs


示例12: AddPostAction

        public void AddPostAction(MyStringId actionId, Action<IMyBot> action)
        {
            if (!m_actions.ContainsKey(actionId))
                AddBotActionDesc(actionId);

            Debug.Assert(m_actions[actionId].PostAction == null, "Adding a bot post action under the same name!");

            m_actions[actionId].PostAction = action;
        }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:9,代码来源:ActionCollection.cs


示例13: MyControllableEntityControlHelper

 public MyControllableEntityControlHelper(
     MyStringId controlId,
     Action<IMyControllableEntity> action,
     Func<IMyControllableEntity, bool> valueGetter,
     MyStringId label,
     MySupportKeysEnum supportKeys = MySupportKeysEnum.NONE)
     : this(controlId, action, valueGetter, label, MySpaceTexts.ControlMenuItemValue_On, MySpaceTexts.ControlMenuItemValue_Off, supportKeys)
 {
 }
开发者ID:austusross,项目名称:SpaceEngineers,代码行数:9,代码来源:MySpaceControlHelpers.cs


示例14: ControlWithDescription

 public ControlWithDescription(MyStringId control)
 {
     MyControl c = MyInput.Static.GetGameControl(control);
     BoundButtons = null;
     c.AppendBoundButtonNames(ref BoundButtons, unassignedText: MyInput.Static.GetUnassignedName());
     Description = MyTexts.Get(c.GetControlDescription() ?? c.GetControlName());
     LeftFont = MyFontEnum.Red;
     RightFont = MyFontEnum.White;
 }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:9,代码来源:MyGuiScreenHelpSpace.cs


示例15: PlayMusic

        public void PlayMusic(MyStringId transition,MyStringId category, bool loop)
        {
            var msg = new PlayMusicMsg();
            msg.Transition = transition;
            msg.Category = category;
            msg.Loop = loop;

            MySession.Static.SyncLayer.SendMessageToAll(ref msg);
        }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:9,代码来源:MySyncGlobal.cs


示例16: GetItemDefinition

        public MyEnvironmentItemDefinition GetItemDefinition(MyStringId subtypeId)
        {
            MyEnvironmentItemDefinition retval = null;

            MyDefinitionId defId = new MyDefinitionId(m_itemDefinitionType, subtypeId);
            MyDefinitionManager.Static.TryGetDefinition(defId, out retval);
            Debug.Assert(retval != null, "Could not find environment item with definition id " + defId);

            return retval;
        }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:10,代码来源:MyEnvironmentItemsDefinition.cs


示例17: MyGeneratedBlockLocation

 public MyGeneratedBlockLocation(MySlimBlock refBlock, MyCubeBlockDefinition blockDefinition, Vector3I position, MyBlockOrientation orientation, ushort? blockIdInCompound = null, MyGridInfo gridInfo = null)
 {
     RefBlock = refBlock;
     BlockDefinition = blockDefinition;
     Position = position;
     Orientation = orientation;
     BlockIdInCompound = blockIdInCompound;
     GridInfo = gridInfo;
     GeneratedBlockType = MyStringId.NullOrEmpty;
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:10,代码来源:MyAdditionalModelGeneratorBase.cs


示例18: PlaySound

 private void PlaySound(MyStringId soundId)
 {
     if (m_sound != null && m_sound.IsPlaying)
     {
         var effect = MyAudio.Static.ApplyEffect(m_sound, MyStringId.GetOrCompute("CrossFade"), new MyStringId[] { soundId }, 2000);
         m_sound = effect.OutputSound;
     }
     else
         m_sound = MyAudio.Static.PlaySound(soundId, null, MySoundDimensions.D2);
 }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:10,代码来源:MyCharacterBreath.cs


示例19: CanStack

 public virtual bool CanStack(MyObjectBuilderType typeId, MyStringId subtypeId, MyItemFlags flags)
 {
     if (flags == Flags &&
         typeId == TypeId &&
         subtypeId == SubtypeId)
     {
         return true;
     }
     return false;
 }
开发者ID:leandro1129,项目名称:SpaceEngineers,代码行数:10,代码来源:MyObjectBuilder_PhysicalObject.cs


示例20: MyHudMissingComponentNotification

 public MyHudMissingComponentNotification(MyStringId text,
     int disapearTimeMs           = 2500,
     MyFontEnum font              = MyFontEnum.White,
     MyGuiDrawAlignEnum textAlign = MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER,
     int priority                 = 0,
     MyNotificationLevel level    = MyNotificationLevel.Normal)
     : base(disapearTimeMs, font, textAlign, priority, level)
 {
     m_originalText = text;
 }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:10,代码来源:MyHudNotification.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# MyStruct类代码示例发布时间:2022-05-24
下一篇:
C# MyStringHash类代码示例发布时间: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