コード例 #1
0
ファイル: ClockAnimator.cs プロジェクト: NUVR/Magic-Mover
 public void SetElapsedTime(float time)
 {
     if (timeElapsed == 0f)
     {
         GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 0.8f);
         isAnimating = true;
         AnimationStarted?.Invoke(new AnimationStartedArgs(duration, frames.Length));
     }
     timeElapsed = time;
     CheckFrame();
 }
コード例 #2
0
ファイル: AndroidGIFImageParser.cs プロジェクト: sung-su/maui
        public override void Start()
        {
            _repeatCounter = 0;
            _frameCount    = NumberOfFrames;
            _finished      = false;

            base.OneShot = RepeatCount == 1;

            base.Start();

            _isRunning = true;
            AnimationStarted?.Invoke(this, null);
        }
コード例 #3
0
    // starts rotation sequence, called with direction from playerinput
    public void StartRotation(Vector3 direction)
    {
        if (rotationDirection == Vector3.zero && MenuOpen == true)
        {
            // sends action to coordinate cursor
            AnimationStarted?.Invoke();

            rotationDirection = direction;
            timer             = rotationTime;

            if (openAudio.isPlaying == false)
            {
                rotateAudio.Play();
            }
        }
    }
コード例 #4
0
        public override void Start()
        {
            _repeatCounter = 0;
            _frameCount    = NumberOfFrames;
            _finished      = false;

            base.OneShot = RepeatCount == 1;

            base.Start();

            if (!System.Maui.Maui.IsLollipopOrNewer)
            {
                base.SetVisible(true, true);
            }

            _isRunning = true;
            AnimationStarted?.Invoke(this, null);
        }
コード例 #5
0
ファイル: Animator.cs プロジェクト: JoNMii/Pokemon3D
 /// <summary>
 /// Sets current animation and starts it.
 /// </summary>
 /// <param name="name">Name of animation</param>
 /// <param name="playReversed">Plays the animation backwards.</param>
 public void SetAnimation(string name, bool playReversed = false)
 {
     if (_currentAnimationName == name && CurrentAnimation != null)
     {
         if (CurrentAnimation.PlayReversed == playReversed)
         {
             return;
         }
         CurrentAnimation.Start(playReversed);
     }
     else
     {
         _currentAnimationName = name;
         CurrentAnimation      = _animations[name];
         CurrentAnimation.Start(playReversed);
         AnimationStarted?.Invoke(name);
     }
 }
コード例 #6
0
    // activates subscreens on open and starts their closing animation on close
    void MenuControl()
    {
        if (MenuOpen == false)
        {
            // opens menu and plays audio
            MenuOpen = true;
            OpenAnimationStarted?.Invoke();
            openAudio.Play();

            // sets new starting position and rotates to the right on open
            startPosition = transform.eulerAngles.y - 90;
            transform.Rotate(0, -90, 0);
            StartRotation(Vector3.up);

            // sets each subscreen to active and enables scripts to play flip animation
            foreach (GameObject screen in subscreens)
            {
                screen.SetActive(true);
                SubscreenAnimation animationScript = screen.GetComponent <SubscreenAnimation>();
                animationScript.enabled = true;
            }
        }

        else if (MenuOpen == true)
        {
            // sends action for closing, but there's no close loop
            CloseAnimationStarted?.Invoke();
            AnimationStarted?.Invoke();
            closeAudio.Play();

            // activates close menu function in each subscreen
            foreach (GameObject screen in subscreens)
            {
                SubscreenAnimation animationScript = screen.GetComponent <SubscreenAnimation>();
                animationScript?.CloseMenuFlip();
            }

            // sets bool to false after to coordinate some rotation actions
            MenuOpen = false;
        }
    }
コード例 #7
0
 protected virtual void OnAnimationStarted()
 {
     AnimationStarted?.Invoke(this, new AnimationStartedEventArgs(AnimationSource));
 }
コード例 #8
0
 /// <summary>
 /// Called when animation started.
 /// </summary>
 void _viewFieldAnimator_Started(ViewFieldAnimator viewFieldAnimator)
 {
     AnimationStarted.Trigger();
 }
コード例 #9
0
 /// <summary>
 /// Starts the animation.
 /// </summary>
 public override void StartAnimation()
 {
     this.ForEachChild <ViewAnimation>(x => x.StartAnimation(), false);
     AnimationStarted.Trigger();
 }