// Use this for initialization
    void Start()
    {
        waitTime = 0.02f;

        scene     = Singleton_Service.GetSingleton <SceneController>();
        player    = Singleton_Service.GetSingleton <Player>();
        rightHand = Singleton_Service.GetSingleton <RightHand>();
        leftHand  = Singleton_Service.GetSingleton <LeftHand>();
        music     = Singleton_Service.GetSingleton <GameMusic>();

        swordSource     = rightHand.GetSword().GetComponent <AudioSource>();
        swordAud        = rightHand.GetSword().GetComponent <SwordAudio>();
        shieldSource    = leftHand.GetShield().GetComponent <AudioSource>();
        shieldAud       = leftHand.GetShield().GetComponent <ShieldAudio>();
        playerHitSource = player.GetComponent <AudioSource>();
        playerHitAud    = player.GetComponent <PlayerHitAudio>();


        playerAttack  = player.GetAttack();
        playerDefense = player.GetDefense();

        anim = GetComponent <Animator>();



        UpdateEnemyUI();

        EnemyInit();
        StartCoroutine("Updating");
        currentState = idleState;
        currentState.StartState();
    }
    public void Damaged()
    {
        tempNumDamages++;
        if (tempNumDamages <= tolerance)
        {
            currentState.ToHurtState();
        }
        else
        {
            if (currentState != specialState && animSpecialString != null)
            {
                switch (enemyType)
                {
                case EnemyType.GreenGhost:
                case EnemyType.WhiteGhost:
                case EnemyType.GreenBat:
                case EnemyType.RedBat:
                    currentState.ToSpecialState();
                    currentState.StartState();
                    break;

                default:
                    break;
                }
            }
        }
        int damage = playerAttack - defense;

        if (damage < 1)
        {
            damage = 1;
        }
        scene.PlayAudio(swordSource, swordAud.swordAudio[Random.Range(0, swordAud.swordAudio.Length)]);
        health -= damage;
        if (health < 0)
        {
            health = 0;
        }
    }