// Token: 0x060051D4 RID: 20948 RVA: 0x0025ED90 File Offset: 0x0025D190
        public static Graphic_Multi GetHeadRandom(Gender gender, Color skinColor, CrownType crownType)
        {
            GraphicDatabaseHeadRecords_Zombiefied.BuildDatabaseIfNecessary();
            Predicate <GraphicDatabaseHeadRecords_Zombiefied.HeadGraphicRecord> predicate = (GraphicDatabaseHeadRecords_Zombiefied.HeadGraphicRecord head) => head.crownType == crownType && head.gender == gender;
            int num = 0;

            GraphicDatabaseHeadRecords_Zombiefied.HeadGraphicRecord headGraphicRecord;
            for (; ;)
            {
                headGraphicRecord = GraphicDatabaseHeadRecords_Zombiefied.heads.RandomElement <GraphicDatabaseHeadRecords_Zombiefied.HeadGraphicRecord>();
                if (predicate(headGraphicRecord))
                {
                    break;
                }
                num++;
                if (num > 40)
                {
                    goto Block_2;
                }
            }
            return(headGraphicRecord.GetGraphic(skinColor, false));

Block_2:
            foreach (GraphicDatabaseHeadRecords_Zombiefied.HeadGraphicRecord headGraphicRecord2 in GraphicDatabaseHeadRecords_Zombiefied.heads.InRandomOrder(null))
            {
                if (predicate(headGraphicRecord2))
                {
                    return(headGraphicRecord2.GetGraphic(skinColor, false));
                }
            }
            Log.Error("Failed to find head for gender=" + gender + ". Defaulting...", false);
            return(GraphicDatabaseHeadRecords_Zombiefied.heads.First <GraphicDatabaseHeadRecords_Zombiefied.HeadGraphicRecord>().GetGraphic(skinColor, false));
        }
Exemple #2
0
        // Token: 0x06000078 RID: 120 RVA: 0x00004AE0 File Offset: 0x00002CE0
        public void ResolveAllGraphics(float scale = 1f)
        {
            Shader shader = ShaderDatabase.LoadShader(this.data.shaderCutoutPath);

            this.ClearCache();
            this.nakedGraphic               = GraphicDatabase.Get <Graphic_Multi>(this.data.bodyType.bodyNakedGraphicPath, ShaderDatabase.CutoutSkin, Vector2.one, this.data.color);
            this.rottingGraphic             = GraphicDatabase.Get <Graphic_Multi>(this.data.bodyType.bodyNakedGraphicPath, ShaderDatabase.CutoutSkin, Vector2.one, PawnGraphicSet.RottingColor);
            this.dessicatedGraphic          = GraphicDatabase.Get <Graphic_Multi>(this.data.bodyType.bodyDessicatedGraphicPath, shader);
            this.headGraphic                = GraphicDatabaseHeadRecords_Zombiefied.GetHeadNamed(this.data.headGraphicPath, this.data.color);
            this.desiccatedHeadGraphic      = GraphicDatabaseHeadRecords_Zombiefied.GetHeadNamed(this.data.headGraphicPath, PawnGraphicSet.RottingColor);
            this.skullGraphic               = GraphicDatabaseHeadRecords.GetSkull();
            this.headStumpGraphic           = GraphicDatabaseHeadRecords.GetStump(this.data.color);
            this.desiccatedHeadStumpGraphic = GraphicDatabaseHeadRecords.GetStump(PawnGraphicSet.RottingColor);
            this.hairGraphic                = GraphicDatabase.Get <Graphic_Multi>(this.data.hairGraphicPath, shader, Vector2.one, this.data.hairColor);
            this.ResolveApparelGraphics();
        }
 // Token: 0x060051D3 RID: 20947 RVA: 0x0025ED7D File Offset: 0x0025D17D
 public static Graphic_Multi GetStump(Color skinColor)
 {
     GraphicDatabaseHeadRecords_Zombiefied.BuildDatabaseIfNecessary();
     return(GraphicDatabaseHeadRecords_Zombiefied.stump.GetGraphic(skinColor, false));
 }
 // Token: 0x060051D2 RID: 20946 RVA: 0x0025ED66 File Offset: 0x0025D166
 public static Graphic_Multi GetSkull()
 {
     GraphicDatabaseHeadRecords_Zombiefied.BuildDatabaseIfNecessary();
     return(GraphicDatabaseHeadRecords_Zombiefied.skull.GetGraphic(Color.white, true));
 }