void createWindowContent(int windowID) { //refresh Textfield stringToEdit = GUI.TextField(new Rect(5, 20, 205, 20), stringToEdit, 25); //if button is pressed and texture name in stringToEdit is available if (GUI.Button(new Rect(5, 60, 100, 20), "OK") && Resources.Load("360View/Wald/" + stringToEdit)) { //finish buttondata and add it to the sphere newButtonData.destination = stringToEdit; sphereButtonEvent.addButton(newButtonData); //add Buttondata to savestate saveManager.addButton(sphereButtonEvent.textureName, newButtonData); //delete temporary buttondata newButtonData = null; //disable window showDestinationWindow = false; } else if (GUI.Button(new Rect(110, 60, 100, 20), "Cancel")) { //cancel the window newButtonData = null; showDestinationWindow = false; } }