Exemplo n.º 1
0
Arquivo: Rest.cs Projeto: 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;
 }
Exemplo n.º 2
0
 public virtual float GetGoalChange(Goal goal)
 {
     if (this.GoalEffects.ContainsKey(goal))
     {
         return this.GoalEffects[goal];
     }
     else return 0.0f;
 }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
 public void AddEffect(Goal goal, float goalChange)
 {
     this.GoalEffects[goal] = goalChange;
 }
Exemplo n.º 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;
 }
Exemplo n.º 6
0
 public override float GetGoalChange(Goal goal)
 {
     var change = base.GetGoalChange(goal);
     if (goal.Name == AutonomousCharacter.CONQUER_GOAL) change -= 2.0f;
     return change;
 }