void OnTriggerEnter(Collider collider)
    {
        GameObject go = collider.gameObject;

        if (go.GetComponent <IsACharacter> () != null && go.GetComponent <IsAEnemyOwned> () != null &&
            gamemgr.State == GameMgr.GameState.IN_GAME)
        {
            gamemgr.AdvanceState();
        }
    }
    void EnemyMovementUpdate()
    {
        transform.Translate(Vector3.right * dir * movementSpeed * Time.deltaTime);          //moves enemies based on direction and speed of enemies

        if (transform.position.x >= 3.25)
        {
            dir = -1;             //if the enemy wave changes direction based on x position and moves down 0.5f towards player
            transform.position = new Vector3(transform.position.x, transform.position.y - 0.5f, transform.position.z);
        }
        else if (transform.position.x <= -3.25)
        {
            dir = 1;             //changes direction of enemies again based on pos of x, also moves enemies down towards player
            transform.position = new Vector3(transform.position.x, transform.position.y - 0.5f, transform.position.z);
        }
        if (gameObject.GetComponentsInChildren <IsACharacter> ().Length == 0 && gamemgr.State == GameMgr.GameState.IN_GAME)
        {
            gamemgr.AdvanceState();
        }
    }