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


C# MyStringId类代码示例

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


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


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