1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- using System;
- using I2.Loc;
- 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[]
- {
- LocalizationManager.GetTranslation("SceneEdit/インフォ文/全", true, 0, true, false, null, null),
- group_num,
- LocalizationManager.GetTranslation("SceneEdit/インフォ文/種", true, 0, true, false, null, null),
- "\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;
- }
|