本文整理汇总了C#中NetInfo.GetMedianLane方法的典型用法代码示例。如果您正苦于以下问题:C# NetInfo.GetMedianLane方法的具体用法?C# NetInfo.GetMedianLane怎么用?C# NetInfo.GetMedianLane使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetInfo
的用法示例。
在下文中一共展示了NetInfo.GetMedianLane方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildUp
public void BuildUp(NetInfo info, NetInfoVersion version)
{
///////////////////////////
// Template //
///////////////////////////
var roadTunnelInfo = Prefabs.Find<NetInfo>(NetInfos.Vanilla.ROAD_4L_TUNNEL);
var roadInfo = Prefabs.Find<NetInfo>(NetInfos.Vanilla.ROAD_6L);
///////////////////////////
// 3DModeling //
///////////////////////////
info.Setup32m3mSW2mMdnMesh(version);
///////////////////////////
// Texturing //
///////////////////////////
SetupTextures(info, version);
///////////////////////////
// Set up //
///////////////////////////
info.m_hasParkingSpaces = false;
info.m_pavementWidth = (version == NetInfoVersion.Slope || version == NetInfoVersion.Tunnel ? 4 : 3);
info.m_halfWidth = (version == NetInfoVersion.Tunnel ? 17 : 16);
if (version == NetInfoVersion.Tunnel)
{
info.m_setVehicleFlags = Vehicle.Flags.Transition | Vehicle.Flags.Underground;
info.m_setCitizenFlags = CitizenInstance.Flags.Transition | CitizenInstance.Flags.Underground;
info.m_class = roadTunnelInfo.m_class.Clone(NetInfoClasses.NEXT_XLARGE_ROAD_TUNNEL);
}
else
{
info.m_class = roadInfo.m_class.Clone(NetInfoClasses.NEXT_XLARGE_ROAD);
}
// Setting up lanes
info.SetRoadLanes(version, new LanesConfiguration
{
IsTwoWay = true,
LanesToAdd = 4,
LaneWidth = version == NetInfoVersion.Slope ? 2.75f : 3,
PedPropOffsetX = version == NetInfoVersion.Slope ? 1.5f : 1f,
CenterLane = CenterLaneType.Median,
CenterLaneWidth = 2,
BusStopOffset = 0f
});
var medianLane = info.GetMedianLane();
var leftPedLane = info.GetLeftRoadShoulder();
var rightPedLane = info.GetRightRoadShoulder();
// Fix for T++ legacy support (reordering)
if (medianLane != null)
{
info.m_lanes = info
.m_lanes
.Except(medianLane)
.Union(medianLane)
.ToArray();
}
//Setting Up Props
var leftPedLaneProps = leftPedLane.m_laneProps.m_props.ToList();
var rightPedLaneProps = rightPedLane.m_laneProps.m_props.ToList();
var medianPedLaneProps = medianLane?.m_laneProps?.m_props.ToList();
if (version != NetInfoVersion.Tunnel)
{
var medianStreetLight = medianPedLaneProps?.FirstOrDefault(p => p.m_prop.name.ToLower().Contains("avenue light"));
if (medianStreetLight != null)
{
medianStreetLight.m_finalProp =
medianStreetLight.m_prop = Prefabs.Find<PropInfo>(LargeAvenueMedianLightBuilder.NAME);
}
}
if (medianPedLaneProps != null)
{
medianPedLaneProps.RemoveProps("50 Speed Limit");
}
if (version == NetInfoVersion.Slope)
{
leftPedLaneProps.AddLeftWallLights(info.m_pavementWidth);
rightPedLaneProps.AddRightWallLights(info.m_pavementWidth);
}
leftPedLane.m_laneProps.m_props = leftPedLaneProps.ToArray();
rightPedLane.m_laneProps.m_props = rightPedLaneProps.ToArray();
if (medianLane?.m_laneProps != null && medianPedLaneProps != null)
{
medianLane.m_laneProps.m_props = medianPedLaneProps.ToArray();
}
info.TrimAboveGroundProps(version);
// AI
var owPlayerNetAI = roadInfo.GetComponent<PlayerNetAI>();
var playerNetAI = info.GetComponent<PlayerNetAI>();
//.........这里部分代码省略.........