Ejemplo n.º 1
0
 public void WearCurrent()
 {
     if (CurrentSelection.Valid)
     {
         if (Worn.ContainsKey(CurrentSelection.ClothingType.Value))
         {
             // We're already wearing something.
             StripCurrent();
         }
         GameObject        inst      = GameObject.Instantiate(selectedCloth.Prefab);
         WardrobeSelection newlyWorn = new WardrobeSelection(CurrentSelection.ClothingType.Value, CurrentSelection.Index, inst);
         this.Worn.Add(newlyWorn.ClothingType.Value, newlyWorn);
     }
 }
Ejemplo n.º 2
0
 private void Awake()
 {
     Worn                = new Dictionary <EClothingType, WardrobeSelection>();
     CurrentSelection    = new WardrobeSelection();
     KnownClothingByType = new Dictionary <EClothingType, List <Clothing> >();
     foreach (Clothing c in KnownClothes)
     {
         if (!KnownClothingByType.ContainsKey(c.CType))
         {
             KnownClothingByType[c.CType] = new List <Clothing>();
         }
         KnownClothingByType[c.CType].Add(c);
     }
 }
Ejemplo n.º 3
0
 public bool SetView(EClothingType drawer)
 {
     if (this.Worn.ContainsKey(drawer))
     {
         // We're already wearing something from this drawer
         WardrobeSelection curr = Worn[drawer];
         this.CurrentSelection = new WardrobeSelection(curr.ClothingType.Value, curr.Index);
     }
     else
     {
         if (this.KnownClothingByType.ContainsKey(drawer))
         {
             this.CurrentSelection = new WardrobeSelection(drawer);
         }
     }
     RefreshView();
     return(CurrentSelection.Valid);
 }