Created
January 16, 2022 19:12
-
-
Save morphingcoffee/3c0c1eb2cac207c6e8be1aeb19fe83ad to your computer and use it in GitHub Desktop.
C# Unity Quest ScriptableObject example class
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 UnityEngine; | |
/** | |
* Avoid deserializing this class and those derived from it, | |
* as only Unity can instantiate Scriptable Objects - constructor call during | |
* deserialization is not allowed. | |
**/ | |
public abstract class QuestSO: ScriptableObject | |
{ | |
[SerializeField] | |
private string id; | |
public string questName; | |
public string description; | |
[SerializeField] | |
private RewardData[] rewards; | |
public string GetId() | |
{ | |
return id; | |
} | |
public RewardData[] GetRewards() { | |
return rewards; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment