38 lines
915 B
C#
38 lines
915 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using cfg.LevelCfg;
|
|
using UnityEngine;
|
|
|
|
public class LevelGroupInfo
|
|
{
|
|
private DataLevelGroup _config;
|
|
|
|
private List<ChapterInfo> _chapterList = new();
|
|
|
|
public int ID => _config.Id;
|
|
|
|
public LevelGroupType GroupType => _config.Type;
|
|
|
|
public string MaterialIcon => _config.MaterialIcon;
|
|
|
|
public string Name => StringManager.Instance.GetLocalizeTextByKey(_config.Name);
|
|
|
|
public string Desc => StringManager.Instance.GetLocalizeTextByKey(_config.Desc);
|
|
|
|
public LevelGroupInfo(DataLevelGroup config)
|
|
{
|
|
_config = config;
|
|
}
|
|
|
|
public void AddChapter(ChapterInfo chapterInfo)
|
|
{
|
|
if (!_chapterList.Contains(chapterInfo))
|
|
{
|
|
_chapterList.Add(chapterInfo);
|
|
}
|
|
else
|
|
{
|
|
DebugUtil.LogError($"cant add chapter,chapterID:{chapterInfo.ID}");
|
|
}
|
|
}
|
|
} |