64 lines
1.5 KiB
C#
64 lines
1.5 KiB
C#
|
|
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;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|