public Person CreatePerson(Person parentA, Person parentB, string name = null, Sprite avatar = null, Person.Sexe sexe = Person.Sexe.MALE) { GameObject g = Instantiate(personGameObject, Vector3.zero, Quaternion.identity) as GameObject; Person person = g.GetComponent <Person>(); person.parentA = parentA; person.parentB = parentB; person.family = RandomFamily(); person.sexe = sexe; if (name == null) { person.personName = RandomNames.PickName(person.sexe); } else { person.personName = name; } if (avatar == null) { person.avatar = avatars.RandomAvatar(person.sexe); } else { person.avatar = avatar; } person.naissance = GameController.instance.annee; return(person); }
public PlayerModel() { PlayerNumber = ++_playerCount; Name = RandomNames.GetRandomName(); Chips = 3; }
private void Awake() { Dude = GetComponent <Dude>(); DudeAnimator = GetComponent <DudeAnimator>(); m_randomNames = new RandomNames(); m_randomNames.Initialize(); }
public Dealer(PedHash pedHash) { Name = RandomNames.GetRandomName(); X = 85.50f; Y = -1959.43f; Z = 21.12f; R = 344.75f; PedName = pedHash.ToString(); }
void GimmeNames() { for (int i = 0; i < GameStatus.playerTeam.units.Length; i++) { UnitSO u = GameStatus.playerTeam.units[i]; u = Instantiate(u); u.unit.Name = RandomNames.RandomName(); GameStatus.playerTeam.units[i] = u; } }
public Dealer(float x, float y, float z, float r, string pedName) { Name = RandomNames.GetRandomName(); X = x; Y = y; Z = z; R = r; PedName = pedName; Ped = null; }
public Dealer() { Name = RandomNames.GetRandomName(); X = 85.50f; Y = -1959.43f; Z = 21.12f; R = 344.75f; PedName = ""; Ped = null; }
// Function which will randomly assign character statistics with a +/- 20% variance based on enemy level // and will account for manual skill upgrades when the user levels up // TO-DO: Refactor this code to improve readability and usability later on, in other words, // separate functionalities into their individual functions // Hi Unity. void Awake() { randomNames = new RandomNames(); enemyName = randomNames.getName (firstNameOrigin, lastNameOrigin); enemyHealth = Random.Range ((50 * enemyLevel - 10 * enemyLevel) + 10 * enemyHPSkill, (50 * enemyLevel + 10 * enemyLevel) + 10 * enemyHPSkill); enemyMana = Random.Range ((20 * enemyLevel - 4 * enemyLevel) + 4 * enemyMPSkill, (20 * enemyLevel + 4 * enemyLevel) + 4 * enemyMPSkill); enemyStrength = Random.Range((10 * enemyLevel - 2 * enemyLevel) + 2 * enemyStrSkill, (10 * enemyLevel + 2 * enemyLevel) + 2 * enemyStrSkill); enemyDefense = Random.Range((10 * enemyLevel - 2 * enemyLevel) + 2 * enemyDefSkill, (10 * enemyLevel + 2 * enemyLevel) + 2 * enemyDefSkill); enemyIntelligence = Random.Range((10 * enemyLevel - 2 * enemyLevel) + 2 * enemyIntSkill, (10 * enemyLevel + 2 * enemyLevel) + 2 * enemyIntSkill); enemyCurrentHP = enemyHealth; enemyCurrentMP = enemyMana; }
protected override void Awake() { base.Awake(); if (ExtRandom.SplitChance()) { _gender = Gender.Male; } else { _gender = Gender.Female; } characterName = RandomNames.GetUniqueName(_gender); }
void GimmeNames() { for (int i = 0; i < playerTeam.units.Length; i++) { UnitSO u = playerTeam.units[i]; if (u == null) { Debug.LogError("Error( Names): Unit not found"); continue; } u = Instantiate(u); u.unit.Name = RandomNames.RandomName(); playerTeam.units[i] = u; } }
private void OnDestroy() { int[] highScores = GetHighScores(); string[] highScorenames = GetHighScoreNames(); string randomName = RandomNames.GetRandomZombieName(); for (int hIndex = 0; hIndex < highScores.Length; ++hIndex) { if (highScores[hIndex] < counter) { highScores = PushNewValueIntoArray(counter, hIndex, highScores); highScorenames = PushNewValueIntoArray(randomName, hIndex, highScorenames); break; } } UpdateHighscore(highScores, highScorenames); }
public Person RandomPerson(Person parentA, Person parentB) { /*GameObject g = Instantiate(personGameObject, Vector3.zero, Quaternion.identity) as GameObject; * * Person person = g.GetComponent<Person>(); * person.parentA = parentA; * person.parentB = parentB; * * person.sexe = RandomSexe(); * person.personName = RandomNames.PickName(person.sexe); * person.avatar = avatars.RandomAvatar(person.sexe); * * if (parentA != null) * { * person.naissance = parentA.naissance + Random.Range(18, 40); * } */ Person.Sexe sexe = RandomSexe(); Person person = CreatePerson(parentA, parentB, RandomNames.PickName(sexe), avatars.RandomAvatar(sexe), sexe); return(person); }
// Create units public IEnumerator CreateUnits() { int length; yield return(null); // Side A units if (teamA.units == null || teamB.units == null || teamA.units.Length == 0 || teamB.units.Length == 0) { Debug.Log("Teams are invalid!"); Debug.LogAssertion("Teams are invalid!"); yield break; } if (teamA.units.Length <= GridClass.instance.sideAStart.Length) { length = teamA.units.Length; } else { length = GridClass.instance.sideAStart.Length; } for (int i = 0; i < length; i++) { UnitClass unit = InstantiateUnit(GridClass.instance.sideAStart[i], teamA.units[i], true); if (GameStatus.playerTeam == null) { unit.Name = "A" + i + ": " + RandomNames.RandomName(); } else { unit.Name = "A" + i + ": " + unit.Name; } SetStartFacing(unit, Facing.east); units.Add(unit); } if (teamB.units.Length <= GridClass.instance.sideBStart.Length) { length = teamB.units.Length; } else { length = GridClass.instance.sideBStart.Length; } if (teamB.units.Length == 0) { Debug.LogAssertion("Here it is"); } // Side B units for (int i = 0; i < length; i++) { UnitClass unit = InstantiateUnit(GridClass.instance.sideBStart[i], teamB.units[i], false); unit.Name = "B" + i + ": " + RandomNames.RandomName(); SetStartFacing(unit, Facing.west); units.Add(unit); } }
public string getRandomPerson() { randomNames = new RandomNames(); return randomNames.getFirstName(firstNameOrigin); }