Prefabs¶
Prefabs are updatable templates you can use to easily manage the design of elements throughout your project. You can adjust choice properties after a prefab has been assigned, and may later reset individual choice properties back to the prefab default. Unchanged properties will remain in sync with the parent prefab as you make changes to it.
Updating Prefab Properties - Synchronization With Choices
After applying a prefab to a choice, you may need to tweak some choice properties, (for example, title and description).
When you later come to adjusting your prefabs properties, it will only update a choice value if said vale is in sync with the prefab value. This means that if a choice title matched its prefabs title, and you modified the prefab, the title would change for both the prefab and linked choice.
If however, the choice title did not match the prefab title, and you adjusted the prefab title, the title would only change for the prefab. Note, this check is performed on a choice by choice, property by property basis, meaning you can have some properties remain in sync with the prefab, and others not.
Choice Defaults - Re-Syncing
When you have a prefab applied to a given choice, the reset property button changes its behavior to reset the choice property back to the prefab value. This will allow you to fix any properties you may have adjusted and put them back in sync with the prefab value.
How To Create A Prefab¶
Step 1: First you will need to open the prefab editor. You can do this from within the CYOA editor, by selecting the stacked boxes button in the top left.
Step 2: Now in the prefab editor, click the "NEW PREFAB" button to create a new prefab.
Step 3: Upon creating your prefab, the prefab properties panel will slide out. You can adjust the properties of your prefab here.
Step 4: It is recommend you assign a descriptive and unique title to each of your prefabs, by editing the "Name" property displayed below. The name you assign is used to help you (the creator) identify this prefab throughout the system.
Bonus Tips¶
The drop-down menu at the bottom of the screen can be used to switch between your created prefabs.
Return to the CYOA editor at any time using the "RETURN" button in the top left.
Applying Your Prefab To A Choice¶
There are two ways to apply a prefab to a choice.
Method 1 (Prefab Pre-Select)¶
Once you have created a prefab in your project, a new drop-down menu will appear. This is the Prefab Pre-Select list. This is a list of all your created prefabs. When you select a prefab from this drop-down, all new choices you create will automatically have this prefab applied to them.
It is recommended you plan ahead and use this method from the outset, as it will save you a lot of time in the long run.
Method 2 (Apply Prefab Directly)¶
Select the choice you want to apply the prefab to. Then look for the "General > Prefab" property in the properties panel. Select from this drop-down the prefab you would like to apply to your choice.
