### UdonChips Wallet Change Event Listener with Manual Registration Source: https://github.com/jlchntoz/udonchips-plus/blob/main/README.md This snippet demonstrates registering a listener for UdonChips wallet changes manually using the _AddListener method in the Start function. This ensures callbacks are only fired after the script is initialized. ```csharp using UnityEngine; using UdonSharp; using UCS; using JLChnToZ.VRC.Foundation; public class MyUdonChipsGimmick : UdonSharpBehaviour { [SerializeField] [HideInInspector] UdonChips udonChips; void Start() { // This registers only when your gimmick first activated. // It will have a little runtime performance overhead, // but gurantees no callback will be fired before your script initialized. udonChips._AddListener(this); } // This will be called when someone adds or takes money from user's udonChips wallet. public void _OnMoneyChanged() { // Your logic here } } ``` -------------------------------- ### Basic UdonChips Money Addition Source: https://github.com/jlchntoz/udonchips-plus/blob/main/README.md This snippet demonstrates how to add 100 UdonChips currency to a user's wallet when the game object becomes active. It assumes UdonChips is automatically bound to the script. ```csharp using UnityEngine; using UdonSharp; using UCS; public class MyUdonChipsGimmick : UdonSharpBehaviour { [SerializeField] [HideInInspector] // HideInInspector is optional, it doesn't matter. UdonChips udonChips; void OnEnable() { // Example: When the current game object active, current user will get 100uc: udonChips.money += 100; } } ``` -------------------------------- ### UdonChips Wallet Change Event Listener with BindUdonSharpEvent Source: https://github.com/jlchntoz/udonchips-plus/blob/main/README.md This snippet shows how to automatically listen for UdonChips wallet changes using the [BindUdonSharpEvent] attribute. The _OnMoneyChanged callback will be invoked when a user's balance is updated. ```csharp using UnityEngine; using UdonSharp; using UCS; using JLChnToZ.VRC.Foundation; public class MyUdonChipsGimmick : UdonSharpBehaviour { [SerializeField] [HideInInspector] [BindUdonSharpEvent] // BindUdonSharpEvent makes this script automatically listen to its callbacks. UdonChips udonChips; // This will be called when someone adds or takes money from user's udonChips wallet. public void _OnMoneyChanged() { // Your logic here } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.