Exemplo n.º 1
0
    public void newProject()
    {
        VrbModel.deleteAll();

        VrbObject o = VrbModel.createCube(0, -100, 0, 100, 100, 100);

        o.displayModel();
    }
Exemplo n.º 2
0
    Vector3 targetVector;    // 手柄触摸板中心到手指触摸处位置在3D世界中的指向

    void Start()
    {
        moveSpeed     = 200;     //操作物体时的移动速度
        moveSelfSpeed = 200;     //摄像机的移动速度
        rotateSpeed   = 60;
        scaleSpeed    = 0.1f;

        exportModelCanvas = GameObject.Find("PlayerController/SaveModelCanvas");
        exportModelCanvas.SetActive(false);

        eventData  = new PointerEventData(EventSystem.current);
        colorPanel = GameObject.Find("PlayerController/DpnCameraRig/ColorCanvas");
        colorPanel.SetActive(false);

        //Cursor.visible = false;//隐藏鼠标
        //Cursor.lockState = CursorLockMode.Locked;//把鼠标锁定到屏幕中间


        openProjectCanvas = GameObject.Find("PlayerController/OpenProjectCanvas");
        openProjectCanvas.SetActive(false);
        saveProjectCanvas = GameObject.Find("PlayerController/SaveProjectCanvas");
        saveProjectCanvas.SetActive(false);

        editableModel = GameObject.Find("EditableModel");

        infoCanvas = GameObject.Find("PlayerController/InfoCanvas");

        objectPanel = GameObject.Find("PlayerController/InfoCanvas/ObjectPanel");

        scrollView    = GameObject.Find("PlayerController/InfoCanvas/ObjectPanel/ScrollView");
        scrollContent = GameObject.Find("PlayerController/InfoCanvas/ObjectPanel/ScrollView/Viewport/Content");

        transformPanel = GameObject.Find("PlayerController/InfoCanvas/TransformPanel");
        transformPanel.SetActive(false);

        positionPanel = GameObject.Find("PlayerController/InfoCanvas/TransformPanel/PositionPanel");
        rotatePanel   = GameObject.Find("PlayerController/InfoCanvas/TransformPanel/RotatePanel");
        scalePanel    = GameObject.Find("PlayerController/InfoCanvas/TransformPanel/ScalePanel");

        lightPanel = GameObject.Find("PlayerController/InfoCanvas/LightPanel");
        lightPanel.SetActive(false);

        matPanel = GameObject.Find("PlayerController/InfoCanvas/MaterialPanel");
        matPanel.SetActive(false);

        mainMenu = GameObject.Find("MainMenu");

        moveButton          = GameObject.Find("MainMenu/MoveButton");
        moveButtonSubCanvas = GameObject.Find("MainMenu/MoveButton/SubCanvas");
        mbx = GameObject.Find("MainMenu/MoveButton/SubCanvas/X");
        mby = GameObject.Find("MainMenu/MoveButton/SubCanvas/Y");
        mbz = GameObject.Find("MainMenu/MoveButton/SubCanvas/Z");

        rotateButton          = GameObject.Find("MainMenu/RotateButton");
        rotateButtonSubCanvas = GameObject.Find("MainMenu/RotateButton/SubCanvas");
        rbx = GameObject.Find("MainMenu/RotateButton/SubCanvas/X");
        rby = GameObject.Find("MainMenu/RotateButton/SubCanvas/Y");
        rbz = GameObject.Find("MainMenu/RotateButton/SubCanvas/Z");

        scaleButton          = GameObject.Find("MainMenu/ScaleButton");
        scaleButtonSubCanvas = GameObject.Find("MainMenu/ScaleButton/SubCanvas");
        sbx = GameObject.Find("MainMenu/ScaleButton/SubCanvas/X");
        sby = GameObject.Find("MainMenu/ScaleButton/SubCanvas/Y");
        sbz = GameObject.Find("MainMenu/ScaleButton/SubCanvas/Z");

        projectButton          = GameObject.Find("MainMenu/ProjectButton");
        projectButtonSubCanvas = GameObject.Find("MainMenu/ProjectButton/SubCanvas");
        projectButtonSubCanvas.SetActive(false);

        settingButtonSubCanvas = GameObject.Find("PlayerController/SettingCanvas");
        settingButtonSubCanvas.SetActive(false);

        placeButton           = GameObject.Find("MainMenu/PlaceButton");
        placeButtonSubCanvas  = GameObject.Find("MainMenu/PlaceButton/SubCanvas");
        placeButtonSubCanvas2 = GameObject.Find("MainMenu/PlaceButton/SubCanvas2");
        placeButtonSubCanvas.SetActive(false);
        placeButtonSubCanvas2.SetActive(false);

        lightButton          = GameObject.Find("MainMenu/LightButton");
        lightButtonSubCanvas = GameObject.Find("MainMenu/LightButton/SubCanvas");
        lightButtonSubCanvas.SetActive(false);

        editButton          = GameObject.Find("MainMenu/EditButton");
        editButtonSubCanvas = GameObject.Find("MainMenu/EditButton/SubCanvas");

        multiSelectButton = GameObject.Find("MainMenu/MultiSelectButton");

        dpnCamera = GameObject.Find("PlayerController/DpnCameraRig");

        txt = GameObject.Find("DebugText").GetComponent <Text>();

        orientationIndicator = GameObject.Find("OrientationIndicator");

        placementTarget = new VrbPlaceTarget();
        placementTarget.constructModel();
        placementTarget.hideModel();

        lightPanel.GetComponent <LightPanel>().init();

        textIndicator = GameObject.Find("PlayerController/DpnCameraRig/TextIndicatorCanvas");
        textIndicator.SetActive(false);

        setMoveMode();
        exitEdit();
        exitMultiSelect();

        measurer      = new VrbMeasurer();
        leftMeasurer  = VrbMeasurer.l;
        rightMeasurer = VrbMeasurer.r;
        measurer.hideModel();

        distanceDisplayer = GameObject.Find("PlayerController/InfoCanvas/DistancePanel");
        distanceDisplayer.SetActive(false);

        VrbObject o = VrbModel.createCube(0, -100, 0, 100, 100, 100);

        o.displayModel();
    }