예제 #1
0
 // sets the satisfaction value of this Action
 public void SetGoalSatisfaction(AIGoals goal, float value)
 {
     if (!GoalSatisfaction.ContainsKey(goal))
     {
         GoalSatisfaction[goal] = value;
     }
 }
 // Use this for initialization
 void Start()
 {
     motorActions    = GetComponent <AIMotorActions>() as AIMotorActions;
     raycastSensors  = GetComponent <AIRaycastSensors>() as AIRaycastSensors;
     contactSensor   = GetComponentInParent <CharacterContactSensor> () as CharacterContactSensor;
     goals           = GetComponent <AIGoals> () as AIGoals;
     parentTransform = this.transform.parent;
 }
예제 #3
0
    // the goal to achieve (constructor)
    public Goals(AIGoals type, float goalvaluemin, float goalvaluemax, float currentvalue, GoalValuefunction utilityfunction)
    {
        goaltype         = type;
        MinimumGoalValue = goalvaluemin;
        MaximumGoalValue = goalvaluemax;

        Gvalue       = currentvalue;
        UtilityValue = utilityfunction;
    }
예제 #4
0
    // returns the amount this action can satisfy a certain goal
    public float EvaluateGoalSatisfaction(AIGoals TypeToCheck)
    {
        if (GoalSatisfaction.ContainsKey(TypeToCheck))
        {
            return(GoalSatisfaction[TypeToCheck]);
        }

        return(0);
    }
예제 #5
0
 //takes in two parameters one is the tyoe of goal this is
 //second is the goals value that needs to be updated
 public void UpdateGoalValue(AIGoals Type, float value)
 {
     foreach (Goals goal in goallist)
     {
         if (goal.TypeReturn() == Type)
         {
             goal.SetValue(value);
         }
     }
 }
예제 #6
0
    // Use this for initialization
    void Start()
    {
        AIGoals goalMaker = new AIGoals();

        goalMaker.CreateGoals();
        goals     = goalMaker.GetGoals();
        goalMaker = null;

        stateMaker = new AIState();
        stateMaker.MakeStates();
        states     = stateMaker.state;
        stateMaker = null;
    }
예제 #7
0
 void Awake()
 {
     a = this;
 }
 // Use this for initialization
 void Start()
 {
     virtualController = GetComponent <AIVirtualController>() as AIVirtualController;
     goals             = GetComponent <AIGoals> () as AIGoals;
     parentTransform   = this.transform.parent;
 }