added chicken
added bucket cow can now be milked
This commit is contained in:
parent
4e286d74ce
commit
8dc7f78803
26 changed files with 1141 additions and 101 deletions
29
Assets/Scripts/Cow.cs
Normal file
29
Assets/Scripts/Cow.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue