// ***********************************************************************
// Assembly : Game
// Author : Kimch
// Created : 2021-03-28
// Description :
// Last Modified By :
// Last Modified On :
// ***********************************************************************
//
//
// ***********************************************************************
namespace G.UI
{
using UnityEngine;
using UnityEngine.UI;
///
///
///
partial class SwordWindow
{
class SwordWidget : KUIWidget
{
Vector3 _position;
public override void Refresh()
{
if (this.data is SwordProxy.SwordInfo swordInfo)
{
this.transform.GetChild(1).gameObject.SetActive(swordInfo.isUnlock);
}
}
public void ResetPosition()
{
transform.localPosition = _position;
}
public void SetScale(float scale)
{
var childs = F.ListPool.Get();
transform.GetComponentsInChildren(childs);
Vector3 uniformScale = Vector3.one * scale;
for (int i = 1; i < childs.Count; i++)
{
childs[i].localScale = uniformScale;
}
F.ListPool.Release(childs);
}
void OnSwordClick()
{
if (this.data is SwordProxy.SwordInfo swordInfo)
{
if (swordInfo.isUnlock)
PostNotification(GlobalDefine.EVENT_SWORD_CLICK, swordInfo);
else
{
PostNotification(GlobalDefine.EVENT_SHOW_TOAST, swordInfo.unlockText);
}
}
}
void Awake()
{
GetComponent