public void Init() { TooltipSave save = MusicFileConfig.LoadTooltips(); for (int i = 0; i < save.mTooltips.Count; i++) { mTooltips.Add(save.mTooltips[i].mTooltips[0], save.mTooltips[i].mTooltips[1]); } GameObject tooltip = Instantiate(mTooltipBase, Vector3.zero, Quaternion.identity, mTooltipCanvas.transform); mTooltipBaseObject = tooltip.AddComponent <TooltipObject>(); mTooltipBaseObject.Init(); /// For saving the tooltips: //MusicGenerator.Instance.mConfigurations.SaveTooltips("tooltips", save); }
public IEnumerator Init() { TooltipSave save = null; yield return(StartCoroutine(MusicFileConfig.LoadTooltips((x) => { save = x; for (int i = 0; i < save.mTooltips.Count; i++) { mTooltips.Add(save.mTooltips[i].mTooltips[0], save.mTooltips[i].mTooltips[1]); } GameObject tooltip = Instantiate(mTooltipBase, Vector3.zero, Quaternion.identity, mTooltipCanvas.transform); mTooltipBaseObject = tooltip.AddComponent <TooltipObject>(); mTooltipBaseObject.Init(); }))); yield return(null); /// For saving the tooltips: //MusicGenerator.Instance.mConfigurations.SaveTooltips("tooltips", save); }