Ejemplo n.º 1
0
        public override bool TryGetNext(out DialogueItem item)
        {
            item = new DialogueItem();
            switch (this.items.Length)
            {
            case 0:
                this.lastIndex = -1;
                return(false);

            case 1:
                if (this.lastIndex == -1)
                {
                    this.SetText(ref item, 0);
                    return(true);
                }

                this.lastIndex = -1;
                return(false);

            default:
                int index = this.lastIndex;

                do
                {
                    index = Random.Range(0, this.items.Length);
                } while (index == this.lastIndex);

                this.SetText(ref item, index);
                return(true);
            }
        }
Ejemplo n.º 2
0
        public override bool TryGetNext(out DialogueItem item)
        {
            if (this.lastIndex < this.items.Length - 1)
            {
                item = this.items[++this.lastIndex];
                return(true);
            }

            item = new DialogueItem();
            return(false);
        }
Ejemplo n.º 3
0
 private void SetText(ref DialogueItem item, int index)
 {
     item           = this.items[index];
     this.lastIndex = index;
 }
Ejemplo n.º 4
0
 public abstract bool TryGetNext(out DialogueItem text);