Example #1
0
 public void RandomizeTattoo()
 {
     if (tattoos.Count > 0)
     {
         curTattoo = tattoos[Random.Range(0, tattoos.Count - 1)];
         if (prefabInstance != null)
         {
             Destroy(prefabInstance);
         }
         prefabInstance = Instantiate(curTattoo.GetPrefab(), transform.position, transform.rotation);
     }
 }
        public static bool Prefix(Pawn pawn, TattooType tattooType, ref StyleItemDef __result)
        {
            IEnumerable <StyleItemDef> source = from item in DefDatabase <StyleItemDef> .AllDefs
                                                where PawnStyleItemChooser.WantsToUseStyle(pawn, item, tattooType)
                                                select item;

            if (!source.Any <StyleItemDef>())
            {
                Log.Error("Error finding style item for " + pawn.LabelShort + " of " + pawn.Faction);
                __result = default(StyleItemDef);
                return(false);
            }
            __result = source.RandomElementByWeight((StyleItemDef s) => PawnStyleItemChooser.TotalStyleItemLikelihood(s, pawn));
            return(false);
        }