예제 #1
0
    public void OnEnterBuilding(InteractableStructure building)
    {
        lastBuildingEntered = building;

        switch (goal)
        {
        case Goals.LOOT:
            movement.AddTargets(building.lootingWaypoints);
            break;

        case Goals.HUNT:
            movement.AddTargets(building.lootingWaypoints);
            break;

        case Goals.STALK:
            positionOptions.Clear();
            positionOptions.AddRange(building.attackCoverWaypoints);
            FindPlaceToStalk();
            break;

        case Goals.ATTACK:

            break;

        case Goals.HIDE:
            positionOptions.Clear();
            positionOptions.AddRange(building.defensiveCoverWaypoints);
            FindPlaceToHide();
            break;

        case Goals.FLEE:

            break;
        }
    }
    public void StructureReached(GameObject waypoint)
    {
        InteractableStructure building = waypoint.GetComponent <InteractableStructure>();

        if (building != null && RemoveTarget(building.gameObject)) // it is a building && its on its list of buildings to travel to
        {
            ai.OnEnterBuilding(building);
        }
    }