codeAPI Reference
s&box ScriptedEmitterModel: Model-based emitter resource
ScriptedEmitterModel GameResource API Reference
ScriptedEmitterModel is a GameResource for model-based particle/VFX emitters. It implements IDefinitionResource and includes a prefab containing the physical emitter body.
Type Signature
CSHARP
[AssetType(Name = "Scripted Model Emitter", Extension = "smemit", Category = "Sandbox", Flags = AssetTypeFlags.NoEmbedding | AssetTypeFlags.IncludeThumbnails)]
public class ScriptedEmitterModel : GameResource, IDefinitionResource
{
[Property]
public PrefabFile Prefab { get; set; }
[Property]
public string Title { get; set; }
[Property]
public string Description { get; set; }
public override Bitmap RenderThumbnail(ThumbnailOptions options);
protected override Bitmap CreateAssetTypeIcon(int width, int height);
}Properties
- PrefabFile Prefab { get; set; } - The prefab containing the physical emitter body
- string Title { get; set; } - Display title for the emitter
- string Description { get; set; } - Description of the emitter
Methods
RenderThumbnail(ThumbnailOptions options)
Renders a thumbnail by rendering the prefab scene to a bitmap.CreateAssetTypeIcon(int width, int height)
Creates the asset type icon with a cloud emoji and blue color.Usage
CSHARP
[AssetType(Name = "Scripted Model Emitter", Extension = "smemit", Category = "Sandbox")]
public class MyEmitterModel : ScriptedEmitterModel
{
[Property]
public PrefabFile Prefab { get; set; } = "prefabs/emitters/my_emitter.prefab";
[Property]
public string Title { get; set; } = "My Emitter";
[Property]
public string Description { get; set; } = "A custom particle emitter";
}Notes
- Used for model-based emitters that have a physical representation
- Implements IDefinitionResource for title/description support
- Thumbnails are rendered from the prefab scene
- NoEmbedding flag prevents embedding in other assets
- IncludeThumbnails flag enables thumbnail generation
Was this helpful?