Files
HX_MapEditor/Assets/Scripts/UI/UIConditionItem.cs
2025-06-14 13:46:24 +08:00

55 lines
1.3 KiB
C#

using HxGame.Data;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class UIConditionItem : MonoBehaviour
{
public Dropdown dropMode; //进入条件
public InputField txtLevel; //进入等级
public InputField txtItemID; //消耗道具
public InputField txtMoney; //消耗货币
public InputField txtTime; //消耗时间
public Button btnDel; //删除
private void Awake()
{
btnDel.onClick.AddListener(RemoveSelf);
}
private void RemoveSelf()
{
DestroyImmediate(gameObject);
}
public bool CheckValid()
{
if (string.IsNullOrEmpty(txtLevel.text))
{
UIWindow.Instance.ShowMessage("请填写进入等级");
return false;
}
if (string.IsNullOrEmpty(txtItemID.text))
{
UIWindow.Instance.ShowMessage("请填写道具ID");
return false;
}
if (string.IsNullOrEmpty(txtMoney.text))
{
UIWindow.Instance.ShowMessage("请填写消耗货币");
return false;
}
if (string.IsNullOrEmpty(txtTime.text))
{
UIWindow.Instance.ShowMessage("请填写时间");
return false;
}
return true;
}
}