Foerming/Assets/Scripts/Animals/Cow.cs
dhain 2d51baacd8 moved Cow.cs and Chicken.cs into Animals Folder
Chicken lays eggs now every day
2022-06-24 08:53:56 +02:00

31 lines
No EOL
776 B
C#

using Actions;
using UnityEngine;
namespace Animals {
public class Cow : Animal {
private bool _canBeMilked;
private void Awake() {
_canBeMilked = true;
HouseController.NewDayEvent.AddListener(UpdateCanBeMilked);
}
/**
* Update the _canBeMilked bool
*/
private void UpdateCanBeMilked() {
Debug.Log("_ca" + _canBeMilked);
_canBeMilked = true;
}
/**
* Get Milk if cow is able to be milked
*/
private void OnMouseDown() {
if(_canBeMilked) {
ActionManager.Instance.ClickAction(gameObject, PlayerController.instance.SelectedItem);
_canBeMilked = false;
}
}
}
}