Skip to content

Commit 917b27a

Browse files
authored
Merge pull request #2 from ashblue/feature/core-docs
docs: initial documentation added
2 parents 1c07368 + 5f412ae commit 917b27a

22 files changed

+1424
-43
lines changed

.releaserc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"release": {
3-
"branches": ["master", "main"]
4-
},
2+
"branches": ["master", "main"],
53
"plugins": [
64
"@semantic-release/commit-analyzer",
75
"@semantic-release/release-notes-generator",

Assets/Examples/CustomEntryTest.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using CleverCrow.Fluid.ElasticInventory;
2+
using UnityEngine;
3+
4+
namespace CleverCrow.Fluid.Examples {
5+
public class CustomEntrySaveLoadTest : MonoBehaviour {
6+
public InventoryHelper inventory;
7+
public ItemDefinitionWeapon weapon;
8+
public int changeDurability = 22;
9+
10+
private void Start () {
11+
// Create the item and modify the durability
12+
var entry = inventory.Instance.Add(weapon) as ItemEntryWeapon;
13+
Debug.Log("New item durability: " + entry.Durability);
14+
15+
entry.Durability = changeDurability;
16+
Debug.Log("Changed item durability: " + entry.Durability);
17+
18+
// Load the item from save data
19+
var save = inventory.Instance.Save();
20+
var newInventory = new InventoryInstance(ItemDatabase.Current);
21+
newInventory.Load(save);
22+
23+
// Print the durability of the loaded item
24+
var restoredItem = newInventory.GetEntry(entry.Id) as ItemEntryWeapon;
25+
Debug.Log("Restored item durability: " + restoredItem.Durability);
26+
}
27+
}
28+
}

Assets/Examples/CustomEntryTest/CustomEntrySaveLoadTest.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)