Пример #1
0
        public override void Update()
        {
            if (modifier_ == null)
            {
                return;
            }

            state_.Text = "State: " + StateToString(modifier_.State);

            var clip = modifier_.CurrentClip;

            if (clip == null)
            {
                clip_.Text = "modifier: (nothing playing)";
            }
            else
            {
                clip_.Text = "modifier: " + clip.displayName;
            }


            var source = modifier_.Source?.audioSource;
            var sclip  = modifier_.Source?.playingClip;
            var uclip  = source?.clip;

            if (source == null)
            {
                sourceClip_.Text = "(no source)";
                seek_.Set(0, 0, 0);
                seek_.Enabled = false;
            }
            else if (uclip == null)
            {
                sourceClip_.Text = "source: (no clip)";
                seek_.Set(0, 0, 0);
                seek_.Enabled = false;
            }
            else
            {
                if (sclip != null)
                {
                    sourceClip_.Text = "source: " + sclip.displayName;
                }
                else
                {
                    sourceClip_.Text = "source: " + uclip.name;
                }

                seek_.Set(0, uclip.length, source.time);
            }

            if (delay_ != null)
            {
                delay_.Update();
            }

            UpdatePauseToggle();
        }
Пример #2
0
        public void Update(Movement mv)
        {
            magnitude_.Set(mv.AvailableRange, mv.Magnitude);

            target_.Value = mv.Target;
            min_.SetValue(mv.Minimum);
            max_.SetValue(mv.Maximum);
        }
Пример #3
0
        public override void Update()
        {
            if (duration_ == null)
            {
                start_.Value    = 0;
                end_.Value      = 0;
                timeUp_.Value   = 0;
                timeDown_.Value = 0;
                hold_.Value     = 0;

                firstHalfProgress_.Value   = 0;
                secondHalfProgress_.Value  = 0;
                inFirstHalf_.Value         = false;
                totalProgress_.Value       = 0;
                inFirstHalfTotal_.Value    = false;
                firstHalfFinished_.Value   = false;
                finished_.Value            = false;
                timeRemaining_.Value       = 0;
                timeRemainingInHalf_.Value = 0;

                current_.Value         = 0;
                elapsed_.Value         = 0;
                totalElapsed_.Value    = 0;
                progress_.Value        = 0;
                holdingProgress_.Value = 0;
                holdingElapsed_.Value  = 0;
            }
            else
            {
                start_.Value    = duration_.Range.Minimum;
                end_.Value      = duration_.Range.Maximum;
                timeUp_.Value   = duration_.TimeUp;
                timeDown_.Value = duration_.TimeDown;
                hold_.Value     = duration_.Hold;

                firstHalfProgress_.Value   = duration_.FirstHalfProgress;
                secondHalfProgress_.Value  = duration_.SecondHalfProgress;
                inFirstHalf_.Value         = duration_.InFirstHalf;
                totalProgress_.Value       = duration_.TotalProgress;
                inFirstHalfTotal_.Value    = duration_.InFirstHalfTotal;
                firstHalfFinished_.Value   = duration_.FirstHalfFinished;
                finished_.Value            = duration_.Finished;
                timeRemaining_.Value       = duration_.TimeRemaining;
                timeRemainingInHalf_.Value = duration_.TimeRemainingInHalf;

                current_.Value      = duration_.Current;
                elapsed_.Value      = duration_.Elapsed;
                totalElapsed_.Value = duration_.TotalElapsed;
                progress_.Value     = duration_.Progress;
                holdingProgress_.Set(0, duration_.Hold, duration_.HoldingElapsed);
                holdingElapsed_.Value = duration_.HoldingElapsed;
            }
        }
Пример #4
0
        public override void Update()
        {
            base.Update();

            var p = parameter_?.Parameter;

            if (p == null)
            {
                paramValue_.Value = 0;
            }
            else
            {
                paramValue_.Set(p.min, p.max, p.val);
            }
        }
Пример #5
0
 public void Update(Overlapper o)
 {
     if (o == null)
     {
         osActive_.Text       = "Overlap: n/a";
         osOverlap_.Text      = "Overlap: n/a";
         timeRemaining_.Value = 0;
         overlapTime_.Value   = 0;
     }
     else
     {
         osActive_.Text       = "Active: " + o.ActiveTick.ToString();
         osOverlap_.Text      = "Overlap: " + o.OverlapTick.ToString();
         timeRemaining_.Value = o.TimeRemainingForCurrent;
         overlapTime_.Set(
             0,
             Math.Max(overlapTime_.Range.Maximum, timeRemaining_.Value),
             o.OverlapTime);
     }
 }
Пример #6
0
        public override void SetValue(
            BasicRandomizableValue <float, FloatParameter> value)
        {
            base.SetValue(value);

            if (value == null)
            {
                return;
            }

            if (value.ActualInterval == 0)
            {
                // always
                progress_.Value = 1;
                progress_.Range = new FloatRange(0, 1);
            }
            else
            {
                progress_.Set(0, value.Current, value.Elapsed);
            }
        }