チュートリアルリセット追加

This commit is contained in:
kimura 2021-10-27 11:28:51 +09:00
parent fd24f8f8cb
commit fb70c00f45
1 changed files with 6 additions and 11 deletions

View File

@ -7,28 +7,23 @@ namespace MyGame.Scripts
{ {
public class TutorialManager : SingletonMonoBehaviour<TutorialManager> public class TutorialManager : SingletonMonoBehaviour<TutorialManager>
{ {
/*
* UIMaskをPrefab化
* InstantiateしてTransform設定
* Unmask自体にクリック判定
* Destroy
* Tutorialへ
* BrotherConversationはCompleteにコールバック設定できるのでそのタイミングで次のステップ実行
*
*/
[SerializeField] private TutorialObjectMask maskPrefab; [SerializeField] private TutorialObjectMask maskPrefab;
public int Index => index; public int Index => index;
private int index; private int index;
private List<BrotherScriptData> scriptList; private List<BrotherScriptData> scriptList;
private void Start() private void Start()
{ {
index = 1; ResetTutorial();
scriptList = SpreadsheetDataManager.Instance.GetBaseDataList<BrotherScriptData>(Const.TutorialScriptDataSheet); scriptList = SpreadsheetDataManager.Instance.GetBaseDataList<BrotherScriptData>(Const.TutorialScriptDataSheet);
} }
public void ResetTutorial()
{
index = 1;
}
public void ShowTutorialConversation(int id, Action onComplete = null) public void ShowTutorialConversation(int id, Action onComplete = null)
{ {
Debug.Log($"count:{scriptList.Count}");
var list = scriptList.Where(data => data.id == id).ToList(); var list = scriptList.Where(data => data.id == id).ToList();
if (list.Count == 0) if (list.Count == 0)
{ {