new public static ToolBase.ToolErrors CheckSpace(BuildingInfo info, BuildingInfo.PlacementMode placementMode, int relocating, Vector3 pos, float minY, float maxY, float angle, int width, int length, bool test, ulong[] collidingSegmentBuffer, ulong[] collidingBuildingBuffer) { return(ToolBase.ToolErrors.None); /*ToolBase.ToolErrors toolErrors = BuildingTool.CheckSpaceImpl(info, placementMode, relocating, pos, minY, maxY, angle, width, length, test, collidingSegmentBuffer, collidingBuildingBuffer); * if (info.m_subBuildings != null && info.m_subBuildings.Length != 0) * { * Matrix4x4 matrix4x = default(Matrix4x4); * matrix4x.SetTRS(pos, Quaternion.AngleAxis(angle * 57.29578f, Vector3.down), Vector3.one); * for (int i = 0; i < info.m_subBuildings.Length; i++) * { * BuildingInfo buildingInfo = info.m_subBuildings[i].m_buildingInfo; * Vector3 vector = matrix4x.MultiplyPoint(info.m_subBuildings[i].m_position); * float angle2 = info.m_subBuildings[i].m_angle * 0.0174532924f + angle; * float minY2; * float maxY2; * float num; * Building.SampleBuildingHeight(vector, angle2, buildingInfo.m_cellWidth, buildingInfo.m_cellLength, buildingInfo, out minY2, out maxY2, out num); * toolErrors |= BuildingTool.CheckSpaceImpl(buildingInfo, placementMode, relocating, vector, minY2, maxY2, angle2, buildingInfo.m_cellWidth, buildingInfo.m_cellLength, test, collidingSegmentBuffer, collidingBuildingBuffer); * } * } * if (!test) * { * NetTool.ReleaseNonImportantSegments(collidingSegmentBuffer); * BuildingTool.ReleaseNonImportantBuildings(collidingBuildingBuffer); * } * return toolErrors;*/ }
public UniqueBuildingInfo(BuildingInfo oldInfo) { m_buildingAI = oldInfo.m_buildingAI; m_props = oldInfo.m_props; m_placementMode = oldInfo.m_placementMode; m_flattenTerrain = oldInfo.m_flattenTerrain; m_fullGravel = oldInfo.m_fullGravel; m_fullPavement = oldInfo.m_fullPavement; }
public override ToolBase.ToolErrors CheckBuildPosition(ushort relocateID, ref Vector3 position, ref float angle, float waterHeight, float elevation, ref Segment3 connectionSegment, out int productionRate, out int constructionCost) { if (Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt)) { if (this.m_info.m_placementMode != this.m_placementModeAlt) { this.m_info.m_placementMode = this.m_placementModeAlt; } } else if (this.m_info.m_placementMode != this.m_placementMode) { this.m_info.m_placementMode = this.m_placementMode; } ToolBase.ToolErrors toolErrors = base.CheckBuildPosition(relocateID, ref position, ref angle, waterHeight, elevation, ref connectionSegment, out productionRate, out constructionCost); return(toolErrors); }
public static void SetPlacementMode(this BuildingInfo building, BuildingInfo.PlacementMode placementMode) { building.m_placementMode = placementMode; }