Skip to content

CustomPrefabPreviewGenerator

ClassAssetInventoryAssetInventory.Editor
public static class CustomPrefabPreviewGenerator

No description is available for this type.

public const string NO_VISIBLE_CONTENT_REASON = "No visible content detected"

No description is available for this member.

Returns

System.String — No return description is available.

public static void ClearVFXCache()

No description is available for this member.

public static Task<Texture2D> Create(string prefabPath, int size = 128, int frameCount = 1, PreviewRequest previewRequest = null)

No description is available for this member.

Parameters

Name Type Description
prefabPath System.String
size System.Int32
frameCount System.Int32
previewRequest AssetInventory.PreviewRequest

Returns

System.Threading.Tasks.Task{UnityEngine.Texture2D} — No return description is available.

Create(GameObject, int, int, string, PreviewRequest)

Section titled “Create(GameObject, int, int, string, PreviewRequest)”
public static Task<Texture2D> Create(GameObject prefab, int size = 128, int frameCount = 1, string prefabPath = null, PreviewRequest previewRequest = null)

No description is available for this member.

Parameters

Name Type Description
prefab UnityEngine.GameObject
size System.Int32
frameCount System.Int32
prefabPath System.String
previewRequest AssetInventory.PreviewRequest

Returns

System.Threading.Tasks.Task{UnityEngine.Texture2D} — No return description is available.

CreateFBX(string, int, int, int, PreviewRequest)

Section titled “CreateFBX(string, int, int, int, PreviewRequest)”
public static Task<Texture2D> CreateFBX(string fbxPath, int size = 128, int frameCount = 1, int animationCount = 0, PreviewRequest previewRequest = null)

No description is available for this member.

Parameters

Name Type Description
fbxPath System.String
size System.Int32
frameCount System.Int32
animationCount System.Int32
previewRequest AssetInventory.PreviewRequest

Returns

System.Threading.Tasks.Task{UnityEngine.Texture2D} — No return description is available.

CreateAnim(string, int, int, PreviewRequest, List)

Section titled “CreateAnim(string, int, int, PreviewRequest, List)”
public static Task<Texture2D> CreateAnim(string animPath, int size = 128, int frameCount = 1, PreviewRequest previewRequest = null, List<AssetFile> dependencies = null)

Creates a preview for a standalone .anim (AnimationClip) file. Unlike FBX, .anim files contain only animation data and require a model to preview on.

Parameters

Name Type Description
animPath System.String Path to the .anim file
size System.Int32 Preview size in pixels
frameCount System.Int32 Number of frames (1 for static, more for animated)
previewRequest AssetInventory.PreviewRequest Optional preview request for metadata storage
dependencies System.Collections.Generic.List{AssetInventory.AssetFile} List of dependencies that may contain FBX models

Returns

System.Threading.Tasks.Task{UnityEngine.Texture2D} — No return description is available.

public static void HandleParticleSystems(GameObject go)

No description is available for this member.

Parameters

Name Type Description
go UnityEngine.GameObject
public static void HandleVFXSystems(GameObject go)

No description is available for this member.

Parameters

Name Type Description
go UnityEngine.GameObject
public static float GetVFXDuration(GameObject go)

No description is available for this member.

Parameters

Name Type Description
go UnityEngine.GameObject

Returns

System.Single — No return description is available.

public static float CalculateOptimalParticleTime(GameObject go)

No description is available for this member.

Parameters

Name Type Description
go UnityEngine.GameObject

Returns

System.Single — No return description is available.

public static float GetParticleSystemDuration(GameObject go)

No description is available for this member.

Parameters

Name Type Description
go UnityEngine.GameObject

Returns

System.Single — No return description is available.

public static float GetVisuallyActiveDuration(GameObject go)

Returns a shorter duration focused on the visually active period of the effect. For non-looping systems this is the emission phase plus a brief aftermath (25% of max particle lifetime, capped at 0.5s). For looping systems the full duration is used. This prevents animated previews from wasting frames on the dying/fading tail.

Parameters

Name Type Description
go UnityEngine.GameObject

Returns

System.Single — No return description is available.

GetVisuallyActiveDuration(GameObject, out bool)

Section titled “GetVisuallyActiveDuration(GameObject, out bool)”
public static float GetVisuallyActiveDuration(GameObject go, out bool isBurstDominated)

Returns a shorter duration focused on the visually active period of the effect. Detects burst-only systems (no continuous rateOverTime/rateOverDistance) and uses lastBurstTime + particleLifetime instead of the system duration which may be much longer.

Parameters

Name Type Description
go UnityEngine.GameObject The particle system root GameObject
isBurstDominated System.Boolean Output: true when majority of systems are burst-only, useful for callers that want to front-load frame distribution.

Returns

System.Single — No return description is available.

CalculateEffectiveCenterAndScale(Bounds, Vector3, out Vector3, out float)

Section titled “CalculateEffectiveCenterAndScale(Bounds, Vector3, out Vector3, out float)”
public static void CalculateEffectiveCenterAndScale(Bounds bounds, Vector3 prefabRoot, out Vector3 effectiveCenter, out float distanceScale)

Calculate the effective look-at center and distance scale factor for particle effects where the bounds center is significantly offset from the prefab root. This consolidates the repeated effectiveCenter correction logic into a single method.

Parameters

Name Type Description
bounds UnityEngine.Bounds The particle bounds
prefabRoot UnityEngine.Vector3 The prefab’s root world position
effectiveCenter UnityEngine.Vector3 Output: the corrected look-at center
distanceScale System.Single Output: multiplier for camera distance (0.5–1.0)

PositionParticleCamera(Bounds, Camera, Vector3)

Section titled “PositionParticleCamera(Bounds, Camera, Vector3)”
public static bool PositionParticleCamera(Bounds bounds, Camera camera, Vector3 prefabRoot)

Position the camera for a particle effect using the standard particle camera angles and the effectiveCenter correction. This consolidates the repeated inline camera positioning code used in pre-passes and post-emit repositioning.

Parameters

Name Type Description
bounds UnityEngine.Bounds The particle bounds to frame
camera UnityEngine.Camera The preview camera
prefabRoot UnityEngine.Vector3 The prefab’s root world position

Returns

System.Boolean — True if camera was successfully repositioned, false if bounds were invalid

PositionCameraForPrefab(GameObject, Camera, PrefabType, float)

Section titled “PositionCameraForPrefab(GameObject, Camera, PrefabType, float)”
public static void PositionCameraForPrefab(GameObject prefab, Camera camera, CustomPrefabPreviewGenerator.PrefabType prefabType, float animationDuration = 0)

No description is available for this member.

Parameters

Name Type Description
prefab UnityEngine.GameObject
camera UnityEngine.Camera
prefabType AssetInventory.CustomPrefabPreviewGenerator.PrefabType
animationDuration System.Single