[英]In Unity, can I expose C# *Properties* in the Inspector Window?
[英]How to add image or logo in Unity C# script to show on Inspector Window?
我正在嘗試在我自己的腳本中添加圖像/徽標,如下例所示。 在 Google 和 Unity 論壇中搜索了很多,但沒有直接找到我。 我想在我的腳本中添加我自己的圖像/徽標,以便它顯示在檢查器窗口中我的腳本頂部。 請參閱下面用紅色標記標記的示例。
這是我的示例代碼:
using UnityEngine;
using System.Collections;
public class MyScript : MonoBehaviour {
public int speed = 20;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
您可以使用DrawPreviewTexture並為其提供您的徽標。 您可以從資源加載您的紋理。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.