This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ItalicPig.PaleoPines.Loading; | |
using UnityEngine; | |
using UnityEngine.Serialization; | |
/* | |
* Copyright © 2020, Italic Pig, All Rights Reserved | |
* | |
* Author: Harry Evans | |
* Date: 25/02/2020 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The Universal Loader automatically searches the project and adds scriptable objects that implement "ILoadable" to a list. | |
The problem this was meant to solve was to be able to access Scriptableobjects easily within code. One could have serialized | |
references wherever they are needed, but those can be changed and if code needs to access the SAME scriptable object, this | |
can be a problem. So the idea came to having a static reference to the scriptable object within it, but if the scriptable | |
object isn't loaded, its Awake() method is never called. Having a Universal Loader Scriptable object that is referenced | |
in the scene that automatically calls a method on that scriptable object that implements ILoadable will allow you to make | |
that reference quickly and easily. | |
*/ | |
namespace ItalicPig.PaleoPines.Loading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
/* | |
============================================================================================================================================================ | |
GameState : A static helper class for GameState<T>. Holds the Current State and handles Transitions (calls OnEnter and OnExit where Necessary). | |
Necessary, since interfaces cannot have static members, and generic classes' static members are not shared across different types. | |
GameState<T> : The actual State Object. Can be referenced via Singleton Instance. |