54 lines
1.5 KiB
C#
54 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
[Serializable]
|
|
public class InventoryUIManager : UIWarehouseManager
|
|
{
|
|
public static new InventoryUIManager Instance { get; protected set; }
|
|
|
|
public override int SLOTS_NUMBER { get { return 48; } }
|
|
|
|
public const string ITEM_LOCALIZATION = "UiPanels/";
|
|
public const string PANEL_NAME = "InventoryPanel";
|
|
|
|
public void Awake()
|
|
{
|
|
if (Instance == null)
|
|
{
|
|
Instance = this;
|
|
}
|
|
else
|
|
{
|
|
Debug.Log(Instance);
|
|
Debug.Log("destroiy inventory UI");
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
|
|
/* public override void UpdateList()
|
|
{
|
|
// TODO something like rebuild associated panel content
|
|
// depending on which class we use it mayu be Inventory / Chest / Shop Panel Controller
|
|
DynamicPanel.GetComponent<InventoryPanelController>(); //.Refresh() -- rebuild content
|
|
}*/
|
|
|
|
public override void SetupPanel()
|
|
{
|
|
base.SetupPanel();
|
|
|
|
// setup models list
|
|
DynamicPanel.GetComponent<InventoryPanelController>().SetUp(Elements);
|
|
}
|
|
|
|
public override void UpdateList()
|
|
{
|
|
DynamicPanel.GetComponent<InventoryPanelController>().BuildPanelContent(Elements);
|
|
}
|
|
|
|
protected override GameObject GetTemplatePanel()
|
|
{
|
|
// Resources = default path - Asset/Resources ... .obj
|
|
return Resources.Load(ITEM_LOCALIZATION + PANEL_NAME) as GameObject;
|
|
}
|
|
} |