浏览代码

Moving Labeling to proper namespace.

/format
Jon Hogins 5 年前
当前提交
e7151b53
共有 3 个文件被更改,包括 23 次插入18 次删除
  1. 3
      com.unity.perception/Editor/GroundTruth/LabelingEditor.cs
  2. 37
      com.unity.perception/Runtime/GroundTruth/Labeling/Labeling.cs
  3. 1
      com.unity.perception/Tests/Runtime/GroundTruthTests/TestHelper.cs

3
com.unity.perception/Editor/GroundTruth/LabelingEditor.cs


using UnityEditorInternal;
using UnityEngine;
using UnityEngine.Perception.GroundTruth;
namespace UnityEditor.Perception.GroundTruth
{

public void OnEnable()
{
m_LabelsList = new ReorderableList(serializedObject, serializedObject.FindProperty(nameof(global::Labeling.labels)), true, false, true, true);
m_LabelsList = new ReorderableList(serializedObject, serializedObject.FindProperty(nameof(global::UnityEngine.Perception.GroundTruth.Labeling.labels)), true, false, true, true);
m_LabelsList.drawElementCallback = DrawElement;
m_LabelsList.onAddCallback += OnAdd;
m_LabelsList.onRemoveCallback += OnRemove;

37
com.unity.perception/Runtime/GroundTruth/Labeling/Labeling.cs


using UnityEngine;
using UnityEngine.Serialization;
/// <summary>
/// Defines a set of labels associated with the object and its descendants. A Labeling component will override any Labeling components on the object's ancestors.
/// </summary>
public class Labeling : MonoBehaviour
namespace UnityEngine.Perception.GroundTruth
/// The label names to associate with the GameObject.
/// Defines a set of labels associated with the object and its descendants. A Labeling component will override any Labeling components on the object's ancestors.
[FormerlySerializedAs("classes")]
public List<string> labels = new List<string>();
public class Labeling : MonoBehaviour
{
/// <summary>
/// The label names to associate with the GameObject.
/// </summary>
[FormerlySerializedAs("classes")]
public List<string> labels = new List<string>();
Entity m_Entity;
void Awake()
{
m_Entity = World.DefaultGameObjectInjectionWorld.EntityManager.CreateEntity();
World.DefaultGameObjectInjectionWorld.EntityManager.AddComponentObject(m_Entity, this);
}
Entity m_Entity;
void Awake()
{
m_Entity = World.DefaultGameObjectInjectionWorld.EntityManager.CreateEntity();
World.DefaultGameObjectInjectionWorld.EntityManager.AddComponentObject(m_Entity, this);
}
void OnDestroy()
{
if (World.DefaultGameObjectInjectionWorld != null)
World.DefaultGameObjectInjectionWorld.EntityManager.DestroyEntity(m_Entity);
void OnDestroy()
{
if (World.DefaultGameObjectInjectionWorld != null)
World.DefaultGameObjectInjectionWorld.EntityManager.DestroyEntity(m_Entity);
}
}
}

1
com.unity.perception/Tests/Runtime/GroundTruthTests/TestHelper.cs


using System;
using UnityEngine;
using UnityEngine.Perception.GroundTruth;
namespace GroundTruthTests
{

正在加载...
取消
保存