Skip to content

Commit

Permalink
EventReceiver fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
FairlySadPanda committed May 8, 2020
1 parent 2669b12 commit d011f69
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions UdonStringEvent/EventReceiver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class EventReceiver : UdonSharpBehaviour
{
/// <Summary>An array of all Emitters in the system.</Summary>
public GameObject[] emitters;
public EventEmitter[] emitters;
public UdonBehaviour handler;

private int clock;
Expand All @@ -32,7 +32,7 @@ void Update()
{
if (emitter == null)
{
emitter = GetEmitter();
emitter = GetEmitter(displayName);

if (emitter != null)
{
Expand Down Expand Up @@ -63,13 +63,13 @@ public void SendEvent(string eventName, string eventPayload)
// This can be bad in two ways: either the return is null or the return is not owned.
if (emitter == null)
{
Debug.Error("emitter was null: could not handle " + eventName + " event");
Debug.LogError("emitter was null: could not handle " + eventName + " event");
return;
}

if (!Networking.IsOwner(emitter.gameObject))
{
Debug.Error("emitter not owned by player: could not handle " + eventName + " event");
Debug.LogError("emitter not owned by player: could not handle " + eventName + " event");
return;
}

Expand All @@ -90,7 +90,7 @@ private EventEmitter GetEmitter(string name)
}

/// <Summary>Get an empty emitter and assign it to the new player.</Summary>
override void OnPlayerJoined(VRCPlayerApi player)
public override void OnPlayerJoined(VRCPlayerApi player)
{
if (Networking.IsOwner(gameObject))
{
Expand All @@ -99,7 +99,7 @@ override void OnPlayerJoined(VRCPlayerApi player)
}

/// <Summary>Get the player's emitter and assign it to nobody.</Summary>
override void OnPlayerLeft(VRCPlayerApi player)
public override void OnPlayerLeft(VRCPlayerApi player)
{
if (Networking.IsOwner(gameObject))
{
Expand Down

0 comments on commit d011f69

Please sign in to comment.