# Scriptable Object Factory

## Links to Scriptable Object Factory - Unity Package

[Scriptable Object Factory - Article - Tal Lior](http://www.li0rtal.com/unity-scriptableobject-factory/)

[**ScriptableObjectFactory** Unity Package Download Link - Dropbox](https://www.dropbox.com/s/vdvf5si4go3jnb5/ScriptableObjectFactory.unitypackage)

[**ScriptableObjectFactory** Link - Box.com](https://utdallas.box.com/s/tjdlm45kuo46dm5rsfcw641mdtpky33s)

The ScriptableObject Factory provides an Editor interface that makes it easy to create scriptableObject instances in your project.  Otherwise, additional custom code must be written to add an option to the menu to allow creation of a scriptable object interface.

Any class that inherits from **ScriptableObject** will now show up as an option in the **Project Assets Menu**:

![](/files/-M0-KjUiDhrpDGNqGB8A)

The image below shows that the Scriptable Object Factory places a new folder: **Editor,** with 2 scripts: ScriptableObjectFactory.cs, ScriptableObjectWindow\.cs. &#x20;

You can delete files: First.cs, Second.cs that are imported as examples with the scriptable object factory.

![](/files/-M0-KjUkqd0a_SyHDJ4x)

* Add a public instance of the Scriptable Object to a custom script that will be attached to a gameObject in a scene. In our case this is the DialogManager.cs script.

  ```java
  public class DialogManager : MonoBehaviour {

     public ConversationList convList; //attach scriptable object in Inspector

     //more class definition code below
  ```
* Use inspector to select a ConversationList scriptableObject from your project's assets, to populate the convList variable defined above.

[Scriptable Objects - Unity Manual, Scripting API](https://docs.unity3d.com/Manual/class-ScriptableObject.html?_ga=2.21799608.2060655022.1537129337-1484586345.1534795685)

ScriptableObject is a class that allows you to store persistent data independent from script instances.  A class you can derive from if you want to create objects that don't need to be attached to game objects. This is most useful for assets which are only meant to store data.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kdoore.gitbook.io/cs2335/project-2-dialog/scriptableobjects/scriptable-object-factory.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
