handle reserved property names of entities

This commit is contained in:
minenice55 2022-08-23 09:24:42 -04:00
parent 8026853788
commit da8c72d9aa
1 changed files with 15 additions and 6 deletions

View File

@ -125,14 +125,23 @@ namespace HeavenStudio
} }
set set
{ {
if (DynamicData.ContainsKey(propertyName)) switch (propertyName)
{ {
DynamicData[propertyName] = value; case "beat":
} case "track":
else case "length":
{ case "swing":
UnityEngine.Debug.LogError($"This entity does not have a property named {propertyName}! Attempted to insert value of type {value.GetType()}"); case "datamodel":
UnityEngine.Debug.LogWarning($"Property name {propertyName} is reserved and cannot be set.");
break;
default:
if (DynamicData.ContainsKey(propertyName))
DynamicData[propertyName] = value;
else
UnityEngine.Debug.LogError($"This entity does not have a property named {propertyName}! Attempted to insert value of type {value.GetType()}");
break;
} }
} }
} }