NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/FunctionLock/FunctionLock.cs

64 lines
1.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using cfg.FunctionLockCfg;
using dnlib.DotNet.MD;
using Framework;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Gameplay.FunctionLock
{
public sealed class FunctionLock : MonoBehaviour
{
/// <summary>
/// 功能锁id
/// </summary>
public int FunctionLockId;
/// <summary>
/// 功能锁根节点
/// </summary>
public GameObject Root;
/// <summary>
/// 功能按钮
/// </summary>
public Button ButtonFunction;
private void Start()
{
DataFunctionLock cfg = TableManager.Instance.Tables.FunctionLockConfig.Get(FunctionLockId);
if (null == cfg)
{
DebugUtil.LogError($"功能锁配置获取错误id{FunctionLockId}");
return;
}
ButtonFunction.interactable = false;
}
/// <summary>
/// 播放解锁动画
/// </summary>
public void PlayUnlockAnim()
{
}
/// <summary>
/// 设置状态
/// </summary>
/// <param name="isUnlock"></param>
private void SetState(bool isUnlock)
{
if (isUnlock)
{
Root.IsScaleShow(false);
ButtonFunction.interactable = true;
}
else
{
Root.IsScaleShow(true);
ButtonFunction.interactable = false;
}
}
}
}