
1.实装死亡重开系统: *:增加被航弹炸死的死法 *:增加被地雷炸死的死法 *:增加了被碉堡打死的死法 *:增加被夜间碉堡扫死的死法 *:增加被夜间巡逻的人打死的死法 *:增加被直升机打死的死法 2.修改碉堡警告UI颜色 3.编写开始游戏界面 4.编写感谢游玩界面 5.修复老兵牺牲动画的Bug (*:第二关的炮火已经越来越好了,但是目前只有炮火,晚上肯定也会开枪吧?希望增加一些随机快速闪烁的光源表示晚上的枪。 xx:人声问题请待定,加上音乐后好像又不是很违和了 (*:碉堡警告音效系统做完了,但是人声感觉上非常奇怪,建议修改 (*:敌人被石头吸引系统实装完成,但是很突兀,建议还是不要出现语言了 接下来的任务: *:试图做得更好
55 lines
1.6 KiB
C#
55 lines
1.6 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using Cinemachine;
|
|
|
|
public class Mine : MonoBehaviour
|
|
{
|
|
//地雷系统的地雷类,因为系统还十分不完善,所以没有什么内容🥔
|
|
private Animator animator;
|
|
|
|
public AudioSource boomAudio;//地雷爆炸音效
|
|
private CinemachineImpulseSource cinemachineImpulseSource;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
animator = GetComponent<Animator>();
|
|
cinemachineImpulseSource = GetComponent<CinemachineImpulseSource>();
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
//爆炸动画结束后调用,销毁自己
|
|
public void DestroySelf()
|
|
{
|
|
Destroy(gameObject);
|
|
}
|
|
|
|
public void OnTriggerEnter2D(Collider2D other)
|
|
{
|
|
//看看进来的是个啥
|
|
switch(other.tag)
|
|
{
|
|
case "Player"://如果是玩家,后续填写死亡
|
|
Debug.Log("玩家踩到地雷了");
|
|
animator.SetBool("IsBoom",true);
|
|
boomAudio.Play();
|
|
cinemachineImpulseSource.GenerateImpulse();
|
|
other.GetComponent<M_Player>().YouAreBoomingDead();
|
|
break;
|
|
case "投掷物"://如果是投掷物,销毁投掷物和自己
|
|
Debug.Log("投掷物砸到地雷了");
|
|
Destroy(other.gameObject);
|
|
animator.SetBool("IsBoom",true);
|
|
boomAudio.Play();
|
|
cinemachineImpulseSource.GenerateImpulse();
|
|
break;
|
|
}
|
|
|
|
}
|
|
}
|