21 lines
575 B
C#
21 lines
575 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using BITFALL;
|
|
using UnityEngine;
|
|
|
|
public abstract class ExampleHostService : MonoBehaviour
|
|
{
|
|
private readonly Dictionary<GameObject, List<GameObject>> inventories = new();
|
|
[ServerRpc]
|
|
public void ServerPickItem(GameObject player, GameObject item)
|
|
{
|
|
if (inventories.TryGetValue(player, out var inventory))
|
|
{
|
|
inventory.Add(item);
|
|
ClientRpc(player,item);
|
|
}
|
|
}
|
|
[ClientRpc]
|
|
public abstract void ClientRpc(GameObject player, GameObject item);
|
|
}
|