public void ShowWindow(GOAP_Character character)
 {
     if (this.character != character)
     {
         ClearPlanMemory();
     }
     this.character = character;
     UpdateWindow();
     ShowWindow();
 }
    public void SpawnCharacter(GOAP_Character.CharacterData characterData)
    {
        Vector3 spawnPosition = InfoBlackBoard.instance.campFireLocation.GetPosition();

        spawnPosition.y = 0.611f;
        Vector2 randomOffset = Random.insideUnitCircle * MaxSpawnDistance;

        spawnPosition += new Vector3(randomOffset.x, 0, randomOffset.y);
        GOAP_Character character = Instantiate(characterPrefab, spawnPosition, Quaternion.identity).GetComponent <GOAP_Character>();

        character.SetCharacterData(new GOAP_Character.CharacterData(characterData));
    }
Beispiel #3
0
    public GOAP_Agent(GOAP_Character character, IGOAP_AgentView view)
    {
        this.character = character;
        View           = view;

        checkedCharacterGoals = new List_GOAP_Worldstate();

        currentActions     = new Queue <GOAP_Action>();
        currentWorldstates = new List_GOAP_Worldstate();
        checkedQuestIds    = new List <int>();

        postedQuestIDs    = new List <int>();
        completedQuestIDs = new List <int>();

        questPlans = new Dictionary <int, Queue <GOAP_Action> >();
        activeGoal = new List_GOAP_Worldstate();

        planMemory = new List <PlanInfo>();

        timeSincePlanned = Random.Range(0, planningWaitTimer);
    }
 public void OnEnable()
 {
     character = (GOAP_Character)target;
     character.characterData.InitBaseActions(GOAP_Action.GetAllActionNames());
     character.characterData.RemoveWrongActions(GOAP_Action.GetAllActionNames());
 }