CORE dashboard + a lot of changes
This commit is contained in:
@@ -8,7 +8,12 @@ using UnityEngine;
|
||||
namespace RPGCore.ObjectModules.EventObjectModule
|
||||
{
|
||||
[Serializable]
|
||||
[RequireComponent(typeof(BaseObject))]
|
||||
[ObjectModule(
|
||||
name: "[Core] Data",
|
||||
description: "[Built-in module] Manages all implementations of <b>BaseData</b>. " +
|
||||
"Automatically adds matching data to attached implementation of <b>BaseObject</b>.",
|
||||
required: true
|
||||
)]
|
||||
public class DataModule : ObjectModule<BaseObject>
|
||||
{
|
||||
// SERIALIZED
|
||||
@@ -48,6 +53,9 @@ namespace RPGCore.ObjectModules.EventObjectModule
|
||||
|
||||
public T Get<T>() where T : BaseData
|
||||
{
|
||||
if (!_dataDict.ContainsKey(typeof(T)))
|
||||
_dataDict.Add(typeof(T), Activator.CreateInstance(typeof(T)) as T);
|
||||
|
||||
return (T)_dataDict[typeof(T)];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user