Skip to content

Commit

Permalink
Apply scriptable object to tutorial controller
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrosine1153 committed Oct 23, 2023
1 parent 1d30d4e commit bbb231f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions nekoyume/Assets/_Scripts/UI/Tutorial/TutorialController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public TutorialController(IEnumerable<Widget> widgets)
}
}

_scenario.AddRange(GetData<TutorialScenario>(ScenarioPath).scenario);
_preset.AddRange(GetData<TutorialPreset>(PresetPath).preset);
_scenario.AddRange(GetData<TutorialScenarioScriptableObject>(ScenarioPath).tutorialScenario.scenario);
_preset.AddRange(GetData<TutorialPresetScriptableObject>(PresetPath).tutorialPreset.preset);
}

public void Run(int clearedStageId)
Expand Down Expand Up @@ -172,11 +172,9 @@ private List<ITutorialData> GetTutorialData(ScenarioData data)
};
}

private static T GetData<T>(string path) where T : new()
private static T GetData<T>(string path) where T : ScriptableObject
{
var json = Resources.Load<TextAsset>(path).ToString();
var data = JsonUtility.FromJson<T>(json);
return data;
return Resources.Load<T>(path);
}

private static int GetCheckPoint(int clearedStageId)
Expand Down

0 comments on commit bbb231f

Please sign in to comment.