Beispiel #1
0
 private void InstallMod(ref ItemModPair to, int slot, ItemModDataBlock datablock, CharacterStateFlags flags)
 {
     to.dataBlock = datablock;
     if (to.representation != null)
     {
         this.KillModRep(ref to.representation, false);
     }
     if (to.dataBlock.hasModRepresentation && to.dataBlock.AddModRepresentationComponent(base.gameObject, out to.representation))
     {
         to.bindState = BindState.None;
         to.representation.Initialize(this, slot, flags);
         if (to.representation != null)
         {
             if (this.worldModels)
             {
                 this._itemMods.BindAsProxy(slot, this);
             }
         }
         else
         {
             to.bindState      = BindState.Vacant;
             to.representation = null;
         }
     }
 }
Beispiel #2
0
 private void BindModAsProxy(ref ItemModPair pair)
 {
     if (((int)pair.bindState) == 1)
     {
         pair.dataBlock.BindAsProxy(pair.representation);
         pair.bindState = BindState.World;
     }
 }
Beispiel #3
0
 private void BindModAsLocal(ref ItemModPair pair, ref ModViewModelAddArgs a)
 {
     if (((int)pair.bindState) == 2)
     {
         this.UnBindModAsProxy(ref pair);
     }
     if ((((int)pair.bindState) == 1) || (((int)pair.bindState) == 3))
     {
         a.modRep = pair.representation;
         pair.dataBlock.BindAsLocal(ref a);
         pair.bindState = BindState.Local;
     }
 }
Beispiel #4
0
 private void ClearModPair(ref ItemModPair pair)
 {
     this.KillModRep(ref pair.representation, false);
     this.EraseModDatablock(ref pair.dataBlock);
     pair = new ItemModPair();
 }