コード例 #1
0
        protected AIAction CreateAction(Type type)
        {
            AIAction aiaction = Activator.CreateInstance(type) as AIAction;

            aiaction.Initialize(this.m_AI, this);
            return(aiaction);
        }
コード例 #2
0
 public override void OnStopAction(AIAction action)
 {
     base.OnStopAction(action);
     if (action.GetType() == typeof(HumanMoveTo) || action.GetType() == typeof(HumanRotateTo))
     {
         float num = Vector3.Angle(this.m_HumanAI.m_StartForward.GetNormalized2D(), this.m_AI.transform.forward.GetNormalized2D());
         if (num >= 5f)
         {
             this.m_HumanRotateTo.SetupParams(this.m_HumanAI.transform.position + this.m_HumanAI.m_StartForward.GetNormalized2D(), 5f);
             base.StartAction(this.m_HumanRotateTo);
         }
         else
         {
             base.StartAction(this.m_Idle);
         }
     }
     else if (action.GetType() == typeof(Idle))
     {
         base.StartAction(this.m_StartCrouch);
     }
     else if (action.GetType() == typeof(StartCrouch))
     {
         base.StartAction(this.m_CrouchIdle);
     }
 }
コード例 #3
0
 public override void OnStopAction(AIAction action)
 {
     base.OnStopAction(action);
     if (this.m_Active && this.SetupPath())
     {
         base.StartAction(this.m_HumanMoveTo);
     }
 }
コード例 #4
0
 public override void OnStopAction(AIAction action)
 {
     base.OnStopAction(action);
     if (action.GetType() == typeof(StopCrouch) || action.GetType() == typeof(HumanRotateTo))
     {
         this.SetupAction();
     }
 }
コード例 #5
0
 protected AIAction StartAction(AIAction action)
 {
     this.m_Plan.Clear();
     this.m_CurrentAction = action;
     this.m_CurrentAction.Start();
     this.m_Plan.Add(this.m_CurrentAction);
     return(this.m_CurrentAction);
 }
コード例 #6
0
 public override void OnStopAction(AIAction action)
 {
     base.OnStopAction(action);
     if (action.GetType() == typeof(HumanRotateTo))
     {
         base.StartAction(this.m_ThrowStone);
     }
 }
コード例 #7
0
 public override void OnStopAction(AIAction action)
 {
     base.OnStopAction(action);
     if (action.GetType() == typeof(RotateTo))
     {
         this.StartIdle();
     }
 }
コード例 #8
0
 public override void OnStopAction(AIAction action)
 {
     base.OnStopAction(action);
     if (action.GetType() == typeof(StartPlay))
     {
         base.StartAction(this.m_PlayIdle);
     }
 }
コード例 #9
0
 public override void OnStopAction(AIAction action)
 {
     base.OnStopAction(action);
     if (action.GetType() == typeof(StopCrouch))
     {
         base.StartAction(this.m_LookAround);
     }
     else if (action.GetType() == typeof(LookAround))
     {
         this.m_HumanAI.SetState(HumanAI.State.Rest);
     }
 }
コード例 #10
0
 public override void OnStopAction(AIAction action)
 {
     base.OnStopAction(action);
     if (action.GetType() == typeof(HumanRotateTo) && this.m_HumanAI.m_WeaponType != HumanAI.WeaponType.Primary)
     {
         base.StartAction(this.m_SwitchWeapon);
     }
     else if (action.GetType() == typeof(SwitchWeapon) || action.GetType() == typeof(HumanRotateTo))
     {
         base.StartAction(this.m_BowAttack);
     }
 }
コード例 #11
0
 public override void OnStopAction(AIAction action)
 {
     base.OnStopAction(action);
     if (action.GetType() == typeof(HumanRotateTo))
     {
         base.StartAction(this.m_SwitchWeapon);
     }
     else if (action.GetType() == typeof(SwitchWeapon))
     {
         this.m_AI.m_GoalsModule.ActivateGoal(AIGoalType.HumanMoveToEnemy);
     }
 }
コード例 #12
0
 public override void OnStopAction(AIAction action)
 {
     base.OnStopAction(action);
     if (action.GetType() == typeof(StartMove))
     {
         base.Prepare();
         this.m_AI.m_AnimationModule.m_TransitionDuration = 0f;
     }
     else if (action.GetType() == typeof(MoveTo))
     {
         this.Prepare();
     }
 }
コード例 #13
0
 public override void OnStopAction(AIAction action)
 {
     base.OnStopAction(action);
     if (action.GetType() == typeof(HumanMoveTo))
     {
         if (this.m_MoveBack)
         {
             if (this.m_Range > this.m_AI.m_Params.m_JumpAttackRange)
             {
                 if (!this.m_MovingBack)
                 {
                     this.m_Range += this.ADD_RANGE;
                     if (this.m_Range >= this.MAX_RANGE)
                     {
                         this.m_MovingBack = true;
                     }
                 }
                 else
                 {
                     this.m_Range -= this.ADD_RANGE;
                 }
                 if (this.SetupPath())
                 {
                     this.SetupAction();
                 }
             }
         }
         else if (base.GetDuration() < this.m_Lenght)
         {
             this.m_Range += this.ADD_RANGE;
             if (this.SetupPath())
             {
                 this.SetupAction();
             }
         }
         else
         {
             Vector3 normalized2D = (Player.Get().transform.position - this.m_AI.transform.position).GetNormalized2D();
             float   num          = Vector3.Angle(normalized2D, this.m_AI.transform.forward.GetNormalized2D());
             if (num >= 10f)
             {
                 this.m_HumanRotateTo.SetupParams(Player.Get().transform.position, 10f);
                 base.StartAction(this.m_HumanRotateTo);
             }
         }
     }
     else if (action.GetType() == typeof(HumanRotateTo) && UnityEngine.Random.Range(0f, 1f) < 0.5f)
     {
         base.StartAction(this.m_Taunt);
     }
 }
コード例 #14
0
 public override void OnStopAction(AIAction action)
 {
     base.OnStopAction(action);
     if (action.GetType() == typeof(HumanStartMove))
     {
         base.StartAction(this.m_HumanMove);
     }
     else if (action.GetType() == typeof(HumanMove))
     {
         if (Vector3.Distance(this.m_HumanAI.transform.position, this.m_AI.m_EnemyModule.m_Enemy.transform.position) > this.m_MinDistToEnemy)
         {
             base.StartAction(this.m_HumanStopMove);
         }
         else if (this.SetupPath())
         {
             base.StartAction(this.m_HumanMove);
         }
         else
         {
             base.StartAction(this.m_HumanStopMove);
         }
     }
 }
コード例 #15
0
 public override void OnStopAction(AIAction action)
 {
     base.OnStopAction(action);
     if (action.GetType() == typeof(HumanStartMove))
     {
         base.StartAction(this.m_HumanMove);
         return;
     }
     if (action.GetType() == typeof(HumanMove))
     {
         if (this.m_HunterAI.IsProperPosToBowAttack())
         {
             base.StartAction(this.m_HumanStopMove);
             return;
         }
         if (this.SetupPath())
         {
             base.StartAction(this.m_HumanMove);
             return;
         }
         base.StartAction(this.m_HumanStopMove);
     }
 }
コード例 #16
0
 protected void AddToPlan(AIAction action)
 {
     action.Reset();
     this.m_Plan.Add(action);
 }
コード例 #17
0
 public virtual void OnStopAction(AIAction action)
 {
 }