void UpdateText() { tm.text = ProcessText(verb) + ProcessText(adjective) + ProcessText(noun); if (tm.text.Length == 3) { bool destructionWasAttemptedButDidntOccur = false; if (verb == "MAKE") { shapeManager.CreateShape(noun, adjective, gameObject); shapeManager.CheckForMatches(gameObject); } else if (verb == "DESTROY") { GameObject shapeToDestroy = shapeManager.GetObjectInGrid(noun, adjective); if (shapeToDestroy != null) { shapeToDestroy.GetComponent <ShapeController> ().DestroyAndScore(gameObject, true); shapeManager.UpdateGrid(); shapeManager.CheckForMatches(gameObject); } else { destructionWasAttemptedButDidntOccur = true; } } gameManager.ActivateActionNotification(playerNum, verb, adjective, noun, destructionWasAttemptedButDidntOccur); ResetText(); } }
void FinishDestroyingShape(GameObject player) { shapeManager.tweensRemaining -= 1; Debug.Log(shapeManager.tweensRemaining); player.GetComponent <PlayerController> ().score += 1; Destroy(gameObject); shapeManager.shapeGrid [col, row] = null; shapeManager.UpdateGrid(); gameManager.UpdateScore(); if (singleDestruction) { singleDestruction = false; shapeManager.CheckForMatches(player); } }