选择封面初步提交
This commit is contained in:
36
Assets/TcgEngine/Scripts/Menu/ChangeCoverLine.cs
Normal file
36
Assets/TcgEngine/Scripts/Menu/ChangeCoverLine.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace TcgEngine
|
||||
{
|
||||
public class ChangeCoverLine : MonoBehaviour
|
||||
{
|
||||
public Image cover;
|
||||
public string coverName;
|
||||
|
||||
public UnityAction<ChangeCoverLine> OnChangeCover;
|
||||
|
||||
/// <summary>
|
||||
/// 初始化封面显示
|
||||
/// </summary>
|
||||
public void SetCover(Sprite coverSprite, string name)
|
||||
{
|
||||
if (cover != null)
|
||||
cover.sprite = coverSprite;
|
||||
|
||||
coverName = name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 点击选择封面
|
||||
/// </summary>
|
||||
public void OnClickCover()
|
||||
{
|
||||
OnChangeCover?.Invoke(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user