void OnTriggerStay2D(Collider2D other) { if (GameManager.Instance.IsPlaying) { Crib crib = other.gameObject.GetComponent <Crib>(); if (crib != null) { OnCribCollision(crib); return; } } }
void OnCribCollision(Crib crib) { UnloadBabies(crib); TargetNearestBaby(); }
void UnloadBabies(Crib crib) { this._numBabiesPickedUp = 0; }
protected override void OnGameStart() { GameObject cribObj = SpawnCribAtRandomPosition(); _currCrib = cribObj.GetComponent <Crib>(); }