private void EatFish(GameObject fishObject) { if (isFull) return; // Cant eat other fish while full. isFull = true; penguinArea.RemoveSpecificFish(fishObject); AddReward(1f); }
private void EatFish(GameObject fishObject) { if (isFull) { return; } isFull = true; penguinArea.RemoveSpecificFish(fishObject); AddReward(1f); }
private void EatFish(GameObject objectFish) { if (true == isFull) { return; // Can't eat another fish while full. } isFull = true; penguinArea.RemoveSpecificFish(objectFish); AddReward(1.0f); }
private void EatFish(GameObject fishObject) { if (isFull) { return; // can't eat another fish while full } isFull = true; penguinArea.RemoveSpecificFish(fishObject); // reward for eaing fish AddReward(1f); }
/// <summary> /// Check if agent is full, if not, eat the fish and get a reward /// </summary> /// <param name="fishObject">The fish to eat</param> public void EatFish(GameObject fishObject) { if (isFull) { return; // Can't eat another fish while full } isFull = true; penguinArea.RemoveSpecificFish(fishObject); if (isAgent) { this.GetComponent <PenguinAgent>().AddReward(1f); } }