Ejemplo n.º 1
0
        public TrackCommand GetNext()
        {
            if (this.CurrentCombo == null)
            {
                this.CurrentCombo = this.ComboManager.GetCombo(this.Level);
            }
            if (this.Index >= this.CurrentCombo.Length)
            {
                this.CurrentCombo = this.ComboManager.GetCombo(this.Level);
                this.Index        = 0;
            }

            string nextLetter = this.CurrentCombo[this.Index].ToString();

            this.Index++;

            Poolable     poolable = this.Pool.Get();
            TrackCommand tc       = poolable.GetComponent <TrackCommand>();

            tc.Reset();
            tc.Init(TypeForLetter(nextLetter));

            if (tc.Type == ControlButtonType.None)
            {
                poolable.Repool();
                return(null);
            }
            return(tc);
        }
Ejemplo n.º 2
0
        public TrackCommand GetRandomCommand()
        {
            Poolable     poolable = this.Pool.Get();
            TrackCommand tc       = poolable.GetComponent <TrackCommand>();

            tc.Reset();
            tc.Init((ControlButtonType)Random.Range(0, 26));
            return(tc);
        }