예제 #1
0
    public void HiddenAddScene(SenceInteractiveInfo s)
    {
        //隐藏模型,隐藏ui,隐藏event,关闭默认相机
        if (s.sceneType != SenceInteractiveInfo.SceneType.大场景)
        {
            foreach (Transform t in s.huXingType.hxMeshRoot.GetComponentsInChildren <Transform>())
            {
                t.gameObject.layer = 29;
            }

            s.huXingType.hxMeshRoot.gameObject.SetActive(false);

            foreach (Canvas c in s.GetComponentsInChildren <Canvas>(true))
            {
                c.gameObject.SetActive(false);
            }

            foreach (EventSystem e in s.GetComponentsInChildren <EventSystem>(true))
            {
                e.gameObject.SetActive(false);
            }

            //设置毛坯相机的layer
            foreach (CameraUniversal c in s.cameraUniversalCenter.cameras)
            {
                //0011 1111 1111 1111 1111 1111 1111 1111
                //设置不渲染30层
                c.GetComponent <Camera>().cullingMask &= 0x3FFFFFFF;
            }

            s.cameraUniversalCenter.currentCamera.DisableCamera();
        }
    }
예제 #2
0
    public void HiddenScene(SenceInteractiveInfo s)
    {
        //隐藏模型,隐藏ui,隐藏event,关闭默认相机
        if (s.sceneType == SenceInteractiveInfo.SceneType.loft ||
            s.sceneType == SenceInteractiveInfo.SceneType.叠拼 ||
            s.sceneType == SenceInteractiveInfo.SceneType.平层 ||
            s.sceneType == SenceInteractiveInfo.SceneType.独栋 ||
            s.sceneType == SenceInteractiveInfo.SceneType.联排
            )
        {
            foreach (Transform t in s.huXingType.hxMeshRoot.GetComponentsInChildren <Transform>())
            {
                t.gameObject.layer = 29;
            }
            if (s.huXingType.hxMeshRoot != null)
            {
                s.huXingType.hxMeshRoot.gameObject.SetActive(false);
            }

            if (s.huXingType.fastMovePointManager != null)
            {
                foreach (Transform t in s.huXingType.fastMovePointManager.GetComponentsInChildren <Transform>())
                {
                    //28层为快速移动层
//                    t.gameObject.layer = 28;
                }
            }


            //设置毛坯相机的layer
            foreach (CameraUniversal c in s.cameraUniversalCenter.cameras)
            {
                //0011 1111 1111 1111 1111 1111 1111 1111
                //设置不渲染30层
                c.GetComponent <Camera>().cullingMask &= 0x3FFFFFFF;
                //关闭所有相机
                c.DisableCamera();
            }
        }


        if (s.meshRoot != null)
        {
            s.meshRoot.gameObject.SetActive(false);
        }

        foreach (Canvas c in s.GetComponentsInChildren <Canvas>(true))
        {
            c.gameObject.SetActive(false);
        }

        foreach (EventSystem e in s.GetComponentsInChildren <EventSystem>(true))
        {
            e.gameObject.SetActive(false);
        }

//        s.cameraUniversalCenter.currentCamera.DisableCamera();
    }
예제 #3
0
    public void EnterHuXing()
    {
        foreach (SenceInteractiveInfo s in senceInteractiveInfoGroup)
        {
            if (s.huXingType.hxName == currentSelectHuXingType.hxName)
            {
                if (s != null && senceInteractiveInfoGroup[0] != null)
                {
                    currentSelectSenceInteractiveInfo   = s;
                    s.huXingType.hxMeshRoot.position    = s.huXingType.hxNKWorldPos;
                    s.huXingType.hxMeshRoot.eulerAngles = new Vector3(0, s.huXingType.rotOffset, 0);
                    s.huXingType.hxMeshRoot.gameObject.SetActive(true);

                    //选房操作初始化预设
                    if (senceInteractiveInfoGroup[0].sceneType == SenceInteractiveInfo.SceneType.大场景 && senceInteractiveInfoGroup[0].louPanManager != null)
                    {
                        louPanManager = senceInteractiveInfoGroup[0].louPanManager;
                        louPanManager.GetSelectHuXinginstance(s.huXingType.hxName);

                        buildScrollMenu.GetComponentInParent <Transform>().DOLocalMoveY(-700, 0.3f);
                        unitScrollMenu.GetComponentInParent <Transform>().DOLocalMoveY(-700, 0.3f);
                        hxInstanceScrollMenu.GetComponentInParent <Transform>().DOLocalMoveY(-700, 0.3f);
                    }
                }
            }
        }

        triggerHuXingThumbnail.AlphaPlayBackward();
        triggerOutDoorThumbnail.AlphaPlayForward();

        huXingCameraBG.transform.parent        = currentSelectSenceInteractiveInfo.cameraUniversalCenter.cameras[0].transform;
        huXingCameraBG.transform.localPosition = new Vector3(0, 0, 90);
        huXingCameraBG.transform.rotation      = new Quaternion();
        huXingCameraBG.transform.localScale    = new Vector3(250, 140, 1);

        senceInteractiveInfoGroup[0].cameraUniversalCenter.currentCamera.GetComponent <Camera>().targetTexture = thumbnail;
        senceInteractiveInfoGroup[0].cameraUniversalCenter.currentCamera.GetComponent <Camera>().Render();
        senceInteractiveInfoGroup[0].cameraUniversalCenter.currentCamera.GetComponent <Camera>().targetTexture = null;

        senceInteractiveInfoGroup[0].cameraUniversalCenter.ChangeCamera(currentSelectSenceInteractiveInfo.cameraUniversalCenter.cameras[0], 0.0f);

        zbz.cameraUniversalCenter = currentSelectSenceInteractiveInfo.cameraUniversalCenter;

        currentSelectSenceInteractiveInfo.huXingType.hxMeshRoot.gameObject.SetActive(true);

        foreach (Canvas c in senceInteractiveInfoGroup[0].GetComponentsInChildren <Canvas>(true))
        {
            c.gameObject.SetActive(false);
        }

        foreach (Canvas c in currentSelectSenceInteractiveInfo.GetComponentsInChildren <Canvas>(true))
        {
            c.gameObject.SetActive(true);
        }

        DisplayHuXingFloorScrollMenu();
    }
예제 #4
0
    public void ChangeInteractiveScene(SenceInteractiveInfo toInteractiveScene, bool disableCurrentSceneMesh)
    {
//     Debug.Log(toInteractiveScene.name);
//     Debug.Log(currentActiveSenceInteractiveInfo.name);

        if (toInteractiveScene == currentActiveSenceInteractiveInfo)
        {
            return;
        }

        if (currentActiveSenceInteractiveInfo != null && disableCurrentSceneMesh)
        {
            if (currentActiveSenceInteractiveInfo.sceneType == SenceInteractiveInfo.SceneType.大场景)
            {
                if (currentActiveSenceInteractiveInfo.meshRoot != null)
                {
                    currentActiveSenceInteractiveInfo.meshRoot.gameObject.SetActive(false);
                }
            }
            else if (currentActiveSenceInteractiveInfo.sceneType == SenceInteractiveInfo.SceneType.Point360)
            {
                if (currentActiveSenceInteractiveInfo.meshRoot != null)
                {
                    currentActiveSenceInteractiveInfo.meshRoot.gameObject.SetActive(false);
                }
            }
            else
            {
                if (currentActiveSenceInteractiveInfo.huXingType.hxMeshRoot != null)
                {
                    currentActiveSenceInteractiveInfo.huXingType.hxMeshRoot.gameObject.SetActive(false);
                }
            }
        }

        if (toInteractiveScene.sceneType == SenceInteractiveInfo.SceneType.Point360)
        {
            globalCameraCenter.ChangeCamera(toInteractiveScene.cameraUniversalCenter.cameras[1], 0.0f);
        }
        else
        {
            globalCameraCenter.ChangeCamera(toInteractiveScene.cameraUniversalCenter.cameras[0], 0.0f);
        }

        if (toInteractiveScene.sceneType == SenceInteractiveInfo.SceneType.大场景)
        {
            if (toInteractiveScene.meshRoot != null)
            {
                toInteractiveScene.meshRoot.gameObject.SetActive(true);
            }
            mainSenceInteractiveInfo = toInteractiveScene;
            //defaultGUI.DisplayDefaultGUI();
        }
        else if (toInteractiveScene.sceneType == SenceInteractiveInfo.SceneType.Point360)
        {
            if (toInteractiveScene.meshRoot != null)
            {
                toInteractiveScene.meshRoot.gameObject.SetActive(true);
            }
            mainSenceInteractiveInfo = toInteractiveScene;
        }
        else
        {
            if (toInteractiveScene.huXingType.hxMeshRoot != null)
            {
                toInteractiveScene.huXingType.hxMeshRoot.gameObject.SetActive(true);
            }
        }

        if (currentActiveSenceInteractiveInfo != null)
        {
            foreach (Canvas c in currentActiveSenceInteractiveInfo.GetComponentsInChildren <Canvas>(true))
            {
                c.gameObject.SetActive(false);
            }
        }

        foreach (Canvas c in toInteractiveScene.GetComponentsInChildren <Canvas>(true))
        {
            c.gameObject.SetActive(true);
        }

        currentActiveSenceInteractiveInfo = toInteractiveScene;
        globalCameraCenter.zbzOffset      = toInteractiveScene.cameraUniversalCenter.zbzOffset;
        zbz.cameraUniversalCenter         = toInteractiveScene.cameraUniversalCenter;

        //    loadingManager.load
        if (CartoonPlayer.hasInit)
        {
            PlayCartoonAni();
        }
    }
예제 #5
0
    public void ChangeInteractiveScene(SenceInteractiveInfo toInteractiveScene, bool disableCurrentSceneMesh)
    {
        if (toInteractiveScene == currentActiveSenceInteractiveInfo)
        {
            return;
        }

        if (currentActiveSenceInteractiveInfo != null && disableCurrentSceneMesh)
        {
            if (currentActiveSenceInteractiveInfo.sceneType == SenceInteractiveInfo.SceneType.大场景)
            {
                if (currentActiveSenceInteractiveInfo.meshRoot != null)
                {
                    currentActiveSenceInteractiveInfo.meshRoot.gameObject.SetActive(false);
                }
            }
            else
            {
                if (currentActiveSenceInteractiveInfo.huXingType.hxMeshRoot != null)
                {
                    currentActiveSenceInteractiveInfo.huXingType.hxMeshRoot.gameObject.SetActive(false);
                }
            }
        }

        globalCameraCenter.ChangeCamera(toInteractiveScene.cameraUniversalCenter.cameras[0], 0.0f);


        if (toInteractiveScene.sceneType == SenceInteractiveInfo.SceneType.大场景)
        {
            if (toInteractiveScene.meshRoot != null)
            {
                toInteractiveScene.meshRoot.gameObject.SetActive(true);
            }
            mainSenceInteractiveInfo = toInteractiveScene;

            defaultGUI.DisplayDefaultGUI();
        }
        else
        {
            if (toInteractiveScene.huXingType.hxMeshRoot != null)
            {
                toInteractiveScene.huXingType.hxMeshRoot.gameObject.SetActive(true);
            }
        }

        if (currentActiveSenceInteractiveInfo != null)
        {
            foreach (Canvas c in currentActiveSenceInteractiveInfo.GetComponentsInChildren <Canvas>(true))
            {
                c.gameObject.SetActive(false);
            }
        }

        foreach (Canvas c in toInteractiveScene.GetComponentsInChildren <Canvas>(true))
        {
            c.gameObject.SetActive(true);
        }

        currentActiveSenceInteractiveInfo = toInteractiveScene;
        globalCameraCenter.zbzOffset      = toInteractiveScene.cameraUniversalCenter.zbzOffset;
        zbz.cameraUniversalCenter         = toInteractiveScene.cameraUniversalCenter;
    }