Skip to content

Commit

Permalink
Merge pull request #77 from MerlinVR/open-beta-events
Browse files Browse the repository at this point in the history
Open beta events -> Master
  • Loading branch information
MerlinVR authored Mar 10, 2021
2 parents 14ddda4 + 1fecfaf commit 6efd57a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Assets/UdonSharp/Editor/UdonSharpResolverContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ public bool ReplaceInternalEventName(ref string eventName)
{ "_onPlayerLeft", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(VRC.SDKBase.VRCPlayerApi), "onPlayerLeftPlayer") } },
{ "_onStationEntered", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(VRC.SDKBase.VRCPlayerApi), "onStationEnteredPlayer") } },
{ "_onStationExited", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(VRC.SDKBase.VRCPlayerApi), "onStationExitedPlayer") } },
#if UDON_BETA_SDK || true
{ "_onOwnershipRequest", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(VRC.SDKBase.VRCPlayerApi), "onOwnershipRequestRequester"), new System.Tuple<System.Type, string>(typeof(VRC.SDKBase.VRCPlayerApi), "onOwnershipRequestNewOwner") } },
{ "_onPlayerTriggerEnter", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(VRC.SDKBase.VRCPlayerApi), "onPlayerTriggerEnterPlayer") } },
{ "_onPlayerTriggerExit", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(VRC.SDKBase.VRCPlayerApi), "onPlayerTriggerExitPlayer") } },
Expand All @@ -159,8 +158,19 @@ public bool ReplaceInternalEventName(ref string eventName)
{ "_onPlayerCollisionExit", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(VRC.SDKBase.VRCPlayerApi), "onPlayerCollisionExitPlayer") } },
{ "_onPlayerCollisionStay", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(VRC.SDKBase.VRCPlayerApi), "onPlayerCollisionStayPlayer") } },
{ "_onPlayerParticleCollision", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(VRC.SDKBase.VRCPlayerApi), "onPlayerParticleCollisionPlayer") } },
{ "_onPlayerRespawn", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(VRC.SDKBase.VRCPlayerApi), "onPlayerRespawnPlayer") } },
{ "_onVideoError", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(VRC.SDK3.Components.Video.VideoError), "onVideoErrorVideoError") } },
#endif
{ "_midiNoteOn", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(int), "midiNoteOnChannel"), new System.Tuple<System.Type, string>(typeof(int), "midiNoteOnNumber"), new System.Tuple<System.Type, string>(typeof(int), "midiNoteOnVelocity") } },
{ "_midiNoteOff", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(int), "midiNoteOffChannel"), new System.Tuple<System.Type, string>(typeof(int), "midiNoteOffNumber"), new System.Tuple<System.Type, string>(typeof(int), "midiNoteOffVelocity") } },
{ "_midiControlChange", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(int), "midiControlChangeChannel"), new System.Tuple<System.Type, string>(typeof(int), "midiControlChangeNumber"), new System.Tuple<System.Type, string>(typeof(int), "midiControlChangeValue") } },
{ "_inputJump", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(bool), "inputJumpBoolValue"), new System.Tuple<System.Type, string>(typeof(VRC.Udon.Common.UdonInputEventArgs), "inputJumpArgs") } },
{ "_inputUse", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(bool), "inputUseBoolValue"), new System.Tuple<System.Type, string>(typeof(VRC.Udon.Common.UdonInputEventArgs), "inputUseArgs") } },
{ "_inputGrab", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(bool), "inputGrabBoolValue"), new System.Tuple<System.Type, string>(typeof(VRC.Udon.Common.UdonInputEventArgs), "inputGrabArgs") } },
{ "_inputDrop", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(bool), "inputDropBoolValue"), new System.Tuple<System.Type, string>(typeof(VRC.Udon.Common.UdonInputEventArgs), "inputDropArgs") } },
{ "_inputMoveHorizontal", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(float), "inputMoveHorizontalFloatValue"), new System.Tuple<System.Type, string>(typeof(VRC.Udon.Common.UdonInputEventArgs), "inputMoveHorizontalArgs") } },
{ "_inputMoveVertical", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(float), "inputMoveVerticalFloatValue"), new System.Tuple<System.Type, string>(typeof(VRC.Udon.Common.UdonInputEventArgs), "inputMoveVerticalArgs") } },
{ "_inputLookHorizontal", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(float), "inputLookHorizontalFloatValue"), new System.Tuple<System.Type, string>(typeof(VRC.Udon.Common.UdonInputEventArgs), "inputLookHorizontalArgs") } },
{ "_inputLookVertical", new System.Tuple<System.Type, string>[] { new System.Tuple<System.Type, string>(typeof(float), "inputLookVerticalFloatValue"), new System.Tuple<System.Type, string>(typeof(VRC.Udon.Common.UdonInputEventArgs), "inputLookVerticalArgs") } },
};

public System.Tuple<System.Type, string>[] GetMethodCustomArgs(string methodName)
Expand Down
15 changes: 15 additions & 0 deletions Assets/UdonSharp/Scripts/UdonSharpBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,25 @@ public virtual void OnPlayerCollisionEnter(VRC.SDKBase.VRCPlayerApi player) { }
public virtual void OnPlayerCollisionExit(VRC.SDKBase.VRCPlayerApi player) { }
public virtual void OnPlayerCollisionStay(VRC.SDKBase.VRCPlayerApi player) { }
public virtual void OnPlayerParticleCollision(VRC.SDKBase.VRCPlayerApi player) { }
public virtual void OnPlayerRespawn(VRC.SDKBase.VRCPlayerApi player) { }

#if UDON_BETA_SDK
public virtual bool OnOwnershipRequest(VRC.SDKBase.VRCPlayerApi requestingPlayer, VRC.SDKBase.VRCPlayerApi requestedOwner) => true;
#endif

public virtual void MidiNoteOn(int channel, int number, int velocity) { }
public virtual void MidiNoteOff(int channel, int number, int velocity) { }
public virtual void MidiControlChange(int channel, int number, int value) { }

public virtual void InputJump(bool value, VRC.Udon.Common.UdonInputEventArgs args) { }
public virtual void InputUse(bool value, VRC.Udon.Common.UdonInputEventArgs args) { }
public virtual void InputGrab(bool value, VRC.Udon.Common.UdonInputEventArgs args) { }
public virtual void InputDrop(bool value, VRC.Udon.Common.UdonInputEventArgs args) { }
public virtual void InputMoveHorizontal(float value, VRC.Udon.Common.UdonInputEventArgs args) { }
public virtual void InputMoveVertical(float value, VRC.Udon.Common.UdonInputEventArgs args) { }
public virtual void InputLookHorizontal(float value, VRC.Udon.Common.UdonInputEventArgs args) { }
public virtual void InputLookVertical(float value, VRC.Udon.Common.UdonInputEventArgs args) { }

[Obsolete("The OnStationEntered() event is deprecated use the OnStationEntered(VRCPlayerApi player) event instead, this event will be removed in a future release.")]
public virtual void OnStationEntered() { }

Expand Down

0 comments on commit 6efd57a

Please sign in to comment.