Skip to content

Game.Prefabs.DilationProperties

Assembly: Game (Game.dll)
Namespace: Game.Prefabs

Type: class

Base: ComponentBase

Summary:
DilationProperties is a small component class intended to configure visual dilation (scaling/visibility adjustments) applied to render prefabs, particularly in the game's "infoview" (overview/inspection) mode. It exposes a minimum size, a factor to apply when in infoview, and a flag to restrict the effect to infoview only. The class is annotated with a ComponentMenu attribute so it appears under the "Rendering/" menu in the editor and is associated with RenderPrefab.


Fields

  • public float m_MinSize = 0.1f
    Minimum allowed size for the dilation effect. Values smaller than this should be clamped to avoid disappearing or becoming too small visually. Default value: 0.1.

  • public float m_InfoviewFactor = 1f
    Multiplier applied to object size (or dilation) when rendering in the infoview/inspection mode. A value of 1 means no change; values >1 enlarge, <1 shrink. Default value: 1.0.

  • public bool m_InfoviewOnly
    When true, the dilation effect is applied only while in infoview/inspection mode. When false, the dilation may be applied more generally (depending on how the rendering code uses this component).

Properties

  • (none)
    This component defines public fields but does not expose C# properties.

Constructors

  • public DilationProperties()
    Default parameterless constructor. Fields are initialized to their default values as declared (m_MinSize = 0.1f, m_InfoviewFactor = 1f, m_InfoviewOnly = false).

Methods

  • public override void GetArchetypeComponents(HashSet<ComponentType> components)
    Override intended to add required ComponentType entries to the given HashSet for archetype generation. In this class the implementation is empty (no additional archetype components are declared here). If a modder needs this component to imply additional ECS components, they can add them to the provided set.

  • public override void GetPrefabComponents(HashSet<ComponentType> components)
    Override intended to add ComponentType entries required on prefabs. The current implementation is empty, so this component does not by itself add extra ECS components to prefabs. Override or modify this method if you need the prefab to contain additional ECS components (for example: components.Add(typeof(SomeRuntimeComponent))).

Usage Example

// Attach this component to a render prefab in code or via the editor.
// Example: configure via script when creating or modifying a prefab:

var dilation = new DilationProperties();
dilation.m_MinSize = 0.2f;
dilation.m_InfoviewFactor = 1.5f;
dilation.m_InfoviewOnly = true;

// If you need this component to imply additional ECS components on the prefab,
// override GetPrefabComponents and add the required ComponentType instances:
//
// public override void GetPrefabComponents(HashSet<ComponentType> components)
// {
//     components.Add(ComponentType.ReadWrite<SomeRuntimeComponent>());
//     // ...other components...
// }

Additional notes: - The class is decorated with [ComponentMenu("Rendering/", new Type[] { typeof(RenderPrefab) })], so it appears in the "Rendering/" menu and is intended to be used alongside RenderPrefab assets. - The two Get*Components overrides are intentionally empty in the shipped file. This is a common pattern when a component provides editor/configuration data only and does not directly alter the prefab's runtime ECS composition. If runtime behavior is required, populate those methods with the appropriate ComponentType additions.