Exemple #1
0
    /** 设置配置 */
    public virtual void initSceneID(int id)
    {
        _config      = SceneConfig.get(id);
        _mapConfig   = SceneMapConfig.get(_config.mapID);
        _placeConfig = ScenePlaceConfig.getSync(id);

        //绑定驱动类型
        if (_config.instanceType == SceneInstanceType.ClientDriveSinglePlayerBattle)
        {
            driveType = SceneDriveType.ClientDriveAll;
        }
        else
        {
            driveType = CommonSetting.sceneDriveType;
        }

        originPos.setByIArr(_mapConfig.origin);
        sizePos.setByIArr(_mapConfig.size);
        endPos.x = originPos.x + sizePos.x;
        endPos.y = originPos.y + sizePos.y;
        endPos.z = originPos.z + sizePos.z;

        method.onSetConfig();

        preInit();
    }
Exemple #2
0
    /** 场景进入场景 */
    private void enterScene(SceneConfig config)
    {
        if (_currentSceneData != null)
        {
            exitScene();
        }

        SceneEditorData sData = _sceneDic.get(config.id);

        if (sData == null)
        {
            sData        = new SceneEditorData();
            sData.config = config;
            sData.read();

            _sceneDic.put(config.id, sData);
        }

        _currentSceneData = sData;

        _elementInstanceID = -1;

        SceneMapConfig mapConfig = SceneMapConfig.get(config.mapID);

        _originPos.setByIArr(mapConfig.origin);
        _sizePos.setByIArr(mapConfig.size);

        EditorSceneManager.sceneLoaded += onSceneLoaded;
        EditorSceneManager.LoadScene(ShineToolGlobal.assetSourceStr + "/" + mapConfig.source);
    }