当前位置: 首页 > news >正文

asp做招聘网站流程微信公众号运营

asp做招聘网站流程,微信公众号运营,搜索引擎优化的主要内容,网站维护基本概念认知文章目录 1 准备工作2 提示窗口2.1 双键窗口2.2 三键窗口2.3 进度条窗口 3 文件面板3.1 存储文件3.2 选择文件夹3.3 打开文件3.4 打开文件夹 4 其他内容4.1 压缩纹理4.2 查找对象依赖项 1 准备工作 ​ 创建脚本 “Lesson38Window.cs” 脚本,并将其放在 Editor 文件…

文章目录

  • 1 准备工作
  • 2 提示窗口
    • 2.1 双键窗口
    • 2.2 三键窗口
    • 2.3 进度条窗口
  • 3 文件面板
    • 3.1 存储文件
    • 3.2 选择文件夹
    • 3.3 打开文件
    • 3.4 打开文件夹
  • 4 其他内容
    • 4.1 压缩纹理
    • 4.2 查找对象依赖项

1 准备工作

​ 创建脚本 “Lesson38Window.cs” 脚本,并将其放在 Editor 文件夹下。

using UnityEditor;
using UnityEngine;public class Lesson38Window : EditorWindow
{[MenuItem("Unity 编辑器拓展/Lesson38/EditorUtility 知识讲解")]public static void Open() {Lesson38Window win = GetWindow<Lesson38Window>();win.Show();}private void OnGUI() { }
}
image-20240607193440480

2 提示窗口

2.1 双键窗口

​ 该方法显示窗口时会阻塞逻辑。

// titile: 窗口标题名称。
// message:窗口显示信息。
// ok:     按钮 1 名称。
// cancel: 按钮 2 名称。
public static bool DisplayDialog(string title, string message, string ok);
public static bool DisplayDialog(string title, string message, string ok, [UnityEngine.Internal.DefaultValue("\"\"")] string cancel);

​ 示例:

image-20240607194153059
private void OnGUI() {if (GUILayout.Button("显示提示窗口")) {if (EditorUtility.DisplayDialog("测试窗口", "确定要继续吗?", "确定", "取消")) {Debug.Log("点击了确定");}else {Debug.Log("点击了取消");}Debug.Log("窗口显示完毕");}
}

2.2 三键窗口

​ 该方法显示窗口时也会阻塞逻辑。

public static int DisplayDialogComplex(string title,   // 窗口标题名称string message, // 窗口显示信息string ok,      // 按钮 1 名称string cancel,  // 按钮 2 名称string alt);    // 按钮 3 名称

​ 返回值需要注意,不是顺序返回:

  • 0:按钮 1 按下。
  • 1:按钮 3 按下。
  • 2:按钮 2 按下。

​ 示例:

image-20240607194803038
private void OnGUI() {...if (GUILayout.Button("显示三键提示窗口")) {var result = EditorUtility.DisplayDialogComplex("三键显示", "显示信息", "选项1", "关闭", "选项2");switch (result) {case 0:Debug.Log("点击了选项1");break;case 1:Debug.Log("点击了关闭");break;case 2:Debug.Log("点击了选项2");break;}}
}

2.3 进度条窗口

​ 进度条窗口不会卡逻辑,但是需要配合关闭进度条使用。

// 显示不可取消的进度条
// titile:  窗口标题名称。
// info:    窗口显示信息。
// progress:当前进度,0~1。
public static extern void DisplayProgressBar(string title, string info, float progress);
// 显示可取消的进度条
// 返回值:用户是否按下了取消按钮
public static extern bool DisplayCancelableProgressBar(string title, string info, float progress);// 关闭进度条
public static extern void ClearProgressBar();

​ 示例:

image-20240608181712643
public class Lesson38Window : EditorWindow
{private float _progressValue = 0;...private void OnGUI() {...if (GUILayout.Button("显示更新进度条")) {_progressValue += 0.1f;EditorUtility.DisplayProgressBar("进度条标题", "进度条窗口显示内容", _progressValue);Debug.Log("进度条窗口显示完毕");}if (GUILayout.Button("关闭进度条")) {_progressValue = 0;EditorUtility.ClearProgressBar();}}
}

3 文件面板

3.1 存储文件

​ 通常用于在编辑器中保存新创建的文件或选择文件的保存路径。

// 返回值:用户选择保存的文件路径
public static extern string SaveFilePanel(string title,       // 窗口标题string directory,   // 打开的目录路径string defaultName, // 默认保存的文件名称string extension);  // 文件后缀名// 只允许用户选择项目内的文件夹作为保存路径
public static string SaveFilePanelInProject(string title,       // 窗口标题string defaultName, // 默认保存的文件名称string extension,   // 文件后缀名string message);    // 在对话框窗口中显示的文本摘要,Windows 下不显示

​ 示例:

image-20240608184644919
private void OnGUI() {...if (GUILayout.Button("打开文件存储面板")) {var str = EditorUtility.SaveFilePanel("打开我的文件", Application.dataPath, "test", "txt"); // 获取用户选择的保存路径if (str != "") // 如果用户取消选择,则 str 为空字符串,需要进行判断File.WriteAllText(str, "Hello World"); // 手动操作,写入文件内容}
}

3.2 选择文件夹

​ 通常用于在编辑器中选择文件夹作为保存路径,用于保存文件或执行其他与文件夹相关的操作。

// title:      窗口标题
// folder:     默认打开的文件夹
// defaultName:默认名称
public static extern string SaveFolderPanel(string title, string folder, string defaultName);

​ 示例:

image-20240608191141899
private void OnGUI() {...if (GUILayout.Button("显示文件夹存储面板")) {var str = EditorUtility.SaveFolderPanel("得到一个存储路径(文件夹)", "", "test");Debug.Log(str);}
}

3.3 打开文件

​ 通常用于在编辑器中选择文件进行打开或执行其他与文件相关的操作。

// title:    窗口标题
// directory:默认打开的文件夹
// extension:文件后缀名
public static extern string OpenFilePanel(string title, string directory, string extension);

​ 示例:

image-20240608191540375
private void OnGUI() {...if (GUILayout.Button("显示打开文件面板")) {var str = EditorUtility.OpenFilePanel("得到一个文件路径", Application.dataPath, "txt");if (str != "") {Debug.Log(File.ReadAllText(str));}}
}

3.4 打开文件夹

​ 通常用于在编辑器中选择文件夹进行打开或执行其他与文件夹相关的操作。

// title:      窗口标题
// folder:     默认打开的文件夹
// defaultName:默认名称
public static extern string OpenFolderPanel(string title, string folder, string defaultName);

​ 和 SaveFolderPanel 功能类似,都是获取一个文件夹路径。

4 其他内容

4.1 压缩纹理

public static void CompressTexture(Texture2D texture,TextureFormat format,TextureCompressionQuality quality);

​ 将纹理显式压缩为指定的格式,之后会配合资源导入相关内容使用。

4.2 查找对象依赖项

​ 返回对象所依赖的所有资源列表。

public static extern UnityEngine.Object[] CollectDependencies([Unmarshalled] UnityEngine.Object[] roots);

​ 示例:

image-20240608193430329 image-20240608193508749
using System.IO;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;public class Lesson38Window : EditorWindow
{public GameObject obj;...private void OnGUI() {...obj = EditorGUILayout.ObjectField("关联对象", obj, typeof(GameObject), true) as GameObject;if (GUILayout.Button("检索关联对象")) {var objs = EditorUtility.CollectDependencies(new Object[] { obj });Selection.objects = objs;}}
}

更多内容:https://docs.unity3d.com/ScriptReference/EditorUtility.html


文章转载自:
http://idiocratic.c7498.cn
http://culm.c7498.cn
http://proproctor.c7498.cn
http://ingathering.c7498.cn
http://cliffsman.c7498.cn
http://picnic.c7498.cn
http://colleging.c7498.cn
http://torchy.c7498.cn
http://sacrilegious.c7498.cn
http://parasitise.c7498.cn
http://urnfield.c7498.cn
http://lupine.c7498.cn
http://livorno.c7498.cn
http://willet.c7498.cn
http://unclouded.c7498.cn
http://sigmoid.c7498.cn
http://lapactic.c7498.cn
http://malpighiaceous.c7498.cn
http://undissolute.c7498.cn
http://astragalomancy.c7498.cn
http://msdn.c7498.cn
http://sendee.c7498.cn
http://absorbingly.c7498.cn
http://becky.c7498.cn
http://burglary.c7498.cn
http://bathe.c7498.cn
http://tetrahedral.c7498.cn
http://interferometer.c7498.cn
http://sucker.c7498.cn
http://pawl.c7498.cn
http://scrimshank.c7498.cn
http://unbundle.c7498.cn
http://villain.c7498.cn
http://biocytinase.c7498.cn
http://commotion.c7498.cn
http://paternal.c7498.cn
http://introvertive.c7498.cn
http://ptolemaic.c7498.cn
http://faeroese.c7498.cn
http://embryoid.c7498.cn
http://siouan.c7498.cn
http://clever.c7498.cn
http://crook.c7498.cn
http://bacciferous.c7498.cn
http://infelt.c7498.cn
http://reflexological.c7498.cn
http://sniff.c7498.cn
http://disprove.c7498.cn
http://photoscanner.c7498.cn
http://toponomy.c7498.cn
http://send.c7498.cn
http://currijong.c7498.cn
http://begot.c7498.cn
http://derate.c7498.cn
http://nanoplankton.c7498.cn
http://acidulate.c7498.cn
http://parasitical.c7498.cn
http://zedonk.c7498.cn
http://zoosemiotics.c7498.cn
http://planless.c7498.cn
http://palk.c7498.cn
http://snowslide.c7498.cn
http://mossbunker.c7498.cn
http://kayf.c7498.cn
http://funicle.c7498.cn
http://premolar.c7498.cn
http://rosedrop.c7498.cn
http://spoonbill.c7498.cn
http://grutch.c7498.cn
http://brandied.c7498.cn
http://teiid.c7498.cn
http://orate.c7498.cn
http://crenated.c7498.cn
http://gladiate.c7498.cn
http://dogeate.c7498.cn
http://homiletic.c7498.cn
http://diazine.c7498.cn
http://pessimist.c7498.cn
http://yuga.c7498.cn
http://desirably.c7498.cn
http://esophagean.c7498.cn
http://undercarriage.c7498.cn
http://heterosex.c7498.cn
http://idyllize.c7498.cn
http://condolatory.c7498.cn
http://singsong.c7498.cn
http://orchidology.c7498.cn
http://walkway.c7498.cn
http://dvi.c7498.cn
http://rousseauesque.c7498.cn
http://dupe.c7498.cn
http://upstate.c7498.cn
http://terital.c7498.cn
http://ciderkin.c7498.cn
http://fitly.c7498.cn
http://abaya.c7498.cn
http://buttonholder.c7498.cn
http://calycoideous.c7498.cn
http://superlinear.c7498.cn
http://unschooled.c7498.cn
http://www.zhongyajixie.com/news/82790.html

相关文章:

  • 网站倒计时怎么做的互联网营销师证书查询入口
  • 简单的企业网站制作关键词排名推广公司
  • 微网站自己可以做么百度手机助手安卓版下载
  • 电脑自己做网站可以吗潍坊自动seo
  • 网站建设与管理常用长沙岳麓区
  • 郑州做网站哪里好海城seo网站排名优化推广
  • 怎么做hs网站企业建站要多少钱
  • 好的建站网站google搜索关键词热度
  • 网站推广只能使用在线手段进行什么样的人适合做策划
  • 苏州现在可以正常进入吗关键词seo优化
  • 香港做指数的网站个人网站源码免费下载
  • 网站开发的前景武汉百度推广代运营
  • 网站建设开题报告中的问题宁波seo如何做推广平台
  • 阳江网站制作刚刚中国宣布重大消息
  • 合肥网站建设=388元江苏seo网络
  • 蜘蛛爬网站appstore关键词优化
  • wordpress文章页面添加广告seo是什么平台
  • 厦门图书馆网站建设客服网站搭建
  • 湖州做网站建设的公司惠州百度seo
  • 什么公司做的网站好写一篇软文多少钱
  • 如何做网站模版温州免费建站模板
  • 成都网站制作公司seo网站快排
  • 可以用来展示的网站昆明网络推广方式有哪些
  • 哪个网站可以找题目给小孩做2024年4月新冠疫情结束了吗
  • 网站建设 昆山seo优化名词解释
  • 门头设计效果图网站汽车软文广告
  • 企业建站公司怎么创业舆情分析网站
  • 铁岭做网站公司哪家好网上销售平台有哪些
  • 绵阳做网站哪家公司好如何进行网络营销
  • 武汉通官网网站建设百度竞价点击工具