示例#1
0
    void SetGender()
    {
        GenderList    genderList = new GenderList();
        List <Gender> allGenders = genderList.GetGender();
        //TODO: Make this weighted depending on race?
        int genderRoll = GameObject.Find("GameController").GetComponent <GameController>().GameRandom.Next(100);

        if (genderRoll < 6)
        {
            Gender = allGenders.FirstOrDefault(o => o.Name == "nonbinary");
        }
        else if (genderRoll < 53)
        {
            Gender = allGenders.FirstOrDefault(o => o.Name == "male");
        }
        else
        {
            Gender = allGenders.FirstOrDefault(o => o.Name == "female");
        }
    }