27 lines
669 B
C#
27 lines
669 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using BITFALL;
|
|
using UnityEngine;
|
|
|
|
public abstract class ExampleClientService : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// 玩家捡起物品的用例
|
|
/// </summary>
|
|
/// <param name="player"></param>
|
|
/// <param name="item"></param>
|
|
[ServerRpc]
|
|
public void TryPickItem(GameObject player,GameObject item)
|
|
{
|
|
ServerPickItem(player, item);
|
|
}
|
|
[ServerRpc]
|
|
public abstract void ServerPickItem(GameObject player, GameObject item);
|
|
|
|
[ClientRpc]
|
|
public void ClientRpc(GameObject player,GameObject item)
|
|
{
|
|
player.SendMessage("捡起了物品",item);
|
|
}
|
|
}
|