本文整理匯總了C#中BaseEntity.IsWeapon方法的典型用法代碼示例。如果您正苦於以下問題:C# BaseEntity.IsWeapon方法的具體用法?C# BaseEntity.IsWeapon怎麽用?C# BaseEntity.IsWeapon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BaseEntity
的用法示例。
在下文中一共展示了BaseEntity.IsWeapon方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Update
public void Update()
{
//If the game processes is not running, close the cheat.
if (!ProcUtils.ProcessIsRunning(Program.GameProcess))
Environment.Exit(0);
WindowTitle = GetActiveWindowTitle();
if (WindowTitle != Program.GameTitle)
return;
var players = new List<Tuple<int, Player>>();
var entities = new List<Tuple<int, BaseEntity>>();
var weapons = new List<Tuple<int, Weapon>>();
State = (SignOnState) Program.MemUtils.Read<int>((IntPtr) (ClientState + Offsets.ClientState.InGame));
_localPlayer = Program.MemUtils.Read<int>((IntPtr) (ClientDllBase + Offsets.Misc.LocalPlayer));
ViewMatrix = Program.MemUtils.ReadMatrix((IntPtr) _viewMatrix, 4, 4);
//If we are not ingame do not update
if (State != SignOnState.SignonstateFull)
return;
var data = new byte[16*8192];
Program.MemUtils.Read((IntPtr) _entityList, out data, data.Length);
for (var i = 0; i < data.Length/16; i++)
{
var address = BitConverter.ToInt32(data, 16*i);
if (address == 0) continue;
var entity = new BaseEntity(address);
if (!entity.IsValid())
continue;
if (entity.IsPlayer())
players.Add(new Tuple<int, Player>(i, new Player(entity)));
else if (entity.IsWeapon())
weapons.Add(new Tuple<int, Weapon>(i, new Weapon(entity)));
else
entities.Add(new Tuple<int, BaseEntity>(i, entity));
}
Players = players.ToArray();
Entities = entities.ToArray();
Weapons = weapons.ToArray();
//Check if our player exists
if (players.Exists(x => x.Item2.Address == _localPlayer))
{
LocalPlayer = new LocalPlayer(players.First(x => x.Item2.Address == _localPlayer).Item2);
LocalPlayerWeapon = LocalPlayer.GetActiveWeapon();
//Only gets the weapon name and formates it properly and retunrs a string. Used for Weapon Configs
WeaponSection = LocalPlayer.GetActiveWeaponName();
}
}