本文整理汇总了C#中UnityEngine.Object.GetPreviewInfo方法的典型用法代码示例。如果您正苦于以下问题:C# Object.GetPreviewInfo方法的具体用法?C# Object.GetPreviewInfo怎么用?C# Object.GetPreviewInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Object
的用法示例。
在下文中一共展示了Object.GetPreviewInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetPreview
private void SetPreview( string pGUID = null, string pPath = null, Object pAsset = null )
{
Resolve( ref pGUID, ref pPath, ref pAsset );
string newTitle = pAsset.name + " (" + pAsset.GetType().ToString().Replace("UnityEngine.", "") + ")";
#if UNITY_5 && !UNITY_5_0
titleContent = new GUIContent(newTitle);
#else
title = newTitle;
#endif
_asset = pAsset;
_noPreview = false;
_hasAlpha = false;
_info = "";
if( pAsset == null )
return;
if( _asset is Texture2D )
{
_tex = (Texture2D)_asset;
_hasAlpha = true;
if( _anchoredToRight )
position = new Rect( position.x, position.y, position.width + 200, position.height );
else
position = new Rect( position.x - 200, position.y, position.width + 200, position.height );
}
else
_tex = Common.GetAssetPreview( _asset );
_info += _asset.GetPreviewInfo();// +"\n" + _asset.GetType().ToString();
_timeStart = EditorApplication.timeSinceStartup;
_window.Repaint();
if( EditorWindow.mouseOverWindow != null )
EditorWindow.mouseOverWindow.Focus();
}