void CleaningCurrentGarbage() { if (_currentGarbageTile != null) { int removeCost = _currentGarbageTile.GetGarbageData().removeCost; if (removeCost <= ResourceManager.Instance.GetGoldResource()) { ObjectTileManager.Instance.RemoveObjectTile(); ResourceManager.Instance.AddGoldResource(-removeCost); FarmUIManager.Instance.UpdateGoldResourceLabel(); } } }
void EnterTile() { OwnCharacter.EndRun(); if (FriendFarmManager.Instance != null) { return; } Point currentPoint = _currentLandTile.MapPoint; MapData.Instance.CurrentFarmerPoint = currentPoint; _currentLandTile.Highlight = true; _currentProductTile = ObjectTileManager.Instance.GetProductTileAtPoint(currentPoint); float grownSpeed = 0.0f; switch (_currentLandTile.Type) { case LandTile.BadlandType: grownSpeed = LandTile.BadlandGrownSpeedScale; break; case LandTile.GrassType: grownSpeed = LandTile.GrassGrownSpeedScale; break; case LandTile.CultivateType: grownSpeed = LandTile.CultivateGrownSpeedScale; break; default: Debug.LogWarning("Unknown Land Type!"); break; } FarmUIManager.Instance.UpdateLandTileChangeInteract(_currentLandTile.Type); if (ObjectTileManager.Instance.HasObjectTileAtPoint(currentPoint)) { if (ObjectTileManager.Instance.GetObjectTileTypeAtPoint(currentPoint) == ObjectTile.ETileType.Garbage) { _currentGarbageTile = ObjectTileManager.Instance.GetGarbageTileAtPoint(currentPoint); FarmUIManager.Instance.GarbageTileFuncButtonInteract(_currentGarbageTile.GetGarbageData()); } else { FarmUIManager.Instance.ObjectTileFuncButtonInteract(false); } } else { FarmUIManager.Instance.UpdatePlantProductEffectText(grownSpeed); FarmUIManager.Instance.ObjectTileFuncButtonInteract(true); } if (_currentProductTile != null) { // 수확 기능 if (_currentProductTile.CanHarvest) { FarmUIManager.Instance.HarvestButtonActive = true; } else { StartCoroutine(CheckCanHarvestEverySeconds()); } // 상단 FarmUIManager.Instance.ProductInfoGroupActive = true; FarmUIManager.Instance.SetProductInfoData(_currentProductTile.ProductData, grownSpeed); } }