Exemple #1
0
        public virtual void OnStart()
        {
            ((Task)this).OnStart();
            this._agent        = this.Agent;
            this._navMeshAgent = this._agent != null ? this._agent.NavMeshAgent : (NavMeshAgent)null;
            this._point        = this._agent != null ? this._agent.TargetStoryPoint : (StoryPoint)null;
            this._missing      = Object.op_Equality((Object)this._agent, (Object)null) || Object.op_Equality((Object)this._navMeshAgent, (Object)null) || Object.op_Equality((Object)this._point, (Object)null);
            if (this._missing)
            {
                return;
            }
            Vector3?nullable1 = new Vector3?(this._point.Position);

            this._agent.DestPosition = nullable1;
            Vector3?nullable2 = nullable1;

            this._agent.ActivateNavMeshAgent();
            this._agent.PlayTutorialDefaultStateAnim();
            this.SetDestinationForce(nullable2.Value);
        }
Exemple #2
0
 public virtual void OnStart()
 {
     ((Task)this).OnStart();
     this._agent = this.Agent;
     this._point = this._agent != null ? this._agent.TargetStoryPoint : (StoryPoint)null;
     this._path  = new NavMeshPath();
     if (this._missing = Object.op_Equality((Object)this._agent, (Object)null) || Object.op_Equality((Object)this._point, (Object)null))
     {
         return;
     }
     NavMesh.CalculatePath(this._agent.Position, this._point.Position, this._agent.NavMeshAgent.get_areaMask(), this._path);
     if (this._missing = this._path.get_status() != 0)
     {
         return;
     }
     this._targetPoint = this._path.get_corners().GetElement <Vector3>(1);
     this._agent.Animation.PlayTurnAnimation(this._targetPoint, 1f, Singleton <Resources> .Instance.DefinePack.AnimatorState.IdleStateInfo, false);
     this._agent.TutorialLocomoCaseID = 100;
     this._changeTime = Singleton <Resources> .Instance.CommonDefine.Tutorial.WalkToRunTime;
 }
Exemple #3
0
        public virtual TaskStatus OnUpdate()
        {
            StoryPoint storyPoint = (StoryPoint)null;

            if (Singleton <Manager.Map> .IsInstance())
            {
                PointManager pointAgent = Singleton <Manager.Map> .Instance.PointAgent;
                if (Object.op_Equality((Object)pointAgent, (Object)null))
                {
                    return((TaskStatus)1);
                }
                Dictionary <int, StoryPoint> storyPointTable = pointAgent.StoryPointTable;
                if (storyPointTable.IsNullOrEmpty <int, StoryPoint>())
                {
                    return((TaskStatus)1);
                }
                storyPointTable.TryGetValue(this._pointID, out storyPoint);
            }
            this.Agent.TargetStoryPoint = storyPoint;
            return(Object.op_Equality((Object)storyPoint, (Object)null) ? (TaskStatus)1 : (TaskStatus)2);
        }
 public virtual void OnStart()
 {
     ((Task)this).OnStart();
     this._agent                 = this.Agent;
     this._animation             = this._agent.Animation;
     this._navMeshAgent          = this._agent.NavMeshAgent;
     this._point                 = this.Agent.TargetStoryPoint;
     this._loopStateName         = string.Empty;
     this._agent.TutorialCanTalk = false;
     if (this._missing = Object.op_Equality((Object)this._agent, (Object)null) || Object.op_Equality((Object)this._animation, (Object)null) || Object.op_Equality((Object)this._navMeshAgent, (Object)null) || Object.op_Equality((Object)this._point, (Object)null))
     {
         return;
     }
     if (this._adjustAngle)
     {
         this.PlayTurnAnimation();
     }
     else
     {
         this.PlayIdleAnimation();
     }
     this._agent.DeactivateNavMeshAgent();
 }
Exemple #5
0
 private void StartMerchantStory0()
 {
     if (!Singleton <Manager.Map> .IsInstance())
     {
         return;
     }
     Manager.Map instance = Singleton <Manager.Map> .Instance;
     this.openData.FindLoad("0", -90, 1);
     this.packData = new CheckEventPointArea.PackData();
     this.packData.Init();
     this.packData.SetParam((IParams)instance.Merchant.MerchantData, (IParams)instance.Player.PlayerData);
     this.packData.onComplete = (System.Action)(() =>
     {
         this.EndMerchantStory0();
         this.packData.Release();
         this.packData = (CheckEventPointArea.PackData)null;
     });
     instance.Player.PlayerController.ChangeState("Idle");
     instance.Merchant.ChangeBehavior(Merchant.ActionType.TalkWithPlayer);
     MapUIContainer.SetVisibleHUD(false);
     ObservableExtensions.Subscribe <Unit>((IObservable <M0>)MapUIContainer.FadeCanvas.StartFade(FadeCanvas.PanelType.Blackout, (global::FadeType)0, 2f, true), (System.Action <M0>)(_ => {}), (System.Action)(() =>
     {
         if (!Singleton <Manager.Map> .IsInstance())
         {
             return;
         }
         MapUIContainer.SetVisibleHUD(false);
         PlayerActor player     = Singleton <Manager.Map> .Instance.Player;
         MerchantActor merchant = Singleton <Manager.Map> .Instance.Merchant;
         StoryPoint storyPoint  = Manager.Map.GetStoryPoint(3);
         Transform transform1   = !Object.op_Inequality((Object)storyPoint, (Object)null) ? (Transform)null : ((Component)storyPoint).get_transform();
         if (Object.op_Inequality((Object)transform1, (Object)null))
         {
             GameObject loop = transform1.FindLoop("player_point");
             if (Object.op_Inequality((Object)loop, (Object)null))
             {
                 transform1 = loop.get_transform();
             }
         }
         if (Object.op_Equality((Object)transform1, (Object)null))
         {
             transform1 = Singleton <Manager.Map> .Instance.PlayerStartPoint;
         }
         Transform transform2 = transform1;
         if (Object.op_Inequality((Object)transform2, (Object)null))
         {
             if (((Behaviour)player.NavMeshAgent).get_enabled())
             {
                 player.NavMeshAgent.Warp(transform2.get_position());
             }
             else
             {
                 player.Position = transform2.get_position();
             }
             player.Rotation = transform2.get_rotation();
         }
         AgentActor tutorialAgent = Singleton <Manager.Map> .Instance.TutorialAgent;
         if (Object.op_Inequality((Object)tutorialAgent, (Object)null))
         {
             if (((Behaviour)tutorialAgent.NavMeshAgent).get_enabled())
             {
                 tutorialAgent.NavMeshAgent.Warp(storyPoint.Position);
             }
             else
             {
                 tutorialAgent.Position = storyPoint.Position;
             }
             tutorialAgent.Rotation = storyPoint.Rotation;
             if (tutorialAgent.TutorialType != AIProject.Definitions.Tutorial.ActionType.WaitAtAgit)
             {
                 tutorialAgent.TargetStoryPoint = storyPoint;
                 tutorialAgent.ChangeTutorialBehavior(AIProject.Definitions.Tutorial.ActionType.WaitAtAgit);
             }
         }
         Transform transform3 = ((Component)merchant.Locomotor).get_transform();
         transform3.LookAt(player.Position);
         Vector3 eulerAngles = transform3.get_eulerAngles();
         eulerAngles.x       = (__Null)(double)(eulerAngles.z = (__Null)0.0f);
         transform3.set_eulerAngles(eulerAngles);
         player.CommCompanion = (Actor)merchant;
         player.PlayerController.ChangeState("Communication");
         if (player.CameraControl.ShotType == ShotType.PointOfView)
         {
             ActorCameraControl cameraControl = player.CameraControl;
             Quaternion rotation = player.Rotation;
             // ISSUE: variable of the null type
             __Null y = ((Quaternion) ref rotation).get_eulerAngles().y;
             cameraControl.XAxisValue        = (float)y;
             player.CameraControl.YAxisValue = 0.5f;
         }
         else
         {
             ActorCameraControl cameraControl = player.CameraControl;
             Quaternion rotation             = player.Rotation;
             double num                      = ((Quaternion) ref rotation).get_eulerAngles().y - 30.0;
             cameraControl.XAxisValue        = (float)num;
             player.CameraControl.YAxisValue = 0.6f;
         }
         // ISSUE: cast to a reference type
         // ISSUE: explicit reference operation
         CinemachineBlendDefinition.Style prevStyle = (CinemachineBlendDefinition.Style)(^ (CinemachineBlendDefinition&)ref player.CameraControl.CinemachineBrain.m_DefaultBlend).m_Style;
         // ISSUE: cast to a reference type
         // ISSUE: explicit reference operation
         (^ (CinemachineBlendDefinition&)ref player.CameraControl.CinemachineBrain.m_DefaultBlend).m_Style = (__Null)0;
         Manager.ADV.ChangeADVCamera((Actor)merchant);
         // ISSUE: cast to a reference type
         // ISSUE: explicit reference operation
         ObservableExtensions.Subscribe <long>(Observable.Take <long>(Observable.Skip <long>((IObservable <M0>)Observable.EveryLateUpdate(), 1), 1), (System.Action <M0>)(_ => (^ (CinemachineBlendDefinition&)ref player.CameraControl.CinemachineBrain.m_DefaultBlend).m_Style = (__Null)prevStyle));
         Transform transform4 = ((Component)player.CameraControl.CameraComponent).get_transform();
         merchant.SetLookPtn(1, 3);
         merchant.SetLookTarget(1, 0, transform4);
         ObservableExtensions.Subscribe <long>(Observable.Take <long>(Observable.SkipWhile <long>(Observable.Skip <long>(Observable.TakeUntilDestroy <long>((IObservable <M0>)Observable.EveryUpdate(), (Component)player), 1), (Func <M0, bool>)(_ => player.CameraControl.CinemachineBrain.get_IsBlending())), 1), (System.Action <M0>)(_ => Singleton <MapUIContainer> .Instance.OpenADV(this.openData, (IPack)this.packData)));
     }));
 }