fix compile warnings for using obsolete enum (#4812)
This commit is contained in:
Родитель
87c9a0b170
Коммит
73804cbca1
|
@ -20,6 +20,7 @@ and this project adheres to
|
|||
|
||||
### Bug Fixes
|
||||
#### com.unity.ml-agents (C#)
|
||||
- Fix a compile warning about using an obsolete enum in `GrpcExtensions.cs`. (#4812)
|
||||
#### ml-agents / ml-agents-envs / gym-unity (Python)
|
||||
|
||||
|
||||
|
|
|
@ -168,6 +168,8 @@ namespace Unity.MLAgents
|
|||
ActionSpec actionSpec;
|
||||
if (bpp.ActionSpec == null)
|
||||
{
|
||||
// Disable deprecation warnings so we can set legacy fields
|
||||
#pragma warning disable CS0618
|
||||
var spaceType = (SpaceType)bpp.VectorActionSpaceTypeDeprecated;
|
||||
if (spaceType == SpaceType.Continuous)
|
||||
{
|
||||
|
@ -177,6 +179,7 @@ namespace Unity.MLAgents
|
|||
{
|
||||
actionSpec = ActionSpec.MakeDiscrete(bpp.VectorActionSizeDeprecated.ToArray());
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче