mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-10 11:45:09 +00:00
handle reserved property names of entities
This commit is contained in:
parent
4e7b9f87ea
commit
cfc8b296ed
1 changed files with 15 additions and 6 deletions
|
@ -125,14 +125,23 @@ namespace HeavenStudio
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
switch (propertyName)
|
||||||
|
{
|
||||||
|
case "beat":
|
||||||
|
case "track":
|
||||||
|
case "length":
|
||||||
|
case "swing":
|
||||||
|
case "datamodel":
|
||||||
|
UnityEngine.Debug.LogWarning($"Property name {propertyName} is reserved and cannot be set.");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
if (DynamicData.ContainsKey(propertyName))
|
if (DynamicData.ContainsKey(propertyName))
|
||||||
{
|
|
||||||
DynamicData[propertyName] = value;
|
DynamicData[propertyName] = value;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
UnityEngine.Debug.LogError($"This entity does not have a property named {propertyName}! Attempted to insert value of type {value.GetType()}");
|
UnityEngine.Debug.LogError($"This entity does not have a property named {propertyName}! Attempted to insert value of type {value.GetType()}");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue