예제 #1
0
        private void onPromptButtonPressed(DPrompt.ButtonFlags pressed)
        {
            if (pressed != DPrompt.ButtonFlags.YES)
            {
                return;
            }
            LocomotionController currentController = LocomotionHelper.GetCurrentController(base.gameObject);

            if (currentController is SitController)
            {
                LocomotionHelper.SetCurrentController <SwimController>(base.gameObject);
            }
            bubbleState = BubbleState.TransitionToHidden;
            playAudioEvent(mutableData.AirCriticalAudioEvent, EventAction.StopSound);
            GameObject gameObject = GameObject.FindWithTag(UIConstants.Tags.UI_Tray_Root);

            if (gameObject != null)
            {
                StateMachineContext component = gameObject.GetComponent <StateMachineContext>();
                if (component != null)
                {
                    component.SendEvent(new ExternalEvent("Root", "noUI"));
                }
            }
            Invoke("startBubbleScreenWipe", 0.7f);
            swimController.ResurfaceAccepted();
            dispatcher.DispatchEvent(default(DivingEvents.PlayerResurfaced));
        }
예제 #2
0
 protected override void Update()
 {
     if (!LocomotionHelper.SetCurrentController <ZiplineController>(GetTarget()))
     {
         Log.LogError(this, "Failed to set the ZiplineController");
     }
     Completed();
 }
    public override void OnEnter()
    {
        GameObject gameObject = GameObject.Find(Target.Value);

        if (gameObject != null)
        {
            LocomotionHelper.SetCurrentController <RunController>(gameObject);
        }
        Finish();
    }
예제 #4
0
    private IEnumerator setSlideLocomotion(float waitTime, GameObject penguinObj)
    {
        yield return(new WaitForSeconds(waitTime));

        if (!LocomotionHelper.IsCurrentControllerOfType <SlideController>(penguinObj))
        {
            if (!LocomotionHelper.SetCurrentController <SlideController>(penguinObj))
            {
                Log.LogErrorFormatted(this, "Failed to set the SlideController on {0}", penguinObj.GetPath());
            }
            CoroutineRunner.Start(toggleWaterTrigger(2f), this, "toggleWaterCollider");
        }
    }
예제 #5
0
 private void handleLocalPlayerLeftLobby()
 {
     isLocalPlayerInLobby = false;
     Service.Get <EventDispatcher>().DispatchEvent(default(TubeRaceEvents.LocalPlayerLeftLobby));
     moveLocalPlayerToPosition(LobbyExitPosition.position);
     LocomotionHelper.SetCurrentController <RunController>(SceneRefs.ZoneLocalPlayerManager.LocalPlayerGameObject);
     Service.Get <EventDispatcher>().DispatchEvent(new UIDisablerEvents.EnableUIElement("ControlsButton2"));
     Service.Get <EventDispatcher>().DispatchEvent(new UIDisablerEvents.EnableUIElement("ActionButton"));
     PartyGameUtils.EnableMainNavigation();
     PartyGameUtils.EnableCellPhoneButton();
     Service.Get <EventDispatcher>().DispatchEvent(new PlayerCardEvents.SetEnablePlayerCard(enable: true));
     Service.Get <QuestService>().SendEvent($"Cancel{RaceDefinition.QuestEventIdentifier}Race");
 }
        public override void OnEnter()
        {
            GameObject localPlayerGameObject = SceneRefs.ZoneLocalPlayerManager.LocalPlayerGameObject;

            if (localPlayerGameObject != null)
            {
                LocomotionHelper.SetCurrentController <RunController>(localPlayerGameObject);
                CharacterController component = localPlayerGameObject.GetComponent <CharacterController>();
                if (component != null)
                {
                    component.enabled = true;
                }
            }
            Finish();
        }
예제 #7
0
 private void handleLocalPlayerJoinedLobby()
 {
     isLocalPlayerInLobby = true;
     Service.Get <EventDispatcher>().DispatchEvent(default(TubeRaceEvents.LocalPlayerJoinedLobby));
     moveLocalPlayerToPosition(LobbyPosition.position);
     LocomotionHelper.SetCurrentController <SlideController>(SceneRefs.ZoneLocalPlayerManager.LocalPlayerGameObject);
     Service.Get <EventDispatcher>().DispatchEvent(new UIDisablerEvents.DisableUIElement("ControlsButton2"));
     Service.Get <EventDispatcher>().DispatchEvent(new UIDisablerEvents.DisableUIElement("ActionButton"));
     PartyGameUtils.DisableMainNavigation();
     PartyGameUtils.DisableCellPhoneButton(hide: true);
     Service.Get <EventDispatcher>().DispatchEvent(new PlayerCardEvents.SetEnablePlayerCard(enable: false));
     Service.Get <EventDispatcher>().DispatchEvent(default(PlayerCardEvents.DismissPlayerCard));
     Service.Get <QuestService>().SendEvent($"Join{RaceDefinition.QuestEventIdentifier}Race");
     Service.Get <ICPSwrveService>().Action("tube_race", "lobby");
 }
예제 #8
0
    protected override void Update()
    {
        ChairProperties component = SceneRefs.ActionSequencer.GetTrigger(GetTarget()).GetComponent <ChairProperties>();

        if (component != null)
        {
            LocomotionHelper.SetCurrentController <SitController>(GetTarget());
            LocomotionController currentController = LocomotionHelper.GetCurrentController(GetTarget());
            if (currentController is SitController)
            {
                SitController sitController = (SitController)currentController;
                sitController.SetChair(component);
            }
        }
        Completed();
    }
예제 #9
0
 public void OnTriggerEnter(Collider col)
 {
     if (!(col != null) || !col.CompareTag(Tag) || !(col.gameObject != null) || (IsMemberOnly && !Service.Get <CPDataEntityCollection>().IsLocalPlayerMember()))
     {
         return;
     }
     if (Action == ActionType.StartingLine)
     {
         RaceController component = col.gameObject.GetComponent <RaceController>();
         if ((object)component != null)
         {
             component.SetInitialTrackDir(base.transform.forward);
             hasPopupOpened = false;
         }
     }
     else if (Action == ActionType.FinishLine)
     {
         if (LocomotionHelper.IsCurrentControllerOfType <RaceController>(col.gameObject))
         {
             RaceGameController raceGameController = col.gameObject.GetComponent <RaceGameController>();
             if (raceGameController == null)
             {
                 raceGameController = col.gameObject.AddComponent <RaceGameController>();
             }
             raceGameController.FinishRace();
         }
     }
     else if (Action == ActionType.EndOfTrack && LocomotionHelper.IsCurrentControllerOfType <RaceController>(col.gameObject))
     {
         RaceController component = col.gameObject.GetComponent <RaceController>();
         if (component != null)
         {
             component.setControlsEnabled(enabled: true);
         }
         LocomotionHelper.SetCurrentController <RunController>(col.gameObject);
         RaceGameController raceGameController = col.gameObject.GetComponent <RaceGameController>();
         if (raceGameController != null)
         {
             raceGameController.RemoveLocalPlayerRaceData();
             Object.Destroy(raceGameController);
         }
         if (!hasPopupOpened)
         {
             Service.Get <QuestService>().SendEvent("FinishredRace");
         }
     }
 }
        protected override void Update()
        {
            GameObject target = GetTarget();

            if (target == SceneRefs.ZoneLocalPlayerManager.LocalPlayerGameObject && !LocomotionHelper.IsCurrentControllerOfType <RaceController>(target))
            {
                LocomotionHelper.SetCurrentController <RaceController>(target);
                LocomotionController currentController = LocomotionHelper.GetCurrentController(target);
                if (currentController is RaceController)
                {
                    RaceGameController raceGameController = target.GetComponent <RaceGameController>();
                    if (raceGameController == null)
                    {
                        raceGameController = target.AddComponent <RaceGameController>();
                    }
                    ((RaceController)currentController).InitializeRace(raceGameController);
                    raceGameController.InitializeRace(RaceGate, Lite1a, Lite2a, Lite3a, Lite1b, Lite2b, Lite3b, SilverTimeMS, GoldTimeMS, LegendaryTimeMS, TrackId);
                }
            }
            Completed();
        }
        public override void OnEnter()
        {
            GameObject localPlayerGameObject = SceneRefs.ZoneLocalPlayerManager.LocalPlayerGameObject;

            if (localPlayerGameObject != null && LocomotionHelper.SetCurrentController <ScriptedController>(localPlayerGameObject))
            {
                if (!string.IsNullOrEmpty(AnimStateName))
                {
                    ScriptedController component = localPlayerGameObject.GetComponent <ScriptedController>();
                    if (component != null)
                    {
                        component.PlayAnim(AnimStateName, LayerIndex);
                    }
                }
                CharacterController component2 = localPlayerGameObject.GetComponent <CharacterController>();
                if (component2 != null)
                {
                    component2.enabled = EnableCharacterController;
                }
            }
            Finish();
        }
예제 #12
0
        protected override void Update()
        {
            GameObject target = GetTarget();

            if (target != null)
            {
                Vector3 vector = base.transform.forward;
                if (IncomingUserData != null && IncomingUserData.GetType() == typeof(Vector3))
                {
                    vector = ((Vector3)IncomingUserData).normalized;
                }
                else if (DirectionY != null)
                {
                    vector = DirectionY.up;
                }
                else if (DirectionZ != null)
                {
                    vector = DirectionZ.forward;
                }
                else if (DirectionTo != null)
                {
                    vector = (DirectionTo.position - target.transform.position).normalized;
                }
                else if (Direction != Vector3.zero)
                {
                    vector = Direction;
                }
                Vector3   vector2   = vector * Magnitude + AddDirection * AddMagnitude;
                bool      flag      = LocomotionHelper.IsCurrentControllerOfType <SlideController>(target);
                Rigidbody component = target.GetComponent <Rigidbody>();
                if (!flag && component != null)
                {
                    if (StartTransform != null)
                    {
                        component.transform.position = StartTransform.position;
                        component.transform.rotation = StartTransform.rotation;
                        component.velocity           = Vector3.zero;
                        component.angularVelocity    = Vector3.zero;
                        component.WakeUp();
                    }
                    component.AddForce(vector2, ForceMode.VelocityChange);
                }
                else
                {
                    if (SetRunLocomotion && (!PreserveTubing || !flag))
                    {
                        LocomotionHelper.SetCurrentController <RunController>(target);
                        flag = false;
                    }
                    if (!flag && StartTransform != null)
                    {
                        target.transform.position = StartTransform.position;
                        target.transform.rotation = StartTransform.rotation;
                    }
                    LocomotionController currentController = LocomotionHelper.GetCurrentController(target);
                    if (currentController != null)
                    {
                        if (currentController is RunController)
                        {
                            ((RunController)currentController).ClearAllVelocityInputs();
                        }
                        currentController.SetForce(vector2, base.gameObject);
                    }
                }
            }
            Completed();
        }
 protected override void Update()
 {
     LocomotionHelper.SetCurrentController <SwimController>(GetTarget());
     Completed();
 }