private void CreateNewName() { if (textDisplay) { if (currentType == nameType.simpleName) { textDisplay.text = nameGenerator.GetFirstName(); //this is how you get a name } else { textDisplay.text = nameGenerator.GetShipNameWithTitle(); //you can call any function from the generator and immediately assign it to a string-variable } } }