本文整理汇总了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);
}
示例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);
}
}
}
示例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);
}
}
}