本文整理汇总了C#中GTA.Ped.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# Ped.Delete方法的具体用法?C# Ped.Delete怎么用?C# Ped.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GTA.Ped
的用法示例。
在下文中一共展示了Ped.Delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CharacterSelection
private void CharacterSelection()
{
//var p = new Point(UI.WIDTH / 2 - 150, UI.HEIGHT - 160);
//new UIRectangle(new Point(p.X, p.Y + 25), new Size(300, 20), Color.FromArgb(180, 8, 8, 8)).Draw();
//new UIText("Name: " + PlayerName, new Point(p.X + 150, p.Y + 25), 0.25f, Color.White, 0, true).Draw();
//var name = AvailablePeds[CurrentCharModel].ToString();
//
//new UIRectangle(new Point(p.X, p.Y + 50), new Size(200, 20), Color.FromArgb(180, 8, 8, 8)).Draw();
//new UIText(name, new Point(p.X + 100, p.Y + 50), 0.25f, Color.White, 0, true).Draw();
if(!IsOpen(CharSelectMenu))
{
if (CarModel != null) CarModel.Delete();
View.AddMenu(CharSelectMenu);
}
if (CharacterModel == null)
{
Model m = AvailablePeds[CurrentCharModel];
m.Request(1000);
CharacterModel = World.CreatePed(m, new Vector3(_playerPosition.X,_playerPosition.Y, _playerPosition.Z - 0.25f),_playerHeading);
RPG.WorldData.AddPed(new NpcObject("charCreation", CharacterModel));
if(CharacterModel != null && !CharacterModel.IsHuman)
{
CharacterModel.Delete();
CharacterModel = null;
NextModel();
}
if(CharacterModel != null)
{
View.RemoveMenu(CharSelectMenu);
//Get Variations
Variations = new Dictionary<int, int>();
CurVariations = new Dictionary<int, int>();
for (int i = 0; i < 25; i++)
{
var a = Function.Call<int>(Hash.GET_NUMBER_OF_PED_DRAWABLE_VARIATIONS, CharacterModel, i);
if(a > 1)
{
Variations.Add(i,a);
CurVariations.Add(i,0);
}
}
//Add scrollers for each variation
var items = new List<IMenuItem>()
{
new MenuButton("Random Character", "").WithActivate(RandomModel),
new MenuEnumScroller("Character Model","",AvailablePeds.Select(x => x.ToString()).ToArray(),CurrentCharModel).WithEnumActions(SetCharModel,d=> { }),
new MenuLabel("", true)
};
var continuebutton = new MenuButton("Continue", "").WithActivate(() => { View.PopMenu(); State = CharCreationState.Car; });
var count = 0;
foreach (var kvp in Variations)
{
var varCount = kvp.Value;
var enumStrings = new string[varCount];
for (int i = 0; i < varCount; i++)
{
enumStrings[i] = i.ToString();
}
items.Add(new MenuNumericScroller("Variation " + (count + 1), "", 0, varCount - 1, 1).WithNumericActions(ChangeVariation, ChangeVariation));
count++;
}
items.Add(new MenuLabel("", true));
items.Add(continuebutton);
CharSelectMenu = new RPGMenu("Character Creation", new GTASprite("commonmenu", "interaction_bgd", Color.DodgerBlue), items.ToArray());
RPGUI.FormatMenu(CharSelectMenu);
View.AddMenu(CharSelectMenu);
CharSelectMenu.SelectedIndex = 1;
Function.Call(Hash.SET_PED_DEFAULT_COMPONENT_VARIATION, CharacterModel.Handle);
Camera.Position = _camPosition;
Camera.PointAt(CharacterModel.Position + CharacterModel.UpVector - new Vector3(0,0,0.2f));
}
}
else
{
CharacterModel.FreezePosition = true;
CharacterModel.Task.ClearAll();
}
}
示例2: Bombat_Tick
//メイン処理
private void Bombat_Tick(object sender, EventArgs e)
{
if (AllF == true)
{
//ここからヘリカメラの処理
if (Game.isGameKeyPressed(GameKey.LookBehind))
{
if (Game.isGameKeyPressed(GameKey.RadarZoom) || CameraFlag)
{
CameraFlag = true;
}
}
if (Game.isGameKeyPressed(GameKey.LookBehind) && !Game.isGameKeyPressed(GameKey.RadarZoom))
{
CameraFlag = false;
}
if (Player.Character.isDead || !Player.Character.isInVehicle())
{
CameraFlag = false;
}
//ここからカオスヘリ自体の処理
if (Player.Character.isDead)
{
//主人公が死んだらヘリを解放
Reset();
Timer = 0;
return;
}
else if (Exists(heli) && Player.Character.isInVehicle(heli))
{
heli.PetrolTankHealth = -1.0f;
if (Exists(driver)) { driver.Invincible = false; }
Reset();
heli = null;
}
if (Timer < 0)
{
//40秒に1回、ヘリを再生成すべきかチェック
if (Exists(heli) && (heli.Speed < 0.2f || heli.Position.DistanceTo2D(Player.Character.Position) > 150.0f))
{
heli.PetrolTankHealth = -1.0f;
Reset();
}
if (!Exists(heli) || !heli.isAlive)
{
Reset();
CreateHeli();
}
else
{
Timer = 40 * 2;
}
}
else
{
if (!Exists(heli)) { Timer--; return; }
if (Exists(driver))
{
if (driver.isInVehicle())
{
driver.Task.DriveTo(heli, Player.Character.Position + new Vector3(0, 0, 20), 100, true, true);
}
else
{
driver.NoLongerNeeded();
driver.Money = 0;
driver.Invincible = false;
driver = heli.CreatePedOnSeat(VehicleSeat.Driver);
if (Exists(driver))
{
driver.Money = 500;
driver.Invincible = true;
}
}
}
if (Exists(p[0])) { if (!p[0].isInVehicle()) { p[0].NoLongerNeeded(); p[0] = heli.CreatePedOnSeat(VehicleSeat.LeftRear); } }
if (Exists(p[1])) { if (!p[1].isInVehicle()) { p[1].NoLongerNeeded(); p[1] = heli.CreatePedOnSeat(VehicleSeat.RightFront); } }
if (Exists(p[2])) { if (!p[2].isInVehicle()) { p[2].NoLongerNeeded(); p[2] = heli.CreatePedOnSeat(VehicleSeat.RightRear); } }
}
if (Exists(A)) { A.Delete(); }
if (Exists(heli))
{
if (Share.Nico_Engo > 0)
{
Share.Nico_Engo--;
A = World.CreatePed(heli.Position + new Vector3(0, 0, -2.5f));
Ped[] Tlist=new Ped[0];
try
//.........这里部分代码省略.........