Example #1
0
 private void MakeLoadButtons()
 {
     m_SavedWorlds = Directory.GetFiles(SaveLocation, "*" + FileExtension);
     for (int i = 0; i < m_SavedWorlds.Length; i++)
     {
         ExampleLoadButton button = GetLoadButton();
         button.LoadPath = m_SavedWorlds[i];
         button.ButtonComp.onClick.AddListener(delegate { Load(button.LoadPath); });
     }
 }
Example #2
0
        private ExampleLoadButton GetLoadButton()
        {
            ExampleLoadButton newButton = null;

            if (m_LoadButtonsPool.Count > 0)
            {
                newButton = m_LoadButtonsPool[0];
                m_LoadButtonsPool.RemoveAt(0);
            }
            else
            {
                newButton = Instantiate(LoadButton, LoadButton.transform.parent);
            }

            newButton.gameObject.SetActive(true);
            m_LoadButtons.Add(newButton);
            return(newButton);
        }