70 lines
1.7 KiB
C#
70 lines
1.7 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using BehaviorDesigner.Runtime;
|
|
using DarkTonic.MasterAudio;
|
|
using DragonLi.Core;
|
|
using DragonLi.Frame;
|
|
using Mirror;
|
|
using UnityEngine;
|
|
using Valheim;
|
|
|
|
public class Fish : Enemy
|
|
{
|
|
// [SoundGroup] public string attackSound;
|
|
// [SoundGroup] public string foundEnemySound;
|
|
// [SoundGroup] public string spawnGroundSound;
|
|
// [SoundGroup] public string deadSound;
|
|
|
|
[Server]
|
|
public override void AttackOnce()
|
|
{
|
|
base.AttackOnce();
|
|
//PlayAttackSound();
|
|
}
|
|
|
|
[Server]
|
|
public override void FoundEnemy()
|
|
{
|
|
if (!model.activeSelf)
|
|
{
|
|
//PlaySpawnGround();
|
|
}
|
|
base.FoundEnemy();
|
|
//PlayFoundEnemy();
|
|
}
|
|
|
|
[Server]
|
|
public override void Die(object info, Transform _sender)
|
|
{
|
|
GameManager.Ins.EnemyList.Remove(this);
|
|
NavAgent.enabled = false;
|
|
GameManager.Ins.CreateSpawnBallPoint(new Vector3(transform.position.x, 0.1F, transform.position.z));
|
|
GameManager.Ins.CheckAreaSettle(areaId);
|
|
//PlayDeadSound();
|
|
}
|
|
|
|
[ClientRpc]
|
|
public void PlayAttackSound()
|
|
{
|
|
MasterAudio.PlaySound3DAtVector3(attackSound, transform.position);
|
|
}
|
|
|
|
// [ClientRpc]
|
|
// public void PlayFoundEnemy()
|
|
// {
|
|
// MasterAudio.PlaySound3DAtVector3(foundEnemySound, transform.position);
|
|
// }
|
|
//
|
|
// [ClientRpc]
|
|
// public void PlaySpawnGround()
|
|
// {
|
|
// MasterAudio.PlaySound3DAtVector3(spawnGroundSound, transform.position);
|
|
// }
|
|
//
|
|
// [ClientRpc]
|
|
// public void PlayDeadSound()
|
|
// {
|
|
// MasterAudio.PlaySound3DAtVector3(deadSound, transform.position);
|
|
// }
|
|
}
|