/* Main Functions */

    void Start()
    {
        UnityEngine.Random.InitState((int)(System.DateTime.Now.Ticks));

        triggers      = gameObject.GetComponent <AITriggerManager>(); // must be initialized first
        movement      = gameObject.GetComponent <AIMovementManager>();
        inventory     = gameObject.GetComponent <AIInventoryManager>();
        weaponManager = gameObject.GetComponent <AIWeaponManager>();

        BuildingSpawner buildingSpawner = GameObject.Find("BuildingSpawner").GetComponent <BuildingSpawner>();

        buildingsGLOBAL = buildingSpawner.buildingLocations;
        placesToLoot    = new List <GameObject>(buildingsGLOBAL);

        CharacterSpawner charSpawner = GameObject.Find("CharacterSpawner").GetComponent <CharacterSpawner>();

        threatsGLOBAL = charSpawner.threats;
        //threats = new List<AIThreat>(threatsGLOBAL);

        status           = gameObject.AddComponent <Status>();
        status.health    = 100;
        status.maxHealth = 100;
        status.armor     = 0;
        status.maxArmor  = 100;

        lootLevel = 0;

        skill      = (int)(UnityEngine.Random.value * 8 + 2);
        aggression = (int)(UnityEngine.Random.value * 9 + 1);

        positionOptions = new List <GameObject>();

        StartCoroutine(AILoop());
    }
    protected override void Initilize()
    {
        aim.transform.position = playerHead.transform.position;
        aim.transform.rotation = playerHead.transform.rotation;
        aim.transform.SetParent(playerHead.transform);

        inventory      = GetComponent <AIInventoryManager>();
        base.inventory = inventory;
    }