religion/Assets/Scripts/抽象/Interactive.cs
Roman ca1cc0162d 任务:编写留言系统、替换和实装美术素材
1.编写留言系统
(1.当玩家无Catch的时候,记录长按Y的时间,若时间大于两秒,呼唤UI,触发相应事件

*.编写撰写留言板逻辑
(*.清空操作地图
(1.呼出留言板UI
(2.当按下确认键,确认建立一个本地留言板,并初始化该本地留言板,恢复操作地图
(3.将留言板数据传向云端

*.编写留言板逻辑
(1.内含BoardInfo内的信息
(2.继承于可交互物体
(3.当交互,呼出留言板UI,显示内容、UID等信息
(4.当按下返回键,关闭UI

*.编写拉取留言板系统
(1.加在开幕演出中,开幕时呼叫sql上的脚本,拉取若干条留言板
(2.在场景内创建留言板,并初始化信息

*.替换和实装美术素材,增加部分动画
1.增加村内上树动画
2.更新村场景,使得玩家可以走到村下
3.制作以撒闪电攻击动画
4.制作以撒冲撞攻击动画
5.制作以撒雕像碎裂动画
6.贴上对话框
7.制作以撒闪电攻击动画
8.制作村民和贵族的待机角色
9.制作特洛伊木马死亡动画
10.制作特洛伊木马的喷射动画

*优化和修复
1.修复佛教前置关掉怪陷阱有时不会触发的问题
2.重做渲染层,避免出现覆盖问题
3.修复玩家会卡在村里桥上的问题
4.解决了屎山代码的warming问题
5.删除了子弹时间,效果太差

建议:
1.给击中添加一些效果,目前还是打击感太弱
2.目前木马死后,灰尘不会消失

*.至此,留言系统全部完成

下班
2021-12-25 00:37:29 +08:00

52 lines
1.5 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;
/// <summary>
/// 可交互物体基类
/// </summary>
public class Interactive : MonoBehaviour
{
/// <summary>
/// 这个是什么东西
/// </summary>
public enum ItemName{
,
,
,
};
public ItemName itemName;
//这是一对碰撞检测代码。当玩家进入将自身传给玩家。当玩家退出把玩家的catch清空
void OnTriggerEnter2D(Collider2D other){
if(other.TryGetComponent<MyPlayer>(out MyPlayer player))
player.catching = this;
}
void OnTriggerExit2D(Collider2D other)
{
if(other.TryGetComponent<MyPlayer>(out MyPlayer player)){
//如果目前退出当前交互区域的时候,玩家的捕捉物体是自己,才把玩家的捕捉清空。否则说明玩家在推出前就捕捉到了新的
//对象。这样是用来解决排布密集的可交互物体的问题
if(player.catching == this)player.catching = null;
//触发一个离开事件
OnLeave();
}
}
/// <summary>
/// 交互键按下触发
/// </summary>
public virtual void OnCall(){}
public virtual void OnBeGaveMoney(){}
/// <summary>
/// 交互键抬起触发
/// </summary>
public virtual void OnCallCancel(){}
public virtual void OnLeave(){}
public virtual int RetuenState(){return 0;}
}