Antura.UI.MinigamesUILives.Setup C# (CSharp) Method

Setup() public method

Sets the max lives. Call this before calling any other method.
public Setup ( int _maxLives ) : void
_maxLives int Max lives
return void
        public void Setup(int _maxLives)
        {
            MaxLives = CurrLives = _maxLives;

            foreach (MinigamesUISingleLife life in lives) Destroy(life.gameObject);
            lives.Clear();

            for (int i = 0; i < MaxLives; ++i) {
                MinigamesUISingleLife life = (MinigamesUISingleLife)Instantiate(LifePrefab, LifePrefab.transform.parent, false);
                life.gameObject.SetActive(true);
                lives.Add(life);
            }

            IsSetup = true;
        }