Improve workflows, validate decisions, and avoid errors with Presets

Sniperindia
Unity

Improve workflows, validate decisions, and avoid errors with Presets

Fundamentally, a Preset is an Asset that allows you to override the defaults for a given Component, Importer, or Manager (anything that extends Unity.Object, in fact). Would it make more sense in your project for a RigidBody to default to a mass of 10 instead of 1, but have gravity turned off? Make it so with a preset.

We can use Presets on things that get imported or instantiated in the hierarchy: Textures, FBX files, MonoBehaviour components like Light, Camera, or RigidBody.

Note that Presets are an Editor feature, designed to improve your authoring workflow, not a runtime feature. The Presets aren’t shipped with your binary, so don’t expect GameObject.AddComponent<RigidBody>() to apply these same defaults. However, the Editor-time ObjectFactory API does support Presets, so ObjectFactory.AddComponent<RigidBody>() operates with the assumption that the project Presets will be respected.

To create a Preset, all you need to do is go to an existing importer or component of the same type, make your adjustments to it in the Inspector, then click the Preset Icon in the upper right. A window will open where you can choose “Save Current To…” to save out the asset. Learn More

Sniper systems is unity reseller in Hyderabad

Back To Top