浏览代码

Add null checks.

/1.5-preview
Tim Mowrer 6 年前
当前提交
baaf4667
共有 1 个文件被更改,包括 15 次插入10 次删除
  1. 25
      Assets/Scripts/UX/UIManager.cs

25
Assets/Scripts/UX/UIManager.cs


static List<ARPlane> s_Planes = new List<ARPlane>();
bool m_ShowingTapToPlace = false;
bool m_ShowingMoveDevice = true;
void OnEnable()

{
if (PlanesFound() && m_ShowingMoveDevice)
{
m_MoveDeviceAnimation.SetTrigger(k_FadeOffAnim);
m_TapToPlaceAnimation.SetTrigger(k_FadeOnAnim);
if (moveDeviceAnimation)
moveDeviceAnimation.SetTrigger(k_FadeOffAnim);
if (tapToPlaceAnimation)
tapToPlaceAnimation.SetTrigger(k_FadeOnAnim);
m_ShowingTapToPlace = true;
m_ShowingMoveDevice = false;
}

{
if (m_PlaneManager)
{
m_PlaneManager.GetAllPlanes(m_Planes);
return m_Planes.Count > 0;
}
return false;
if (planeManager == null)
return false;
planeManager.GetAllPlanes(s_Planes);
return s_Planes.Count > 0;
}
void PlacedObject()

m_TapToPlaceAnimation.SetTrigger(k_FadeOffAnim);
if (tapToPlaceAnimation)
tapToPlaceAnimation.SetTrigger(k_FadeOffAnim);
}
正在加载...
取消
保存