@@ -494,6 +494,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
_undo.Enabled = false;
|
||||
_undo.Clear();
|
||||
_propertiesEditor.BuildLayoutOnUpdate();
|
||||
UpdateToolstrip();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -504,6 +505,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
_undo.Enabled = true;
|
||||
_undo.Clear();
|
||||
_propertiesEditor.BuildLayoutOnUpdate();
|
||||
UpdateToolstrip();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -221,9 +221,7 @@ Asset::LoadResult GameplayGlobals::load()
|
||||
// Get data
|
||||
const auto chunk = GetChunk(0);
|
||||
if (!chunk || !chunk->IsLoaded())
|
||||
{
|
||||
return LoadResult::MissingDataChunk;
|
||||
}
|
||||
MemoryReadStream stream(chunk->Get(), chunk->Size());
|
||||
|
||||
// Load all variables
|
||||
@@ -234,15 +232,16 @@ Asset::LoadResult GameplayGlobals::load()
|
||||
for (int32 i = 0; i < count; i++)
|
||||
{
|
||||
stream.ReadString(&name, 71);
|
||||
if (name.IsEmpty())
|
||||
{
|
||||
LOG(Warning, "Empty variable name");
|
||||
return LoadResult::InvalidData;
|
||||
}
|
||||
auto& e = Variables[name];
|
||||
stream.ReadVariant(&e.DefaultValue);
|
||||
e.Value = e.DefaultValue;
|
||||
}
|
||||
if (stream.HasError())
|
||||
{
|
||||
// Failed to load data
|
||||
Variables.Clear();
|
||||
return LoadResult::InvalidData;
|
||||
}
|
||||
|
||||
return LoadResult::Ok;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user