
1.添加场景1查看绳结仓颉动画
(*:为玩家基类添加功能,public void StopInputUntil(float time);表示接下来多长时间内,无视输入事件。
2.适配了播片系统
3.编写演出:凤凰
好像不能摸鱼了,明天不知道写什么,下班了喵😿
43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
|
||
/// <summary>
|
||
/// 进入式触发器的基类,继承自事件,每一个进入式触发器都必须继承这个类
|
||
/// </summary>
|
||
public class EntryTrigger : Event
|
||
{
|
||
private Collider2D m_collider;
|
||
public Event m_event;
|
||
public Stage m_stage;
|
||
|
||
void Start()
|
||
{
|
||
//如果没有挂载碰撞盒,则报错
|
||
if(!TryGetComponent<Collider2D>(out m_collider))
|
||
{
|
||
Debug.LogError(this.GetType() + gameObject.name + "没有挂载碰撞盒,请检查!");
|
||
}
|
||
//如果不是触发器,则报错
|
||
if(!m_collider.isTrigger)
|
||
{
|
||
Debug.LogError(this.GetType() + gameObject.name + "碰撞盒没有设置为触发器,请检查!");
|
||
}
|
||
}
|
||
|
||
virtual public void OnTriggerEnter2D(Collider2D other)
|
||
{
|
||
//如果玩家进入碰撞盒则触发事件
|
||
if(other.TryGetComponent<Player>(out Player player)) OnCall();
|
||
}
|
||
|
||
public override void OnCall()
|
||
{
|
||
//如果链接了事件或者演出,则执行
|
||
if(m_event != null) m_event.OnCall();
|
||
if(m_stage != null) m_stage.OnCall();
|
||
//如果二者都为null,则报告
|
||
if(m_event == null && m_stage == null) Debug.Log(this.GetType() + gameObject.name + "没有链接事件或者演出,你确定吗?");
|
||
}
|
||
}
|