Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Canvas Renderer Absolute Depth#

Rendering / Canvas Renderer / Canvas Renderer Absolute Depth

  • Can Read

  • Cannot Write

Description#

The Absolute Depth property of the Canvas Renderer component

Code#

// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>

using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.Rendering;

namespace VisualScript.Runtime
{
    [Get]
    
    [Title("Canvas Renderer Absolute Depth")]
    [Category("Rendering/Canvas Renderer/Absolute Depth")]
    [Description("The Absolute Depth property of the Canvas Renderer component")]
    
    [Image(typeof(IconEye), ColorTheme.Type.TextLight)]
    
    [Serializable]
    public class GenTypeInteger_CanvasRenderer_AbsoluteDepth : TypeNumber
    {
        [SerializeField] private GetGameObject m_CanvasRenderer = new GetGameObject(
            new GenTypeGameObject_CanvasRenderer()
        );
        
        public override double GetPreview(GameObject source)
        {
            GameObject instance = this.m_CanvasRenderer.GetPreview(source);
            if (instance == null) return default;
            
            CanvasRenderer component = instance.GetComponent<CanvasRenderer>();
            return component != null ? component.absoluteDepth : default;
        }
        
        public override double Get(Args args)
        {
            CanvasRenderer instance = this.m_CanvasRenderer.Get<CanvasRenderer>(args);
            return instance != null
                ? instance.absoluteDepth
                : default;
        }
        
        public override string ToString()
        {
            return $"{this.m_CanvasRenderer} Absolute Depth";
        }
        
        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}

Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.