コード例 #1
0
 /// <summary>
 /// 查看模型
 /// </summary>
 /// <param name="prefab"></param>
 private void viewPrefab(GameObject prefab)
 {
     if (prefab != null)
     {
         Selection.activeGameObject = prefab;
         previewSystem.SetPreview(prefab);
         EditorGUIUtility.PingObject(prefab);
     }
 }
コード例 #2
0
        /// <summary>
        /// 查看模型
        /// </summary>
        /// <param name="prefab"></param>
        private void viewPrefabInfo(PrefabVO vo, bool selectedIt = true)
        {
            if (vo == null)
            {
                return;
            }
            string     path   = vo.prefabPath;
            GameObject prefab = AssetDatabase.LoadAssetAtPath <GameObject>(path);

            if (prefab == null)
            {
                return;
            }
            previewSystem.SetPreview(prefab);
            if (selectedIt)
            {
                Selection.activeGameObject = prefab;
                EditorGUIUtility.PingObject(prefab);
            }
        }