public void OnSaveButtonClick() { string profileName = transform.FindChild("ProfileNameInputField").FindChild("Text").GetComponent <Text>().text; if (!string.IsNullOrEmpty(profileName)) { OptionsController.ChangeConstant(0, profileName); transform.parent.GetChild(0).FindChild("Profile").GetComponent <Text>().text = "Profile: " + OptionsController.GetConstantValue(0); } //... OptionsController.SaveGameOptions(); }