Terra Studio Wiki
  • Home
  • Scripting in Terra Studio Pro
    • Scripting Basics
    • Key Differences - T# versus C#
      • Syntax Differences - T# v/s C#
      • Multiplayer Support Differences
      • Restrictions on Unity APIs
      • Restrictions on Collections & Types
      • Restrictions on Input, UI, Async
      • Miscellaneous Restrictions
    • Creating & Using Scripts
    • πŸ“˜ Terra Studio Runtime Classes
    • 🎨 Terra Studio UI Systems Overview
    • Animation Support
    • 🎧 Audio & SFX Support in Terra Studio
    • πŸ”₯ VFX Support in Terra Studio
    • πŸ“Š Game Analytics & FTUE Tracking in Terra Studio
    • 🌐 Multiplayer in Terra Studio
Powered by GitBook
On this page
  • INPUT & UI
  • πŸ–±οΈ IPointer Events
  • 🎞️ DOTween for UI Animations
  • ASYNC & REFLECTION
  • ❌ async / await
  • ❌ Task.Run()
  1. Scripting in Terra Studio Pro
  2. Key Differences - T# versus C#

Restrictions on Input, UI, Async

This page lists everything that is currently not supported in T#

This section rounds up all input-related limitations, asynchronous code restrictions, and other notable Unity patterns that are not supported in T#. It also covers UI events, reflection methods, and a few important workarounds.

INPUT & UI

πŸ–±οΈ IPointer Events

In Unity’s UI system, interfaces like IPointerClickHandler are used to detect and respond to user input events like button clicks or hovers. This is not supported in T#.

public class MyScript : MonoBehaviour, IPointerClickHandler {
    public void OnPointerClick(PointerEventData eventData) {
        // Handle click
    }
}

πŸ” What you instead need to do in T# to detect user input: Use manual input checks inside Update() or OnMouseDown() if available.

void Update() {
    if (Input.GetMouseButtonDown(0)) {
        // Perform raycast or bounds check to detect a click
        HandleClick();
    }
}

void HandleClick() {
    Debug.Log("Custom click logic triggered.");
}

🎞️ DOTween for UI Animations

DOTween is widely used in Unity for smooth tween-based animations but DOTween is only partially supported in T#.

πŸ” What works in T#:

Basic one-liners like this are supported:

transform.DOMoveX(5, 2f); // βœ… Simple implementaiton like this works

Advanced features like custom Tweeners, complex Sequences, and chaining may not work:

Sequence s = DOTween.Sequence(); // ❌ Limited or unsupported
s.Append(...);

ASYNC & REFLECTION

❌ async / await

In Unity, asynchronous methods using async Task are often used for non-blocking workflows. This is not supported in T# .

async Task MyAsyncMethod() {
    await SomeTask();
}

.

πŸ” What you instead need to do in T#: Use coroutines for delays or async-like behavior.

void Start() {
    StartCoroutine(MyCoroutine());
}

IEnumerator MyCoroutine() {
    yield return new WaitForSeconds(1f);
    // Continue logic
}

❌ Task.Run()

Unity developers sometimes use Task.Run to offload work to background threads. This is not supported in T#.

Task.Run(() => {
    // Heavy operation
});

πŸ” What you instead need to do in T#: T# is single-threaded. Keep logic lightweight and frame-safe. You can Break tasks into smaller operations in Update() or use coroutines for pacing.


❌ GetType() or typeof()

In Unity, these are used for reflection, dynamic behavior, or type comparisons. These are not supported in T#.

Type type = GetType(); // Not supported
Type componentType = typeof(Rigidbody); // Not supported

πŸ” What you instead need to do in T#: Instead of GetType() or typeof(), you need to use direct type references and avoid dynamic type inspection.


PreviousRestrictions on Collections & TypesNextMiscellaneous Restrictions

Last updated 2 months ago