Enterprise Apps: Zoo App Part 3

Objective: Scriptable Objects in Unity

To get ready for the scriptable object, we start out with a new panel. The Card Panel will represent each exhibit of the zoo and get filled dynamically. The panel is made up of UI Text and Image elements and a Close Button.

The next step is to create a CardView script and create the associated variables.

Next for the scriptable object we create a CardModel script that inherits from ScriptableObject and again create the associated variables. We use this script in setting up a CreateAssetMenu for a Card.

As you can see we can now populate the card models inside the inspector for each of the designated sectors of the Zoo.

Next we create a CardModel array for the Cards and set them in the inspector based on the buttons associated with each sector.

We can then use a DisplayCard method that takes an integer input which related to the card and assigns the values set to the CardPanel.

--

--

--

Developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

“Whatever you don’t use will reduce to a point where you will eventually lose.”

Third Doctor Archive

The Adarna — DREAM TOUR Ep. 881 [VIDEO]

The Tales of Luminaria Anime in Extended Trailer

The Tales of Luminaria Anime in Extended Trailer

Pets whenever you try to have food in front of them

Pets whenever you try to have food in front of them

New Opened

Thank you for your support.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Simon Leen

Simon Leen

Developer

More from Medium

Get Started Your First Mobile Top Down Shooting Game Development With Unity Visual Scripting Part 7

Unity camera plugin save image data as bytes

My journey becoming a Unity game developer: Make a game look beautiful-Creating Ceilings pt.1

Creating Main Menu UI Panel Part 2!