public void DestroyOre(bool minedByPlayer) { _gridBehavior.InstantiateNewGridPrefab(transform.position); if (minedByPlayer) { extractedOresCounter.GetOre(index, BoostersController.boosters[2].activeSelf ? 2 : 1); animatorController.InvertIsMiningVar(); progressBar.IncreaseValue(transform.position); ChestSpawnController.Try2SpawnChest(transform.position); if (Statistics.minedOres[index] == false) { Statistics.GetNewMinedOre(index); } foreach (var type in boosterTypes) { ChanceToGetBooster(type); } _oreGenerator.GenerateNewOres(this.transform.position); } Mining.isMining = false; SelectionController.RemoveSelection(); Destroy(gameObject); }
// Invokes on PlayerStop and Start MineCoroutine public void InvokeMiningAnimation() { if (block) { animatorController.SetValues(block.transform.position); animatorController.InvertIsMiningVar(); isMining = true; } }