本文整理汇总了C#中Vehicle.GetRandomDoorPosition方法的典型用法代码示例。如果您正苦于以下问题:C# Vehicle.GetRandomDoorPosition方法的具体用法?C# Vehicle.GetRandomDoorPosition怎么用?C# Vehicle.GetRandomDoorPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vehicle
的用法示例。
在下文中一共展示了Vehicle.GetRandomDoorPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreatePolice
private void CreatePolice(ushort vehicleID, ref Vehicle data, Citizen.AgePhase agePhase)
{
SimulationManager instance = Singleton<SimulationManager>.instance;
CitizenManager instance2 = Singleton<CitizenManager>.instance;
CitizenInfo groupCitizenInfo = instance2.GetGroupCitizenInfo(ref instance.m_randomizer, this.m_info.m_class.m_service, Citizen.Gender.Male, Citizen.SubCulture.Generic, agePhase);
if (groupCitizenInfo != null)
{
int family = instance.m_randomizer.Int32(256u);
uint num = 0u;
if (instance2.CreateCitizen(out num, 90, family, ref instance.m_randomizer, groupCitizenInfo.m_gender))
{
ushort num2;
if (instance2.CreateCitizenInstance(out num2, ref instance.m_randomizer, groupCitizenInfo, num))
{
Vector3 randomDoorPosition = data.GetRandomDoorPosition(ref instance.m_randomizer, VehicleInfo.DoorType.Exit);
groupCitizenInfo.m_citizenAI.SetCurrentVehicle(num2, ref instance2.m_instances.m_buffer[(int)num2], 0, 0u, randomDoorPosition);
groupCitizenInfo.m_citizenAI.SetTarget(num2, ref instance2.m_instances.m_buffer[(int)num2], data.m_targetBuilding);
instance2.m_citizens.m_buffer[(int)((UIntPtr)num)].SetVehicle(num, vehicleID, 0u);
}
else
{
instance2.ReleaseCitizen(num);
}
}
}
}