GUI - Casual Fantasy

About GUI - Casual Fantasy – Unity 2D & UI Pack

GUI - Casual Fantasy Unity Asset Overview

The GUI - Casual Fantasy asset offers a structured collection of high-definition 2D interface visual elements, character frames, icons, and animated HUD components designed for fantasy-themed mobile and desktop applications. To maintain a stable 60+ FPS target on mobile hardware, implementing a optimized uGUI system layout is essential. Placing all UI panels under a single root Canvas component can lead to substantial CPU spikes during frame updates; any modification to a single UI element (such as a animated health bar or updating text field) marks the entire canvas as dynamic, triggering layout recalculations and batch rebuilds across all nested child nodes.

To mitigate performance degradation, organize your user interface into a segmented multi-canvas hierarchy:

Sprite Atlas Optimization & Draw Call Batching

Reducing batch draw calls requires consolidating individual UI textures into optimized texture atlases using Unity's Sprite Atlas v2 system (UnityEngine.U2D.SpriteAtlas). When non-atlased sprites are rendered interleaved with custom TextMeshProUGUI font materials or 3D viewports, Unity's UI batching pipeline breaks, resulting in high draw call counts.

Group individual GUI textures—such as button sliced states, frame borders, and fantasy skill icons—into designated sprite atlases categorized by usage context (e.g., HUDAtlas.spriteatlasv2 and InventoryAtlas.spriteatlasv2). Ensure that Allow Rotation is disabled for sliced GUI graphics to prevent visual distortion along sliced 9-slice borders, and apply a 4-pixel to 8-pixel padding block to eliminate texture bleeding artifacts during dynamic display scaling.

Memory Overhead & Graphic Raycaster Management

By default, Unity assigns an enabled Image or TextMeshProUGUI component a dynamic hit target status by toggling on the Raycast Target property. When the user interacts with the screen, the engine's EventSystem performs spatial point-in-polygon checks via the active GraphicRaycaster against every enabled target across active canvases.

To reduce CPU raycast processing overhead:

// Utility script to programmatically clear unnecessary raycast targets across UI structures
using UnityEngine;
using UnityEngine.UI;
using TMPro;

public class UIComponentOptimizer : MonoBehaviour
{
    public void StripUnnecessaryRaycastTargets(GameObject targetPanel)
    {
        Graphic[] graphics = targetPanel.GetComponentsInChildren<Graphic>(true);
        for (int i = 0; i < graphics.Length; i++)
        {
            // Retain interaction capabilities only on explicit Button or Toggle structures
            bool isInteractive = graphics[i].GetComponent<Selectable>() != null;
            if (!isInteractive)
            {
                graphics[i].raycastTarget = false;
            }
        }
    }
}

Resolution Scaling & Responsive Layouts

Adapting fantasy-style borders and window frames across disparate device aspect ratios (from 16:9 desktop monitors to 19.5:9 mobile display cutouts) requires strict adherence to anchor positioning rules combined with optimized Canvas Scaler configurations.

Canvas Scaler Configuration Matrix

Configure the CanvasScaler on your core root canvases using the Scale With Screen Size mode. Define a reference resolution standard (e.g., 1920x1080) and tune the scaling parameters based on targeting criteria:

Anchor Presets & Auto-Layout Groups

When anchoring complex frame graphics, avoid assigning raw, absolute unit pixel positions to RectTransform components. Anchor window backdrops using Stretch-Stretch configurations with defined inner margins. For localized UI elements such as action bars and close buttons, anchor to specific screen edges or corners using normalized pivot points (e.g., top-right pivot (1.0, 1.0) for modal dismissal buttons).

While automatic layout drivers like HorizontalLayoutGroup, VerticalLayoutGroup, and GridLayoutGroup simplify array alignments, they recalculate bounds on every transform alteration. Disable dynamic layout components at runtime via custom scripts once initial panel populating is complete, or utilize manual anchor offsets to prevent CPU frame stalls during heavy list populating operations.

Event System & Integration Setup

Managing transitions, screen pop-ups, and character previews requires a lightweight runtime framework. Avoid using full mechanical Animator setups on complex UI trees, as active state machines dirty all child RectTransform values every frame, forcing constant mesh rebuilds in Canvas.SendWillRenderCanvases.

Programmatic UI Tweening Architecture

Use a unified canvas group controller to handle panel fading, scaling transitions, and raycast interaction blocking efficiently:

using System.Collections;
using UnityEngine;

[RequireComponent(typeof(CanvasGroup))]
public class UIPanelView : MonoBehaviour
{
    [SerializeField] private CanvasGroup canvasGroup;
    [SerializeField] private float fadeDuration = 0.2f;

    private Coroutine currentFadeRoutine;

    private void Awake()
    {
        if (canvasGroup == null)
            canvasGroup = GetComponent<CanvasGroup>();
    }

    public void SetVisibility(bool visible)
    {
        if (currentFadeRoutine != null)
            StopCoroutine(currentFadeRoutine);

        currentFadeRoutine = StartCoroutine(TransitionRoutine(visible));
    }

    private IEnumerator TransitionRoutine(bool show)
    {
        float startAlpha = canvasGroup.alpha;
        float targetAlpha = show ? 1.0f : 0.0f;
        float elapsed = 0.0f;

        if (show)
        {
            canvasGroup.blocksRaycasts = true;
            canvasGroup.interactable = true;
        }

        while (elapsed < fadeDuration)
        {
            elapsed += Time.unscaledDeltaTime;
            canvasGroup.alpha = Mathf.Lerp(startAlpha, targetAlpha, elapsed / fadeDuration);
            yield return null;
        }

        canvasGroup.alpha = targetAlpha;

        if (!show)
        {
            canvasGroup.blocksRaycasts = false;
            canvasGroup.interactable = false;
        }

        currentFadeRoutine = null;
    }
}

Integrating 3D Character Viewports into 2D UI

To integrate 3D character models and active skeletal animations alongside 2D interface windows, set up a dedicated preview pipeline using modern camera rendering structures:

  1. Dedicated Preview Layer: Create a unique Unity user layer (e.g., UI_3D_Preview) and assign your target character model and lighting rigs to this layer.
  2. Orthographic Secondary Camera: Configure a secondary Camera with its culling mask set exclusively to UI_3D_Preview. Set its clear flags to Solid Color with an alpha set to 0.
  3. Render Texture Target: Create a dedicated RenderTexture asset and assign it to the camera's Target Texture field.
  4. Raw Image Binding: Direct the output texture into a RawImage component housed within the GUI window structure, allowing fully animated 3D meshes to render within stylized 2D frame borders.

Technical Highlights & Profiling Assessment

Evaluating this asset's structure yields several clear operational features alongside workflow considerations for integration teams:

Asset Details & Specifications

Category2D / GUI
Latest Versionv2.0.4 (2 tracked releases)
File Size21.04 MB
Added to PlatformFebruary 6, 2026
Views6 views
Downloads2 downloads
Favourites0 favourites
Official StoreBuy Original License on Unity Asset Store →
Issue with Package?Report Broken Link →

Developers Who Downloaded This Also Downloaded

Related Unity 2D Assets