コード例 #1
0
 /// <summary>
 /// Hide the fish quickly for a new cast.
 /// </summary>
 private void OnActionChanged(object stateObj, FishingActionEventArgs e)
 {
     if (e.Action == FishingAction.Swing)
     {
         CancelAnimation();
     }
 }
コード例 #2
0
ファイル: GameGuide.cs プロジェクト: errcw/fishing-girl
        /// <summary>
        /// Displays appropriate help based on the current action.
        /// </summary>
        private void OnActionChanged(object stateObj, FishingActionEventArgs e)
        {
            FishingState state = (FishingState)stateObj;

            if (_showCastingGuide)
            {
                switch (e.Action)
                {
                case FishingAction.Idle:
                    _text.Show(Resources.GuideCastingStart);
                    break;

                case FishingAction.Swing:
                    _text.Show(Resources.GuideCastingRelease);
                    break;

                case FishingAction.Cast:
                    _text.Hide();
                    break;

                case FishingAction.Reel:
                    _text.Show(Resources.GuideReelIn);
                    _textTimeout      = new DelayAnimation(ReelInGuideTime);
                    _showCastingGuide = false;  // no guide after first successful cast
                    _showChainGuide   = true;   // show how to catch better fish now
                    break;
                }
            }
            if (e.Action != FishingAction.Idle && _showingIdleGuide)
            {
                // message is only valid in idle state
                _text.Hide();
                _showingIdleGuide = false;
            }
        }
コード例 #3
0
 /// <summary>
 /// Checks the action for the lure hitting the water.
 /// </summary>
 private void OnActionChanged(object stateObj, FishingActionEventArgs e)
 {
     if (e.Action == FishingAction.Idle)
     {
         _followLure = false;
     }
     else if (e.Action == FishingAction.Swing)
     {
         ResetForCast();
     }
     else if (e.Action == FishingAction.Cast)
     {
         _followLure = true;
     }
 }
コード例 #4
0
ファイル: FishingView.cs プロジェクト: errcw/fishing-girl
        private void OnActionChanged(object stateObj, FishingActionEventArgs e)
        {
            switch (e.Action)
            {
            case FishingAction.Idle:
                _lureAnimation = new ColorAnimation(_lure, Color.White, 0.5f, InterpolateColor);
                break;

            case FishingAction.Cast:
                _releaseEffect.Play(0.6f, 0f, 0f);
                break;

            case FishingAction.Reel:
                _splashEffect.Play(0.2f, 0f, 0f);
                break;
            }
        }