public static void SetupCostElements(UXFactory uxFactory, string costElementName, string clonedParentName, int credits, int materials, int contraband, int crystals, int eventPoints, bool locked, string lockedText, int clampWidth) { string costGroupStr = UXUtils.FormatAppendedName(costElementName, clonedParentName); string costElementStr = UXUtils.FormatAppendedName(costElementName + "Label", clonedParentName); string creditName = UXUtils.FormatAppendedName(costElementName + "CreditIcon", clonedParentName); string materialName = UXUtils.FormatAppendedName(costElementName + "MaterialIcon", clonedParentName); string contrabandName = UXUtils.FormatAppendedName(costElementName + "ContrabandIcon", clonedParentName); string crystalName = UXUtils.FormatAppendedName(costElementName + "CrystalIcon", clonedParentName); string eventPointsName = UXUtils.FormatAppendedName(costElementName + "EventIcon", clonedParentName); string reputationName = UXUtils.FormatAppendedName(costElementName + "ReputationIcon", clonedParentName); UXUtils.CommonSetupTasks(uxFactory, credits, materials, contraband, crystals, eventPoints, locked, lockedText, costGroupStr, creditName, materialName, contrabandName, crystalName, eventPointsName, reputationName, costElementStr, clampWidth); }
public static void AppendNameRecursively(GameObject gameObject, string name, bool root) { if (root) { gameObject.name = name; } else { gameObject.name = UXUtils.FormatAppendedName(gameObject.name, name); } Transform transform = gameObject.transform; int i = 0; int childCount = transform.childCount; while (i < childCount) { UXUtils.AppendNameRecursively(transform.GetChild(i).gameObject, name, false); i++; } }