Esempio n. 1
0
        public EyesTargetContainer GetTarget(int orderIndex)
        {
            if (orderIndex < 0 || orderIndex >= order_.Count)
            {
                return(null);
            }

            var i = order_.Get(orderIndex);

            if (i < 0 || i >= targets_.Count)
            {
                return(null);
            }

            return(targets_[i]);
        }
Esempio n. 2
0
        protected override void DoTick(
            float deltaTime, float progress, bool firstHalf)
        {
            if (inDelay_)
            {
                Delay.Tick(deltaTime);

                if (Delay.Finished)
                {
                    inDelay_ = false;
                    Delay.Reset();
                }

                return;
            }


            base.DoTick(deltaTime, progress, firstHalf);

            if (source_ == null)
            {
                state_ = NoSourceState;
                return;
            }

            if (currentClip_ != null)
            {
                if (source_.audioSource.isPlaying || source_.audioSource.time > 0)
                {
                    state_ = PlayingState;
                    return;
                }
            }

            if (clips_.Count == 0)
            {
                state_ = NoClipsState;
                return;
            }

            if (newClip_)
            {
                state_ = PlayingState;
                return;
            }

            if (needsDelay_)
            {
                needsDelay_ = false;
                inDelay_    = true;
                state_      = InDelayState;
                return;
            }

            ++currentIndex_;
            if (currentIndex_ >= clipOrder_.Count)
            {
                Reshuffle();
            }

            currentClip_ = clips_[clipOrder_.Get(currentIndex_)];
            newClip_     = true;
            needsDelay_  = true;

            state_ = PlayingState;
        }