Skip to content

Instantly share code, notes, and snippets.

@morphingcoffee
Created January 16, 2022 19:12
Show Gist options
  • Save morphingcoffee/3c0c1eb2cac207c6e8be1aeb19fe83ad to your computer and use it in GitHub Desktop.
Save morphingcoffee/3c0c1eb2cac207c6e8be1aeb19fe83ad to your computer and use it in GitHub Desktop.
C# Unity Quest ScriptableObject example class
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