38 lines
784 B
C#
38 lines
784 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using cfg.LevelCfg;
|
|
using UnityEngine;
|
|
|
|
public class ChapterInfo
|
|
{
|
|
private DataChapter _config;
|
|
|
|
private List<LevelInfo> _levelList = new();
|
|
|
|
public int ID => _config.Id;
|
|
|
|
public int GroupID => _config.GroupID;
|
|
|
|
public LevelType LevelType => _config.Type;
|
|
|
|
public int[] StarList => _config.StarList;
|
|
|
|
public int[] Rewards => _config.Rewards;
|
|
|
|
public ChapterInfo(DataChapter config)
|
|
{
|
|
_config = config;
|
|
}
|
|
|
|
public void AddLevel(LevelInfo levelInfo)
|
|
{
|
|
if (!_levelList.Contains(levelInfo))
|
|
{
|
|
_levelList.Add(levelInfo);
|
|
}
|
|
else
|
|
{
|
|
DebugUtil.LogError($"cant add level,level id:{levelInfo.ID}");
|
|
}
|
|
}
|
|
} |