本文整理汇总了C#中ObjectTypes.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectTypes.ToString方法的具体用法?C# ObjectTypes.ToString怎么用?C# ObjectTypes.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectTypes
的用法示例。
在下文中一共展示了ObjectTypes.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTick
public void OnTick(object sender, EventArgs e)
{
// Load maps from "AutoloadMaps"
if (!_hasLoaded)
{
AutoloadMaps();
_hasLoaded = true;
}
_menuPool.ProcessMenus();
PropStreamer.Tick();
if (PropStreamer.EntityCount > 0 || PropStreamer.RemovedObjects.Count > 0 || PropStreamer.Markers.Count > 0 || PropStreamer.Pickups.Count > 0)
{
_currentEntitiesItem.Enabled = true;
_currentEntitiesItem.Description = "";
}
else
{
_currentEntitiesItem.Enabled = false;
_currentEntitiesItem.Description = Translation.Translate("There are no current entities.");
}
if (Game.IsControlPressed(0, Control.LookBehind) && Game.IsControlJustPressed(0, Control.FrontendLb) && !_menuPool.IsAnyMenuOpen() && _settings.Gamepad)
{
_mainMenu.Visible = !_mainMenu.Visible;
}
if (_settings.AutosaveInterval != -1 && DateTime.Now.Subtract(_lastAutosave).Minutes >= _settings.AutosaveInterval && PropStreamer.EntityCount > 0 && _changesMade > 0 && PropStreamer.EntityCount != _loadedEntities)
{
SaveMap("Autosave.xml", MapSerializer.Format.NormalXml);
_lastAutosave = DateTime.Now;
}
if (_currentObjectsMenu.Visible)
{
if (Game.IsControlJustPressed(0, Control.PhoneLeft))
{
if (_currentObjectsMenu.CurrentSelection <= 100)
{
_currentObjectsMenu.CurrentSelection = 0;
}
else
{
_currentObjectsMenu.CurrentSelection -= 100;
}
}
if (Game.IsControlJustPressed(0, Control.PhoneRight))
{
if (_currentObjectsMenu.CurrentSelection >= _currentObjectsMenu.Size - 101)
{
_currentObjectsMenu.CurrentSelection = _currentObjectsMenu.Size - 1;
}
else
{
_currentObjectsMenu.CurrentSelection += 100;
}
}
}
//
// BELOW ONLY WHEN MAP EDITOR IS ACTIVE
//
if (!IsInFreecam) return;
if(_settings.InstructionalButtons && !_objectsMenu.Visible)
Function.Call(Hash._0x0DF606929C105BE1, _scaleform.Handle, 255, 255, 255, 255, 0);
Function.Call(Hash.DISABLE_CONTROL_ACTION, 0, (int)Control.CharacterWheel);
Function.Call(Hash.DISABLE_CONTROL_ACTION, 0, (int)Control.SelectWeapon);
Function.Call(Hash.DISABLE_CONTROL_ACTION, 0, (int)Control.FrontendPause);
Function.Call(Hash.DISABLE_CONTROL_ACTION, 0, (int)Control.NextCamera);
Function.Call(Hash.DISABLE_CONTROL_ACTION, 0, (int)Control.Phone);
Function.Call(Hash.HIDE_HUD_AND_RADAR_THIS_FRAME);
if (Game.IsControlJustPressed(0, Control.Enter) && !_isChoosingObject)
{
var oldType = _currentObjectType;
_currentObjectType = ObjectTypes.Prop;
if(oldType != _currentObjectType)
RedrawObjectsMenu(type: _currentObjectType);
_isChoosingObject = true;
_snappedProp = null;
_selectedProp = null;
_menuPool.CloseAllMenus();
if (_quitWithSearchVisible && oldType == _currentObjectType)
{
_searchMenu.Visible = true;
OnIndexChange(_searchMenu, _searchMenu.CurrentSelection);
}
else
{
_objectsMenu.Visible = true;
OnIndexChange(_objectsMenu, _objectsMenu.CurrentSelection);
}
_objectsMenu.Subtitle.Caption = "~b~" + Translation.Translate("PLACE") + " " + _currentObjectType.ToString().ToUpper();
}
//.........这里部分代码省略.........