From 7eb9351d905ddf6316fd6b177fff967fbac6fc94 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Apr 2022 10:19:09 +0800 Subject: * rename decoration to item --- .../UI/Panel/PanelTopStuffBar/UIDecorationBar.cs | 42 ---------------------- 1 file changed, 42 deletions(-) delete mode 100644 SurvivalTest/Assets/Scripts/UI/Panel/PanelTopStuffBar/UIDecorationBar.cs (limited to 'SurvivalTest/Assets/Scripts/UI/Panel/PanelTopStuffBar/UIDecorationBar.cs') diff --git a/SurvivalTest/Assets/Scripts/UI/Panel/PanelTopStuffBar/UIDecorationBar.cs b/SurvivalTest/Assets/Scripts/UI/Panel/PanelTopStuffBar/UIDecorationBar.cs deleted file mode 100644 index 6dce384..0000000 --- a/SurvivalTest/Assets/Scripts/UI/Panel/PanelTopStuffBar/UIDecorationBar.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class UIDecorationBar : MonoBehaviour -{ - public UIDecorationWidget m_DecorationTemplate; - - public UISimpleGrid m_DecorationGrid; - - private List m_Decorations = new List(); - - public void Set() - { - m_DecorationTemplate.gameObject.SetActive(false); - - for (int i = 0; i < PlayerManager.Instance.decorations.Count; ++i) - { - UIDecorationWidget widget = MakeDecorationWidget(PlayerManager.Instance.decorations[i]); - m_Decorations.Add(widget); - } - } - - UIDecorationWidget MakeDecorationWidget(DecorationBase decoration) - { - UIDecorationWidget widget = Instantiate(m_DecorationTemplate); - widget.transform.SetParent(m_DecorationGrid.transform); - widget.gameObject.SetActive(true); - widget.GetComponent().anchoredPosition = new Vector2(0, 0); -#if UNITY_EDITOR - widget.name = "decoration (" + decoration.name + ")"; -#endif - - UIDecorationWidgetParam param = new UIDecorationWidgetParam(); - param.decoration = decoration; - widget.Set(param); - return widget; - } - - - -} \ No newline at end of file -- cgit v1.1-26-g67d0