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


C# Building.CalculateSidewalkPosition方法代码示例

本文整理汇总了C#中Building.CalculateSidewalkPosition方法的典型用法代码示例。如果您正苦于以下问题:C# Building.CalculateSidewalkPosition方法的具体用法?C# Building.CalculateSidewalkPosition怎么用?C# Building.CalculateSidewalkPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Building的用法示例。


在下文中一共展示了Building.CalculateSidewalkPosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GarbageTruckAI_TryCollectGarbage_Original

 /// <summary>
 /// Copied from original game code at game version 1.2.0.
 /// </summary>
 /// <param name="garbageTruckAI">The garbage truck AI instance.</param>
 /// <param name="vehicleID">The vehicle identifier.</param>
 /// <param name="vehicleData">The vehicle data.</param>
 /// <param name="frameData">The frame data.</param>
 /// <param name="buildingID">The building identifier.</param>
 /// <param name="building">The building.</param>
 private static void GarbageTruckAI_TryCollectGarbage_Original(GarbageTruckAI garbageTruckAI, ushort vehicleID, ref Vehicle vehicleData, ref Vehicle.Frame frameData, ushort buildingID, ref Building building)
 {
     if ((double)Vector3.SqrMagnitude(building.CalculateSidewalkPosition() - frameData.m_position) >= 1024.0)
         return;
     int amountDelta = Mathf.Min(0, (int)vehicleData.m_transferSize - garbageTruckAI.m_cargoCapacity);
     if (amountDelta == 0)
         return;
     building.Info.m_buildingAI.ModifyMaterialBuffer(buildingID, ref building, (TransferManager.TransferReason)vehicleData.m_transferType, ref amountDelta);
     if (amountDelta == 0)
         return;
     vehicleData.m_transferSize += (ushort)Mathf.Max(0, -amountDelta);
 }
开发者ID:DinkyToyz,项目名称:wtmcsServiceDispatcher,代码行数:21,代码来源:GarbageTruckAITryCollectGarbageDetour.cs

示例2: TryCollectCrime

 private void TryCollectCrime(ushort vehicleID, ref Vehicle vehicleData, ref Vehicle.Frame frameData, ushort buildingID, ref Building building)
 {
     Vector3 a = building.CalculateSidewalkPosition();
     if (Vector3.SqrMagnitude(a - frameData.m_position) < 1024f)
     {
         int num = -this.m_crimeCapacity;
         BuildingInfo info = building.Info;
         info.m_buildingAI.ModifyMaterialBuffer(buildingID, ref building, TransferManager.TransferReason.Crime, ref num);
         if (num != 0)
         {
             num = Mathf.Clamp(num, (int)vehicleData.m_transferSize - this.m_crimeCapacity, 0);
             vehicleData.m_transferSize += (ushort)Mathf.Max(0, -num);
         }
     }
 }
开发者ID:moverperfect,项目名称:csl-traffic,代码行数:15,代码来源:CustomPoliceCarAI.cs

示例3: TryCollectGarbage

 private void TryCollectGarbage(ushort vehicleID, ref Vehicle vehicleData, ref Vehicle.Frame frameData, ushort buildingID, ref Building building)
 {
     Vector3 a = building.CalculateSidewalkPosition();
     if (Vector3.SqrMagnitude(a - frameData.m_position) < 1024f)
     {
         int num = Mathf.Min(0, (int)vehicleData.m_transferSize - this.m_cargoCapacity);
         if (num == 0)
         {
             return;
         }
         BuildingInfo info = building.Info;
         info.m_buildingAI.ModifyMaterialBuffer(buildingID, ref building, (TransferManager.TransferReason)vehicleData.m_transferType, ref num);
         if (num != 0)
         {
             vehicleData.m_transferSize += (ushort)Mathf.Max(0, -num);
         }
     }
 }
开发者ID:bagukiri,项目名称:csl-traffic,代码行数:18,代码来源:CustomGarbageTruckAI.cs


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