[ExpressionField]

Displays a read-only field showing the result of a dynamic expression.

Parameters

Parameter Name
Arguments
Description

expression

string

Expression to evaluate. Must start with '@'.

Height

float

Field height in pixels.

ShowUpdateButton

bool

Show manual update button when auto-update is disabled.

UpdateInterval

double

Auto-update interval in seconds. Zero means update every frame.

Examples

using UnityEngine;
using RenownedGames.Apex;

public class ExpressionFieldExample : MonoBehaviour
{
    public float health = 100;
    public float maxHealth = 100;

    [ExpressionField("@health / @maxHealth")]
    public float healthPercentage;

    [ExpressionField("@UnityEngine.Time.time", UpdateInterval = 1)]
    public float timeDisplay;
}

Last updated