void StartNewDay() { Debug.Log("New day"); ++_currDay; _currTime = DayTimeSeconds; FarmManager.GetInstance().OnNextDay(); }
public override void GetTileData(Vector3Int location, ITilemap tilemap, ref TileData tileData) { tileData.sprite = GrowthLevels[0].Texture; FarmManager mgr = FarmManager.GetInstance(); if (mgr != null) { int tileAge = mgr.GetTileAge(location); GrowthLevel level = GetGrowthLevel(tileAge); if (level != null) { tileData.sprite = level.Texture; } } }
void FixedUpdate() { Vector2 dir = Vector2.zero; dir.y += Input.GetAxis("Vertical"); dir.x += Input.GetAxis("Horizontal"); dir *= Speed * Time.fixedDeltaTime; _rigidbody.MovePosition(_rigidbody.position + dir); if (dir.magnitude > .05f) { _dir = dir; } if (Input.GetKeyUp(KeyCode.Space)) { Vector2 worldPos = _rigidbody.position + _dir.normalized; FarmManager.GetInstance().Plant(farmTile, worldPos); } }