Exemple #1
0
        private IEnumerator Start()
        {
            var charList = ActiveData.Characters.OrderBy(a => a.hyperspeed).ToArray();

            CharacterSelectEntry cancelEnt = Instantiate(entryPrefab);

            cancelEnt.IconImage.sprite = cancelIconSprite;
            cancelEnt.transform.SetParent(entryContainer.transform, false);
            activeEntries.Add(cancelEnt);

            for (int i = 0; i < charList.Length; i++)
            {
                if (!charList[i].hidden)
                {
                    CharacterSelectEntry characterEnt = Instantiate(entryPrefab);

                    characterEnt.Init(charList[i]);
                    characterEnt.transform.SetParent(entryContainer.transform, false);
                    activeEntries.Add(characterEnt);
                }
            }

            //Wait a single frame before selecting the first character.
            yield return(null);

            Select(1);
        }
        private IEnumerator Start()
        {
            var charList = ActiveData.Characters.OrderBy(a => a.tier).ToArray();

            if (ActiveData.GameSettings.eSportsReady)
            {
                charList = charList.Where(a => a.tier == SanicballCore.CharacterTier.Hyperspeed).ToArray();
            }

            else if (ActiveData.GameSettings.greenModeReady)
            {
                charList = charList.Where(a => a.tier == SanicballCore.CharacterTier.Odd).ToArray();
            }

            CharacterSelectEntry cancelEnt = Instantiate(entryPrefab);

            cancelEnt.IconImage.sprite = cancelIconSprite;
            cancelEnt.transform.SetParent(entryContainer.transform, false);
            activeEntries.Add(cancelEnt);

            for (int i = 0; i < charList.Length; i++)
            {
                if (!charList[i].hidden)
                {
                    CharacterSelectEntry characterEnt = Instantiate(entryPrefab);

                    characterEnt.Init(charList[i]);
                    characterEnt.transform.SetParent(entryContainer.transform, false);
                    activeEntries.Add(characterEnt);
                }
            }

            //Wait a single frame before selecting the first character.
            yield return(null);

            Select(1);
        }