-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVRC Override Methods reference.cs
227 lines (209 loc) · 7.19 KB
/
VRC Override Methods reference.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
using UdonSharp;
using VRC.SDK3.Components.Video;
using VRC.SDKBase;
using VRC.Udon.Common;
public class OverrideList : UdonSharpBehaviour
{
//
// More info
// https://docs.vrchat.com/docs/event-nodes
//
public override void Interact()
{
// runs when you Interact with an object
}
public override void OnSpawn()
{
//Runs when you spawn an object
}
/*
* Overship transfers
*/
public override void OnOwnershipTransferred(VRCPlayerApi _player)
{
//Runs when this object changes owners
//
//Extra note:
//Picking up an object transfers ownership
}
public override bool OnOwnershipRequest(VRCPlayerApi _requestingPlayer, VRCPlayerApi _currentOwner)
{
//When an object tries to transfer Ownship
//this will run allowing you to define if ownership is allowed to transfer.
//
//If this isnt present in your code it will retruen True by default allowing the owner to change.
return true;
}
/*
* Pickups
* These must be attached to an object with VRC_Pickup on it
*/
public override void OnPickup()
{
//Runs for the player that pickups the object
}
public override void OnDrop()
{
//Runs for the player that drops the object
}
public override void OnPickupUseDown()
{
//Runs for the player that uses the pickup
}
public override void OnPickupUseUp()
{
//Runs for the player that stops using the pickup
}
/*
* Player Events
*/
public override void OnPlayerJoined(VRCPlayerApi _player)
{
//Runs when a player joins
//Returns that player that joined
}
public override void OnPlayerLeft(VRCPlayerApi _player)
{
//runs when a player leaves
//Returns that player that left
}
public override void OnPlayerRespawn(VRCPlayerApi player)
{
//Runs when a player respawns
//this may run for EVERYONE when somone respawns
//will be tested and updated at a later date
}
public override void OnPlayerParticleCollision(VRCPlayerApi player)
{
//This has to be added to a Particle System to run
//When a Particle with collision from the Particle System hits a player, this runs.
//This only triggers for the local player that gets hit due to player particle collision being local only.
}
public override void OnPlayerTriggerEnter(VRCPlayerApi player)
{
//This has to be attached to a GameObject with a trigger collider on it
//if a player has multiple colliders on their avatar, this will run once for each collider they have.
//Runs whan any player enters a Trigger.
//If a client doesnt have the trigger enabled, it will not run.
}
public override void OnPlayerTriggerExit(VRCPlayerApi player)
{
//This has to be attached to a GameObject with a trigger collider on it
//if a player has multiple colliders on their avatar, this will run once for each collider they have.
//Runs whan any player Exits a Trigger.
//If a client doesnt have the Trigger enabled, it will not run.
//This will still call if the Trigger gets turned off when the client is inside of it.
}
public override void OnPlayerTriggerStay(VRCPlayerApi player)
{
//This has to be attached to a GameObject with a trigger collider on it
//if a player has multiple colliders on their avatar, this will run once for each collider they have.
//Runs on every frame whan a player is inside of a Trigger.
}
public override void OnPlayerCollisionEnter(VRCPlayerApi player)
{
//This has to be attached to a GameObject with a collider on it
//if a player has multiple colliders on their avatar, this will run once for each collider they have.
//Runs whan any player enters a Collider.
//If a client doesnt have the Collider enabled, it will not run.
}
public override void OnPlayerCollisionExit(VRCPlayerApi player)
{
//This has to be attached to a GameObject with a collider on it
//if a player has multiple colliders on their avatar, this will run once for each collider they have.
//Runs whan any player Exits a Collider.
//If a client doesnt have the Collider enabled, it will not run.
//This will still call if the Collider gets turned off when the client is inside of it.
}
public override void OnPlayerCollisionStay(VRCPlayerApi player)
{
//This has to be attached to a GameObject with a collider on it
//if a player has multiple colliders on their avatar, this will run once for each collider they have.
//Runs on every frame whan a player is inside of a Trigger.
}
public override void PostLateUpdate()
{
//runs every frane after the IK is calculated
}
/*
* Stations
* These are what chairs use to work
*/
public override void OnStationEntered(VRCPlayerApi _player)
{
//Runs when you enter a chair
}
public override void OnStationExited(VRCPlayerApi _player)
{
//Runs when you leave a chair
}
/*
* Video Player
*
* These need to be on an VideoPlayer component to work
*/
public override void OnVideoEnd()
{
//When a video ends
}
public override void OnVideoPause()
{
//When a video pauses
}
public override void OnVideoPlay()
{
//When a video starts playing, this can include:
//Video first starts
//UnPausing a video
}
public override void OnVideoStart()
{
//Runs when a video player starts from a stopped state.
//seems to be the same as OnVideoPlay()
}
public override void OnVideoLoop()
{
//Runs when a video loops
}
public override void OnVideoReady()
{
//Runs when a video loads in and is ready to be played, but not when the video plays.
}
public override void OnVideoError(VideoError videoError)
{
//Requires "using VRC.SDK3.Components.Video;" to be used
}
/*
* Serialization
*/
public override void OnDeserialization()
{
//This runs whenever the client recives Networking data.
}
public override void OnPreSerialization()
{
//This runs before the client sends Networking data.
}
public override void OnPostSerialization(SerializationResult result)
{
//requires "using VRC.Udon.Common;" to use
//From what i understand this
//runs after all other Serialization event and allows you top check if it was sent successfully.
}
/*
* MIDI
*/
public override void MidiControlChange(int channel, int number, int value)
{
//Runs when a Control changes on the MIDI controller. this basically anything that isnt a note
//Examples beiong a slider, a knob, or a sustain pedal
}
public override void MidiNoteOn(int channel, int number, int velocity)
{
//Runs when you push a MIDI note
}
public override void MidiNoteOff(int channel, int number, int velocity)
{
//Runs when you let go of a MIDI note
}
}