FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

IntoTheDev/Scriptable-Object-Loader at v1 · GitHub

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Scriptable Object Loader

Load Scriptable Objects via code

Usage

Creating ScriptableObject:

	[CreateAssetMenu(menuName = "Game/Configs/Player")]
	public class PlayerConfig : ScriptableObject
	{
		[SerializeField] private float _startHealth = 100f;

		public float StartHealth => _startHealth;
	}

Now you need to create an asset and put it in Resources folder

Get Data from ScriptableObject:

	public class Player : MonoBehaviour
	{
		private float _health = 0f;

		private void Awake()
		{
			_health = Storage.Get<PlayerConfig>().StartHealth;
		}
	}

About

Load Scriptable Objects via code

Topics

Resources

Stars

39 stars

Watchers

2 watching

Forks

Releases

Contributors

Languages


Back | FazBrowse Home | New Git URL