45 lines
995 B
C#
45 lines
995 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using DarkTonic.MasterAudio;
|
|
using DragonLi.Core;
|
|
using Mirror;
|
|
using UnityEngine;
|
|
|
|
public enum ExplosionType
|
|
{
|
|
PistolEx=0,
|
|
SmokeEx=1,
|
|
ShieldEx=2,
|
|
PoisonEx=3,
|
|
HpEx=4,
|
|
AtkDummy=5,
|
|
Bomb=6,
|
|
}
|
|
public class Explosion : NetworkBehaviour
|
|
{
|
|
[SoundGroup] public string explosionSound;
|
|
public ExplosionType type;
|
|
public TeamType curTeam;
|
|
public int playerId;
|
|
public int score;
|
|
public virtual void OnSpawn(TeamType team,float curDurationTime,int id)
|
|
{
|
|
curTeam = team;
|
|
playerId = id;
|
|
GameManager.Ins.PlaySound3D(explosionSound,transform);
|
|
|
|
switch (type)
|
|
{
|
|
case ExplosionType.PistolEx:
|
|
curDurationTime = 5;
|
|
break;
|
|
}
|
|
|
|
CoroutineTaskManager.Instance.WaitSecondTodo(() =>
|
|
{
|
|
NetworkServer.Destroy(gameObject);
|
|
}, curDurationTime);
|
|
}
|
|
}
|