quantum-space-buddies/QSB/EchoesOfTheEye/Ghosts/Messages/ChangeNodeMapMessage.cs

21 lines
651 B
C#
Raw Normal View History

2022-05-06 23:21:55 +00:00
using QSB.EchoesOfTheEye.Ghosts.WorldObjects;
using QSB.Messaging;
using QSB.WorldSync;
namespace QSB.EchoesOfTheEye.Ghosts.Messages;
internal class ChangeNodeMapMessage : QSBWorldObjectMessage<QSBGhostController, int>
{
public ChangeNodeMapMessage(int nodeMapIndex) : base(nodeMapIndex) { }
public override void OnReceiveRemote()
{
var nodeMap = Data.GetWorldObject<QSBGhostNodeMap>().AttachedObject;
WorldObject.AttachedObject._nodeMap = nodeMap;
WorldObject.AttachedObject.transform.parent = nodeMap.transform;
WorldObject.AttachedObject._nodeRoot = nodeMap.transform;
WorldObject.AttachedObject.OnNodeMapChanged.Invoke();
}
}