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); }
public TrackCommand GetRandomCommand() { Poolable poolable = this.Pool.Get(); TrackCommand tc = poolable.GetComponent <TrackCommand>(); tc.Reset(); tc.Init((ControlButtonType)Random.Range(0, 26)); return(tc); }