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()
 {
     IS = GetComponent<IonianStatistics>();
     target = FindClosestEnemy();
     attack1dmg = IS._attackOne.currentValue;
     attack2dmg = IS._attackTwo.currentValue;
     aerialAttackdmg = IS._attackOne.currentValue + (int)(IS._attackOne.currentValue * 0.5f);
     spearDamage = IS._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 OnEnable()
 {
     SS = Ionian.GetComponent<IonianStatistics>();
 }
 void Awake()
 {
     IS = GetComponent<IonianStatistics>();
     _motor = GetComponent<PlatformerMotor2D>();
 }