private IEnumerator SecondChance(Button continueGameButton, TimerSlider timerSlider) { yield return(CallOpenAnimation(continueGameButton.gameObject)); //continueGameButton.gameObject.SetActive(true); timerSlider.gameObject.SetActive(true); yield return(new WaitWhile(() => { return timerSlider.GetComponent <TimerSlider>().IsTimerRunning; })); timerSlider.gameObject.SetActive(false); yield return(CallCloseAnimation(continueGameButton.gameObject)); continueGameButton.gameObject.SetActive(false); }
public MainWindow() { InitializeComponent(); //TimerSlider.DataContext = mMediaPlayer.Position; SoundSlider.DataContext = mMediaPlayer; MuteCheckBox.DataContext = mMediaPlayer; TimerSliderLabel timerSliderLabel = new TimerSliderLabel(); Binding myBindingTimerLabel = new Binding("LabelString"); myBindingTimerLabel.Source = timerSliderLabel; TimerLabel.SetBinding(Label.ContentProperty, myBindingTimerLabel); Binding myBindingTimerSlider = new Binding("SliderDouble"); myBindingTimerSlider.Source = timerSliderLabel; TimerSlider.SetBinding(Slider.ValueProperty, myBindingTimerSlider); ImageBrush imageBrush = new ImageBrush(); imageBrush.ImageSource = new BitmapImage(new Uri("example.jpg", UriKind.Relative)); CoverImage.Fill = imageBrush; transform = new RotateTransform() { CenterX = 0.5, CenterY = 0.5, Angle = 0, }; CoverImage.RenderTransform = transform; animation = new DoubleAnimation() { From = 0, To = 360, Duration = TimeSpan.FromSeconds(10), RepeatBehavior = RepeatBehavior.Forever }; }
//публичные методы для вызова анимации public Coroutine CallSecondChance(Button continueGameButton, TimerSlider timerSlider) { return(StartCoroutine(SecondChance(continueGameButton, timerSlider))); }