CangJie/Assets/Scripts//绳结/KnotMediator.cs
lspdC f29c5c2a4c 4.2(已合并)
合并分支
2022-04-03 01:45:27 +08:00

51 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Sirenix.OdinInspector;
/// <summary>
/// 绳结中介者,负责交流皇帝、玩家、绳结的信息
/// </summary>
public class KnotMediator : UnitySingleton<KnotMediator>
{
public enum KnotType
{
None,
,
,
}
/// <summary>
/// 当前记录的绳结类型
/// </summary>
[Header("当前记录的绳结类型")][SerializeField][EnumPaging]
private KnotType currentKnotType;
private Player player;
void Start(){
player = FindObjectOfType<Player>();
}
public void RecordKnotType(KnotType knotType)
{
currentKnotType = knotType;
//让仓颉做出查看绳结的动作
player.StopInputTo(2f);
player.Behavior("查看绳结");
}
/// <summary>
/// 有黄帝调用,检查当前记录的和需要的绳结类型是否一致
/// </summary>
/// <param name="knotType">黄帝需要的绳结类型</param>
/// <returns></returns>
public bool CheckKnotType(KnotType knotType)
{
return knotType == currentKnotType;
}
}