コード例 #1
0
ファイル: EquipmentItem.cs プロジェクト: Deus0/zoxel
            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);
            }
コード例 #2
0
        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;
        }