public static void AddHUDButtons(GameObject buttonBP, float baseX, float baseY) { int index = 0; foreach (KeyValuePair <string, string> bData in buttonConfig) { GameObject buttonGO = NGUITools.AddChild(paHUD, buttonBP); buttonGO.name = "PA_Button_" + bData.Key; ButtonPrompt button = buttonGO.transform.GetComponent <ButtonPrompt>(); string label = buttonLabels[bData.Key]; button.UpdatePromptLabel(label); button.m_KeyboardButtonLabel.text = bData.Value; if (bData.Key == "CONFORM") { conformButton = button; } else if (bData.Key == "SNAP") { snapButton = button; } if (bData.Value == "SHIFT") { button.m_KeyboardButtonSprite.transform.localScale = new Vector3(2.6f, 1f, 1f); } if (bData.Value == "LEFT ALT") { button.m_KeyboardButtonSprite.transform.localScale = new Vector3(3.0f, 1f, 1f); } float posX = baseX + ((index % 2) * 110f); float posY = baseY - (Mathf.Floor(index / 2) * 80); buttonGO.transform.localPosition = new Vector3(posX, posY, 0); buttonList.Add(button); index++; } }