csharp 每个实例的ScriptableObject实例的自定义图标;来自https://www.reddit.com/r/Unity3D/comments/3yq4we/custom_icon_

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp 每个实例的ScriptableObject实例的自定义图标;来自https://www.reddit.com/r/Unity3D/comments/3yq4we/custom_icon_相关的知识,希望对你有一定的参考价值。

using UnityEngine;
using UnityEditor;
using System.Collections;
using UnityEditor.Callbacks;

public class GizmoIconUtility 
{
    [DidReloadScripts]
    static GizmoIconUtility()
    {
        EditorApplication.projectWindowItemOnGUI = ItemOnGUI;
    }

    static void ItemOnGUI(string guid, Rect rect)
    {
        string assetPath = AssetDatabase.GUIDToAssetPath(guid);

        MyScriptableObject obj = AssetDatabase.LoadAssetAtPath(assetPath, typeof(MyScriptableObject)) as MyScriptableObject;

        if (obj != null)
        {
            rect.width = rect.height;

            if (obj._Id == 1)
            {
                GUI.DrawTexture( rect, (Texture2D) AssetDatabase.LoadAssetAtPath( "Assets/Gizmos/MyScriptableObject_id-1.png", typeof( Texture2D ) ) );
            }
            else if (obj._Id == 2)
            {
                GUI.DrawTexture( rect, (Texture2D) AssetDatabase.LoadAssetAtPath( "Assets/Gizmos/MyScriptableObject_id-2.png", typeof( Texture2D ) ) );
            }
        }
    }
}

以上是关于csharp 每个实例的ScriptableObject实例的自定义图标;来自https://www.reddit.com/r/Unity3D/comments/3yq4we/custom_icon_的主要内容,如果未能解决你的问题,请参考以下文章

csharp 实例-CSHARP-GroupDocs.Conversion.Examples.CSharp变频-ConvertTopresentationAsPath.cs

csharp 实例-CSHARP-GroupDocs.Conversion.Examples.CSharp变频-ConvertTopresentationAsPath.cs

csharp 实例-CSHARP-GroupDocs.Conversion.Examples.CSharp变频-ConvertTopresentationAsPath.cs

csharp 实例-CSHARP-GroupDocs.Conversion.Examples.CSharp变频-ConvertWithCustomOutputDataHandler.cs

csharp 实例-CSHARP-GroupDocs.Conversion.Examples.CSharp变频-ConvertToPresentationWithoutCommentsAsPath.c

csharp 获取BPM中运行BO的当前实例