Scripting Support (C#)
advanced scriptingHighlight Plus · Scripting Support (C#)
The HighlightPlus namespace provides a comprehensive highlighting system for 3D objects in Unity. Add using HighlightPlus; at the top of your scripts.
HighlightEffect
MonoBehaviour — The main component that controls all highlight effects on a GameObject. Attach to any renderer or parent object.
Highlight Control
bool highlighted get/setEnables or disables the highlight effect. Setting this triggers fade animations if fadeInDuration/fadeOutDuration are configured.
bool isSelected get/setGets or sets the selection state of this object.
bool ignoreWhen true, the object will not be highlighted by automatic systems (HighlightManager/HighlightTrigger).
float fadeInDurationDuration in seconds for the highlight fade-in animation.
float fadeOutDurationDuration in seconds for the highlight fade-out animation.
FadingState fadingCurrent fading state of the effect (NoFading, FadingIn, FadingOut).
void SetHighlighted(bool state)Programmatically sets the highlight state. Equivalent to setting the highlighted property.
static HighlightEffect lastHighlightedReference to the last highlighted object in the scene.
static HighlightEffect lastSelectedReference to the last selected object in the scene.
static effects List<HighlightEffect>List of all active HighlightEffect instances in the scene.
static bool useUnscaledTimeWhen true, all effects use Time.unscaledTime instead of Time.time, allowing effects to work when the game is paused.
Target & Geometry
TargetOptions effectGroupDetermines which renderers are included. Options: Children, OnlyThisObject, RootToChildren, LayerInScene, LayerInChildren, Scripting.
Transform effectTargetOptional explicit target transform for the effect.
LayerMask effectGroupLayerLayer mask filter applied when effectGroup uses layer-based targeting.
string effectNameFilterOptional name filter for included renderers. Supports plain text or regex when effectNameUseRegEx is true.
bool effectNameUseRegExWhen true, effectNameFilter is interpreted as a regular expression.
bool excludeObjectsWithHighlightEffectWhen true, child objects that already have their own HighlightEffect component are excluded from this group.
bool combineMeshesCombines all meshes in the group for a unified outline/glow effect without internal edges.
Transform target get/setGets or sets the target transform at runtime.
int includedObjectsCount read-onlyReturns the number of renderers currently included in this effect.
void SetTarget(Transform transform)Sets a new target transform and re-initializes the effect on the new hierarchy.
void SetTargets(Transform transform, Renderer[] renderers)Sets a target with explicit renderers instead of auto-detecting them from the hierarchy.
bool Includes(Transform transform)Returns true if the given transform is part of this effect's renderer group.
Rendering Options
LayerMask camerasLayerMaskRestricts which cameras render this effect.
float alphaCutOffAlpha cutoff threshold for transparent objects. Pixels below this threshold are excluded from the effect.
bool cullBackFacesEnables back-face culling for the highlight effect rendering.
bool ignoreObjectVisibilityWhen true, the effect renders even if the object's renderer is disabled.
bool GPUInstancingEnables GPU instancing for improved performance when multiple objects share the same effect.
bool constantWidthWhen true, outline and glow width remain constant regardless of camera distance.
float paddingAdditional padding around the object bounds for the effect.
int subMeshMaskBitmask controlling which sub-meshes are included. -1 includes all sub-meshes.
bool depthClipEnables depth clipping to prevent effects from rendering through geometry.
bool optimizeSkinnedMeshOptimizes skinned mesh rendering by caching mesh data.
bool cameraDistanceFadeEnables distance-based fading of the highlight effect.
float cameraDistanceFadeNearDistance at which the effect starts fading.
float cameraDistanceFadeFarDistance at which the effect is fully faded out.
NormalsOption normalsOptionControls how mesh normals are used for the effect (Smooth, PreserveOriginal, Reorient, Planar).
float minimumWidthMinimum width for outlines and glows to prevent them from disappearing at large distances.
Outline
float outlineOutline intensity. 0 disables the outline, 1 is fully visible.
Color (HDR) — default: black outlineColorOutline color. Supports HDR values for bloom-compatible outlines.
float outlineWidthWidth of the outline in world units (or screen units if constantWidth is true).
QualityLevel outlineQualityQuality of the outline rendering (Fastest, High, Highest, Medium).
OutlineEdgeMode outlineEdgeModeControls whether the outline appears on the exterior only or also on interior edges.
float outlineEdgeThresholdSensitivity for interior edge detection when outlineEdgeMode includes interior edges.
Visibility outlineVisibilityControls whether the outline is visible normally, always on top, or only when occluded.
bool outlineIndependentWhen true, the outline renders independently from the glow, preventing overlap artifacts.
ColorStyle outlineColorStyleColor mode for the outline (SingleColor or Gradient).
Gradient (HDR) outlineGradientGradient used when outlineColorStyle is set to Gradient.
bool outlineGradientInLocalSpaceWhen true, the gradient is applied in local object space instead of world space.
int outlineBlurPassesNumber of blur passes for soft outline rendering.
float outlineSharpnessControls the sharpness of the outline edge.
int outlineDownsamplingDownsampling factor for outline rendering. Higher values improve performance at the cost of precision.
ContourStyle outlineContourStyleControls the contour rendering style (AroundVisibleParts, AroundObjectShape).
Stylized Outline
bool outlineStylizedEnables the stylized/patterned outline mode.
Texture2D outlinePatternPattern texture applied to the stylized outline.
float outlinePatternScaleScale of the pattern texture.
float outlinePatternThresholdThreshold for pattern visibility.
float outlinePatternDistortionAmountAmount of noise distortion applied to the pattern.
Texture2D outlinePatternDistortionTextureDistortion noise texture for the stylized pattern.
float outlinePatternStopMotionScaleControls the stop-motion animation scale of the pattern.
Dashed Outline
bool outlineDashedEnables dashed outline rendering.
float outlineDashWidthWidth of the visible dash segments.
float outlineDashGapSize of the gap between dash segments.
float outlineDashSpeedAnimation speed of the dashed pattern.
Outer Glow
float glowOuter glow intensity. 0 disables the glow.
Color (HDR) — default: (0.64, 1, 0, 1) glowHQColorGlow color when using High Quality mode. Supports HDR for bloom-compatible glows.
float glowWidthWidth of the outer glow effect.
QualityLevel glowQualityQuality of the glow rendering (Fastest, High, Highest, Medium).
BlurMethod glowBlurMethodBlur algorithm used for the glow (Gaussian, Kawase).
bool glowHighPrecisionUses higher precision render textures for the glow effect.
int glowDownsamplingDownsampling factor for glow rendering. Higher values improve performance.
float glowAnimationSpeedAnimation speed of the glow pulsing effect.
Visibility glowVisibilityControls whether the glow is visible normally, always on top, or only when occluded.
GlowPassData[] glowPassesArray of glow pass configurations controlling multi-layer glow effects with individual offset, width, and color per pass.
GlowBlendMode glowBlendModeBlend mode for the glow (Additive, Cutout).
bool glowBlendPassesWhen true, multiple glow passes blend together for a smoother result.
float glowDitheringAmount of dithering applied to reduce banding artifacts in the glow.
void SetGlowColor(Color color)Sets the glow color for all glow passes at once.
Inner Glow
float innerGlowInner glow intensity. 0 disables the inner glow.
Color (HDR) — default: white innerGlowColorColor of the inner glow effect.
float innerGlowWidthWidth of the inner glow from the object edges inward.
float innerGlowPowerPower/falloff curve of the inner glow effect.
InnerGlowBlendMode innerGlowBlendModeBlend mode for the inner glow (Additive, AlphaBlend).
Visibility innerGlowVisibilityControls visibility of the inner glow (Normal, AlwaysOnTop, OnlyWhenOccluded).
Overlay
float overlayOverlay intensity. 0 disables the overlay effect.
Color (HDR) — default: yellow overlayColorColor of the overlay effect.
OverlayMode overlayModeControls when the overlay is visible (WhenHighlighted, Always).
float overlayAnimationSpeedSpeed of the overlay pulsing animation.
float overlayMinIntensityMinimum intensity during overlay animation cycles.
float overlayBlendingControls the blending strength of the overlay with the underlying material.
Texture2D overlayTextureOptional texture applied as the overlay pattern.
TextureUVSpace overlayTextureUVSpaceUV coordinate space for the overlay texture (ObjectSpace, ScreenSpace, WorldSpace).
float overlayTextureScaleScale of the overlay texture.
Vector2 overlayTextureScrollingScrolling speed of the overlay texture in X and Y directions.
Visibility overlayVisibilityControls visibility of the overlay (Normal, AlwaysOnTop, OnlyWhenOccluded).
OverlayPattern overlayPatternBuilt-in procedural overlay pattern (None, Dots, Lines, Grid, etc.).
float overlayPatternScaleScale of the procedural overlay pattern.
float overlayPatternSizeSize of pattern elements.
float overlayPatternSoftnessEdge softness of the pattern elements.
float overlayPatternRotationRotation of the overlay pattern in degrees.
Vector2 overlayPatternScrollingScrolling speed of the overlay pattern.
See-Through
SeeThroughMode seeThroughSee-through rendering mode (Never, WhenHighlighted, AlwaysWhenOccluded, etc.).
LayerMask seeThroughOccluderMaskLayers that act as occluders for the see-through effect.
bool seeThroughOccluderMaskAccurateUses per-pixel accurate occlusion testing instead of bounds-based.
float seeThroughOccluderThresholdThreshold for determining when an object is considered occluded.
float seeThroughOccluderCheckIntervalInterval in seconds between occlusion checks. Lower values are more responsive but costlier.
bool seeThroughOccluderCheckIndividualObjectsWhen true, checks occlusion for each renderer individually rather than the group bounds.
float seeThroughIntensityIntensity of the see-through silhouette.
Color (HDR) — default: red seeThroughTintColorTint color of the see-through silhouette.
float seeThroughTintAlphaAlpha transparency of the see-through tint.
float seeThroughNoiseAmount of noise/scanline effect applied to the see-through silhouette.
float seeThroughBorderIntensity of the see-through silhouette border/outline.
Color seeThroughBorderColorColor of the see-through border.
float seeThroughBorderWidthWidth of the see-through border.
bool seeThroughBorderOnlyWhen true, only the border is shown without the tinted fill.
float seeThroughDepthOffsetDepth offset for the see-through effect to fine-tune occlusion behavior.
float seeThroughMaxDepthMaximum depth at which the see-through effect is visible. 0 means unlimited.
float seeThroughFadeRangeRange over which the see-through effect fades out near the max depth.
bool seeThroughOrderedEnables ordered rendering for correct see-through with multiple overlapping objects.
Texture2D seeThroughTextureOptional texture applied to the see-through silhouette.
TextureUVSpace seeThroughTextureUVSpaceUV coordinate space for the see-through texture.
float seeThroughTextureScaleScale of the see-through texture.
Target FX
bool targetFXEnables the animated target indicator effect (ground marker below the object).
TargetFXStyle targetFXStyleVisual style of the target FX (Texture, Frame).
Texture2D targetFXTextureTexture used for the target indicator when style is Texture.
Color (HDR) — default: white targetFXColorColor tint of the target indicator.
Transform targetFXCenterOptional custom center point for the target indicator.
float targetFXRotationSpeedRotation speed of the target indicator in degrees per second.
float targetFXRotationAngleFixed rotation angle for the target indicator. 0 uses rotation speed animation.
float targetFXInitialScaleStarting scale of the target indicator animation (scales down to targetFXEndScale).
float targetFXEndScaleFinal scale of the target indicator after the transition animation completes.
bool targetFXScaleToRenderBoundsWhen true, the target indicator scales relative to the object's render bounds.
bool targetFXSquareForces the target indicator to maintain a square aspect ratio.
bool targetFXAlignToGroundProjects the target indicator onto the ground surface below the object.
float targetFXGroundMaxDistanceMaximum raycast distance for ground alignment.
LayerMask targetFXGroundLayerMaskLayer mask for ground detection raycast.
Vector3 targetFXOffsetPosition offset for the target indicator.
float targetFXTransitionDurationDuration of the scale-in transition animation.
float targetFXStayDurationHow long the target indicator remains visible after the transition.
Visibility targetFXVisibilityControls whether the target FX renders on top of other geometry.
float targetFXFrameWidthLine width when using Frame style.
float targetFXCornerLengthCorner bracket length when using Frame style.
bool targetFxCenterOnHitPositionCenters the target FX on the hit/click position instead of the object center.
bool targetFxAlignToNormalAligns the target FX to the surface normal at the hit point.
void TargetFX()Triggers the target FX animation on demand.
Icon FX
bool iconFXEnables a 3D icon/mesh indicator above the object.
IconAssetType iconFXAssetTypeType of asset for the icon (Mesh or Prefab).
GameObject iconFXPrefabPrefab used as the icon when asset type is Prefab.
Mesh iconFXMeshMesh used as the icon when asset type is Mesh.
Color (HDR) — default: white iconFXLightColorLight/highlight color of the icon mesh.
Color (HDR) — default: gray iconFXDarkColorDark/shadow color of the icon mesh.
Transform iconFXCenterOptional custom center transform for the icon positioning.
float iconFXRotationSpeedRotation speed of the icon in degrees per second.
IconAnimationOption iconFXAnimationOptionAnimation type for the icon (None, Bounce, Pulse).
float iconFXAnimationAmountAmplitude of the icon animation.
float iconFXAnimationSpeedSpeed of the icon animation.
float iconFXScaleScale multiplier for the icon.
Vector3 iconFXOffsetPosition offset for the icon relative to the object center.
float iconFXTransitionDurationDuration of the icon appear/disappear transition.
float iconFXStayDurationHow long the icon stays visible after the transition.
void IconFX()Triggers the icon FX animation on demand.
Hit FX
float hitFxInitialIntensityDefault initial intensity for hit effects.
HitFxMode hitFxModeVisual mode for hit effects (Overlay, InnerGlow, LocalHit).
HitFXTriggerMode hitFXTriggerModeHow hit effects are triggered (Scripting, Collider).
float hitFxFadeOutDurationDuration of the hit effect fade-out in seconds.
Color (HDR) — default: white hitFxColorColor of the hit flash effect.
float hitFxRadiusRadius for localized hit effects.
void HitFX()Triggers a hit effect using the default field values (hitFxColor, hitFxFadeOutDuration, hitFxInitialIntensity).
void HitFX(Vector3 position)Triggers a localized hit effect at the specified world position.
void HitFX(Color color, float fadeOutDuration, float initialIntensity = 1f)Triggers a hit effect with custom color, fade-out duration, and initial intensity.
void HitFX(Color color, float fadeOutDuration, float initialIntensity, Vector3 position, float radius)Triggers a localized hit effect with full control over color, fade, intensity, position, and radius.
void SetHitPosition(Transform target, Vector3 localPosition, Vector3 offsetWS, Vector3 normalWS)Sets the hit position manually. Updates the label position if labelFollowCursor is enabled.
Focus
float focusIntensity of the focus effect (0–1). Dims the background while keeping highlighted objects visible. A value of 0 disables the effect.
Color focusColorColor and transparency of the focus dim overlay. Default: semi-transparent black (0, 0, 0, 0.94).
float focusBlurBackground blur intensity for the focus effect (0–1).
int focusBlurDownsamplingDownsampling factor for the focus blur (1–8). Higher values improve performance at the cost of quality. Default: 2.
float focusDesaturationDesaturation intensity for the focus background (0–1). A value of 1 makes the background fully grayscale.
Labels
bool labelEnabledEnables a floating text label above the highlighted object.
string labelTextText content displayed in the label.
float labelTextSizeFont size of the label text.
Color (HDR) — default: white labelColorColor of the label text.
GameObject labelPrefabCustom prefab for the label UI. Must contain a TextMeshProUGUI component.
LabelMode labelModeControls when the label is visible (WhenHighlighted, Always, WhenSelected).
float labelVerticalOffsetVertical offset of the label above the object.
Vector2 labelViewportOffsetScreen-space offset for the label position.
float labelLineLengthMaximum line width in pixels before text wrapping.
bool labelFollowCursorWhen true, the label follows the mouse cursor position instead of staying fixed above the object.
LabelAlignment labelAlignmentText alignment of the label (Auto, Left, Center, Right).
float labelMaxDistanceMaximum distance from the camera at which the label is visible.
float labelFadeStartDistanceDistance at which the label starts fading out.
bool labelScaleByDistanceWhen true, the label scales based on camera distance.
float labelScaleMinMinimum scale of the label when scaling by distance.
float labelScaleMaxMaximum scale of the label when scaling by distance.
void RefreshLabel()Destroys and recreates the label with current settings.
Events
event OnObjectHighlightStart(GameObject obj)Fired when the object begins highlighting. Return false to cancel the highlight.
event OnObjectHighlightEnd(GameObject obj)Fired when the highlight is removed. Return false to prevent un-highlighting.
event OnObjectHighlightStateChange(GameObject obj, bool state)Fired on any highlight state change. Provides both the object and new state.
event OnObjectSelected(GameObject obj)Fired when the object is selected. Return false to cancel the selection.
event OnObjectUnSelected(GameObject obj)Fired when the object is deselected. Return false to cancel the deselection.
event OnRendererHighlightStart(Renderer renderer)Fired per renderer when highlighting starts. Return false to exclude a specific renderer from highlighting.
event OnTargetAnimates(ref Vector3 center, ref Quaternion rotation, ref Vector3 scale, float t)Fired during Target FX animation, allowing custom control over the indicator's position, rotation, and scale. The parameter t is the animation progress (0-1).
event OnIconAnimates(ref Vector3 center, ref Quaternion rotation, ref Vector3 scale, float t)Fired during Icon FX animation with the same parameters as OnTargetAnimates.
Profile Management
HighlightProfile profileThe profile asset assigned to this effect. When assigned with profileSync enabled, all changes to the profile are automatically applied.
bool profileSyncWhen true, the effect stays synchronized with the assigned profile.
void ProfileLoad(HighlightProfile profile)Loads all settings from a profile into this effect.
void ProfileReload()Reloads settings from the currently assigned profile.
void ProfileSaveChanges(HighlightProfile profile)Saves the current effect settings to the specified profile asset.
void ProfileSaveChanges()Saves the current effect settings to the currently assigned profile.
void RestorePreviousHighlightEffectSettings()Restores the effect settings to the state before the last profile was loaded.
Utility Methods
void Refresh(bool discardCachedMeshes = false)Re-initializes the effect. Pass true to discard cached mesh data (useful after mesh changes).
void UpdateMaterialProperties(bool disabling = false)Updates all internal material properties. Call this after changing effect settings via script.
void ResetHighlightStartTime()Resets the animation start time, causing time-based animations to restart from the beginning.
Clears the global mesh cache used by all effects. Call when loading a new scene or after significant mesh changes.
HighlightProfile
ScriptableObject — Stores highlight effect settings as a reusable asset. Create via Assets > Create > Highlight Plus > Highlight Profile. Contains all the same visual settings as HighlightEffect (outline, glow, overlay, see-through, target FX, icon FX, hit FX, labels) and can be loaded/saved at runtime.
HighlightManager
MonoBehaviour — Automatic highlight management component. Add to a scene to enable pointer-based highlighting and selection for all objects with HighlightEffect components. Uses raycasting to detect objects under the cursor.
Properties
static instance HighlightManager — read-onlySingleton reference to the HighlightManager in the scene.
static selectedObjects List<HighlightEffect> — read-onlyList of all currently selected objects managed by HighlightManager.
bool highlightOnHover get/setWhen true, objects are highlighted when the pointer hovers over them.
LayerMask layerMaskLayer mask for raycast detection. Only objects on these layers can be highlighted.
Camera raycastCameraCamera used for raycasting. Defaults to Camera.main if not set.
RayCastSource raycastSourceInput source for raycasting (MousePosition, ScreenCenter).
LayerMask blockingLayerMaskObjects on these layers block the raycast from reaching highlight targets.
float minDistanceMinimum raycast distance for detecting objects.
float maxDistanceMaximum raycast distance. 0 means unlimited.
bool selectOnClickEnables object selection on click/tap.
HighlightProfile selectedProfileProfile applied to selected objects (replaces their highlight settings while selected).
HighlightProfile selectedAndHighlightedProfileProfile applied when an object is both selected and highlighted simultaneously.
bool singleSelectionWhen true, only one object can be selected at a time.
bool toggleWhen true, clicking a selected object deselects it.
bool keepSelectionWhen true, selected objects remain highlighted even when the pointer moves away.
bool respectUIWhen true, raycasts are blocked when the pointer is over UI elements.
Events
event OnObjectHighlightStart(GameObject obj)Fired when the pointer enters an object. Return false to prevent highlighting.
event OnObjectHighlightStay(GameObject obj)Fired every frame while the pointer remains over a highlighted object.
event OnObjectHighlightEnd(GameObject obj)Fired when the pointer leaves a highlighted object.
event OnObjectSelected(GameObject obj)Fired when an object is selected via click. Return false to prevent selection.
event OnObjectUnSelected(GameObject obj)Fired when an object is deselected.
event OnObjectClicked(GameObject obj)Fired when any object is clicked, regardless of selection state.
Methods
void SelectObject(Transform t)Programmatically selects an object.
void SelectObjects(Transform[] objects)Selects multiple objects at once.
void SelectObjects(List<Transform> objects)Selects multiple objects from a list.
void ToggleObject(Transform t)Toggles the selection state of an object.
void UnselectObject(Transform t)Deselects a specific object.
Deselects all currently selected objects in the scene.
Returns the active camera used for raycasting.
HighlightTrigger
MonoBehaviour — Per-object trigger component for highlight interaction. Unlike HighlightManager (scene-wide), HighlightTrigger provides per-object control over input detection including collider-based and volume-based triggers.
Properties
bool highlightOnHoverWhen true, the object highlights when the pointer hovers over it.
TriggerMode triggerModeDetection method for the trigger (ColliderEventsOnlyOnThisObject, RaycastOnThisObjectAndChildren, Volume).
Camera raycastCameraCamera used for raycasting. Defaults to Camera.main.
RayCastSource raycastSourceInput source for raycasting (MousePosition, ScreenCenter).
bool selectOnClickEnables selection on click/tap for this specific object.
HighlightProfile selectedProfileProfile applied when the object is selected.
bool singleSelectionWhen true, selecting this object deselects all others.
bool toggleWhen true, clicking toggles the selection state.
LayerMask volumeLayerMaskLayer mask for volume-based trigger detection.
HighlightEffect highlightEffect read-onlyReturns the associated HighlightEffect component.
Events
event OnObjectHighlightStart(GameObject obj)Fired when this object begins highlighting.
event OnObjectHighlightStay(GameObject obj)Fired every frame while this object is highlighted.
event OnObjectHighlightEnd(GameObject obj)Fired when the highlight is removed from this object.
event OnObjectSelected(GameObject obj)Fired when this object is selected.
event OnObjectUnSelected(GameObject obj)Fired when this object is deselected.
event OnObjectClicked(GameObject obj)Fired when this object is clicked.
Code Examples
Basic Highlight Configuration
using UnityEngine;
using HighlightPlus;
public class HighlightSetup : MonoBehaviour
{
void Start()
{
HighlightEffect effect = gameObject.AddComponent<HighlightEffect>();
// Outline
effect.outline = 1f;
effect.outlineColor = Color.cyan;
effect.outlineWidth = 0.8f;
effect.outlineQuality = QualityLevel.High;
// Outer glow
effect.glow = 1f;
effect.glowHQColor = new Color(0f, 0.5f, 1f);
effect.glowWidth = 0.6f;
// See-through
effect.seeThrough = SeeThroughMode.WhenHighlighted;
effect.seeThroughTintColor = new Color(0f, 0.5f, 1f, 0.3f);
effect.seeThroughIntensity = 0.8f;
// Apply and highlight
effect.UpdateMaterialProperties();
effect.highlighted = true;
}
}
Hit FX on Damage
using UnityEngine;
using HighlightPlus;
public class DamageFlash : MonoBehaviour
{
HighlightEffect effect;
void Awake()
{
effect = GetComponent<HighlightEffect>();
}
public void TakeDamage(float amount, Vector3 hitPoint)
{
// Full-object hit flash
effect.HitFX(Color.red, 0.3f, 1f);
// Or localized hit at impact point
effect.HitFX(Color.red, 0.3f, 1f, hitPoint, 0.5f);
}
}
HighlightManager Selection Handling
using UnityEngine;
using HighlightPlus;
public class SelectionHandler : MonoBehaviour
{
void Start()
{
HighlightManager manager = HighlightManager.instance;
manager.OnObjectSelected += OnSelected;
manager.OnObjectUnSelected += OnDeselected;
manager.OnObjectHighlightStart += OnHover;
}
bool OnSelected(GameObject obj)
{
Debug.Log($"Selected: {obj.name}");
return true; // Allow selection
}
bool OnDeselected(GameObject obj)
{
Debug.Log($"Deselected: {obj.name}");
return true; // Allow deselection
}
bool OnHover(GameObject obj)
{
// Return false to prevent highlighting specific objects
if (obj.CompareTag("Locked"))
return false;
return true;
}
}
Profile Switching
using UnityEngine;
using HighlightPlus;
public class ProfileSwitcher : MonoBehaviour
{
public HighlightProfile normalProfile;
public HighlightProfile dangerProfile;
HighlightEffect effect;
void Awake()
{
effect = GetComponent<HighlightEffect>();
}
public void SetDangerMode(bool danger)
{
effect.ProfileLoad(danger ? dangerProfile : normalProfile);
effect.highlighted = true;
}
}
Label Configuration
using UnityEngine;
using HighlightPlus;
public class LabelSetup : MonoBehaviour
{
void Start()
{
HighlightEffect effect = GetComponent<HighlightEffect>();
effect.labelEnabled = true;
effect.labelText = "Pick Up";
effect.labelColor = Color.yellow;
effect.labelTextSize = 16;
effect.labelMode = LabelMode.WhenHighlighted;
effect.labelFollowCursor = false;
effect.labelVerticalOffset = 1.5f;
effect.labelMaxDistance = 30f;
effect.labelFadeStartDistance = 20f;
effect.UpdateMaterialProperties();
}
}
Suggest an improvement
Help us improve this documentation page.