CangJie/Assets/Scripts//绳结/KnotMediator.cs
Roman ab6cfd79a0 任务:搭建场景
1.添加场景1查看绳结仓颉动画
(*:为玩家基类添加功能,public void StopInputUntil(float time);表示接下来多长时间内,无视输入事件。

2.适配了播片系统

3.编写演出:凤凰

好像不能摸鱼了,明天不知道写什么,下班了喵😿
2022-04-02 21:46:10 +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;
}
}