您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
18 行
456 B
18 行
456 B
using UnityEngine;
|
|
using MLAgents;
|
|
using MLAgents.SideChannels;
|
|
|
|
public class GridSettings : MonoBehaviour
|
|
{
|
|
public Camera MainCamera;
|
|
|
|
public void Awake()
|
|
{
|
|
SideChannelUtils.GetSideChannel<FloatPropertiesChannel>().RegisterCallback("gridSize", f =>
|
|
{
|
|
MainCamera.transform.position = new Vector3(-(f - 1) / 2f, f * 1.25f, -(f - 1) / 2f);
|
|
MainCamera.orthographicSize = (f + 5f) / 2f;
|
|
});
|
|
|
|
}
|
|
}
|