コード例 #1
0
        private void PopulateCatalogues()
        {
            uistatesystem.RemoveLoadingScreen();
            TransformUtils.ClearChilds(catalogueScrollContentHolder, catalogueButtonPooler);
            loadingProgress = 0;

            if (Catalogues.Count > 0)
            {
                for (int i = 0; i < Catalogues.Count; i++)
                {
                    // Pooling
                    GameObject catalogueButtonGO = catalogueButtonPooler.GetObject();
                    catalogueButtonGO.transform.SetParent(catalogueScrollContentHolder);
                    catalogueButtonGO.GetComponent <RectTransform>().localScale = Vector3.one;
                    //Initialize
                    bool success = catalogueButtonGO.GetComponentInChildren <CatalogueButton>().Init(Catalogues[i], i);

                    // SetLoadProgress
                    if (success)
                    {
                        SetLoadProgress(i);
                    }
                }
            }
            else
            {
                DebugHelper.Log("Couldn't load catalogue buttons");
            }
        }