72 lines
2.0 KiB
C#
72 lines
2.0 KiB
C#
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
using UnityEngine.EventSystems;
|
|||
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System;
|
|||
|
using GCGame.Table;
|
|||
|
|
|||
|
public class LiveItemClass
|
|||
|
{
|
|||
|
public string _ClassName;
|
|||
|
public List<Tab_LivingSkillItem> _LiveItems;
|
|||
|
public bool _AutoSelected = false;
|
|||
|
}
|
|||
|
|
|||
|
public class LiveSkillClass : UIItemSelect
|
|||
|
{
|
|||
|
|
|||
|
public Text _Name;
|
|||
|
public UIContainerSelect _LiveSkillItems;
|
|||
|
public GameObject _ItemListPanel;
|
|||
|
|
|||
|
private LiveItemClass _ItemClass;
|
|||
|
|
|||
|
public override void Show(Hashtable hash)
|
|||
|
{
|
|||
|
base.Show();
|
|||
|
|
|||
|
var liveSkillClass = (LiveItemClass)hash["InitObj"];
|
|||
|
UpdateLiveSkill(liveSkillClass);
|
|||
|
}
|
|||
|
|
|||
|
private void UpdateLiveSkill(LiveItemClass liveSkillClass)
|
|||
|
{
|
|||
|
_ItemClass = liveSkillClass;
|
|||
|
_Name.text = liveSkillClass._ClassName;
|
|||
|
if (LiveSkillLogic.Instance().DefaultShowItem != null)
|
|||
|
{
|
|||
|
_LiveSkillItems.InitSelectContent(liveSkillClass._LiveItems, new List<Tab_LivingSkillItem>() { LiveSkillLogic.Instance().DefaultShowItem }, LiveSkillLogic.Instance().OnLiveItemSelected);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
if (liveSkillClass._AutoSelected)
|
|||
|
{
|
|||
|
_LiveSkillItems.InitSelectContent(liveSkillClass._LiveItems, new List<Tab_LivingSkillItem>() { liveSkillClass._LiveItems[0] }, LiveSkillLogic.Instance().OnLiveItemSelected);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
_LiveSkillItems.InitSelectContent(liveSkillClass._LiveItems, null, LiveSkillLogic.Instance().OnLiveItemSelected);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public override void Refresh()
|
|||
|
{
|
|||
|
base.Refresh();
|
|||
|
|
|||
|
if (_ItemClass == null)
|
|||
|
return;
|
|||
|
|
|||
|
if (!_ItemClass._LiveItems.Contains(LiveSkillLogic.Instance().SelectedLiveItem))
|
|||
|
{
|
|||
|
_LiveSkillItems.ClearSelect();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void OnItemListFold()
|
|||
|
{
|
|||
|
_ItemListPanel.SetActive(!_ItemListPanel.activeSelf);
|
|||
|
}
|
|||
|
}
|