/// <summary> /// Sets the greater triangle colours to match the center colour /// Also increments score /// </summary> /// <param name="center">The Center Triangle</param> private void SetGreaterTriangleColours(triangleNode center) { GlobalFlags.setScore(GlobalFlags.getScore() + (GlobalFlags.getBaseScoreValue() * GlobalFlags.getMultiplier())); center.delayedDestroy = true; Color c = center.triangleObject.GetComponent<TriangleColour>().GetColour(); triangleNode n; if( c != Color.black) { if(isPointingUp(center)) { //check upper node n = getNode(center.x, center.y - 1); if(n !=null && n.triangleObject.GetComponent<TriangleColour>().GetColour() != Color.black) { n.triangleObject.GetComponent<TriangleColour>().SetColour(c); } } else { //check lower node n = getNode(center.x, center.y + 1); if(n !=null && n.triangleObject.GetComponent<TriangleColour>().GetColour() != Color.black) { n.triangleObject.GetComponent<TriangleColour>().SetColour(c); } } //check left node n = getNode(center.x - 1, center.y); if(n !=null && n.triangleObject.GetComponent<TriangleColour>().GetColour() != Color.black) { n.triangleObject.GetComponent<TriangleColour>().SetColour(c); } //check right node n = getNode(center.x + 1, center.y); if(n !=null && n.triangleObject.GetComponent<TriangleColour>().GetColour() != Color.black) { n.triangleObject.GetComponent<TriangleColour>().SetColour(c); } } CascadeAndClear(center); }
void OnGUI() { int height = Screen.height / 15; GUIStyle style = new GUIStyle(GUI.skin.label); style.fontSize = (int)(height / 2); GUI.Label(new Rect(0, 0, Screen.width, height), "Score: " + GlobalFlags.getScore(), style); GUI.Label(new Rect(0, 1 * Screen.height / 15, Screen.width, height), "Multiplier: " + GlobalFlags.getMultiplier(), style); if (!GlobalFlags.infiniteRandomMode) { GUI.Label(new Rect(0, 2 * Screen.height / 15, Screen.width, height), "Queue Bonus: " + GlobalFlags.getQueueBounusTotal(), style); } }