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

        _currCrib = cribObj.GetComponent <Crib>();
    }