コード例 #1
0
ファイル: Rest.cs プロジェクト: IAJ-g04/Lab9
 public override float GetGoalChange(Goal goal)
 {
     var change = base.GetGoalChange(goal);
     if (goal.Name == AutonomousCharacter.REST_GOAL) change -= 0.1f;
     if (goal.Name == AutonomousCharacter.EAT_GOAL) change += 0.1f;
     return change;
 }
コード例 #2
0
ファイル: Action.cs プロジェクト: IAJ-g04/Lab9
 public virtual float GetGoalChange(Goal goal)
 {
     if (this.GoalEffects.ContainsKey(goal))
     {
         return this.GoalEffects[goal];
     }
     else return 0.0f;
 }
コード例 #3
0
ファイル: MeleeAttack.cs プロジェクト: IAJ-g04/Lab9
        public override float GetGoalChange(Goal goal)
        {
            var change = base.GetGoalChange(goal);

            if (goal.Name == AutonomousCharacter.EAT_GOAL)
            {
                change -= 2.0f;
            }
            else if (goal.Name == AutonomousCharacter.REST_GOAL)
            {
                change += 0.5f;
            }
            else if (goal.Name == AutonomousCharacter.SURVIVE_GOAL)
            {
                change += 2.0f;
            }

            return change;
        }
コード例 #4
0
ファイル: Action.cs プロジェクト: IAJ-g04/Lab9
 public void AddEffect(Goal goal, float goalChange)
 {
     this.GoalEffects[goal] = goalChange;
 }
コード例 #5
0
 public override float GetGoalChange(Goal goal)
 {
     if (goal.Name == AutonomousCharacter.REST_GOAL)
     {
         var distance =
             (this.Target.transform.position - this.Character.Character.KinematicData.position).magnitude;
         //+0.01 * distance because of the walk
         return distance * 0.01f;
     }
     if (goal.Name == AutonomousCharacter.EAT_GOAL)
     {
         var distance =
             (this.Target.transform.position - this.Character.Character.KinematicData.position).magnitude;
         //+0.01 * distance because of the walk
         return distance * 0.1f;
     }
     else return 0;
 }
コード例 #6
0
ファイル: PlaceFlag.cs プロジェクト: IAJ-g04/Lab9
 public override float GetGoalChange(Goal goal)
 {
     var change = base.GetGoalChange(goal);
     if (goal.Name == AutonomousCharacter.CONQUER_GOAL) change -= 2.0f;
     return change;
 }