Background Manager
Posted: Fri Jun 30, 2017 10:36 pm
Hi Guys,
I made a simple setup to easily manage 2d backgrounds in Visual Novel/Adventure type games. I hope someone else will find this useful as well.
With this you can setup the database of different backgrounds and change them with DS Sequence command. And optionally save/load current BG.
It supports sprite BG and Prefab type BG. And has Scaling/Position offset options.
You can use SetBackground(BGName) to set the BG if you use one Background Manager. Where BGName is the name of the BG in database.
You can use SetBackground(BGName, Gameobjectname) to target a specific Background Manager if you use several of them. Gameobjectname parameter is the name of the Gameobject that BackgroundManager is attached to.
Check the SecondaryBG toggle for all additional Background Managers.
You can add PersistentDataBackgroundManager to same GameObject you have attached BackgroundManager script to and this will save and load current BG with DS save system. But to use this you have to make sure each BackgroundManager gameobject has unique name, as the name is used as identifier in saves.
In the package you can find example scene that demonstrates BG manager in use.
You can download the package here: https://drive.google.com/open?id=0B81Lv ... nY3aUQ3RW8
Be sure to import Dialogue System plugin before you import this.
I made a simple setup to easily manage 2d backgrounds in Visual Novel/Adventure type games. I hope someone else will find this useful as well.
With this you can setup the database of different backgrounds and change them with DS Sequence command. And optionally save/load current BG.
It supports sprite BG and Prefab type BG. And has Scaling/Position offset options.
You can use SetBackground(BGName) to set the BG if you use one Background Manager. Where BGName is the name of the BG in database.
You can use SetBackground(BGName, Gameobjectname) to target a specific Background Manager if you use several of them. Gameobjectname parameter is the name of the Gameobject that BackgroundManager is attached to.
Check the SecondaryBG toggle for all additional Background Managers.
You can add PersistentDataBackgroundManager to same GameObject you have attached BackgroundManager script to and this will save and load current BG with DS save system. But to use this you have to make sure each BackgroundManager gameobject has unique name, as the name is used as identifier in saves.
In the package you can find example scene that demonstrates BG manager in use.
You can download the package here: https://drive.google.com/open?id=0B81Lv ... nY3aUQ3RW8
Be sure to import Dialogue System plugin before you import this.