Unity Tutorial: Scriptable Objects (Unity Basics 2022)

preview_player
Показать описание
This video is a bit of a departure from some of my previous videos - I wanted to potentially start to cover some basics of game development of there is interest for it. Lemme know in the comments or the discord what you think!

Here are the example scripts covered within the video here:
----
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(fileName = "GroupName", menuName = "ScriptableObjects/CreateIngredientGroup", order = 1)]
public class CreateIngredientGroup : ScriptableObject {
public string groupName;
public Sprite picture;
public Color groupTint;
}
---
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(fileName = "IngredientName", menuName = "ScriptableObjects/CreateIngredient", order = 1)]
public class CreateIngredient : ScriptableObject {
public string ingredientName;
public double baseCost;
public Sprite picture;
public CreateIngredientGroup ingredient_Group;
public double appealValue;
public double currentCost;
}
----

Рекомендации по теме
Комментарии
Автор

Good intro video to scriptable objects. Honestly, this is something I've come across time and time again, but always forget about. I'm fairly certain I could find a use-case for this in my own project, , but now it becomes a decision as to whether or not I want to redo sections of my code for that. Been toying with the idea of using interfaces as well because I've been learning a bit more about them and how they could be super helpful in a game dev environment. But it would require refactors...which then pushes back any practical updates to my game. I guess that's the conundrum a lot of coders probably face on a daily basis though lol.

StealthyShiroeanGaming
Автор

This could really help with a clicker game since all the upgrades are basically the same thing.

blockify
welcome to shbcf.ru