58 lines
2.2 KiB
C#
58 lines
2.2 KiB
C#
|
|
using System.Collections.Generic;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
namespace TKS
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// 1장 학습 판 표(Assets/Data/Stages/tutorial_{stage,layout,guide,config}.csv · 기획 tables/ 사본 · utf-8-sig · 2026-11-12 PD 「초반 10 스테이지 = 기본 기능 학습」 · 개발 요청서 C5)
|
||
|
|
/// → 메뉴 TKS/Import Tutorial (1장 학습 판 임포트) → Resources/Tutorial/TutorialDb. 값은 모두 표(C45) — 코드는 칸 이름과 뜻만 안다.
|
||
|
|
/// </summary>
|
||
|
|
public class TutorialDb : ScriptableObject
|
||
|
|
{
|
||
|
|
public List<TutorialStageRow> stages = new List<TutorialStageRow>();
|
||
|
|
public List<TutorialLayoutRow> layout = new List<TutorialLayoutRow>();
|
||
|
|
public List<TutorialGuideRow> guide = new List<TutorialGuideRow>();
|
||
|
|
public List<TutorialConfigEntry> config = new List<TutorialConfigEntry>();
|
||
|
|
|
||
|
|
public TutorialStageRow Stage(int chapter, int stage)
|
||
|
|
{
|
||
|
|
foreach (var s in stages)
|
||
|
|
if (s.chapter == chapter && s.stage == stage) return s;
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
|
||
|
|
public List<TutorialLayoutRow> Layout(int chapter, int stage)
|
||
|
|
{
|
||
|
|
var res = new List<TutorialLayoutRow>();
|
||
|
|
foreach (var r in layout)
|
||
|
|
if (r.chapter == chapter && r.stage == stage) res.Add(r);
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>그 판의 안내(n_step 순).</summary>
|
||
|
|
public List<TutorialGuideRow> Guide(int chapter, int stage)
|
||
|
|
{
|
||
|
|
var res = new List<TutorialGuideRow>();
|
||
|
|
foreach (var r in guide)
|
||
|
|
if (r.chapter == chapter && r.stage == stage) res.Add(r);
|
||
|
|
res.Sort((a, b) => a.step.CompareTo(b.step));
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
|
||
|
|
public bool Has(string key)
|
||
|
|
{
|
||
|
|
foreach (var c in config)
|
||
|
|
if (c.key == key) return true;
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>tutorial_config.csv 값(없으면 fallback — 표에 키를 넣을 것).</summary>
|
||
|
|
public float Num(string key, float fallback)
|
||
|
|
{
|
||
|
|
foreach (var c in config)
|
||
|
|
if (c.key == key) return c.value;
|
||
|
|
return fallback;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|