示例#1
0
    public void RemoveLineInspectorInfoProperties(LineInspectorInfo lineInfo)
    {
        // Remove map layer
        if (lineInfo.mapLayer != null)
        {
            toolLayers.Remove(lineInfo.mapLayer);
            if (lineInfo.mapLayer.grids.Count > 0)
            {
                lineInspectorGrids.AddRange(lineInfo.mapLayer.grids);
                lineInfo.mapLayer.Clear();
            }
            GameObject.Destroy(lineInfo.mapLayer.gameObject);
            lineInfo.mapLayer = null;
        }

        // Remove line inspection delete
        if (lineInfo.inspectionDelete)
        {
            GameObject.Destroy(lineInfo.inspectionDelete.gameObject);
            lineInfo.inspectionDelete = null;
        }

        // Remove control points
        foreach (var controlPtTB in lineInfo.controlPtsTB)
        {
            GameObject.Destroy(controlPtTB.gameObject);
        }
        lineInfo.controlPtsTB.Clear();
        lineInfo.controlPts.Clear();
        lineInfo.coords.Clear();

        // Remove line renderer
        if (lineInfo.line)
        {
            GameObject.Destroy(lineInfo.line.gameObject);
            lineInfo.line = null;
        }

        // Remove line inspection
        if (lineInfo.lineInspection != null)
        {
            GameObject.Destroy(lineInfo.lineInspection.gameObject);
            lineInfo.lineInspection = null;
        }

        lineInfo.mapViewAreaChanged = false;
    }
    public void RemoveAreaInspectorInfoProperties(AreaInspectorInfo areaInfo)
    {
        // Remove map layer
        if (areaInfo.mapLayer != null)
        {
            toolLayers.Remove(areaInfo.mapLayer);
            if (areaInfo.mapLayer.grids.Count > 0)
            {
                areaInspectorGrids.AddRange(areaInfo.mapLayer.grids);
                areaInfo.mapLayer.Clear();
            }
            GameObject.Destroy(areaInfo.mapLayer.gameObject);
            areaInfo.mapLayer = null;
        }

        // Remove area inspection delete
        if (areaInfo.areaInspectionDelete)
        {
            GameObject.Destroy(areaInfo.areaInspectionDelete.gameObject);
            areaInfo.areaInspectionDelete = null;
        }

        areaInfo.coords.Clear();

        // Remove line renderer
        if (areaInfo.line)
        {
            GameObject.Destroy(areaInfo.line.gameObject);
            areaInfo.line = null;
        }

        // Remove area inspection
        if (areaInfo.areaInspection != null)
        {
            GameObject.Destroy(areaInfo.areaInspection.gameObject);
            areaInfo.areaInspection = null;
        }

        areaInfo.mapViewAreaChanged = false;
    }