123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System;
- using UnityEngine;
- public class ItemInfoWnd : MonoBehaviour
- {
- private void Start()
- {
- GameObject childObject = UTY.GetChildObject(base.gameObject, "Base", false);
- this.m_uiBase = childObject.GetComponent<UISprite>();
- GameObject childObject2 = UTY.GetChildObject(childObject, "Title", false);
- this.m_uiTitle = childObject2.GetComponent<UILabel>();
- GameObject childObject3 = UTY.GetChildObject(childObject, "Info", false);
- this.m_uiInfo = childObject3.GetComponent<UILabel>();
- GameObject childObject4 = UTY.GetChildObject(childObject, "Icon", false);
- this.m_uiIcon = childObject4.GetComponent<UI2DSprite>();
- this.m_uiBase.color = new Color(1f, 1f, 1f, 0f);
- }
- public void Open(Vector3 f_vecPos, Texture2D f_texIcon, string f_strTitle, string f_strInfo, int group_num = 0)
- {
- Transform transform = this.m_uiBase.gameObject.transform;
- transform.position = f_vecPos;
- float y = transform.localPosition.y;
- transform.localPosition = this.m_vecOffsetPos + new Vector3(-337f, y, 0f);
- if (-512f > transform.localPosition.y - 90f)
- {
- Vector3 vecOffsetPos = this.m_vecOffsetPos;
- vecOffsetPos.y *= -1f;
- transform.localPosition = vecOffsetPos + new Vector3(-337f, y, 0f);
- }
- Sprite sprite2D = Sprite.Create(f_texIcon, new Rect(0f, 0f, (float)f_texIcon.width, (float)f_texIcon.height), default(Vector2));
- this.m_uiIcon.sprite2D = sprite2D;
- this.m_uiTitle.text = f_strTitle;
- if (0 < group_num)
- {
- this.m_uiInfo.text = string.Concat(new object[]
- {
- "全",
- group_num,
- "種\n",
- f_strInfo
- });
- }
- else
- {
- this.m_uiInfo.text = f_strInfo;
- }
- this.m_uiBase.color = new Color(1f, 1f, 1f, 1f);
- }
- public void Close()
- {
- this.m_uiIcon.sprite2D = null;
- this.m_uiTitle.text = string.Empty;
- this.m_uiInfo.text = string.Empty;
- this.m_uiBase.color = new Color(1f, 1f, 1f, 0f);
- }
- private void Update()
- {
- }
- private UISprite m_uiBase;
- private UILabel m_uiTitle;
- private UILabel m_uiInfo;
- private UI2DSprite m_uiIcon;
- public Vector3 m_vecOffsetPos;
- }
|