void Start() { slidingContainer = GetComponent <SlidingContainer>(); HiddenCreatureOpacitySlider.onValueChanged.AddListener(delegate(float value) { Delegate.HiddenCreatureOpacityDidChange(this, value); Refresh(); }); ShowMuscleContractionToggle.onValueChanged.AddListener(delegate(bool value) { Delegate.ShowMuscleContractionDidChange(this, value); Refresh(); }); ShowMusclesToggle.onValueChanged.AddListener(delegate(bool value) { Delegate.ShowMusclesDidChange(this, value); Refresh(); }); slideInOutButton.onClick.AddListener(delegate() { // Slide the container in and out. if (slidingContainer.LastSlideDirection == SlidingContainer.Direction.Up) { slidingContainer.Slide(SlidingContainer.Direction.Down, Constants.slidingDuration, false); } else { slidingContainer.Slide(SlidingContainer.Direction.Up, Constants.slidingDuration, false); } RefreshEjectImages(); }); // Immediately hide the menu at first slidingContainer.Slide(SlidingContainer.Direction.Up, 0f); }
private void SetOpen() { DoubleAnimation openAnimation = new DoubleAnimation(50.0, new Duration(new TimeSpan(0, 0, 0, 0, 500))); openAnimation.EasingFunction = new BackEase(); SlidingContainer.BeginAnimation(Canvas.RightProperty, openAnimation); }
private void SetClosed() { DoubleAnimation closeAnimation = new DoubleAnimation(-520.0, new Duration(new TimeSpan(0, 0, 0, 0, 250))); SlidingContainer.BeginAnimation(Canvas.RightProperty, closeAnimation); }
void Start() { this.menu = FindObjectOfType <SlidingContainer>(); }