浏览代码

Remove macros for older unity versions which are no longer needed. (#3168)

/asymm-envs
GitHub 5 年前
当前提交
754492dc
共有 3 个文件被更改,包括 0 次插入30 次删除
  1. 4
      UnitySDK/Assets/ML-Agents/Editor/DemonstrationImporter.cs
  2. 7
      UnitySDK/Assets/ML-Agents/Editor/Tests/StandaloneBuildTest.cs
  3. 19
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/RpcCommunicator.cs

4
UnitySDK/Assets/ML-Agents/Editor/DemonstrationImporter.cs


var texture = (Texture2D)
AssetDatabase.LoadAssetAtPath(k_IconPath, typeof(Texture2D));
#if UNITY_2017_3_OR_NEWER
#else
ctx.SetMainAsset(ctx.assetPath, demonstration);
#endif
}
catch
{

7
UnitySDK/Assets/ML-Agents/Editor/Tests/StandaloneBuildTest.cs


using System;
using UnityEditor;
using UnityEngine;
#if UNITY_2018_1_OR_NEWER
#endif
namespace MLAgents
{

{
string[] scenes = { "Assets/ML-Agents/Examples/3DBall/Scenes/3DBall.unity" };
var buildResult = BuildPipeline.BuildPlayer(scenes, "testPlayer", BuildTarget.StandaloneOSX, BuildOptions.None);
#if UNITY_2018_1_OR_NEWER
var isOk = buildResult.summary.result == BuildResult.Succeeded;
var error = "";
foreach (var stepInfo in buildResult.steps)

}
}
}
#else
var error = buildResult;
var isOk = string.IsNullOrEmpty(error);
#endif
if (isOk)
{
EditorApplication.Exit(0);

19
UnitySDK/Assets/ML-Agents/Scripts/Grpc/RpcCommunicator.cs


var result = m_Client.Exchange(WrapMessage(unityOutput, 200));
unityInput = m_Client.Exchange(WrapMessage(null, 200)).UnityInput;
#if UNITY_EDITOR
#if UNITY_2017_2_OR_NEWER
#else
EditorApplication.playmodeStateChanged += HandleOnPlayModeChanged;
#endif
#endif
return result.UnityInput;
#else

#endregion
#if UNITY_EDITOR
#if UNITY_2017_2_OR_NEWER
/// <summary>
/// When the editor exits, the communicator must be closed
/// </summary>

}
}
#else
/// <summary>
/// When the editor exits, the communicator must be closed
/// </summary>
private void HandleOnPlayModeChanged()
{
// This method is run whenever the playmode state is changed.
if (!EditorApplication.isPlayingOrWillChangePlaymode)
{
Close();
}
}
#endif
#endif
}
}
正在加载...
取消
保存