Colossus Name Generator Documentation
Setup and basic usage
- Drag the NameGenerator prefab from the MuteColossus/NameGenerator/Prefabs directory into your scene.
- In the script that you want to generate a name add the following code at the top of the file:
using MuteColossus;
- In the method that you want the name to be generated call the GenerateName method. The following code will generate a Female first name with a last name.
string name = CNG.instance.gen.GenerateName(Gender.Female);
- The name variable will now be filled with a random name.
Available Genders
The following genders are available through the Genders enum.
Gender.Female | Generates a first name from the Female names list. |
Gender.Male | Generates a first name from the Male names list. |
Gender.Other | Will randomly select either Male or Female genders to create the name. If middles names has been selected then Male first names will have a Female middle name, and Female first names will have a Male middle name. |
Class Methods
class NameGenerator
The following methods can be called from the CNG.instance.gen singleton:
public string GenerateName(Gender gender, bool addSurname = true, bool addMiddleName = false)
The GenerateName method will return a string based on the input you give it.
Gender gender | A gender from the MuteColossus Gender enum |
bool addSurname | If true, then a surname will be added, otherwise you’ll just get a first name. This is true by default. |
bool addMiddleName | If true, then a middle name will be added unless addSurname is false. This is false by default. |
public CharacterName GenerateNameObject(Gender gender, bool addSurname = true, bool addMiddleName = false)
The GenerateName method will return a CharacterName object based on the input you give it.
Gender gender | A gender from the MuteColossus Gender enum |
bool addSurname | If true, then a surname will be added, otherwise you’ll just get a first name. This is true by default. |
bool addMiddleName | If true, then a middle name will be added unless addSurname is false. This is false by default. |
class CharacterName
public string GetFirstName()
public void SetFirstName(string firstName)
public string GetMiddleName()
public void SetMiddleName(string middleName)
public string GetSurname()
public void SetSurname(string surname)
Sets the surname.