void AyncLoadObject() { if (enabled == false) { return; } NcTickTimerTool tickTimer = new NcTickTimerTool(); for (int n = 0; n < m_nObjectCount; n++) { if (m_ObjectNodes[n].m_Object == null) { m_ObjectNodes[n].m_Object = GetObjectNodeTexture(n); m_ObjectContents[n].image = NgAsset.GetMiniThumbnail(m_ObjectNodes[n].m_Object); m_ObjectContents[n].tooltip = FXMakerTooltip.Tooltip(GetTextureInfo(m_ObjectContents[n].image, true)); m_ObjectContents[n].tooltip += FXMakerTooltip.AddPopupPreview(m_ObjectContents[n].image); m_nNotLoadCount--; // return; if (200 < tickTimer.GetStartedTickCount()) { return; } } } }
void BuildContents() { if (enabled == false) { return; } m_nNotLoadCount = 0; for (int n = 0; n < m_nObjectCount; n++) { if (m_ObjectContents[n] == null) { m_ObjectContents[n] = new GUIContent(); m_ObjectContents[n].text = NgFile.GetFilename(m_ObjectNodes[n].m_AssetPath); } if (m_ObjectNodes[n].m_Object == null) { m_nNotLoadCount++; } else { m_ObjectContents[n].image = NgAsset.GetMiniThumbnail(m_ObjectNodes[n].m_Object); m_ObjectContents[n].tooltip = FXMakerTooltip.Tooltip(GetTextureInfo(m_ObjectContents[n].image, true)); m_ObjectContents[n].tooltip += FXMakerTooltip.AddPopupPreview(m_ObjectContents[n].image); } } }
void AyncLoadObject() { if (enabled == false) return; NcTickTimerTool tickTimer = new NcTickTimerTool(); for (int n=0; n < m_nObjectCount; n++) { if (m_ObjectNodes[n].m_Object == null || m_ObjectContents[n].image == null) { if (m_ObjectNodes[n].m_Object == null) { m_ObjectNodes[n].m_Object = GetObjectNodePrefab(n); } if (m_ObjectContents[n].image == null) m_ObjectContents[n].image = FXMakerMain.inst.GetPrefabThumbTexture(GetObjectNodePrefab(n)); if (m_ObjectContents[n].image != null) { string subDir = AssetDatabase.GetAssetPath(GetObjectNodePrefab(n)); subDir = NgFile.PathSeparatorNormalize(subDir).Replace(m_LoadDirectory, ""); m_ObjectContents[n].tooltip = FXMakerTooltip.Tooltip(GetObjectInfo(GetObjectNodePrefab(n), subDir)); m_ObjectContents[n].tooltip += FXMakerTooltip.AddPopupPreview(m_ObjectContents[n].image); m_nNotLoadCount--; } if (300 < tickTimer.GetStartedTickCount()) return; } } }
void BuildNewShaderContents() { CancelInvoke("BuildNewShaderContents"); if (enabled == false) { return; } if (m_NewShaderMaterials == null || m_NewShaderMaterials.Length <= 0) { return; } int nNotLoadPreviewCount = 0; int nCount = 0; foreach (Material mat in m_NewShaderMaterials) { if (m_NewShaderMaterialContents[nCount] == null) { m_NewShaderMaterialContents[nCount] = new GUIContent(); m_NewShaderMaterialContents[nCount].text = mat.name; m_NewShaderMaterialContents[nCount].tooltip = FXMakerTooltip.Tooltip(mat.name + "\n" + (mat.shader != null ? mat.shader.name : "Not Selected")); } if (m_NewShaderMaterialContents[nCount].image == null) { m_NewShaderMaterialContents[nCount].image = NgAsset.GetAssetPreview(mat); if (m_NewShaderMaterialContents[nCount].image != null) { m_NewShaderMaterialContents[nCount].tooltip += FXMakerTooltip.AddPopupPreview(m_NewShaderMaterialContents[nCount].image); } } if (m_NewShaderMaterialContents[nCount].image == null) { nNotLoadPreviewCount++; } nCount++; } if (0 < nNotLoadPreviewCount) { Invoke("BuildNewShaderContents", FXMakerLayout.m_fReloadPreviewTime); } }
void BuildContents() { CancelInvoke("BuildContents"); if (enabled == false) { return; } int nNotLoadPreviewCount = 0; for (int n = 0; n < m_nObjectCount; n++) { if (m_ObjectContents[n] == null) { string subDir = AssetDatabase.GetAssetPath(m_CurveAniObjects[n]); subDir = NgFile.PathSeparatorNormalize(subDir).Replace(m_LoadDirectory, ""); m_ObjectContents[n] = new GUIContent(); m_ObjectContents[n].text = m_CurveAniObjects[n].name; m_ObjectContents[n].tooltip = FXMakerTooltip.Tooltip(m_CurveAniObjects[n].name + "\n" + subDir); } if (m_ObjectContents[n].image == null) { m_ObjectContents[n].image = FXMakerMain.inst.GetPrefabThumbTexture(m_CurveAniObjects[n]); if (m_ObjectContents[n].image != null) { m_ObjectContents[n].tooltip += FXMakerTooltip.AddPopupPreview(m_ObjectContents[n].image); } } if (m_ObjectContents[n].image == null) { nNotLoadPreviewCount++; } } if (0 < nNotLoadPreviewCount) { Invoke("BuildContents", FXMakerLayout.m_fReloadPreviewTime); } }