public override void Respond(Unit unit) { base.Respond(unit); ///IF SEED READY TIO BE PLANTED, PLANT if ((pusheableType == PUSHEABLE_TYPE.CARROT_SEEDS || pusheableType == PUSHEABLE_TYPE.PUMKIN_SEEDS) && unit.GetComponent <Player>() != null && unit.GetComponent <Player>().equippedTool == Tool.TOOL_TYPE.SHOVEl && block.fertile ) { Pusheable pusheable = Instantiate(product).GetComponent <Pusheable>(); pusheable.transform.position = block.transform.position; // pusheable.block pusheable.block = block; block.unit = pusheable; pusheable.block.fertile = false; block.walkable = false; Destroy(gameObject); } else if (CanPush(unit.direction)) { direction = unit.direction; Push(direction); } }
public void Harvest() { Pusheable pusheable = Instantiate(product).GetComponent <Pusheable>(); pusheable.transform.position = block.transform.position; pusheable.block = block; block.unit = pusheable; block.walkable = false; //block.SetUnit(pusheable); Invoke("NotifyPlayer", 1f); }
public void ExpireCrop() { Pusheable pusheable = Instantiate(basVersion).GetComponent <Pusheable>(); pusheable.transform.position = block.transform.position; // pusheable.block pusheable.block = block; block.unit = pusheable; pusheable.block.fertile = false; block.walkable = false; Destroy(gameObject); }