浏览代码

bring back root reference

/develop/grid-rootref-debug
Ruo-Ping Dong 4 年前
当前提交
9e15056d
共有 3 个文件被更改,包括 49 次插入4 次删除
  1. 39
      Project/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockCollabAreaGrid.prefab
  2. 1
      com.unity.ml-agents/Editor/GridSensorComponentEditor.cs
  3. 13
      com.unity.ml-agents/Runtime/Sensors/GridSensorComponent.cs

39
Project/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockCollabAreaGrid.prefab


m_Modification:
m_TransformParent: {fileID: 8188317207052398481}
m_Modifications:
- target: {fileID: 1548337883655231979, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
propertyPath: m_RootReference
value:
objectReference: {fileID: 8190299122290044757}
- target: {fileID: 2598450485826216109, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
propertyPath: m_Model

type: 3}
m_PrefabInstance: {fileID: 6067781793364901444}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_GameObject: {fileID: 8190299122290044757}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d94a85eca2e074578943301959c555ba, type: 3}

type: 3}
m_PrefabInstance: {fileID: 6067781793364901444}
m_PrefabAsset: {fileID: 0}
--- !u!1 &8190299122290044757 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2710286047221272849, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
m_PrefabInstance: {fileID: 6067781793364901444}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &6565363751102736699
PrefabInstance:
m_ObjectHideFlags: 0

m_Modifications:
- target: {fileID: 1548337883655231979, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
propertyPath: m_RootReference
value:
objectReference: {fileID: 9115291448867436586}
- target: {fileID: 2598450485826216109, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
propertyPath: m_Model

type: 3}
m_PrefabInstance: {fileID: 6565363751102736699}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_GameObject: {fileID: 9115291448867436586}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d94a85eca2e074578943301959c555ba, type: 3}

type: 3}
m_PrefabInstance: {fileID: 6565363751102736699}
m_PrefabAsset: {fileID: 0}
--- !u!1 &9115291448867436586 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2710286047221272849, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
m_PrefabInstance: {fileID: 6565363751102736699}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &6716844123244810954
PrefabInstance:
m_ObjectHideFlags: 0

m_Modifications:
- target: {fileID: 1548337883655231979, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
propertyPath: m_RootReference
value:
objectReference: {fileID: 8695281997955662811}
- target: {fileID: 2598450485826216109, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
propertyPath: m_Model

type: 3}
m_PrefabInstance: {fileID: 6716844123244810954}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_GameObject: {fileID: 8695281997955662811}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d94a85eca2e074578943301959c555ba, type: 3}

type: 3}
m_PrefabInstance: {fileID: 6716844123244810954}
m_PrefabAsset: {fileID: 0}
--- !u!1 &8695281997955662811 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2710286047221272849, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
m_PrefabInstance: {fileID: 6716844123244810954}
m_PrefabAsset: {fileID: 0}

1
com.unity.ml-agents/Editor/GridSensorComponentEditor.cs


var gridSize2d = new Vector3Int(gridSize.vector3IntValue.x, 1, gridSize.vector3IntValue.z);
var newGridSize = EditorGUILayout.Vector3IntField("Grid Size", gridSize2d);
gridSize.vector3IntValue = new Vector3Int(newGridSize.x, 1, newGridSize.z);
EditorGUILayout.PropertyField(so.FindProperty(nameof(GridSensorComponent.m_RootReference)), true);
}
EditorGUI.EndDisabledGroup();
EditorGUILayout.PropertyField(so.FindProperty(nameof(GridSensorComponent.m_RotateWithAgent)), true);

13
com.unity.ml-agents/Runtime/Sensors/GridSensorComponent.cs


}
[HideInInspector, SerializeField]
internal GameObject m_RootReference;
/// <summary>
/// Rotate the grid based on the direction the agent is facing.
/// </summary>
public GameObject RootReference
{
get { return (m_RootReference == null ? gameObject : m_RootReference); }
set { m_RootReference = value; }
}
[HideInInspector, SerializeField]
internal string[] m_DetectableTags;
/// <summary>
/// List of tags that are detected.

m_GridSize,
m_RotateWithAgent,
m_ColliderMask,
gameObject,
RootReference,
m_DetectableTags,
m_InitialColliderBufferSize,
m_MaxColliderBufferSize

正在加载...
取消
保存