EVERYTHING
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using UnityEngine;
|
||||
|
||||
[DisallowMultipleComponent]
|
||||
public sealed class OnPlayerJoinedBehavior : NodeBehavior
|
||||
{
|
||||
private NodeGraphManager graph;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
graph = NodeGraphManager.Instance;
|
||||
if (graph != null)
|
||||
{
|
||||
graph.PlayerJoined += HandlePlayerJoined;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (graph != null)
|
||||
{
|
||||
graph.PlayerJoined -= HandlePlayerJoined;
|
||||
}
|
||||
}
|
||||
|
||||
private void HandlePlayerJoined(int actorNumber)
|
||||
{
|
||||
if (!(Node == null) && actorNumber > 0)
|
||||
{
|
||||
SetLocalOutputValue("Player", BSValue.FromPlayer(actorNumber));
|
||||
Node.TriggerRun("Joined");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user