onSetIfVisible method

void onSetIfVisible()

Implementation

void onSetIfVisible() {
  bool nowIsVisible = _isVisibleInCamera();
  if (nowIsVisible && !isVisible) {
    (gameRef as BonfireGame).addVisible(this);
  }
  if (!nowIsVisible && isVisible) {
    (gameRef as BonfireGame).removeVisible(this);
  }
  isVisible = nowIsVisible;
}