
*:合并了SAIPOVersion 场景【第二关】 1.放置巡逻类敌人 *制作AC【巡逻敌人】 2.完善巡逻类敌人,具有以下特性: (1.普通巡逻时,执行走路动画 (2.监测到玩家时,执行开枪动画 (3.给动画添加事件,开枪瞬间播放玩家死亡动画 (4.当听到石头声音,执行听见动画 (5.结束后让敌人冲向石头落地处 (6.到达石头落地处后,执行检查动画 (7.检查动画结束后,返回步行状态继续巡逻 3.布置了投掷物堆 4.布置了挡板,具有以下特性: (1.当玩家位于挡板后,标记自身被遮挡,不会被敌人发现 (2.当玩家离开挡板后,标记自身未被遮挡,会被敌人发现 (3.修改敌人逻辑,当发现挡板后的玩家,无事发生,而当发现无遮挡的玩家,执行开枪和玩家死亡动画 5.解决了玩家转身后无法投掷的问题 6.放置了两个敌人 7.放置了两个挡板 8.布置营地 9.给桌子加上修理电报机系统 10.替换修理电报机界面UI美术素材 11.提高了修理台的转速
48 lines
1.2 KiB
C#
48 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Mine : MonoBehaviour
|
|
{
|
|
//地雷系统的地雷类,因为系统还十分不完善,所以没有什么内容🥔
|
|
private Animator animator;
|
|
|
|
public AudioSource boomAudio;//地雷爆炸音效
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
animator = GetComponent<Animator>();
|
|
}
|
|
|
|
// 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();
|
|
break;
|
|
case "投掷物"://如果是投掷物,销毁投掷物和自己
|
|
Debug.Log("投掷物砸到地雷了");
|
|
Destroy(other.gameObject);
|
|
animator.SetBool("IsBoom",true);
|
|
boomAudio.Play();
|
|
break;
|
|
}
|
|
}
|
|
}
|