40 lines
1009 B
C#
40 lines
1009 B
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;
|
|
|
|
public void RecordKnotType(KnotType knotType)
|
|
{
|
|
currentKnotType = knotType;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 有黄帝调用,检查当前记录的和需要的绳结类型是否一致
|
|
/// </summary>
|
|
/// <param name="knotType">黄帝需要的绳结类型</param>
|
|
/// <returns></returns>
|
|
public bool CheckKnotType(KnotType knotType)
|
|
{
|
|
return knotType == currentKnotType;
|
|
}
|
|
}
|