Major Fishing changes
This commit is contained in:
parent
1a12d986c4
commit
9e91220be4
11 changed files with 173 additions and 49 deletions
|
|
@ -14,16 +14,6 @@ namespace Tiles
|
|||
this._sprite = GenerateSpriteFromFile(pathToImageFile);
|
||||
}
|
||||
|
||||
protected void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void DayLightStep()
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -21,18 +21,18 @@ namespace Tiles
|
|||
|
||||
ItemContainer ic = ItemContainer.Instance;
|
||||
|
||||
if (usable.id == ic.GetItemIdByName("Hoe"))
|
||||
if (usable.ID == ic.GetItemIdByName("Hoe"))
|
||||
{
|
||||
Debug.Log("Farmland hydrated");
|
||||
//_hydrated = true;
|
||||
}
|
||||
|
||||
if (usable.id == ic.GetItemIdByName("Wheat Seed") && _crop == null)
|
||||
if (usable.ID == ic.GetItemIdByName("Wheat Seed") && _crop == null)
|
||||
{
|
||||
Plant();
|
||||
}
|
||||
|
||||
if (usable.id == ic.GetItemIdByName("Scythe") && _crop != null && _crop.FullyGrown)
|
||||
if (usable.ID == ic.GetItemIdByName("Scythe") && _crop != null && _crop.FullyGrown)
|
||||
{
|
||||
Harvest();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ namespace Tiles
|
|||
if (usable != null)
|
||||
{
|
||||
base.Clicked(usable);
|
||||
if (usable.id == ic.GetItemIdByName("Hoe")) {
|
||||
if (usable.ID == ic.GetItemIdByName("Hoe")) {
|
||||
rv = new FarmlandTile();
|
||||
} else if (usable.id == ic.GetItemIdByName("Shovel")) {
|
||||
} else if (usable.ID == ic.GetItemIdByName("Shovel")) {
|
||||
rv = new WaterTile();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,43 +1,29 @@
|
|||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Tiles
|
||||
{
|
||||
namespace Tiles {
|
||||
public class WaterTile : BaseTile {
|
||||
private double _fishingTime;
|
||||
private bool _fishing = false;
|
||||
private bool _catchable = false;
|
||||
private int _lastCall = 0;
|
||||
public WaterTile() : base("Assets/Farming Asset Pack/Split Assets/farming_tileset_023.png") {
|
||||
}
|
||||
|
||||
public override BaseTile Clicked(UsableItem usable) {
|
||||
base.Clicked(usable);
|
||||
BaseTile rv = null;
|
||||
|
||||
ItemContainer ic = ItemContainer.Instance;
|
||||
|
||||
if (usable.id == ic.GetItemIdByName("Fishing Rod")) {
|
||||
if (!_fishing) {
|
||||
_fishing = true;
|
||||
_fishingTime = 0f;
|
||||
Fish();
|
||||
} else if (_catchable) {
|
||||
_fishing = false;
|
||||
Debug.Log("Fished for" + _fishingTime/1000);
|
||||
if (usable.ID == ic.GetItemIdByName("Fishing Rod")) {
|
||||
FishingController fc = FishingController.instance;
|
||||
if (!fc.Fishing) {
|
||||
fc.StartFishing();
|
||||
} else {
|
||||
fc.TryCatch();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void Fish() {
|
||||
if (_fishing) {
|
||||
if (_catchable) {
|
||||
// _fishingTime += _lastCall - System.DateTime.Now; deltaTime between last recursive call
|
||||
}
|
||||
//Fish();
|
||||
} else if (usable.ID == ic.GetItemIdByName("Shovel")) {
|
||||
rv = new GrassTile();
|
||||
}
|
||||
|
||||
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue