diff --git a/Assembly-CSharp.csproj b/Assembly-CSharp.csproj
index 87ed0a0..4cb8179 100644
--- a/Assembly-CSharp.csproj
+++ b/Assembly-CSharp.csproj
@@ -52,24 +52,26 @@
+
+
+
-
-
+
diff --git a/Assets/Editor/DictionaryDrawer.cs b/Assets/Editor/DictionaryDrawer.cs
deleted file mode 100644
index 8dc029f..0000000
--- a/Assets/Editor/DictionaryDrawer.cs
+++ /dev/null
@@ -1,439 +0,0 @@
-using System;
-using System.Collections.Generic;
-using UnityEditor;
-using UnityEngine;
-using UnityObject = UnityEngine.Object;
-using System.Reflection;
-
-public abstract class DictionaryDrawer : PropertyDrawer
-{
- private Dictionary _Dictionary;
- private bool _Foldout;
- private const float kButtonWidth = 18f;
- private static float lineHeight = EditorGUIUtility.singleLineHeight + 4;
- private float spacing = 12f;
- private float fieldPadding = 1f;
-
- private GUIStyle addEntryStyle;
- private GUIContent addEntryContent;
- private GUIStyle clearDictionaryStyle;
- private GUIContent clearDictionaryContent;
- //reuses clearDictionaryStyle. I am adding it for readability
- private GUIStyle removeEntryStyle;
- private GUIContent removeEntryContent;
-
- private GUIStyle HeaderStyle;
-
- private Rect buttonRect;
-
- public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
- {
- CheckInitialize(property, label);
- if (_Foldout)
- {
- //Height of the main Header and the two column headers + height of all the drawn dictionary entries + a little padding on the bottom.
- return (GetDictionaryElementsHeight() + (lineHeight * 2)) + 14f;
- }
- return lineHeight+ 4f;
- }
-
- public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
- {
- CheckInitialize(property, label);
-
- position.height = 20f;
- DrawHeader(position, property, label);
-
-
- if (!_Foldout)
- return;
- position.y += 5f + lineHeight * 2;
- foreach (var item in _Dictionary)
- {
- var key = item.Key;
- var value = item.Value;
-
- var keyRect = position;
- keyRect.width /= 3;
- keyRect.x += 10;
- //Apply vertical padding
- keyRect.y += fieldPadding;
- keyRect.height -= fieldPadding * 2;
-
- EditorGUI.BeginChangeCheck();
- var newKey = DoField(keyRect, typeof(TK), (TK)key);
- if (EditorGUI.EndChangeCheck())
- {
- try
- {
- _Dictionary.Remove(key);
- _Dictionary.Add(newKey, value);
- }
- catch (Exception e)
- {
- _Dictionary.Remove(key);
- Debug.Log(e.Message);
- }
- break;
- }
-
- var valueRect = position;
- valueRect.x = keyRect.xMax + spacing;
- valueRect.y += fieldPadding;
- //Apply vertical padding
- valueRect.height -= fieldPadding * 2;
- valueRect.width = (position.width - keyRect.width) - ((kButtonWidth + 2) * 2f) - valueRect.size.y - (spacing* 2.5f);
- EditorGUI.BeginChangeCheck();
- value = DoField(valueRect, typeof(TV), (TV)value);
-
-
- Rect changeValueRect = new Rect(new Vector2(buttonRect.x - 2f, valueRect.position.y), new Vector2(kButtonWidth, valueRect.size.y));
- value = ChangeValueType(changeValueRect, key, value);
-
- if (EditorGUI.EndChangeCheck())
- {
- _Dictionary[key] = value;
- break;
- }
- EditorGUIUtility.AddCursorRect(changeValueRect, MouseCursor.Link);
-
- var removeRect = valueRect;
- removeRect.x = buttonRect.x + kButtonWidth;
- removeRect.width = kButtonWidth;
- if (GUI.Button(removeRect, removeEntryContent, removeEntryStyle))
- {
- RemoveItem(key);
- break;
- }
- EditorGUIUtility.AddCursorRect(removeRect, MouseCursor.Link);
- position.y += Mathf.Max(GetEntryHeight(key) ,GetEntryHeight(value));
- }
- }
-
- ///
- /// Gets the combined height of all dictionary elements
- ///
- ///
- private float GetDictionaryElementsHeight()
- {
- float height = 0;
- foreach(var item in _Dictionary)
- {
- var key = item.Key;
- var value = item.Value;
- height += Mathf.Max(GetEntryHeight(key), GetEntryHeight(value));
- }
-
- return height;
- }
-
- private void DrawColumn(Rect position, GUIStyle style)
- {
- Rect columnRect = new Rect(position.x, position.yMax - 1, position.width, GetDictionaryElementsHeight() + 12f);
- GUI.Box(columnRect, GUIContent.none, style);
- }
-
- private void DrawHeader(Rect position, SerializedProperty property, GUIContent label)
- {
- Rect headerRect = new Rect(position.position, new Vector2(position.size.x - kButtonWidth * 1.5f, lineHeight));
- GUI.Box(headerRect, GUIContent.none, HeaderStyle);
- var foldoutRect = position;
- foldoutRect.x += 4f;
- foldoutRect.width -= 2 * kButtonWidth;
- EditorGUI.BeginChangeCheck();
- if(_Dictionary.Count > 0)
- {
- _Foldout = EditorGUI.Foldout(foldoutRect, _Foldout, label, true);
- }
- else
- {
- foldoutRect.x += 4f;
- EditorGUI.LabelField(foldoutRect, label);
- _Foldout = false;
- }
- if (EditorGUI.EndChangeCheck())
- {
- EditorPrefs.SetBool(label.text, _Foldout);
- }
-
- //Draw the Add Item Button
- buttonRect = position;
- buttonRect.x = position.width - 20 - kButtonWidth + position.x + 1;
- buttonRect.width = kButtonWidth;
-
- GUIStyle headerButtonStyle = new GUIStyle(HeaderStyle);
- headerButtonStyle.padding = new RectOffset(0, 0, 0, 0);
- Rect headerButtonRect = new Rect(buttonRect.position, new Vector2(kButtonWidth * 1.5f, lineHeight));
- if (GUI.Button(headerButtonRect, addEntryContent, headerButtonStyle))
- {
- AddNewItem();
- }
- EditorGUIUtility.AddCursorRect(headerButtonRect, MouseCursor.Link);
- buttonRect.x -= kButtonWidth;
-
- //Draw the Item count label
- GUIStyle headerItemCountLabelStyle = new GUIStyle("MiniLabel");
- GUIContent headerItemCountLabelContent = new GUIContent();
- if(_Dictionary.Count == 0)
- {
- headerItemCountLabelContent = new GUIContent("Empty");
- }
- else
- {
- headerItemCountLabelContent = new GUIContent($"{_Dictionary.Count} Item{(_Dictionary.Count == 1 ? "" : "s")}");
- }
-
- GUI.Label(new Rect(buttonRect.x - 30f, buttonRect.y, 50f, headerRect.height), headerItemCountLabelContent, headerItemCountLabelStyle);
-
-
- //Draw the header labels (Keys - Values)
- if(_Foldout)
- {
- //Draw "Keys" header
- position.y += headerRect.height;
- Rect keyHeaderRect = new Rect(position.x, position.y - 1, position.width /3f + kButtonWidth - 1, headerRect.height);
- GUIStyle columnHeaderStyle = new GUIStyle("GroupBox");
- columnHeaderStyle.padding = new RectOffset(0, 0, 0, 0);
- columnHeaderStyle.contentOffset = new Vector2(0, 3f);
- GUI.Box(keyHeaderRect, new GUIContent("Keys"), columnHeaderStyle);
-
- //Draw "Values" header
- Rect valuesHeaderRect = new Rect(keyHeaderRect.xMax - 1, keyHeaderRect.y, (position.width - keyHeaderRect.width - kButtonWidth * 0.5f), keyHeaderRect.height);
- GUI.Box(valuesHeaderRect, new GUIContent("Values"), columnHeaderStyle);
- //Draw the Columns for the keys and values.
- DrawColumn(keyHeaderRect, columnHeaderStyle);
- DrawColumn(valuesHeaderRect, columnHeaderStyle);
-
- position.y += headerRect.height;
- }
-
- /*
- if (GUI.Button(buttonRect, clearDictionaryContent, clearDictionaryStyle))
- {
- ClearDictionary();
- }
- */
- }
-
- #region TypeControls
- private static float GetEntryHeight(T value)
- {
- switch (value)
- {
- case Bounds: return lineHeight * 2;
- case BoundsInt: return lineHeight * 2;
- case Rect: return lineHeight * 2;
- case RectInt: return lineHeight * 2;
- default: return lineHeight;
- }
- }
-
- private static T DoField(Rect rect, Type type, T value)
- {
- if (typeof(UnityObject).IsAssignableFrom(type))
- return (T)(object)EditorGUI.ObjectField(rect, (UnityObject)(object)value, type, true);
- switch (value)
- {
- case null: EditorGUI.LabelField(rect, "null"); return value;
- case long: return (T)(object)EditorGUI.LongField(rect, (long)(object)value);
- case int: return (T)(object)EditorGUI.IntField(rect, (int)(object)value);
- case float: return (T)(object)EditorGUI.FloatField(rect, (float)(object)value);
- case double: return (T)(object)EditorGUI.DoubleField(rect, (double)(object)value);
- case string: return (T)(object)EditorGUI.TextField(rect, (string)(object)value);
- case bool: return (T)(object)EditorGUI.Toggle(rect, (bool)(object)value);
- case Vector2Int: return (T)(object)EditorGUI.Vector2IntField(rect, GUIContent.none, (Vector2Int)(object)value);
- case Vector3Int: return (T)(object)EditorGUI.Vector3IntField(rect, GUIContent.none, (Vector3Int)(object)value);
- case Vector2: return (T)(object)EditorGUI.Vector2Field(rect, GUIContent.none, (Vector2)(object)value);
- case Vector3: return (T)(object)EditorGUI.Vector3Field(rect, GUIContent.none, (Vector3)(object)value);
- case Vector4: return (T)(object)EditorGUI.Vector4Field(rect, GUIContent.none, (Vector4)(object)value);
- case BoundsInt: return (T)(object)EditorGUI.BoundsIntField(rect, (BoundsInt)(object)value);
- case Bounds: return (T)(object)EditorGUI.BoundsField(rect, (Bounds)(object)value);
- case RectInt: return (T)(object)EditorGUI.RectIntField(rect, (RectInt)(object)value);
- case Rect: return (T)(object)EditorGUI.RectField(rect, (Rect)(object)value);
- case Color: return (T)(object)EditorGUI.ColorField(rect, (Color)(object)value);
- case AnimationCurve: return (T)(object)EditorGUI.CurveField(rect, (AnimationCurve)(object)value);
- case Gradient: return (T)(object)EditorGUI.GradientField(rect, (Gradient)(object)value);
- case UnityObject: return (T)(object)EditorGUI.ObjectField(rect, (UnityObject)(object)value, type, true);
- }
-
- if (value.GetType().IsEnum)
- {
- if (Enum.TryParse(value.GetType(), value.ToString(), out object enumValue))
- {
- return (T)(object)EditorGUI.EnumPopup(rect, (Enum)enumValue);
- }
- }
-
- //Setup GUIStyle and GUIContent for the "Clear Dictionary" button
- GUIStyle style = new GUIStyle(EditorStyles.miniButton);
- style.padding = new RectOffset(2, 2, 2, 2);
- GUIContent content = new GUIContent(EditorGUIUtility.IconContent("d_UnityEditor.ConsoleWindow@2x"));
- content.tooltip = "Debug Values";
-
- Type fieldType = value.GetType();
- bool isStruct = fieldType.IsValueType && !fieldType.IsEnum;
- EditorGUI.LabelField(rect, $"{fieldType.ToString().Replace("+", ".")} {(isStruct ? "struct" : "class")} instance");
- if( GUI.Button(new Rect(rect.xMax - kButtonWidth, rect.y, kButtonWidth, kButtonWidth), content, style))
- {
- Debug.Log(JsonUtility.ToJson(value));
- }
-
- //DrawSerializableObject(rect, value);
- return value;
- }
-
- //Unfinished
- /*
- public static void DrawSerializableObject(Rect rect, object obj)
- {
- if (obj == null)
- {
- Console.WriteLine("Object is null.");
- return;
- }
-
- Type type = obj.GetType();
- FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
-
- foreach (FieldInfo field in fields)
- {
- object value = field.GetValue(obj);
- rect.y += GetEntryHeight(value);
- Debug.Log($"{field.Name}: {value}");
- if(value != null)
- {
- DoField(rect, value.GetType(), value);
- }
- }
-
- }
- */
-
-private TV ChangeValueType(Rect rect, TK key, TV value)
- {
- GUIContent content = EditorGUIUtility.IconContent("_Popup");
- content.tooltip = "Change Value Type";
- GUIStyle changeItemStyle = new GUIStyle(EditorStyles.miniButton);
- changeItemStyle.padding = new RectOffset(2, 2, 2, 2);
-
- if (GUI.Button(rect, content, changeItemStyle))
- {
- GenericMenu genericMenu = new GenericMenu();
- genericMenu.AddItem(new GUIContent("Numbers/int"), value is int, () => { _Dictionary[key] = (TV)(object)default(int); });
- genericMenu.AddItem(new GUIContent("Numbers/float"), value is float, () => { _Dictionary[key] = (TV)(object)default(float); });
- genericMenu.AddItem(new GUIContent("Numbers/double"), value is double, () => { _Dictionary[key] = (TV)(object)default(double); });
- genericMenu.AddItem(new GUIContent("Numbers/long"), value is long, () => { _Dictionary[key] = (TV)(object)default(long); });
- genericMenu.AddItem(new GUIContent("Vectors/Vector2"), (value is Vector2 && !(value is Vector2Int)), () => { _Dictionary[key] = (TV)(object)default(Vector2); });
- genericMenu.AddItem(new GUIContent("Vectors/Vector3"), (value is Vector3 && !(value is Vector3Int)), () => { _Dictionary[key] = (TV)(object)default(Vector3); });
- genericMenu.AddItem(new GUIContent("Vectors/Vector4"), value is Vector4, () => { _Dictionary[key] = (TV)(object)default(Vector4); });
- genericMenu.AddItem(new GUIContent("Vectors/Vector2Int"), value is Vector2Int, () => { _Dictionary[key] = (TV)(object)default(Vector2Int); });
- genericMenu.AddItem(new GUIContent("Vectors/Vector3Int"), value is Vector3Int, () => { _Dictionary[key] = (TV)(object)default(Vector3Int); });
- genericMenu.AddItem(new GUIContent("Bounds/Bounds"), value is Bounds && value is not BoundsInt, () => { _Dictionary[key] = (TV)(object)default(Bounds); });
- genericMenu.AddItem(new GUIContent("Bounds/BoundsInt"), value is BoundsInt, () => { _Dictionary[key] = (TV)(object)default(BoundsInt); });
- genericMenu.AddItem(new GUIContent("Rects/Rect"), value is Rect && value is not RectInt, () => { _Dictionary[key] = (TV)(object)default(Rect); });
- genericMenu.AddItem(new GUIContent("Rects/RectInt"), value is RectInt, () => { _Dictionary[key] = (TV)(object)default(RectInt); });
- genericMenu.AddItem(new GUIContent("string"), value is string, () => { _Dictionary[key] = (TV)(object)""; });
- genericMenu.AddItem(new GUIContent("bool"), value is bool, () => { _Dictionary[key] = (TV)(object)default(bool); });
- genericMenu.AddItem(new GUIContent("Color"), value is Color, () => { _Dictionary[key] = (TV)(object)default(Color); });
- genericMenu.AddItem(new GUIContent("AnimationCurve"), value is AnimationCurve, () => { _Dictionary[key] = (TV)(object)(new AnimationCurve()); });
- genericMenu.AddItem(new GUIContent("Gradient"), value is Gradient, () => { _Dictionary[key] = (TV)(object)(new Gradient()); });
- genericMenu.AddItem(new GUIContent("Unity Object"), value is UnityObject, () => { _Dictionary[key] = (TV)(object)(new UnityObject()); });
- genericMenu.ShowAsContext();
- }
-
- return (TV)value;
- }
-#endregion
-
- private void RemoveItem(TK key)
- {
- _Dictionary.Remove(key);
- }
-
- private void CheckInitialize(SerializedProperty property, GUIContent label)
- {
- if (_Dictionary == null)
- {
- SetupStyles();
- var target = property.serializedObject.targetObject;
- _Dictionary = fieldInfo.GetValue(target) as Dictionary;
- if (_Dictionary == null)
- {
- _Dictionary = new Dictionary();
- fieldInfo.SetValue(target, _Dictionary);
- }
-
- _Foldout = EditorPrefs.GetBool(label.text);
- }
- }
-
- private void SetupStyles()
- {
- //Setup GUIStyle and GUIContent for the "Add Item" button
- addEntryStyle = new GUIStyle(EditorStyles.miniButton);
- addEntryStyle.padding = new RectOffset(3, 3, 3, 3);
- addEntryContent = new GUIContent(EditorGUIUtility.IconContent("d_CreateAddNew@2x"));
- addEntryContent.tooltip = "Add Item";
-
- //Setup GUIStyle and GUIContent for the "Clear Dictionary" button
- clearDictionaryStyle = new GUIStyle(EditorStyles.miniButton);
- clearDictionaryStyle.padding = new RectOffset(2, 2, 2, 2);
- clearDictionaryContent = new GUIContent(EditorGUIUtility.IconContent("d_winbtn_win_close@2x"));
- clearDictionaryContent.tooltip = "Clear dictionary";
-
- removeEntryContent = new GUIContent(EditorGUIUtility.IconContent("d_winbtn_win_close@2x"));
- removeEntryContent.tooltip = "Remove Item";
- removeEntryStyle = new GUIStyle(clearDictionaryStyle);
-
- HeaderStyle = new GUIStyle("MiniToolbarButton");
- HeaderStyle.fixedHeight = 0;
- HeaderStyle.fixedWidth = 0;
- HeaderStyle.padding = new RectOffset(2,2,2,2);
- }
-
- private void ClearDictionary()
- {
- _Dictionary.Clear();
- }
-
- private void AddNewItem()
- {
- TK key;
- if (typeof(TK) == typeof(string))
- key = (TK)(object)"";
- else key = default(TK);
-
- if (typeof(TV) == typeof(object))
- {
- var value = (TV)(object)1;
- try
- {
- _Dictionary.Add(key, value);
- }
- catch (Exception e)
- {
- Debug.Log(e.Message);
- }
- }
- else
- {
- var value = default(TV);
- try
- {
- _Dictionary.Add(key, value);
- }
- catch (Exception e)
- {
- Debug.Log(e.Message);
- }
- }
- }
-}
-
-
-[CustomPropertyDrawer(typeof(Blackboard))]
-public class BlackboardDrawer : DictionaryDrawer { }
-
-
-// [CustomPropertyDrawer(typeof(Inventory))]
-// public class InventoryDrawer : DictionaryDrawer { }
diff --git a/Assets/Editor/DictionaryDrawer.cs.meta b/Assets/Editor/DictionaryDrawer.cs.meta
deleted file mode 100644
index c4b4c11..0000000
--- a/Assets/Editor/DictionaryDrawer.cs.meta
+++ /dev/null
@@ -1,2 +0,0 @@
-fileFormatVersion: 2
-guid: d98eeb23cea688d4c9a9ce396d927919
\ No newline at end of file
diff --git a/Assets/Prefabs/Shelf.prefab b/Assets/Prefabs/Shelf.prefab
index 7c9c8ca..4c99811 100644
--- a/Assets/Prefabs/Shelf.prefab
+++ b/Assets/Prefabs/Shelf.prefab
@@ -181,3 +181,5 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 38451aa38ba98df4f939ff6b7b8214c2, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::InventoryScreenInvoker
+ SourceInventory: {fileID: 0}
+ TargetInventory: {fileID: -5117840549013073363}
diff --git a/Assets/Prefabs/Storage.prefab b/Assets/Prefabs/Storage.prefab
new file mode 100644
index 0000000..38370e1
--- /dev/null
+++ b/Assets/Prefabs/Storage.prefab
@@ -0,0 +1,182 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &4557172615047839809
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 2592813772834325640}
+ - component: {fileID: 6329482849752991534}
+ - component: {fileID: 5507466453634029947}
+ - component: {fileID: 5465635363533564358}
+ - component: {fileID: -3570956179444851343}
+ - component: {fileID: -1329949174847138657}
+ m_Layer: 0
+ m_Name: Storage
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &2592813772834325640
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 4557172615047839809}
+ serializedVersion: 2
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0.44873, y: 0.92241, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!212 &6329482849752991534
+SpriteRenderer:
+ serializedVersion: 2
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 4557172615047839809}
+ m_Enabled: 1
+ m_CastShadows: 0
+ m_ReceiveShadows: 0
+ m_DynamicOccludee: 1
+ m_StaticShadowCaster: 0
+ m_MotionVectors: 1
+ m_LightProbeUsage: 1
+ m_ReflectionProbeUsage: 1
+ m_RayTracingMode: 0
+ m_RayTraceProcedural: 0
+ m_RayTracingAccelStructBuildFlagsOverride: 0
+ m_RayTracingAccelStructBuildFlags: 1
+ m_SmallMeshCulling: 1
+ m_ForceMeshLod: -1
+ m_MeshLodSelectionBias: 0
+ m_RenderingLayerMask: 1
+ m_RendererPriority: 0
+ m_Materials:
+ - {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
+ m_StaticBatchInfo:
+ firstSubMesh: 0
+ subMeshCount: 0
+ m_StaticBatchRoot: {fileID: 0}
+ m_ProbeAnchor: {fileID: 0}
+ m_LightProbeVolumeOverride: {fileID: 0}
+ m_ScaleInLightmap: 1
+ m_ReceiveGI: 1
+ m_PreserveUVs: 0
+ m_IgnoreNormalsForChartDetection: 0
+ m_ImportantGI: 0
+ m_StitchLightmapSeams: 1
+ m_SelectedEditorRenderState: 0
+ m_MinimumChartSize: 4
+ m_AutoUVMaxDistance: 0.5
+ m_AutoUVMaxAngle: 89
+ m_LightmapParameters: {fileID: 0}
+ m_GlobalIlluminationMeshLod: 0
+ m_SortingLayerID: 0
+ m_SortingLayer: 0
+ m_SortingOrder: 0
+ m_MaskInteraction: 0
+ m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
+ m_Color: {r: 1, g: 1, b: 1, a: 1}
+ m_FlipX: 0
+ m_FlipY: 0
+ m_DrawMode: 0
+ m_Size: {x: 1, y: 1}
+ m_AdaptiveModeThreshold: 0.5
+ m_SpriteTileMode: 0
+ m_WasSpriteAssigned: 1
+ m_SpriteSortPoint: 0
+--- !u!61 &5507466453634029947
+BoxCollider2D:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 4557172615047839809}
+ m_Enabled: 1
+ serializedVersion: 3
+ m_Density: 1
+ m_Material: {fileID: 0}
+ m_IncludeLayers:
+ serializedVersion: 2
+ m_Bits: 0
+ m_ExcludeLayers:
+ serializedVersion: 2
+ m_Bits: 0
+ m_LayerOverridePriority: 0
+ m_ForceSendLayers:
+ serializedVersion: 2
+ m_Bits: 4294967295
+ m_ForceReceiveLayers:
+ serializedVersion: 2
+ m_Bits: 4294967295
+ m_ContactCaptureLayers:
+ serializedVersion: 2
+ m_Bits: 4294967295
+ m_CallbackLayers:
+ serializedVersion: 2
+ m_Bits: 4294967295
+ m_IsTrigger: 0
+ m_UsedByEffector: 0
+ m_CompositeOperation: 0
+ m_CompositeOrder: 0
+ m_Offset: {x: 0, y: 0}
+ m_SpriteTilingProperty:
+ border: {x: 0, y: 0, z: 0, w: 0}
+ pivot: {x: 0.5, y: 0.5}
+ oldSize: {x: 1, y: 1}
+ newSize: {x: 1, y: 1}
+ adaptiveTilingThreshold: 0.5
+ drawMode: 0
+ adaptiveTiling: 0
+ m_AutoTiling: 0
+ m_Size: {x: 1, y: 1}
+ m_EdgeRadius: 0
+--- !u!114 &5465635363533564358
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 4557172615047839809}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 003acbbf759b3bc4ea37150bcd331f99, type: 3}
+ m_Name:
+ m_EditorClassIdentifier: Assembly-CSharp::Storage
+--- !u!114 &-3570956179444851343
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 4557172615047839809}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 687937cfe3daa04489c5323f36aef2e7, type: 3}
+ m_Name:
+ m_EditorClassIdentifier: Assembly-CSharp::InfoBox
+ uiAsset: {fileID: 9197481963319205126, guid: 6b3866a73cab45c429ffb420315993ca, type: 3}
+ uiPanelSettings: {fileID: 11400000, guid: 7b1015287071c934bb8054c1ae46eccd, type: 2}
+ AlwaysVisible: 1
+--- !u!114 &-1329949174847138657
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 4557172615047839809}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 38451aa38ba98df4f939ff6b7b8214c2, type: 3}
+ m_Name:
+ m_EditorClassIdentifier: Assembly-CSharp::InventoryScreenInvoker
diff --git a/Assets/Prefabs/Storage.prefab.meta b/Assets/Prefabs/Storage.prefab.meta
new file mode 100644
index 0000000..f793322
--- /dev/null
+++ b/Assets/Prefabs/Storage.prefab.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: c60f8ab2809e8c242be075b99cf9e734
+PrefabImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity
index b038497..19dd18b 100644
--- a/Assets/Scenes/MainScene.unity
+++ b/Assets/Scenes/MainScene.unity
@@ -149,6 +149,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 543349003}
+ - {fileID: 1188620131}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &519420028
@@ -349,6 +350,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 9b472ba6d08a54940a9db7abce45bb03, type: 3}
m_Name:
m_EditorClassIdentifier: '::'
+ storage: {fileID: 1202152176}
ShelfPrefab: {fileID: 4557172615047839809, guid: 6bda07d3031c8084e91a4cec9ed7e579, type: 3}
--- !u!1 &619394800
GameObject:
@@ -481,6 +483,103 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1001 &1188620130
+PrefabInstance:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_Modification:
+ serializedVersion: 3
+ m_TransformParent: {fileID: 339608289}
+ m_Modifications:
+ - target: {fileID: -1329949174847138657, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: SourceInventory
+ value:
+ objectReference: {fileID: 1202152176}
+ - target: {fileID: 2592813772834325640, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: m_LocalScale.x
+ value: 2.7598
+ objectReference: {fileID: 0}
+ - target: {fileID: 2592813772834325640, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: m_LocalScale.y
+ value: 2.2123
+ objectReference: {fileID: 0}
+ - target: {fileID: 2592813772834325640, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: m_LocalPosition.x
+ value: -7.55
+ objectReference: {fileID: 0}
+ - target: {fileID: 2592813772834325640, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: m_LocalPosition.y
+ value: -2.83
+ objectReference: {fileID: 0}
+ - target: {fileID: 2592813772834325640, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: m_LocalPosition.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 2592813772834325640, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: m_LocalRotation.w
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 2592813772834325640, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: m_LocalRotation.x
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 2592813772834325640, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: m_LocalRotation.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 2592813772834325640, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: m_LocalRotation.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 2592813772834325640, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.x
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 2592813772834325640, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 2592813772834325640, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 4557172615047839809, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: m_Name
+ value: "\u0421\u043A\u043B\u0430\u0434"
+ objectReference: {fileID: 0}
+ - target: {fileID: 6329482849752991534, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: m_Color.b
+ value: 0.057271264
+ objectReference: {fileID: 0}
+ - target: {fileID: 6329482849752991534, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: m_Color.g
+ value: 0.057271264
+ objectReference: {fileID: 0}
+ - target: {fileID: 6329482849752991534, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ propertyPath: m_Color.r
+ value: 0.122641504
+ objectReference: {fileID: 0}
+ m_RemovedComponents: []
+ m_RemovedGameObjects: []
+ m_AddedGameObjects: []
+ m_AddedComponents: []
+ m_SourcePrefab: {fileID: 100100000, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+--- !u!4 &1188620131 stripped
+Transform:
+ m_CorrespondingSourceObject: {fileID: 2592813772834325640, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ m_PrefabInstance: {fileID: 1188620130}
+ m_PrefabAsset: {fileID: 0}
+--- !u!114 &1202152176 stripped
+MonoBehaviour:
+ m_CorrespondingSourceObject: {fileID: 5465635363533564358, guid: c60f8ab2809e8c242be075b99cf9e734, type: 3}
+ m_PrefabInstance: {fileID: 1188620130}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 003acbbf759b3bc4ea37150bcd331f99, type: 3}
+ m_Name:
+ m_EditorClassIdentifier: Assembly-CSharp::Storage
--- !u!1 &1754384484
GameObject:
m_ObjectHideFlags: 0
@@ -605,9 +704,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 631c59a16a4091a4caa7b4ff24839552, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::InventoryScreen
- uiAsset: {fileID: 9197481963319205126, guid: 3f702f69419923044856bc754559430b, type: 3}
+ uiInventoryAsset: {fileID: 9197481963319205126, guid: 473047aab40dd3b42870b44f023fbaa5, type: 3}
uiItemAsset: {fileID: 9197481963319205126, guid: eb46dce908061864c935406ab889f172, type: 3}
- uiPanelSettings: {fileID: 11400000, guid: 7b1015287071c934bb8054c1ae46eccd, type: 2}
--- !u!114 &2016876942
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -683,11 +781,30 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
+ - target: {fileID: 7458587233354274444, guid: 19c1ccebaf45a40478633ddde15bf4d7, type: 3}
+ propertyPath: SourceInventory
+ value:
+ objectReference: {fileID: 3377531241049282649}
+ - target: {fileID: 7458587233354274444, guid: 19c1ccebaf45a40478633ddde15bf4d7, type: 3}
+ propertyPath: TargetInventory
+ value:
+ objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 19c1ccebaf45a40478633ddde15bf4d7, type: 3}
+--- !u!114 &3377531241049282649 stripped
+MonoBehaviour:
+ m_CorrespondingSourceObject: {fileID: 1184499778079033655, guid: 19c1ccebaf45a40478633ddde15bf4d7, type: 3}
+ m_PrefabInstance: {fileID: 3377531241049282641}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: cffc1654223acc54f9aa045c5a7730a3, type: 3}
+ m_Name:
+ m_EditorClassIdentifier: Assembly-CSharp::PlayerInventory
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
diff --git a/Assets/Scripts/Blackboard.cs b/Assets/Scripts/Blackboard.cs
deleted file mode 100644
index 04ea5e4..0000000
--- a/Assets/Scripts/Blackboard.cs
+++ /dev/null
@@ -1,631 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using System;
-using System.Linq;
-using UnityEditor;
-using System.Text.RegularExpressions;
-
-[Serializable]
-public class Blackboard : Dictionary, ISerializationCallbackReceiver
-{
- [Serializable]
- //struct represents the string key, and the serialized value from the dictionary.
- private struct SaveItem
- {
- public string key;
- public string value;
- public int index;
-
- public SaveItem(string key, string val, int index)
- {
- this.key = key;
- this.value = val;
- this.index = index;
- }
- }
-
- //All serialized items except for objects in a scene, which have to be handled separately.
- [SerializeField, HideInInspector]
- private List saveItems;
-
- //We need a different struct and list for Object references in scene :(
- [Serializable]
- private struct NonAssetSaveItem
- {
- public string key;
- public UnityEngine.Object obj;
- public int index;
-
- public NonAssetSaveItem(string key, UnityEngine.Object obj, int index)
- {
- this.key = key;
- this.obj = obj;
- this.index = index;
- }
- }
- [SerializeField, HideInInspector]
- private List sceneObjectSaveItems;
-
- ///
- /// Takes all of the keyvalue pairs from the Dictionary and stores them as Serializable lists.
- ///
- public void OnBeforeSerialize()
- {
- sceneObjectSaveItems = new List();
- saveItems = new List();
- List keys = this.Keys.ToList();
- List