public EquipmentItem GetRealOne() { var real = new EquipmentItem(); real.durability = durability; //real.dirty = dirty; real.bodyIndex = bodyIndex; real.slotIndex = slotIndex; real.data = data.GetRealOne(); return(real); }
public void AddNewBodyPart(int bodyPartIndex, int slotIndex, Item item) { var oldBodyParts = body.ToArray(); body = new BlitableArray <EquipmentItem>(oldBodyParts.Length + 1, Allocator.Persistent); for (int i = 0; i < oldBodyParts.Length; i++) { body[i] = oldBodyParts[i]; } var bodyPart = new EquipmentItem(); bodyPart.data = item; bodyPart.bodyIndex = bodyPartIndex; bodyPart.slotIndex = slotIndex; body[oldBodyParts.Length] = bodyPart; dirty = 1; }