本文整理汇总了C#中NetInfo.Setup8m1p5mSWMesh方法的典型用法代码示例。如果您正苦于以下问题:C# NetInfo.Setup8m1p5mSWMesh方法的具体用法?C# NetInfo.Setup8m1p5mSWMesh怎么用?C# NetInfo.Setup8m1p5mSWMesh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetInfo
的用法示例。
在下文中一共展示了NetInfo.Setup8m1p5mSWMesh方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildUp
public void BuildUp(NetInfo info, NetInfoVersion version)
{
///////////////////////////
// Template //
///////////////////////////
var roadInfo = Prefabs.Find<NetInfo>(NetInfos.Vanilla.ROAD_2L);
///////////////////////////
// 3DModeling //
///////////////////////////
info.Setup8m1p5mSWMesh(version);
///////////////////////////
// Texturing //
///////////////////////////
switch (version)
{
case NetInfoVersion.Ground:
info.SetAllSegmentsTexture(
new TextureSet
(@"Roads\TinyRoads\Alley2L\Textures\Ground_Segment__MainTex.png",
@"Roads\TinyRoads\Alley2L\Textures\Ground_Segment__APRMap.png"),
new LODTextureSet
(@"Roads\TinyRoads\Alley2L\Textures\Ground_Segment_LOD__MainTex.png",
@"Roads\TinyRoads\Alley2L\Textures\Ground_Segment_LOD__APRMap.png",
@"Roads\TinyRoads\Alley2L\Textures\Ground_LOD__XYSMap.png"));
foreach (var node in info.m_nodes)
{
if (node.m_flagsForbidden == NetNode.Flags.Transition)
{
node.SetTextures(
new TextureSet
(@"Roads\TinyRoads\Alley2L\Textures\Ground_Node__MainTex.png",
@"Roads\TinyRoads\Alley2L\Textures\Ground_Node__APRMap.png"),
new LODTextureSet
(@"Roads\TinyRoads\Alley2L\Textures\Ground_Node_LOD__MainTex.png",
@"Roads\TinyRoads\Alley2L\Textures\Ground_Node_LOD__APRMap.png",
@"Roads\TinyRoads\Alley2L\Textures\Ground_LOD__XYSMap.png"));
}
else if (node.m_flagsRequired == NetNode.Flags.Transition)
{
node.SetTextures(
new TextureSet
(@"Roads\TinyRoads\Alley2L\Textures\Ground_Trans__MainTex.png",
@"Roads\TinyRoads\Alley2L\Textures\Ground_Trans__APRMap.png"),
new LODTextureSet
(@"Roads\TinyRoads\Alley2L\Textures\Ground_Trans_LOD__MainTex.png",
@"Roads\TinyRoads\Alley2L\Textures\Ground_Trans_LOD__APRMap.png",
@"Roads\TinyRoads\Alley2L\Textures\Ground_LOD__XYSMap.png"));
}
}
break;
}
///////////////////////////
// Set up //
///////////////////////////
info.m_hasParkingSpaces = false;
info.m_halfWidth = 4f;
info.m_pavementWidth = 1.5f;
info.m_surfaceLevel = 0;
info.m_class = roadInfo.m_class.Clone("NExt2LAlley");
info.m_class.m_level = (ItemClass.Level)5; //New level
info.m_lanes = info.m_lanes
.Where(l => l.m_laneType != NetInfo.LaneType.Parking)
.ToArray();
var pedLanes = info.m_lanes.Where(l => l.m_laneType == NetInfo.LaneType.Pedestrian);
var roadLanes = info.m_lanes.Where(l => l.m_laneType != NetInfo.LaneType.Pedestrian && l.m_laneType != NetInfo.LaneType.None);
foreach (var pedLane in pedLanes)
{
pedLane.m_verticalOffset = 0.25f;
}
foreach (var roadLane in roadLanes)
{
roadLane.m_verticalOffset = 0.1f;
}
info.SetRoadLanes(version, new LanesConfiguration
{
IsTwoWay = true,
LaneWidth = 2.5f,
SpeedLimit = 0.6f,
BusStopOffset = 0f,
PedLaneOffset = -0.75f,
PedPropOffsetX = 2.25f
});
info.SetupNewSpeedLimitProps(30, 40);
info.TrimArrowsProps();
var originPlayerNetAI = roadInfo.GetComponent<PlayerNetAI>();
var playerNetAI = info.GetComponent<PlayerNetAI>();
if (playerNetAI != null && originPlayerNetAI != null)
{
playerNetAI.m_constructionCost = originPlayerNetAI.m_constructionCost * 1 / 2;
playerNetAI.m_maintenanceCost = originPlayerNetAI.m_maintenanceCost * 1 / 2;
//.........这里部分代码省略.........