Files
JJBB/Assets/Project/Script/GUI/Base/UIItemMultiSelect.cs
2024-08-23 15:49:34 +08:00

40 lines
880 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// 基于UIItemSelect配合UIContainerMultiSelect使用
// 增加已添加状态。
public class UIItemMultiSelect : UIItemSelect {
public GameObject _HasAddedGO; // 用于显示已被添加
#region _hasAddedGO控制
// 每次调用更改_hasAddedGO的激活状态
public virtual void Add()
{
if (_HasAddedGO != null)
{
_HasAddedGO.SetActive(!_HasAddedGO.activeSelf);
}
}
public virtual void UnAdd()
{
if (_HasAddedGO != null)
{
_HasAddedGO.SetActive(false);
}
}
// 检查是否已经添加
public virtual bool hasAdd()
{
if (_HasAddedGO != null)
return _HasAddedGO.activeSelf;
return false;
}
#endregion
}