-
Notifications
You must be signed in to change notification settings - Fork 0
/
ItemHolder.cs
37 lines (34 loc) · 1.21 KB
/
ItemHolder.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using SLHub.Interactable;
using SLHub.Teleporter;
using Synapse.Api;
using Synapse.Config;
using UnityEngine;
namespace PvPArena
{
public class ItemHolder : IHubDummy, IEnterable
{
public ItemHolder(SerializedItem item, SerializedTeleporter teleporter)
{
Item = item;
TeleportBack = teleporter.TeleportTo.Parse().Position;
Position = teleporter.Position.Parse().Position;
LookingAt = teleporter.LookingAt.Parse().Position;
Role = teleporter.Role;
DisplayName = teleporter.Name;
var dummy = HubDummyHandler.SpawnHubDummy(this);
dummy.HeldItem = SynapseController.Server.ItemManager.GetBaseType(item.ID);
}
public SerializedItem Item { get; set; }
public Vector3 TeleportBack { get; set; }
public GameObject GameObject { get; set; }
public Vector3 Position { get; set; }
public Vector3 LookingAt { get; set; }
public RoleType Role { get; set; }
public string DisplayName { get; set; }
public void OnEnter(Player player)
{
player.Position = TeleportBack;
player.Inventory.AddItem(Item.Parse());
}
}
}