Beispiel #1
0
    private void ExitMode()
    {
        terrainBrush.SetInactive();
        terrainContiner.SetActive(false);
        menuTerrainController.SetInactive();

        terrain.Destroy();
        terrain = null;

        modeExitedSubject.OnNext(Unit.Default);
    }
Beispiel #2
0
    private void SaveTerrainAndExitMode()
    {
        terrainBrush.SetInactive();
        mcManager.Save(terrain, sceneGuid);

        terrainContiner.SetActive(false);
        menuTerrainController.SetInactive();

        modeSavedAndExitedSubject.OnNext(terrain.GetData());
        terrain.Destroy();
        terrain = null;
    }
Beispiel #3
0
    public void TurnOnMode(LoadData loadData)
    {
        this.sceneGuid = loadData.sceneGuid;

        terrain = mcManager.LoadTerrain(loadData.data);
        terrain.gameObject.transform.parent = terrainContiner.transform;
        terrain.transform.localPosition     = new Vector3(0, 0, 0);
        terrain.transform.localRotation     = Quaternion.Euler(Vector3.zero);
        terrain.transform.localScale        = new Vector3(0.1f, 0.1f, 0.1f);

        terrainContiner.transform.rotation = oculusBase.rotation;
        var positionOffset = oculusBase.forward * McConsts.TerrN * terrain.transform.lossyScale.x - oculusBase.up;

        terrainContiner.transform.position = oculusBase.position + positionOffset;

        terrainContiner.SetActive(true);
        menuTerrainController.ResetMenus();
        terrainBrush.SetActive();
    }