bool OnEnter() { float d_r = GetComponent <SpriteRenderer>().bounds.size.magnitude; this.hitEnemy = Collide.RayGetCollideByTag(transform.position, d_r, dir, "enemy"); this.hitPlayer = Collide.RayGetCollideByTag(transform.position, d_r, dir, "player"); this.hitBuilding = Collide.RayGetCollideByTag(transform.position, d_r, dir, "building"); //TODO: impove return method return(this.hitEnemy.Length != 0 || this.hitBuilding.Length != 0 || this.hitPlayer.Length != 0); }