migration from new repo
This commit is contained in:
commit
423134a840
26930 changed files with 3458568 additions and 0 deletions
32
Assets/_/Features/Quests/Runtime/Events/QuestEventSO.cs
Normal file
32
Assets/_/Features/Quests/Runtime/Events/QuestEventSO.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Quests.Runtime
|
||||
{
|
||||
[CreateAssetMenu(fileName = "QuestEventSO", menuName = "Guild Tycoon/Quests/Event", order = 0)]
|
||||
public class QuestEventSO : ScriptableObject
|
||||
{
|
||||
[SerializeField] string m_assetGuid;
|
||||
public QuestEvent m_data;
|
||||
public Guid AssetGuid => Guid.Parse(m_assetGuid);
|
||||
|
||||
public QuestEvent ToQuestEventClass(int time, Guid? id = null)
|
||||
{
|
||||
QuestEvent eventQuest = new QuestEvent(AssetGuid, this, time);
|
||||
|
||||
return eventQuest;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void OnValidate()
|
||||
{
|
||||
Guid tempGuid;
|
||||
if (string.IsNullOrEmpty(m_assetGuid) || !Guid.TryParse(m_assetGuid, out tempGuid))
|
||||
{
|
||||
m_assetGuid = Guid.NewGuid().ToString();
|
||||
UnityEditor.EditorUtility.SetDirty(this);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue