// Start is called before the first frame update
 void Start()
 {
     swarmRatBehavior = FindObjectOfType <SwarmBehaviorData>();
     swarmRatBehavior.RegisterObserver(this);
     chasingPlayer = false;
     player        = FindObjectOfType <Player_Movement>().gameObject;
     GetComponent <BoxCollider2D>().isTrigger = true;
     GetComponent <Rigidbody2D>().simulated   = false;
     tempMinRange = minRange;
     orgColor     = this.GetComponent <SpriteRenderer>().color;
     orgColor.a   = .25f;
     this.GetComponent <SpriteRenderer>().color = orgColor;
     minRange = 10000000000000000000;
     Invoke("SpawnFix", 1);
 }
    void OnEnable()
    {
        swarmRatBehavior = FindObjectOfType <SwarmBehaviorData>();

        if (this.gameObject != null)
        {
            swarmRatBehavior.RegisterObserver(this);
        }

        GetComponent <BoxCollider2D>().isTrigger = true;
        GetComponent <Rigidbody2D>().simulated   = false;
        tempMinRange = minRange;
        orgColor     = this.GetComponent <SpriteRenderer>().color;
        orgColor.a   = .25f;
        this.GetComponent <SpriteRenderer>().color = orgColor;
        minRange = 10000000000000000000;
        Invoke("SpawnFix", 1);
    }