Example #1
0
    private void LoadDXF(string path = null)
    {
        //try
        //{
        GetComponent <MeshGenerater.DataContainer>().ResetError();
        if (path == null)
        {
            iLoader = new DiskFile(content);
        }
        else
        {
            iLoader = new DiskFile(path);
        }

        DXFConvert.DXFStructure dxfStructure = new DXFConvert.DXFStructure(iLoader);
        dxfStructure.Load();
        iLoader.Dispose();
        TView.Set(dxfStructure);
        NormalCenter.GetCenter(TView.transform);
        GetComponent <MeshGenerater.DataContainer>().SerializeData();
        Camera.main.GetComponent <BLCameraControl>().LookAtResAutoDis(GameObject.Find("TViewBase").transform);
        //Debug.Log("OK:" + path);
        //}
        //catch (System.Exception ex)
        //{
        //    Debug.Log("Error:" +ex.Message);
        //}
    }
Example #2
0
    public void LookAtResAutoDis2(Transform target)
    {
        Vector3 targetSize   = NormalSize.GetSize(target);
        Vector3 targetCenter = NormalCenter.GetCenter(target);

        norCenterGo.position = targetCenter;
        float norDis = (targetSize.x + targetSize.z) + lookDistance;

        SetZoomLimit(0, 2000);
        MoveTo(norDis * 2, 30f);
    }
Example #3
0
    public void LookAtUpground2(Transform target, float rotateX, float rotateY, float minZoom = 0f)
    {
        Vector3 targetSize   = NormalSize.GetSize(target);
        Vector3 targetCenter = NormalCenter.GetCenter(target);

        norCenterGo.GetComponent <NormalTarget>().SetTarget(null);
        norCenterGo.position = targetCenter;
        float norDis = (targetSize.x + targetSize.z) / 2f * autoSizeScale + 300f;

        SetZoomLimit(minZoom, 2000);
        MoveTo(norDis, rotateX, rotateY, 0.5f);
    }
Example #4
0
    public void LookAtResAutoDisS(Transform target)
    {
        Vector3 targetSize   = NormalSize.GetSize(target);
        Vector3 targetCenter = NormalCenter.GetCenter(target);

        norCenterGo.position = targetCenter;
        float norDis = (targetSize.x + targetSize.z) / 2f + 150f;

        SetZoomLimit(0, 2000);
        MoveTo(norDis, 90f);
        canZoom = false;
        isMove  = false;
    }
Example #5
0
    public void LookAtUpGround3(Transform target)
    {
        Vector3 targetSize   = NormalSize.GetSize(target);
        Vector3 targetCenter = NormalCenter.GetCenter(target);

        norCenterGo.position = targetCenter;
        float norDis = (targetSize.x + targetSize.z) / 2f + 300f;

        SetZoomLimit(0, 2500);
        MoveTo(norDis, 30f);
        canZoom = true;
        isMove  = true;
    }
Example #6
0
    public void LookAtAreaAutoDis(Transform target)
    {
        if (target == null)
        {
            target = GameObject.Find("ModelRoot").transform;
        }
        Vector3 targetSize   = NormalSize.GetSize(target);
        Vector3 targetCenter = NormalCenter.GetCenter(target);

        norCenterGo.GetComponent <NormalTarget>().SetTarget(null);
        norCenterGo.position = targetCenter;
        float norDis = (targetSize.x + targetSize.z) / 2f * autoSizeScale;

        SetZoomLimit(0, 2000);
        MoveTo(norDis, 30f);
    }
Example #7
0
    public void LookAtResAutoDis3(List <Transform> targets)
    {
        Vector3 targetSize = Vector3.zero;

        for (int i = 0; i < targets.Count; i++)
        {
            targetSize += NormalSize.GetSize(targets[i]) * targets[i].localScale.z;
        }
        targetSize = targetSize / targets.Count;
        Vector3 targetCenter = NormalCenter.GetCenter(targets);

        norCenterGo.position = targetCenter;
        float norDis = (targetSize.x + targetSize.z) / 2 + lookDistance;

        SetZoomLimit(0, 2000);
        MoveTo(norDis * 2, 30f);
    }
Example #8
0
    public void LookAtArea(List <Transform> targets)
    {
        Vector3 targetSize   = Vector3.zero;
        Vector3 targetCenter = Vector3.zero;

        for (int i = 0; i < targets.Count; i++)
        {
            targetSize   += NormalSize.GetSize(targets[i]);
            targetCenter += NormalCenter.GetCenter(targets[i]);
        }
        targetSize           = targetSize / targets.Count;
        targetCenter         = targetCenter / targets.Count;
        norCenterGo.position = targetCenter;
        float norDis = (targetSize.x + targetSize.z) + 100;

        SetZoomLimit(0, 2000);
        MoveTo(norDis * 2, 30f);
    }