Events
Forms that compile (125)
Section titled “Forms that compile (125)”82 are written with override; 43 are recognized by name and argument types. Types are written in full; write a using and the short name works.
Forms written by overriding a base declaration
Section titled “Forms written by overriding a base declaration”| Syntax | Name called | Variable that receives the argument |
|---|---|---|
void InputDrop(bool value, VRC.Udon.Common.UdonInputEventArgs args) | _inputDrop | inputDropBoolValue inputDropArgs |
void InputGrab(bool value, VRC.Udon.Common.UdonInputEventArgs args) | _inputGrab | inputGrabBoolValue inputGrabArgs |
void InputJump(bool value, VRC.Udon.Common.UdonInputEventArgs args) | _inputJump | inputJumpBoolValue inputJumpArgs |
void InputLookHorizontal(float value, VRC.Udon.Common.UdonInputEventArgs args) | _inputLookHorizontal | inputLookHorizontalFloatValue inputLookHorizontalArgs |
void InputLookVertical(float value, VRC.Udon.Common.UdonInputEventArgs args) | _inputLookVertical | inputLookVerticalFloatValue inputLookVerticalArgs |
void InputMoveHorizontal(float value, VRC.Udon.Common.UdonInputEventArgs args) | _inputMoveHorizontal | inputMoveHorizontalFloatValue inputMoveHorizontalArgs |
void InputMoveVertical(float value, VRC.Udon.Common.UdonInputEventArgs args) | _inputMoveVertical | inputMoveVerticalFloatValue inputMoveVerticalArgs |
void InputUse(bool value, VRC.Udon.Common.UdonInputEventArgs args) | _inputUse | inputUseBoolValue inputUseArgs |
void Interact() | _interact | — |
void MidiControlChange(int channel, int number, int value) | _midiControlChange | midiControlChangeChannel midiControlChangeNumber midiControlChangeValue |
void MidiNoteOff(int channel, int number, int velocity) | _midiNoteOff | midiNoteOffChannel midiNoteOffNumber midiNoteOffVelocity |
void MidiNoteOn(int channel, int number, int velocity) | _midiNoteOn | midiNoteOnChannel midiNoteOnNumber midiNoteOnVelocity |
void OnAsyncGpuReadbackComplete(VRC.SDK3.Rendering.VRCAsyncGPUReadbackRequest request) | _onAsyncGpuReadbackComplete | onAsyncGpuReadbackCompleteRequest |
void OnAvatarChanged(VRC.SDKBase.VRCPlayerApi player) | _onAvatarChanged | onAvatarChangedPlayer |
void OnAvatarEyeHeightChanged(VRC.SDKBase.VRCPlayerApi player, float prevEyeHeightAsMeters) | _onAvatarEyeHeightChanged | onAvatarEyeHeightChangedPlayer onAvatarEyeHeightChangedPrevEyeHeightAsMeters |
void OnContactEnter(VRC.Dynamics.ContactEnterInfo contactInfo) | _onContactEnter | onContactEnterContactInfo |
void OnContactExit(VRC.Dynamics.ContactExitInfo contactInfo) | _onContactExit | onContactExitContactInfo |
void OnControllerColliderHitPlayer(VRC.SDK3.ControllerColliderPlayerHit hit) | _onControllerColliderHitPlayer | onControllerColliderHitPlayerHit |
void OnDeserialization(VRC.Udon.Common.DeserializationResult result) | _onDeserialization | onDeserializationResult |
void OnDroneTriggerEnter(VRC.SDKBase.VRCDroneApi drone) | _onDroneTriggerEnter | onDroneTriggerEnterDrone |
void OnDroneTriggerExit(VRC.SDKBase.VRCDroneApi drone) | _onDroneTriggerExit | onDroneTriggerExitDrone |
void OnDroneTriggerStay(VRC.SDKBase.VRCDroneApi drone) | _onDroneTriggerStay | onDroneTriggerStayDrone |
void OnDrop() | _onDrop | — |
void OnImageLoadError(VRC.SDK3.Image.IVRCImageDownload result) | _onImageLoadError | onImageLoadErrorIVRCImageDownload |
void OnImageLoadSuccess(VRC.SDK3.Image.IVRCImageDownload result) | _onImageLoadSuccess | onImageLoadSuccessIVRCImageDownload |
void OnInputMethodChanged(VRC.SDKBase.VRCInputMethod inputMethod) | _onInputMethodChanged | onInputMethodChangedInputMethod |
void OnLanguageChanged(string language) | _onLanguageChanged | onLanguageChangedLanguage |
void OnListAvailableProducts(VRC.Economy.IProduct[] products) | _onListAvailableProducts | onListAvailableProductsResult |
void OnListProductOwners(VRC.Economy.IProduct product, string[] owners) | _onListProductOwners | onListProductOwnersResult onListProductOwnersOwners |
void OnListPurchases(VRC.Economy.IProduct[] products, VRC.SDKBase.VRCPlayerApi player) | _onListPurchases | onListPurchasesResult onListPurchasesPlayer |
void OnMasterTransferred(VRC.SDKBase.VRCPlayerApi newMaster) | _onMasterTransferred | onMasterTransferredNewMaster |
bool OnOwnershipRequest(VRC.SDKBase.VRCPlayerApi requestingPlayer, VRC.SDKBase.VRCPlayerApi requestedOwner) | _onOwnershipRequest | onOwnershipRequestRequester onOwnershipRequestNewOwner |
void OnOwnershipTransferred(VRC.SDKBase.VRCPlayerApi player) | _onOwnershipTransferred | onOwnershipTransferredPlayer |
void OnPersistenceUsageUpdated() | _onPersistenceUsageUpdated | — |
void OnPhysBoneGrabbed(VRC.Dynamics.PhysBoneGrabbedInfo physBoneInfo) | _onPhysBoneGrabbed | onPhysBoneGrabbedPhysBoneInfo |
void OnPhysBonePosed(VRC.Dynamics.PhysBonePosedInfo physBoneInfo) | _onPhysBonePosed | onPhysBonePosedPhysBoneInfo |
void OnPhysBoneReleased(VRC.Dynamics.PhysBoneReleasedInfo physBoneInfo) | _onPhysBoneReleased | onPhysBoneReleasedPhysBoneInfo |
void OnPhysBoneUnPosed(VRC.Dynamics.PhysBoneUnPosedInfo physBoneInfo) | _onPhysBoneUnPosed | onPhysBoneUnPosedPhysBoneInfo |
void OnPickup() | _onPickup | — |
void OnPickupUseDown() | _onPickupUseDown | — |
void OnPickupUseUp() | _onPickupUseUp | — |
void OnPlayerCollisionEnter(VRC.SDKBase.VRCPlayerApi player) | _onPlayerCollisionEnter | onPlayerCollisionEnterPlayer |
void OnPlayerCollisionExit(VRC.SDKBase.VRCPlayerApi player) | _onPlayerCollisionExit | onPlayerCollisionExitPlayer |
void OnPlayerCollisionStay(VRC.SDKBase.VRCPlayerApi player) | _onPlayerCollisionStay | onPlayerCollisionStayPlayer |
void OnPlayerDataStorageExceeded(VRC.SDKBase.VRCPlayerApi player) | _onPlayerDataStorageExceeded | onPlayerDataStorageExceededPlayer |
void OnPlayerDataStorageWarning(VRC.SDKBase.VRCPlayerApi player) | _onPlayerDataStorageWarning | onPlayerDataStorageWarningPlayer |
void OnPlayerDataUpdated(VRC.SDKBase.VRCPlayerApi player, VRC.SDK3.Persistence.PlayerData.Info[] infos) | _onPlayerDataUpdated | onPlayerDataUpdatedPlayer onPlayerDataUpdatedInfos |
void OnPlayerJoined(VRC.SDKBase.VRCPlayerApi player) | _onPlayerJoined | onPlayerJoinedPlayer |
void OnPlayerLeft(VRC.SDKBase.VRCPlayerApi player) | _onPlayerLeft | onPlayerLeftPlayer |
void OnPlayerObjectStorageExceeded(VRC.SDKBase.VRCPlayerApi player) | _onPlayerObjectStorageExceeded | onPlayerObjectStorageExceededPlayer |
void OnPlayerObjectStorageWarning(VRC.SDKBase.VRCPlayerApi player) | _onPlayerObjectStorageWarning | onPlayerObjectStorageWarningPlayer |
void OnPlayerParticleCollision(VRC.SDKBase.VRCPlayerApi player) | _onPlayerParticleCollision | onPlayerParticleCollisionPlayer |
void OnPlayerRespawn(VRC.SDKBase.VRCPlayerApi player) | _onPlayerRespawn | onPlayerRespawnPlayer |
void OnPlayerRestored(VRC.SDKBase.VRCPlayerApi player) | _onPlayerRestored | onPlayerRestoredPlayer |
void OnPlayerSuspendChanged(VRC.SDKBase.VRCPlayerApi player) | _onPlayerSuspendChanged | onPlayerSuspendChangedPlayer |
void OnPlayerTriggerEnter(VRC.SDKBase.VRCPlayerApi player) | _onPlayerTriggerEnter | onPlayerTriggerEnterPlayer |
void OnPlayerTriggerExit(VRC.SDKBase.VRCPlayerApi player) | _onPlayerTriggerExit | onPlayerTriggerExitPlayer |
void OnPlayerTriggerStay(VRC.SDKBase.VRCPlayerApi player) | _onPlayerTriggerStay | onPlayerTriggerStayPlayer |
void OnPostSerialization(VRC.Udon.Common.SerializationResult result) | _onPostSerialization | onPostSerializationResult |
void OnPreSerialization() | _onPreSerialization | — |
void OnProductEvent(VRC.Economy.IProduct product, VRC.SDKBase.VRCPlayerApi player) | _onProductEvent | onProductEventResult onProductEventPlayer |
void OnPurchaseConfirmed(VRC.Economy.IProduct product, VRC.SDKBase.VRCPlayerApi player, bool purchasedNow) | _onPurchaseConfirmed | onPurchaseConfirmedResult onPurchaseConfirmedPlayer onPurchaseConfirmedPurchasedNow |
void OnPurchaseConfirmedMultiple(VRC.Economy.IProduct product, VRC.SDKBase.VRCPlayerApi player, bool purchasedNow, int quantity) | _onPurchaseConfirmedMultiple | onPurchaseConfirmedMultipleResult onPurchaseConfirmedMultiplePlayer onPurchaseConfirmedMultiplePurchasedNow onPurchaseConfirmedMultipleQuantity |
void OnPurchaseExpired(VRC.Economy.IProduct product, VRC.SDKBase.VRCPlayerApi player) | _onPurchaseExpired | onPurchaseExpiredResult onPurchaseExpiredPlayer |
void OnPurchasesLoaded(VRC.Economy.IProduct[] products, VRC.SDKBase.VRCPlayerApi player) | _onPurchasesLoaded | onPurchasesLoadedResult onPurchasesLoadedPlayer |
void OnScreenUpdate(VRC.SDK3.Platform.ScreenUpdateData data) | _onScreenUpdate | onScreenUpdateData |
void OnSpawn() | _onSpawn | — |
void OnStationEntered(VRC.SDKBase.VRCPlayerApi player) | _onStationEntered | onStationEnteredPlayer |
void OnStationExited(VRC.SDKBase.VRCPlayerApi player) | _onStationExited | onStationExitedPlayer |
void OnStringLoadError(VRC.SDK3.StringLoading.IVRCStringDownload result) | _onStringLoadError | onStringLoadErrorIVRCStringDownload |
void OnStringLoadSuccess(VRC.SDK3.StringLoading.IVRCStringDownload result) | _onStringLoadSuccess | onStringLoadSuccessIVRCStringDownload |
void OnVRCCameraSettingsChanged(VRC.SDK3.Rendering.VRCCameraSettings cameraSettings) | _onVRCCameraSettingsChanged | onVRCCameraSettingsChangedCamera |
void OnVRCPlusMassGift(VRC.SDKBase.VRCPlayerApi gifter, int numGifts) | _onVRCPlusMassGift | onVRCPlusMassGiftGifter onVRCPlusMassGiftNumGifts |
void OnVRCQualitySettingsChanged() | _onVRCQualitySettingsChanged | — |
void OnVideoEnd() | _onVideoEnd | — |
void OnVideoError(VRC.SDK3.Components.Video.VideoError videoError) | _onVideoError | onVideoErrorVideoError |
void OnVideoLoop() | _onVideoLoop | — |
void OnVideoPause() | _onVideoPause | — |
void OnVideoPlay() | _onVideoPlay | — |
void OnVideoReady() | _onVideoReady | — |
void OnVideoStart() | _onVideoStart | — |
void PostLateUpdate() | _postLateUpdate | — |
Forms recognized by name and argument type
Section titled “Forms recognized by name and argument type”| Syntax | Name called | Variable that receives the argument |
|---|---|---|
void FixedUpdate() | _fixedUpdate | — |
void LateUpdate() | _lateUpdate | — |
void OnAnimatorIK(int layerIndex) | _onAnimatorIK | onAnimatorIKLayerIndex |
void OnAnimatorMove() | _onAnimatorMove | — |
void OnBecameInvisible() | _onBecameInvisible | — |
void OnBecameVisible() | _onBecameVisible | — |
void OnCollisionEnter(UnityEngine.Collision other) | _onCollisionEnter | onCollisionEnterOther |
void OnCollisionEnter2D(UnityEngine.Collision2D other) | _onCollisionEnter2D | onCollisionEnter2DOther |
void OnCollisionExit(UnityEngine.Collision other) | _onCollisionExit | onCollisionExitOther |
void OnCollisionExit2D(UnityEngine.Collision2D other) | _onCollisionExit2D | onCollisionExit2DOther |
void OnCollisionStay(UnityEngine.Collision other) | _onCollisionStay | onCollisionStayOther |
void OnCollisionStay2D(UnityEngine.Collision2D other) | _onCollisionStay2D | onCollisionStay2DOther |
void OnControllerColliderHit(UnityEngine.ControllerColliderHit hit) | _onControllerColliderHit | onControllerColliderHitHit |
void OnDestroy() | _onDestroy | — |
void OnDisable() | _onDisable | — |
void OnEnable() | _onEnable | — |
void OnJointBreak(float breakForce) | _onJointBreak | onJointBreakBreakForce |
void OnJointBreak2D(UnityEngine.Joint2D brokenJoint) | _onJointBreak2D | onJointBreak2DBrokenJoint |
void OnMouseDown() | _onMouseDown | — |
void OnMouseDrag() | _onMouseDrag | — |
void OnMouseEnter() | _onMouseEnter | — |
void OnMouseExit() | _onMouseExit | — |
void OnMouseOver() | _onMouseOver | — |
void OnMouseUp() | _onMouseUp | — |
void OnMouseUpAsButton() | _onMouseUpAsButton | — |
void OnParticleCollision(UnityEngine.GameObject other) | _onParticleCollision | onParticleCollisionOther |
void OnParticleTrigger() | _onParticleTrigger | — |
void OnPostRender() | _onPostRender | — |
void OnPreCull() | _onPreCull | — |
void OnPreRender() | _onPreRender | — |
void OnRenderImage(UnityEngine.RenderTexture src, UnityEngine.RenderTexture dest) | _onRenderImage | onRenderImageSrc onRenderImageDest |
void OnRenderObject() | _onRenderObject | — |
void OnTransformChildrenChanged() | _onTransformChildrenChanged | — |
void OnTransformParentChanged() | _onTransformParentChanged | — |
void OnTriggerEnter(UnityEngine.Collider other) | _onTriggerEnter | onTriggerEnterOther |
void OnTriggerEnter2D(UnityEngine.Collider2D other) | _onTriggerEnter2D | onTriggerEnter2DOther |
void OnTriggerExit(UnityEngine.Collider other) | _onTriggerExit | onTriggerExitOther |
void OnTriggerExit2D(UnityEngine.Collider2D other) | _onTriggerExit2D | onTriggerExit2DOther |
void OnTriggerStay(UnityEngine.Collider other) | _onTriggerStay | onTriggerStayOther |
void OnTriggerStay2D(UnityEngine.Collider2D other) | _onTriggerStay2D | onTriggerStay2DOther |
void OnWillRenderObject() | _onWillRenderObject | — |
void Start() | _start | — |
void Update() | _update | — |
Forms that don’t compile (2)
Section titled “Forms that don’t compile (2)”| Syntax | Description | Error | Reason | Alternative |
|---|---|---|---|---|
public void _start() and void Start() | Give a method the name the runtime uses | TUKI0001 | runtime | Change the method’s name |
base.OnPlayerJoined(player) | Call the base implementation from the override | TUKI0101 | runtime | Write only your own code without calling the base implementation (the base has none) |
Spelling checks
Section titled “Spelling checks”| Family | If the name is wrong | If an argument type is wrong |
|---|---|---|
Written with override (82) | You get a CS0115 error | You get a CS0115 error |
| Written by name and argument type (43) | Supported. Never called | Supported. Never called |
How they’re recognized
Section titled “How they’re recognized”Events come in two families, differing both in where they are declared and in what checks their spelling.
Written with override (82) | Recognized by name (43) | |
|---|---|---|
| Origin | Runtime events | Unity messages |
| Where it is declared | The base TsukimiBehaviour | Nowhere (you write it yourself) |
| Spelling checks | The C# compiler | Nothing does (Spelling checks) |
| Checking of parameter types | The C# compiler | Not performed |
| When it departs from the list | A CS0115 error | It becomes an ordinary method |
| Access modifier | Written with public override | Doesn’t matter (private is still an event) |
| Return value | As declared in the base | void |
| Shape of the call | A method matching a name and argument types from the list is given an entry-point name such as _start, and the runtime calls it by that name (not a C# virtual call) | Same |
Forms recognized by name
Section titled “Forms recognized by name”The shortest form is Start.
using UnityEngine;using Tsukimi;
public class EventsStart : TsukimiBehaviour{ void Start() { Debug.Log(1); // => 1 }}Forms written with override
Section titled “Forms written with override”Match the declaration the base already holds.
using UnityEngine;using Tsukimi;
public class EventsInteract : TsukimiBehaviour{ public override void Interact() { Debug.Log(2); }
void Start() { Debug.Log(1); // => 1 }}Misspellings
Section titled “Misspellings”With override, C# checks both the spelling and the argument types, so you get an error on the spot.
using UnityEngine;using Tsukimi;using VRC.SDKBase;
public class R_events_override_typo : TsukimiBehaviour{ public override void OnPlayerJoind(VRCPlayerApi player) { Debug.Log(player.playerId); }}Forms that depart from the list
Section titled “Forms that depart from the list”The Update below takes one argument, so it isn’t an event; being private with nothing calling it, no instructions are generated either.
using UnityEngine;using Tsukimi;
public class EventsNameMatchMiss : TsukimiBehaviour{ private void Update(float delta) { Debug.Log(2); }
void Start() { Debug.Log(1); // => 1 }}Access range
Section titled “Access range”A method marked private is an event too.
using UnityEngine;using Tsukimi;
public class EventsPrivateEvent : TsukimiBehaviour{ private void LateUpdate() { Debug.Log(2); }
void Start() { Debug.Log(1); // => 1 }}Name the runtime calls
Section titled “Name the runtime calls”The runtime calls the program using the event name with its first letter lowercased and an _ prefixed
(Start becomes _start; that name is the middle column of the table in the list).
That name is registered separately from the method name, so writing a method with the same spelling yourself
registers it twice and produces a TUKI0001 error.
using UnityEngine;using Tsukimi;
public class R_events_entry_collision : TsukimiBehaviour{ public void _start() { Debug.Log(2); }
void Start() { Debug.Log(1); }}How arguments arrive
Section titled “How arguments arrive”| How it is passed | There is no mechanism for the runtime to pass arguments into an event. The value is written into a named variable first, and the event is called afterwards |
| The variable’s name | The event name with its first letter lowercased, joined to the runtime-side parameter name with its first letter uppercased (the right column of the table in the list) |
| If the name is off by even one character | The write goes nowhere. The event is still called, and runs with the argument at its initial value. Neither an error nor a runtime failure appears |
| Who holds the mapping | The compiler holds it, checked against the event definitions the runtime holds |
using UnityEngine;using Tsukimi;using VRC.SDKBase;
public class EventsPlayerJoined : TsukimiBehaviour{ public override void OnPlayerJoined(VRCPlayerApi player) { Debug.Log(player.playerId); }
void Start() { Debug.Log(1); // => 1 }}The parameter names you write
Section titled “The parameter names you write”The runtime-side parameter name decides the variable’s name, so you are free to name your parameters as you like.
using UnityEngine;using Tsukimi;using VRC.SDKBase;
public class EventsParameterName : TsukimiBehaviour{ public override void OnPlayerLeft(VRCPlayerApi who) { Debug.Log(who.playerId); }
void Start() { Debug.Log(1); // => 1 }}Events recognized by name
Section titled “Events recognized by name”They receive them by the same rule.
using UnityEngine;using Tsukimi;
public class EventsTriggerEnter : TsukimiBehaviour{ void OnTriggerEnter(Collider other) { Debug.Log(other.gameObject.activeSelf); }
void Start() { Debug.Log(1); // => 1 }}Ones where the names differ
Section titled “Ones where the names differ”There are events where the argument name in the base declaration differs from the name of the variable the runtime writes the value into There are 22. The parameter names you write are unused, so they make no difference to behaviour.
| Events | Argument name in the base declaration | Variable that receives the argument |
|---|---|---|
InputDrop | value | inputDropBoolValue |
InputGrab | value | inputGrabBoolValue |
InputJump | value | inputJumpBoolValue |
InputLookHorizontal | value | inputLookHorizontalFloatValue |
InputLookVertical | value | inputLookVerticalFloatValue |
InputMoveHorizontal | value | inputMoveHorizontalFloatValue |
InputMoveVertical | value | inputMoveVerticalFloatValue |
InputUse | value | inputUseBoolValue |
OnImageLoadError | result | onImageLoadErrorIVRCImageDownload |
OnImageLoadSuccess | result | onImageLoadSuccessIVRCImageDownload |
OnListAvailableProducts | products | onListAvailableProductsResult |
OnListProductOwners | product | onListProductOwnersResult |
OnListPurchases | products | onListPurchasesResult |
OnOwnershipRequest | requestingPlayer requestedOwner | onOwnershipRequestRequester onOwnershipRequestNewOwner |
OnProductEvent | product | onProductEventResult |
OnPurchaseConfirmed | product | onPurchaseConfirmedResult |
OnPurchaseConfirmedMultiple | product | onPurchaseConfirmedMultipleResult |
OnPurchaseExpired | product | onPurchaseExpiredResult |
OnPurchasesLoaded | products | onPurchasesLoadedResult |
OnStringLoadError | result | onStringLoadErrorIVRCStringDownload |
OnStringLoadSuccess | result | onStringLoadSuccessIVRCStringDownload |
OnVRCCameraSettingsChanged | cameraSettings | onVRCCameraSettingsChangedCamera |
using UnityEngine;using Tsukimi;using VRC.Udon.Common;
public class EventsInputJump : TsukimiBehaviour{ public override void InputJump(bool value, UdonInputEventArgs args) { Debug.Log(value); }
void Start() { Debug.Log(1); // => 1 }}Form that takes no arguments
Section titled “Form that takes no arguments”4 events also have a declaration with no arguments. If you don’t need the argument, you can write it this way.
| Events | Another way to write it |
|---|---|
OnDeserialization | void OnDeserialization() |
OnOwnershipTransferred | void OnOwnershipTransferred() |
OnStationEntered | void OnStationEntered() |
OnStationExited | void OnStationExited() |
using UnityEngine;using Tsukimi;
public class EventsNoArgumentOverload : TsukimiBehaviour{ public override void OnStationEntered() { Debug.Log(2); }
void Start() { Debug.Log(1); // => 1 }}Ones called without writing any calling code
Section titled “Ones called without writing any calling code”Every event in the tables above, except for the ones not in the runtime’s definitions,
is called without a call written anywhere. For Interact, that’s when a player
uses that object (see the example in How they’re recognized).
Appearance when used
Section titled “Appearance when used”The text shown on approach is set by InteractionText. Setting DisableInteractive
stops the object from receiving Interact, and the outline no longer appears.
using UnityEngine;using Tsukimi;
public class EventsInteractAppearance : TsukimiBehaviour{ public bool locked;
void Start() { InteractionText = "Open"; }
public override void Interact() { locked = !locked; DisableInteractive = locked; }}Form you call from code
Section titled “Form you call from code”Separate from events, a method marked public is registered by name and becomes a destination for
SendCustomEvent (for how to write it and the forms that error, see Getting and calling components).
Registration as a target happens even if there isn’t a single call inside that program. The caller may be in a different program, or on the runtime’s side, invisible at compile time.
Ones called along with sync
Section titled “Ones called along with sync”OnDeserialization OnPreSerialization OnPostSerialization OnOwnershipRequest
and OnOwnershipTransferred are called along with value sync and ownership. The conditions for being called are
covered in Sync.
Ones you can write conditionally
Section titled “Ones you can write conditionally”In the base classes of the distributed package, the following 6 are wrapped in conditional compilation.
If the project hasn’t enabled that feature, the declaration doesn’t exist, so you can’t write it with override.
| Events | Condition |
|---|---|
OnPersistenceUsageUpdated | VRC_ENABLE_PLAYER_PERSISTENCE || VRC_ENABLE_INSTANCE_PERSISTENCE |
OnPlayerDataStorageExceeded | VRC_ENABLE_PLAYER_PERSISTENCE |
OnPlayerDataStorageWarning | VRC_ENABLE_PLAYER_PERSISTENCE |
OnPlayerDataUpdated | VRC_ENABLE_PLAYER_PERSISTENCE |
OnPlayerObjectStorageExceeded | VRC_ENABLE_PLAYER_PERSISTENCE |
OnPlayerObjectStorageWarning | VRC_ENABLE_PLAYER_PERSISTENCE |
Ones not in the runtime’s definitions
Section titled “Ones not in the runtime’s definitions”The following 2 compile, but they aren’t in the event definitions the runtime holds. Existing code that overrides
Existing code that used override still compiles as-is.
| Events |
|---|
OnVideoPause |
OnVideoPlay |
Ones this language doesn’t have
Section titled “Ones this language doesn’t have”There’s 1 event that exists on the runtime’s side but not in this language. OnVariableChange
is called under a different name per variable, so it can’t be placed as a single event. Overriding this
Using override produces a CS0115 error.
using UnityEngine;using Tsukimi;
public class R_events_on_variable_change : TsukimiBehaviour{ public override void OnVariableChange() { Debug.Log(1); }}