Skip to content

Commit 64a787b

Browse files
authored
Merge pull request #31 from ashblue/develop
V2.0.1 Release
2 parents d6d026d + 0846d36 commit 64a787b

File tree

6 files changed

+46
-1
lines changed

6 files changed

+46
-1
lines changed

Assets/Examples/Resources/ItemDatabase.asset

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ MonoBehaviour:
1414
m_EditorClassIdentifier:
1515
_autoLoad: 1
1616
_definitions:
17+
- {fileID: 11400000, guid: 80d3b6ab2a78e6b418da8aed88e32926, type: 2}
1718
- {fileID: 11400000, guid: d3988ba3f8a2c44e6a1b98201ce75ee2, type: 2}
1819
- {fileID: 11400000, guid: 4e2438a1b36c043e587e88575d07b5ff, type: 2}
1920
- {fileID: 11400000, guid: 5e7593ddbeb614a3984bd7fcc9251406, type: 2}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 11500000, guid: e149b91f3de145dc9820a3c795b7b05a, type: 3}
13+
m_Name: CustomItem
14+
m_EditorClassIdentifier:
15+
_id: fe563339-c771-4245-9db6-3b38dccf7426

Assets/Examples/Shop/Definitions/CustomItem.asset.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using CleverCrow.Fluid.ElasticInventory;
2+
3+
namespace CleverCrow.Fluid.Examples {
4+
/// <summary>
5+
/// Simulates creating a custom display name and category for an item definition
6+
/// </summary>
7+
[ItemDefinitionDetails("Custom Display Details")]
8+
public class ItemDefinitionCustomDisplayName : ItemDefinitionBase {
9+
public override string DisplayName => "Custom Display Name";
10+
public override string Category => "Custom Category";
11+
}
12+
}

Assets/Examples/Shop/Scripts/Definitions/ItemDefinitionCustomDisplayName.cs.meta

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/com.fluid.elastic-inventory/Editor/Components/Pages/PageItemDatabase.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,13 @@ void CreateItemDefinition (ItemDatabase database, Type type) {
9595

9696
var serializedObject = new SerializedObject(itemDefinition);
9797
var fileName = System.IO.Path.GetFileNameWithoutExtension(path);
98-
serializedObject.FindProperty("_displayName").stringValue = MakeSpacedWord(fileName);
98+
99+
// Set the display name to be the spaced version of the file name (if it exists)
100+
var displayName = serializedObject.FindProperty("_displayName");
101+
if (displayName != null) {
102+
displayName.stringValue = MakeSpacedWord(fileName);
103+
}
104+
99105
// @TODO Duplicate IDs are inevitable due to object cloning, repair them automatically when refreshing asset references
100106
serializedObject.FindProperty("_id").stringValue = Guid.NewGuid().ToString();
101107
serializedObject.ApplyModifiedPropertiesWithoutUndo();

0 commit comments

Comments
 (0)