浏览代码

updated format and removed Debug

/4.1
Shan Jiang 4 年前
当前提交
ce44a636
共有 1 个文件被更改,包括 31 次插入33 次删除
  1. 64
      Assets/Scenes/ImageTracking/Multi Prefab - Image Tracking/MultiTrackedImageInfoManager.cs

64
Assets/Scenes/ImageTracking/Multi Prefab - Image Tracking/MultiTrackedImageInfoManager.cs


/// </summary>
public Camera worldSpaceCanvasCamera
{
get { return m_WorldSpaceCanvasCamera; }
set { m_WorldSpaceCanvasCamera = value; }
get => m_WorldSpaceCanvasCamera;
set => m_WorldSpaceCanvasCamera = value;
}
[SerializeField]

/// </summary>
public Texture2D defaultTexture
{
get { return m_DefaultTexture; }
set { m_DefaultTexture = value; }
get => m_DefaultTexture;
set => m_DefaultTexture = value;
}
[Serializable]

public string prefabName
{
get { return m_PrefabName; }
set { m_PrefabName = value; }
get => m_PrefabName;
set => m_PrefabName = value;
get { return m_Prefab; }
set { m_Prefab = value; }
get => m_Prefab;
set => m_Prefab = value;
}
public NamedPrefab(string prefabName, GameObject prefab)

[SerializeField]
[Tooltip("Each prefab corresponds to each image in the Image Library.")]
List<NamedPrefab> m_PrefabList;
List<NamedPrefab> m_PrefabList = new List<NamedPrefab>();
/// <summary>
/// Each prefab corresponds to the each image in the Image Library in the same order.

get { return m_PrefabList; }
set { m_PrefabList = value; }
get => m_PrefabList;
set => m_PrefabList = value;
}
Dictionary<string, GameObject> m_PrefabsDictionary = new Dictionary<string, GameObject>();

internal void OnLibraryChanged(XRReferenceImageLibrary library)
{
Debug.Log("OnLibraryChanged");
if (m_PrefabList.Count == m_ImageLibrary.count)
if (m_ImageLibrary != null)
for (int i = 0; i < m_PrefabList.Count; i++)
if (m_PrefabList.Count == m_ImageLibrary.count)
var pref = m_PrefabList[i];
pref.prefabName = m_ImageLibrary[i].name;
m_PrefabList[i] = pref;
for (int i = 0; i < m_PrefabList.Count; i++)
{
var pref = m_PrefabList[i];
pref.prefabName = m_ImageLibrary[i].name;
m_PrefabList[i] = pref;
}
}
else
{
m_PrefabList = new List<NamedPrefab>();
for (int i = 0; i < m_ImageLibrary.count; i++)
else
NamedPrefab pref = new NamedPrefab(m_ImageLibrary[i].name, null);
m_PrefabList.Add(pref);
for (int i = 0; i < m_ImageLibrary.count; i++)
{
var pref = new NamedPrefab(m_ImageLibrary[i].name, null);
m_PrefabList.Add(pref);
}
GameObject prefab;
if (m_PrefabsDictionary.TryGetValue(trackedImage.referenceImage.name, out prefab)){
if (m_PrefabsDictionary.TryGetValue(trackedImage.referenceImage.name, out GameObject prefab)){
Instantiate(prefab, trackedImage.transform);
}
}

}
foreach (var trackedImage in eventArgs.updated)
{
}
}

EditorGUI.BeginChangeCheck();
EditorGUI.PropertyField(position, property);
{
Debug.Log($"Library field changed");
}
{
Debug.Log("Library changed (items added or removed)");
}
// Update current
m_ReferenceImages.Clear();

正在加载...
取消
保存