当前位置: 首页>>代码示例>>C#>>正文


C# Vehicle.GetRandomDoorPosition方法代码示例

本文整理汇总了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);
             }
         }
     }
 }
开发者ID:moverperfect,项目名称:csl-traffic,代码行数:26,代码来源:CustomPoliceCarAI.cs


注:本文中的Vehicle.GetRandomDoorPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。