浏览代码

DeserializeConfiguration() is now protected

/generic-asset-sources
sleal-unity 3 年前
当前提交
4c7f4e1d
共有 4 个文件被更改,包括 9 次插入4 次删除
  1. 2
      com.unity.perception/Editor/Randomization/Editors/ScenarioBaseEditor.cs
  2. 7
      com.unity.perception/Runtime/Randomization/Scenarios/ScenarioBase.cs
  3. 2
      com.unity.perception/Runtime/Randomization/Scenarios/UnitySimulationScenario.cs
  4. 2
      com.unity.perception/Tests/Runtime/Randomization/ScenarioTests/ScenarioTests.cs

2
com.unity.perception/Editor/Randomization/Editors/ScenarioBaseEditor.cs


Undo.RecordObject(m_Scenario, "Deserialized scenario configuration");
var originalConfig = m_Scenario.configuration;
m_Scenario.LoadConfigurationFromFile(filePath);
m_Scenario.DeserializeConfiguration();
m_Scenario.DeserializeConfigurationInternal();
m_Scenario.configuration = originalConfig;
Debug.Log($"Deserialized scenario configuration from {Path.GetFullPath(filePath)}. " +
"Using undo in the editor will revert these changes to your scenario.");

7
com.unity.perception/Runtime/Randomization/Scenarios/ScenarioBase.cs


/// <summary>
/// Overwrites this scenario's randomizer settings and scenario constants from a JSON serialized configuration
/// </summary>
public virtual void DeserializeConfiguration()
protected virtual void DeserializeConfiguration()
}
internal void DeserializeConfigurationInternal()
{
DeserializeConfiguration();
}
/// <summary>

2
com.unity.perception/Runtime/Randomization/Scenarios/UnitySimulationScenario.cs


}
/// <inheritdoc/>
public override void DeserializeConfiguration()
protected override void DeserializeConfiguration()
{
base.DeserializeConfiguration();
if (Configuration.Instance.IsSimulationRunningInCloud())

2
com.unity.perception/Tests/Runtime/Randomization/ScenarioTests/ScenarioTests.cs


// Change the values
m_Scenario.constants = changedConstants;
m_Scenario.DeserializeConfiguration();
m_Scenario.DeserializeConfigurationInternal();
// Check if the values reverted correctly
Assert.AreEqual(m_Scenario.constants.framesPerIteration, constants.framesPerIteration);

正在加载...
取消
保存