Roman 808d25ea32 任务:替换现有美术素材和动画
场景:【序章-家中】
1.更换电报机UI层图片,并使按下打码键后,电报机把手按下,松开则弹起。
2.更新操作地图,使得玩家操作电报机时将无法走动。

场景:【序章-战场】
1.替换场景美术素材为新
2.使电话线断除被修好后,图片插件打开
3.修改地形

场景【测试】
1.导入了麒哥动画包
2021-08-25 16:47:03 +08:00

42 lines
1.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Interactive : MonoBehaviour
{
//这是所有可交互物体的基类
public GameObject m_interface;//可交互物体一般都和一个UI界面挂钩这就是那个UI界面
//这是一对碰撞检测代码。当玩家进入将自身传给玩家。当玩家退出把玩家的catch清空
void OnTriggerEnter2D(Collider2D other)
{
if(other.tag == "Player")
{
other.GetComponent<M_Player>().catched = this;
}
}
void OnTriggerExit2D(Collider2D other)
{
if(other.tag == "Player")
{
//如果目前退出当前交互区域的时候,玩家的捕捉物体是自己,才把玩家的捕捉清空。否则说明玩家在推出前就捕捉到了新的
//对象。这样是用来解决排布密集的可交互物体的问题
if(other.GetComponent<M_Player>().catched == this) other.GetComponent<M_Player>().catched = null;
}
}
//
//当这个可交互物体被玩家交互。一般需要重写这个函数。
public virtual void OnCall(){}
//
//以下为针对各具体可交互对象的虚拟函数,在具体物体中重写
public virtual void Coding(string temp){}//电报机的打码
public virtual void StopRepareTheTelephoneLine(){}//电话线的停止修复(松开按键检测
public virtual void Quit(){}//任务书的关闭
public virtual void Comfirm(){}//修复电报机界面按下交互键触发
public virtual void ChangeHandleTo(bool isDown){}
//
}