Example #1
0
    public void Setup()
    {
        Util.FindIfNotSet(this, ref popups);
        Util.FindIfNotSet(this, ref loadingScreen);
        Util.FindIfNotSet(this, ref sceneController);

        templateItem.gameObject.SetActive(false);
        foreach (BuiltInTemplateInfo templateInfo in TEMPLATES)
        {
            GameObject obj = GameObject.Instantiate(templateItem.gameObject);
            obj.transform.SetParent(templateItem.transform.parent, false);
            TemplateItem thisItem = obj.GetComponent <TemplateItem>();
            thisItem.SetTitle(templateInfo.name);
            thisItem.SetThumbnailPath(Path.Combine(Application.streamingAssetsPath, "ExampleGames", "Public", templateInfo.baseFileName + ".png"));
            thisItem.AddClickListener(() => OnTemplateClicked(templateInfo));
            obj.SetActive(true);
        }

        closeButton.onClick.AddListener(Close);
    }