Convert current player MonoBehaviour to be ScriptableObject based.
Currently the prototype Player script is MonoBehaviour
based, but as players will be able to choose their character (and each will have different characteristics/visuals) we'll need to switch it to be ScriptableObject
based.
We'll still have a Player MonoBehaviour
, but with this change we're essentially pulling the configuration and visuals out of the MonoBehaviour
so we can configure them within a ScriptableObject
.
The ScriptableObject
should follow the following abstract, with whatever necessary changes/additions are needed:
public abstract class PlayerConfig : ScriptableObject
{
// Example fields
public string name;
public float weight;
public Sprite sprite;
// We should have a setup function that we can call from the
// Player MonoBehaviour on Awake/Start, so the MonoBehaviour
// has the correct settings and configurations.
public abstract void SetupGameObject(GameObject entity);
}
-
Split Player configurations into their own ScriptableObject
-based class. -
Add MonoBehaviour setup method to ScriptableObject for runtime player MonoBehaviour
/Rigidbody2D
setup, etc. -
Create Player delegate MonoBehaviour
Edited by username-removed-1478175