Newer
Older
using UnityEngine;
John Schihada
committed
public string preferredStartScrollName;
static public List<Scroll> AllowedScrolls;
.Where(s => StageStatic.stage.AllowedScrolls?.Contains(s.@ref) ?? true)
for (int i = 0; i < AllowedScrolls.Count; i++)
{
var obj = Instantiate(ScrollPrefab, scrollscreenContent);
obj.GetComponent<ScrollClickedScript>().scroll = AllowedScrolls[i];
obj.GetComponent<ScrollClickedScript>().DetailScreen = this.DetailScreen;
obj.transform.GetChild(0).gameObject.GetComponent<TextMeshProUGUI>().text = AllowedScrolls[i].label;
Scroll preferredStartScroll = AllowedScrolls.Find(x => x.label.Equals(preferredStartScrollName));
if (preferredStartScroll != null)
John Schihada
committed
this.DetailScreen.GetComponent<ScrollDetails>().setScroll(preferredStartScroll);