public void SetArmor(ItemWearable item) { if (item != null && item.wearableType != ItemWearable.WearableTypes.Armor) { return; } if (Armor != null) { Armor.Deactivate(); } Armor = item; if (onSetWearable != null) { onSetWearable(item); } }
public void SetRing(ItemWearable item) { if (item != null && item.wearableType != ItemWearable.WearableTypes.Ring) { return; } if (Ring != null) { Ring.Deactivate(); } Ring = item; if (onSetWearable != null) { onSetWearable(item); } }
public void SetAmulet(ItemWearable item) { if (item != null && item.wearableType != ItemWearable.WearableTypes.Amulet) { return; } if (Amulet != null) { Amulet.Deactivate(); } Amulet = item; if (onSetWearable != null) { onSetWearable(item); } }
public void SetHelmet(ItemWearable item) { if (item != null && item.wearableType != ItemWearable.WearableTypes.Helmet) { return; } if (Helmet != null) { Helmet.Deactivate(); } Helmet = item; if (onSetWearable != null) { onSetWearable(item); } }
public void SetWearable(ItemWearable item) { if (item.wearableType == ItemWearable.WearableTypes.Armor) { SetArmor(item); } if (item.wearableType == ItemWearable.WearableTypes.Helmet) { SetHelmet(item); } if (item.wearableType == ItemWearable.WearableTypes.Amulet) { SetAmulet(item); } if (item.wearableType == ItemWearable.WearableTypes.Ring) { SetRing(item); } }
private void DrawWearableProperties(ItemWearable item) { EditorGUILayout.BeginHorizontal(); item.wearableType = (ItemWearable.WearableTypes)EditorGUILayout.EnumPopup(item.wearableType, GUILayout.Width(120)); EditorGUILayout.LabelField("Strenght", GUILayout.Width(60)); item.strenghtBonus = EditorGUILayout.IntField(item.strenghtBonus, GUILayout.Width(30)); EditorGUILayout.LabelField("Stamina", GUILayout.Width(60)); item.staminaBonus = EditorGUILayout.IntField(item.staminaBonus, GUILayout.Width(30)); EditorGUILayout.LabelField("Willpower", GUILayout.Width(60)); item.willpowerBonus = EditorGUILayout.IntField(item.willpowerBonus, GUILayout.Width(30)); EditorGUILayout.LabelField("Mind", GUILayout.Width(60)); item.mindBonus = EditorGUILayout.IntField(item.mindBonus, GUILayout.Width(30)); EditorGUILayout.LabelField(" DEFENSE (0-1):", GUILayout.Width(100)); EditorGUILayout.LabelField("Physical", GUILayout.Width(60)); item.defenceBonus.physical = EditorGUILayout.FloatField(item.defenceBonus.physical, GUILayout.Width(30)); EditorGUILayout.LabelField("Fire", GUILayout.Width(60)); item.defenceBonus.fire = EditorGUILayout.FloatField(item.defenceBonus.fire, GUILayout.Width(30)); EditorGUILayout.LabelField("Ice", GUILayout.Width(60)); item.defenceBonus.ice = EditorGUILayout.FloatField(item.defenceBonus.ice, GUILayout.Width(30)); EditorGUILayout.LabelField("Electro", GUILayout.Width(60)); item.defenceBonus.electro = EditorGUILayout.FloatField(item.defenceBonus.electro, GUILayout.Width(30)); EditorGUILayout.EndHorizontal(); }