41 lines
735 B
C#
41 lines
735 B
C#
using System;
|
|
using UnityEngine;
|
|
public class NXR03 : Enemy
|
|
{
|
|
public GameObject bomb;
|
|
|
|
public void Start()
|
|
{
|
|
if (isServer)
|
|
{
|
|
behaviorTree.RegisterEvent("DelSelf", DelSelf2);
|
|
}
|
|
}
|
|
|
|
public override void UpdateRotation() { }
|
|
|
|
public void DelSelf()
|
|
{
|
|
if (isServer)
|
|
{
|
|
GameManager.Ins.DeleteEnemy(id);
|
|
CreatExplosion();
|
|
}
|
|
}
|
|
|
|
// 自毁
|
|
public void DelSelf2()
|
|
{
|
|
ApplyDamage(99999, null, null);
|
|
}
|
|
|
|
public void FireBomb()
|
|
{
|
|
bomb.SetActive(false);
|
|
if (isServer)
|
|
{
|
|
GameManager.Ins.CreateBomb(bomb.transform.position, bomb.transform.eulerAngles);
|
|
}
|
|
}
|
|
}
|