Foerming/Assets/Scripts/Cow.cs
d-hain 8dc7f78803 added chicken
added bucket
cow can now be milked
2022-06-24 00:49:22 +02:00

29 lines
No EOL
669 B
C#

using Actions;
using UnityEngine;
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;
}
}
}