本文整理汇总了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);
}
示例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();
}
}
}
}
示例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;
}
示例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;
}
示例5: MyGuiScreenProgress
public MyGuiScreenProgress(StringBuilder text, MyStringId? cancelText = null)
: base(MySpaceTexts.Blank, cancelText)
{
// Copy
Text = new StringBuilder(text.Length);
Text.AppendStringBuilder(text);
}
示例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));
}
}
}
}
示例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);
}
示例8: GetGameControlHelper
public static MyGuiDescriptor GetGameControlHelper(MyStringId controlHelper)
{
MyGuiDescriptor ret;
if (m_gameControlHelpers.TryGetValue(controlHelper, out ret))
return ret;
else
return null;
}
示例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);
}
示例10: LocalizationFileInfo
public LocalizationFileInfo(string language, string path, ulong id, bool isDefault, MyStringId bundle)
{
Language = language;
Path = path;
Bundle = bundle;
Id = id;
IsDefault = isDefault;
}
示例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;
}
示例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;
}
示例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)
{
}
示例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;
}
示例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);
}