URT3D Docs
  • ๐Ÿ“˜Welcome to URT3D Docs
  • Getting Started
    • ๐Ÿš€Quickstart
  • Basics
    • ๐ŸŒIntroduction to URT3D
    • ๐Ÿ”„How to Convert Your Files
    • โฌ†๏ธUpload Tips and Guidelines
    • ๐Ÿ“ฆUsing Your Converted Files
    • ๐Ÿ› ๏ธTroubleshooting Conversion
  • ๐Ÿ“‚ Developers
    • ๐Ÿ‘ฉโ€๐Ÿ’ปGetting Started with the SDK
    • ๐Ÿ‘จโ€๐Ÿ’ปUnity Integration Guide
    • ๐Ÿ—๏ธCore Concepts & Architecture
    • ๐ŸงฌTraits System
    • โœ๏ธScripting System
      • ๐ŸงพMiniScript Recipes
    • ๐Ÿ“˜API Reference
    • ๐Ÿ’กExamples and Best Practices
    • ๐Ÿ›ฐ๏ธAdvanced Topics
Powered by GitBook
On this page
  1. ๐Ÿ“‚ Developers

API Reference

Full reference for all major URT3D SDK classes, traits, scripting objects, and utility functions โ€” with signatures, structure, and purpose.

PreviousMiniScript RecipesNextExamples and Best Practices

Last updated 1 month ago

๐Ÿ“˜ Looking for detailed implementation docs? This page gives you a high-level overview, but you can always dive deeper in the official SDK documentation on GitHub:

This page provides a technical breakdown of the core classes, traits, scripting APIs, and utility functions available in the URT3D SDK for Unity.


๐Ÿ”น Core Classes

Asset The base class for all .urta files.

public abstract class Asset
{
    public Actor Actor { get; }
    public Preview Preview { get; }
    public Metadata Metadata { get; }
    public ReadOnlyCollection<Trait> Traits { get; }
    public ReadOnlyCollection<Script> Scripts { get; }

    public static Task<Asset> Construct(string pathToAsset);
    public void Destroy();
    public T GetTrait<T>() where T : Trait;
    public void AddScript(Script script);
    public void RemoveScript(Script script);
}

Wrapper Unity MonoBehaviour that links a URT3D asset to a GameObject.

public class Wrapper : MonoBehaviour
{
    public enum ModeType { Local_File = 0, Remote_Guid = 1 }

    public string Json { get; set; }
    public ModeType Mode { get; set; }
    public Guid Guid { get; }
    public string Path { get; set; }
    public Asset Asset { get; }
    public ScriptExecutionMode ExecutionMode { get; set; }

    public void Reload();
    public bool RunScriptReference(Script script);
    public void RunScriptsByTrigger(ScriptTriggerType triggerType);
    public void TriggerCustomEvent(string eventName);
    public void StopScripts();
}

Actor

public class Actor
{
    public GameObject GameObject { get; }
    public static Task<Actor> Construct(string pathToGlb);
    public void Destroy();
}

Metadata

public class Metadata
{
    public Guid GuidDefinition { get; }
    public Guid GuidInstance { get; set; }
    public string NameDefinition { get; }
    public string NameInstance { get; set; }
    public Type TypeDefinition { get; }
    public Type TypeInstance { get; set; }
    public static Task<Metadata> Construct(string pathToMetadata);
    public void Destroy();
}

Preview

public class Preview
{
    public Texture2D Texture { get; }
    public static Task<Preview> Construct(string pathToImage);
    public void Destroy();
}

๐Ÿ”น Traits System

Trait (base class)

public abstract class Trait
{
    public string Name { get; protected set; }
    public Asset Asset { get; internal set; }
    public virtual void Initialize(Asset asset);
    public virtual void Deinitialize();
}

TraitPosition3d

public class TraitPosition3d : Trait
{
    public Vector3 Value { get; }
    public Vector3 GetValue();
    public void SetValue(Vector3 position);
}

TraitRotation3d

public class TraitRotation3d : Trait
{
    public Vector3 Value { get; }
    public Vector3 GetValue();
    public void SetValue(Vector3 rotation);
}

TraitScale3d

public class TraitScale3d : Trait
{
    public Vector3 GetValue();
    public void SetValue(Vector3 scale);
    public void SetValue(float uniformScale);
}

TraitAnimatable

public class TraitAnimatable : Trait
{
    public event Action<string> OnAnimationStart;
    public event Action<string> OnAnimationComplete;
    public ReadOnlyCollection<string> AvailableAnimations { get; }
    public void PlayAnimation(string name, bool loop = false);
    public void StopAnimation(string name);
    public void StopAllAnimations();
    public bool IsPlaying(string name);
}

TraitInteractable

public class TraitInteractable : Trait
{
    public event Action<InteractionEventArgs> OnClicked;
    public event Action<InteractionEventArgs> OnHoverEnter;
    public event Action<InteractionEventArgs> OnHoverExit;
    public bool IsHovered { get; }
    public void EnableInteraction(bool enable);
}

๐Ÿ”น Scripting API (MiniScript Runtime)

Script

public class Script
{
    public Guid Guid { get; set; }
    public string Name { get; set; }
    public bool Enabled { get; set; }
    public ScriptTriggerType TriggerType { get; set; }
    public string CustomEventName { get; set; }
    public string ScriptContent { get; set; }
}

ScriptTriggerType

public enum ScriptTriggerType
{
    OnLoad = 0,
    OnUpdate = 1,
    OnCustomEvent = 2
}

ScriptExecutionMode

public enum ScriptExecutionMode
{
    EditorOnly = 0,
    RuntimeOnly = 1,
    Both = 2
}

UrtScriptEngine

public class UrtScriptEngine
{
    public event Action<Guid, bool, string> OnScriptCompleted;
    public event Action<Guid, string> OnScriptOutput;

    public UrtScriptEngine(Asset asset);
    public bool ExecuteScript(Script script);
    public void ExecuteScriptsByTrigger(List<Script> scripts, ScriptTriggerType triggerType);
    public void ExecuteScriptsByCustomEvent(List<Script> scripts, string eventName);
    public void StopAllScripts();
}

๐Ÿ”น Utilities

AssetFinder

public static class AssetFinder
{
    public static Task<string> Find(Guid guid);
    public static bool IsValid(string path);
}

Decrypt

public static class Decrypt
{
    public static Task<string> Extract(string pathToAsset);
}

JsonUtil

public static class JsonUtil
{
    public static string ToJson(object obj);
    public static T FromJson<T>(string json);
    public static void FromJson(string json, object target);
}

๐Ÿ’ฌ Need Help?

๐Ÿ“ฉ Email us at:

๐Ÿ“˜
urt3d-sdk_unity โ€บ Documentation
๐Ÿ—จ๏ธ Join our Discord creator community
support@urt3d.com