一个简单的prefab上Image/Texture替换工具
using System;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
using Object = UnityEngine.Object;
public class ReplaceSprite : EditorWindow
{
[MenuItem("Assets/客户端/UI工具/查找引用图片替换")]
static void SearchRefrencePrefab()
{
ReplaceSprite window = (ReplaceSprite)EditorWindow.GetWindow(typeof(ReplaceSprite), false, "Searching", true);
window.Show();
}
private Object SearchObject;
private Sprite TargetObject;
private bool IsReplace=false;
bool showBtn =false;
private Vector2 scroPos;
// private static Object SearchPathPath = null;
private void OnGUI()
{
EditorGUILayout.BeginVertical();
EditorGUILayout.SelectableLabel("导出节点文本路径:"+m_savepath);
//this.Repaint();//实时刷新
EditorGUILayout.EndVertical();
EditorGUILayout.BeginHorizontal();
SearchObject = (Sprite)EditorGUILayout.ObjectField(SearchObject, typeof(Object), true, GUILayout.Width(200));
if (GUILayout.Button("Search", GUILayout.Width