private IEnumerator ExecuteCast()
        {
            RemotePlayerVisibilityState.HideRemotePlayers();
            sendCameraEvent(cinematicCameraFishingController);
            cinematicCameraFishingController.transform.position = player.transform.position;
            playerAnimator.SetInteger("PropMode", 3);
            fishingRodAnimator.SetInteger("PropMode", 3);
            yield return(new WaitForEndOfFrame());

            float castingAnimationTime = playerAnimator.GetCurrentAnimatorClipInfo(1)[0].clip.length;

            yield return(new WaitForSeconds(castingAnimationTime));

            setupStartingAnimatorValues();
            SetBobberHierarchy(doSet: true);
            rootTransform.localPosition = config.BobberLocationInWater;
            Vector3 hookPosition = GetFishPosition(currentPatternConfig.hookInterp);

            SetBobberPosition(hookPosition);
            _bobberAnimator.Play(ANIM_DROP);
            yield return(new WaitForEndOfFrame());

            float bobberDropAnimationLength = _bobberAnimator.GetCurrentAnimatorStateInfo(0).length;

            yield return(new WaitForSeconds(bobberDropAnimationLength * dropSplashFactor));

            fxSmallSplash.Play();
            yield return(new WaitForSeconds(bobberDropAnimationLength * (1f - dropSplashFactor)));

            _isCast = true;
            StartGameplay();
        }
Beispiel #2
0
 public override void OnEnter()
 {
     dispatcher = Service.Get <EventDispatcher>();
     if (SuppressQuestNotifier)
     {
         dispatcher.DispatchEvent(new HudEvents.SuppressQuestNotifier(suppress: true, autoShow: true));
     }
     if (RemoveControls)
     {
         GameObject gameObject = GameObject.FindWithTag(UIConstants.Tags.UI_Tray_Root);
         if (gameObject != null)
         {
             StateMachineContext component = gameObject.GetComponent <StateMachineContext>();
             component.SendEvent(new ExternalEvent("Root", "minnpc"), checkDependencies: true);
         }
         Service.Get <EventDispatcher>().DispatchEvent(new UIDisablerEvents.DisableUIElementGroup("MainNavButtons"));
         Service.Get <EventDispatcher>().DispatchEvent(new UIDisablerEvents.DisableUIElement("ChatButtons"));
     }
     if (HideRemotePlayers)
     {
         RemotePlayerVisibilityState.HideRemotePlayers();
     }
     if (HideLocalPlayer)
     {
         Camera.main.cullingMask &= ~(1 << LayerMask.NameToLayer("LocalPlayer"));
     }
     if (HideInWorldText)
     {
         dispatcher.DispatchEvent(default(InWorldUIEvents.DisableInWorldText));
     }
     if (DisablePlayerCard)
     {
         dispatcher.DispatchEvent(new PlayerCardEvents.SetEnablePlayerCard(enable: false));
     }
     if (HideActionIndicators)
     {
         dispatcher.DispatchEvent(default(InWorldUIEvents.DisableActionIndicators));
     }
     Finish();
 }
Beispiel #3
0
 private void deactivateQuest(Quest.QuestState state, bool doCleanup = true)
 {
     if (ActiveQuest != null)
     {
         trace("Deactivating quest {0} with state {1}", ActiveQuest.Id, state);
         ActiveQuest.Deactivate(state);
         if (state == Quest.QuestState.Suspended)
         {
             Mascot mascot = questToMascotMap[ActiveQuest.Id];
             mascot.ResumableQuests.Add(ActiveQuest);
         }
         ActiveQuest = null;
         Service.Get <ZonePathing>().ClearWaypoint();
     }
     Service.Get <TutorialBreadcrumbController>().RemoveAllBreadcrumbs();
     if (doCleanup)
     {
         dispatcher.DispatchEvent(default(HudEvents.ResetQuestNotifier));
         RemotePlayerVisibilityState.ShowRemotePlayers();
     }
     Service.Get <EventDispatcher>().DispatchEvent(default(CinematographyEvents.ClearGroupCullingOverride));
     setPlayerOutOfWorld(isOutOfWorld: false);
 }
 private void finishMinigame()
 {
     if (fishingRod != null)
     {
         SetBobberHierarchy(doSet: false);
         fishingRodAnimator.enabled = true;
     }
     RemotePlayerVisibilityState.ShowRemotePlayers();
     resetCameraToPenguin();
     resetAnimators();
     if (fishingRod != null)
     {
         PropCancel component = fishingRod.GetComponent <PropCancel>();
         if (component != null)
         {
             component.enabled = true;
         }
     }
     eventDispatcher.DispatchEvent(new ControlsScreenEvents.SetButton(fishingRodContentKey, 0));
     eventDispatcher.DispatchEvent(new PlayerCardEvents.SetEnablePlayerCard(enable: true));
     eventDispatcher.DispatchEvent(new UIDisablerEvents.EnableUIElementGroup("MainNavButtons"));
     eventDispatcher.DispatchEvent(new UIDisablerEvents.EnableUIElement("ChatButtons"));
     userControl.enabled = true;
     eventDispatcher.DispatchEvent(new UIDisablerEvents.EnableUIElement("Joystick"));
     locomotionBroadcaster.BroadcastOnControlsUnLocked();
     eventDispatcher.DispatchEvent(default(FishingEvents.FishingGameComplete));
     eventDispatcher.DispatchEvent(default(HudEvents.UnsuppressCoinDisplay));
     CoroutineRunner.StopAllForOwner(this);
     removeLoadedAssets();
     Service.Get <ICPSwrveService>().EndTimer("fishing_time");
     UnityEngine.Object.Destroy(base.gameObject);
     if (fishingRod != null)
     {
         Service.Get <PropService>().LocalPlayerRetrieveProp("FishingRod");
     }
 }
 public override void OnEnter()
 {
     RemotePlayerVisibilityState.ShowRemotePlayers();
     Finish();
 }
Beispiel #6
0
 private void showRemotePlayers()
 {
     RemotePlayerVisibilityState.ShowRemotePlayers();
 }
Beispiel #7
0
 private void hideRemotePlayers()
 {
     RemotePlayerVisibilityState.HideRemotePlayers();
 }