public override void AddToTopUI(IModifier m) { base.AddToTopUI(m); modifier_ = m as AudioModifier; if (modifier_ == null) { return; } delayWidgets_.SetValue(modifier_.Delay); clips_.Value = modifier_.Clips; delayCollapsible_.Clear(); delayCollapsible_.Add(delayWidgets_.GetWidgets()); AddAtomWidgets(m); widgets_.AddToUI(playType_); playType_.Value = PlayTypeToString(modifier_.PlayType); delayCollapsible_.AddToUI(); widgets_.AddToUI(new SmallSpacer(Widget.Right)); widgets_.AddToUI(stop_); widgets_.AddToUI(clips_); }
public override IModifier Clone(int cloneFlags = 0) { var m = new AudioModifier(); CopyTo(m, cloneFlags); return(m); }
private void CopyTo(AudioModifier m, int cloneFlags) { base.CopyTo(m, cloneFlags); m.source_ = source_; m.clips_ = new List <NamedAudioClip>(clips_); m.clipOrder_ = clipOrder_.Clone(); m.currentIndex_ = currentIndex_; m.Delay = Delay?.Clone(cloneFlags); }
public override void AddToUI(IModifier m) { modifier_ = m as AudioModifier; if (modifier_ == null) { return; } if (modifier_ != null) { if (delay_ == null || delay_.DurationType != modifier_.Delay.GetFactoryTypeName()) { delay_ = MonitorUI.CreateDurationMonitor( "Delay", modifier_.Delay, Widget.Right); } } else { delay_ = null; } if (delay_ != null) { delay_.AddToUI(modifier_?.Delay); } widgets_.AddToUI(state_); widgets_.AddToUI(clip_); widgets_.AddToUI(sourceClip_); widgets_.AddToUI(seek_); widgets_.AddToUI(pauseToggle_); clip_.Height = 100; sourceClip_.Height = 100; pauseToggle_.BackgroundColor = Color.red; pauseToggle_.TextColor = Color.white; }