80 lines
1.7 KiB
C#
80 lines
1.7 KiB
C#
![]() |
// ***********************************************************************
|
|||
|
// Assembly : Game
|
|||
|
// Author : Kimch
|
|||
|
// Created : 2021-06-16
|
|||
|
// Description :
|
|||
|
// Last Modified By :
|
|||
|
// Last Modified On :
|
|||
|
// ***********************************************************************
|
|||
|
// <copyright file= "EquipmentSelectWidget" company="Kunpo"></copyright>
|
|||
|
// <summary></summary>
|
|||
|
// ***********************************************************************
|
|||
|
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
|
|||
|
namespace G.UI
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
public class EquipmentSelectWidget : KUIWidget
|
|||
|
{
|
|||
|
#region Field
|
|||
|
|
|||
|
#pragma warning disable CS0649 // 从未对字段赋值,字段将一直保持其默认值 null
|
|||
|
[KUIFlag]
|
|||
|
GameObject _goSignined;
|
|||
|
[KUIFlag]
|
|||
|
GameObject __goEquipment;
|
|||
|
#pragma warning restore CS0649 // 从未对字段赋值,字段将一直保持其默认值 null
|
|||
|
|
|||
|
private EquipmentWidget _equipmentWidget;
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Method
|
|||
|
|
|||
|
public override void Refresh()
|
|||
|
{
|
|||
|
if (this.data is EntityItemEquipment equipment)
|
|||
|
{
|
|||
|
_equipmentWidget.SetData(equipment);
|
|||
|
_goSignined.SetActive(false);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public bool IsSelect()
|
|||
|
{
|
|||
|
return _goSignined.activeSelf;
|
|||
|
}
|
|||
|
|
|||
|
public void SetSelect(bool select)
|
|||
|
{
|
|||
|
_goSignined.SetActive(select);
|
|||
|
}
|
|||
|
|
|||
|
private void OnFrameBtnClick()
|
|||
|
{
|
|||
|
PostNotification(GlobalDefine.EVENT_EQUIPMENT_SELECT, this, "");
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Unity
|
|||
|
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
private void Awake()
|
|||
|
{
|
|||
|
SetViewData();
|
|||
|
_equipmentWidget = __goEquipment.AddComponent<EquipmentWidget>();
|
|||
|
GetComponent<Button>().onClick.AddListener(this.OnFrameBtnClick);
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|