Skip to content

Instantly share code, notes, and snippets.

@TheHelpfulHelper
TheHelpfulHelper / UdonSharpCustomClassPattern.cs
Created January 15, 2024 01:31
U# Fake Custom Classes Pattern
// NOTE: The current U# compiler will log an error, it however still compiles and functions correctly!
public class MyCustomClass : DataDictionary
{
public static MyCustomClass ctor() // you can call this whatever you want, New(), Create(), or here ctor()
{
var instance = (MyCustomClass)new DataDictionary();
instance["player"] = new DataToken(Networking.LocalPlayer); // Example of something you might want to do in the constructor
@TheHelpfulHelper
TheHelpfulHelper / VRCDataUtility.cs
Last active November 14, 2024 00:48
Formats a VRC.SDK3.Data.DataToken similar to VRCJson.TrySerializeToJson, however with handling for Reference and Error Tokens
using UdonSharp;
using UnityEngine;
using VRC.SDK3.Data;
namespace THH.Utility
{
public static class VRCDataExtensions
{
public static void Log(this DataToken token)
{