コード例 #1
0
 public void AddPosition(TypedSlotPosition position)
 {
     if (!ItemTypePositions.ContainsKey(position.Type))
     {
         positions.Add(position);
         OnValidate();
     }
 }
コード例 #2
0
        public ItemSlotPosition GetPosition(ItemType itemType, string modelName = "")
        {
            var key = ModelSlotPosition.CreateKey(itemType, modelName);

            if (ModelSlotPositionsSet.ContainsKey(key))
            {
                return(ModelSlotPositionsSet[key].position);
            }
            else if (ItemTypePositions.ContainsKey(itemType))
            {
                return(ItemTypePositions[itemType].position);
            }

            return(new ItemSlotPosition()
            {
                type = itemType,
                bone = defaultBone
            });
        }
コード例 #3
0
 public TypedSlotPosition GetTypedSlotPosition(Item item)
 {
     return(ItemTypePositions.TryGetValue(item.Type, out var result) ? result : null);
 }