public void UpgradeGem() { if (comboable && gemScript.UpgradedPrefab != null) { Debug.Log(this.transform.position + " upgraded gem"); gemScript.DestroyGem(); Gem = gemScript.SpawnGemCopy(this.transform, gemScript.UpgradedPrefab); gemScript.SetGemProperties(this.transform.position, gem); } }
public void UpgradeGem() { if (gemScript.UpgradedPrefab != null) { StartCoroutine(gemScript.DestroyGem(true)); if (gemScript.basePrefab == null) { Debug.Log("Base Prefab Null"); } if (gemScript.UpgradedPrefab == null) { Debug.Log("Upgraded Prefab Null"); } Gem = gemScript.SpawnGemCopy(this.transform, gemScript.UpgradedPrefab, gemScript.basePrefab); if (Gem) { gemScript.SetGemProperties(this.transform.position, gem, this.transform); } } }