47 lines
931 B
C#
47 lines
931 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using DarkTonic.MasterAudio;
|
|
using Mirror;
|
|
using UnityEngine;
|
|
|
|
namespace Valheim
|
|
{
|
|
public class Dialogue : NetworkBehaviour
|
|
{
|
|
public GameObject DialogueUI;
|
|
public GameObject BarkSound;
|
|
|
|
public Pet pet;
|
|
|
|
public void Update()
|
|
{
|
|
if (isServer)
|
|
{
|
|
if (pet.state == PetState.Wild)
|
|
{
|
|
RpcShow();
|
|
}
|
|
else if (pet.state == PetState.Trained)
|
|
{
|
|
RpcHide();
|
|
}
|
|
}
|
|
}
|
|
|
|
[ClientRpc]
|
|
public void RpcShow()
|
|
{
|
|
//展示UI
|
|
DialogueUI.SetActive(true);
|
|
}
|
|
|
|
[ClientRpc]
|
|
public void RpcHide()
|
|
{
|
|
DialogueUI.SetActive(false);
|
|
BarkSound.SetActive(false);
|
|
}
|
|
}
|
|
}
|
|
|