void Awake()
    {
        EH = GetComponent<EnemyHealth>();
        stopDist = 1.5f;
        _canAttack = true;

        _motor = GetComponent<PlatformerMotor2D>();
        _anim = GetComponent<EnemyAIAnimator>();
        _hero = PlayerPrefs.GetInt("Hero");

        AI = this.gameObject;

        //Determine which hero to look for and go after;
        switch (_hero)
        {
            case 0:
                Debug.Log("I am from Ionia");
                target = GameObject.FindGameObjectWithTag("Ionian");
                targetT = target.transform;
                IS = target.GetComponent<IonianStatistics>();
                IH = target.GetComponent<IonianHealth>();
                IXP = target.GetComponent<IonianEXP>();
                _pMaster = target.GetComponent<PlayerMaster>();
                break;
            case 1:
                Debug.Log("I am from Athens");
                target = GameObject.FindGameObjectWithTag("Athenian");
                targetT = target.transform;
                ATS = target.GetComponent<AthenianStatistics>();
                ATH = target.GetComponent<AthenianHealth>();
                ATXP = target.GetComponent<AthenianEXP>();
                _pMaster = target.GetComponent<PlayerMaster>();
                break;
            case 2:
                Debug.Log("I am from Sparta");
                target = GameObject.FindGameObjectWithTag("Spartan");
                targetT = target.transform;
                SS = target.GetComponent<SpartanStatistics>();
                SH = target.GetComponent<SpartanHealth>();
                SXP = target.GetComponent<SpartanEXP>();
                _pMaster = target.GetComponent<PlayerMaster>();
                break;
            case 3:
                Debug.Log("I am Greek");
                target = GameObject.FindGameObjectWithTag("Achilles");
                targetT = target.transform;
                AS = target.GetComponent<AchillesStatistics>();
                AH = target.GetComponent<AchillesHealth>();
                AXP = target.GetComponent<AchillesEXP>();
                _pMaster = target.GetComponent<PlayerMaster>();
                break;
        }
    }
 // Use this for initialization
 void Start()
 {
     AS = GetComponent<AchillesStatistics>();
     target = FindClosestEnemy();
     attack1dmg = AS._attackOne.currentValue;
     attack2dmg = AS._attackTwo.currentValue;
     aerialAttackdmg = AS._attackOne.currentValue + (int)(AS._attackOne.currentValue * 0.5f);
     spearDamage = AS._spearDamage.currentValue;
 }
 void Start()
 {
     switch (_hero)
     {
         case 0:
             IS = GetComponent<IonianStatistics>();
             Energy = IS._energy.currentFValue;
             MaxEnergy = IS._energy.maxValue;
             EnergyRegen = IS._energy.percentageValue;
             break;
         case 1:
             ATS = GetComponent<AthenianStatistics>();
             Energy = ATS._energy.currentFValue;
             MaxEnergy = ATS._energy.maxValue;
             EnergyRegen = ATS._energy.percentageValue;
             ATspearControl = GetComponent<ATSpearControl>();
             break;
         case 2:
             SS = GetComponent<SpartanStatistics>();
             Energy = SS._energy.currentFValue;
             MaxEnergy = SS._energy.maxValue;
             EnergyRegen = SS._energy.percentageValue;
             SspearControl = GetComponent<SSpearControl>();
             break;
         case 3:
             AS = GetComponent<AchillesStatistics>();
             Energy = AS._energy.currentFValue;
             MaxEnergy = AS._energy.maxValue;
             EnergyRegen = AS._energy.percentageValue;
             AspearControl = GetComponent<ASpearControl>();
             break;
     }
 }
 void Awake()
 {
     AS = GetComponent<AchillesStatistics>();
 }
    void Awake()
    {
        control = this;

        created = PlayerPrefs.GetInt("ASCreated");

        //If already loaded for the first time skip this step.
        if (created != 1)
        {
            StatCreation();
        }

        //Load
        LoadStats();

        //Initiate a refrence to use in game
        InGameStats();

        _energy.currentFValue = _energy.maxValue;
    }