コード例 #1
0
    /** 重新加载配置 */
    private void reloadConfig()
    {
        long now = Ctrl.getTimer();

        BaseC.config.loadSyncForEditorAll();

        long now2 = Ctrl.getTimer();

        Ctrl.print("editor加载配置All完成,耗时:", now2 - now);

        int i = 0;

        _sceneList     = new SList <SceneConfig>();
        _sceneListStrs = new string[SceneConfig.getDic().size()];

        SceneConfig.getDic().getSortedKeyList().forEach(k =>
        {
            SceneConfig config = SceneConfig.get(k);
            _sceneList.add(config);
            _sceneListStrs[i++] = config.id + ":" + config.name;
        });

        i                = 0;
        _monsterList     = new SList <MonsterConfig>();
        _monsterListStrs = new string[MonsterConfig.getDic().size()];

        MonsterConfig.getDic().getSortedKeyList().forEach(k =>
        {
            MonsterConfig config = MonsterConfig.get(k);
            _monsterList.add(config);
            _monsterListStrs[i++] = config.id + ":" + config.name;
        });

        i = 0;
        _operationList     = new SList <OperationConfig>();
        _operationListStrs = new string[OperationConfig.getDic().size()];

        OperationConfig.getDic().getSortedKeyList().forEach(k =>
        {
            OperationConfig config = OperationConfig.get(k);
            _operationList.add(config);
            _operationListStrs[i++] = config.id + ":" + config.name;
        });
    }
コード例 #2
0
    private void makeElementModel(SceneElementEditorData data)
    {
        switch (data.config.type)
        {
        case SceneElementType.Npc:
        {
        }
        break;

        case SceneElementType.Monster:
        {
            MonsterConfig monsterConfig = MonsterConfig.get(data.config.id);

            data.gameObject = createModel(FightUnitConfig.get(monsterConfig.fightUnitID).modelID, data);
        }
        break;

        case SceneElementType.Operation:
        {
            OperationConfig operationConfig = OperationConfig.get(data.config.id);

            data.gameObject = createModel(operationConfig.modelID, data);
        }
        break;

        case SceneElementType.FieldItem:
        {
            ItemConfig itemConfig = ItemConfig.get(data.config.id);

            data.gameObject = createModel(itemConfig.fieldItemModelID, data);
        }
        break;
        }

        setPosToGameObject(data);
    }