예제 #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;
 }