首页 > 其他分享 >unity Editor

unity Editor

时间:2023-08-03 09:00:12浏览次数:38  
标签:ProcedureBase name unity Editor using stepBase target

using System.Collections; using System.Collections.Generic; using UnityEditor; using UnityEngine; using WT_LZY;
[CustomEditor(typeof(ProcedureBase))] [CanEditMultipleObjects] public class ProcedureBaseEditor : Editor {     SerializedProperty mProcedureBase;     //private SerializedObject obj;     void OnEnable()     {         mProcedureBase = serializedObject.FindProperty("ProcedureBase");     }         public override void OnInspectorGUI()     {         base.OnInspectorGUI();         serializedObject.Update();                 EditorGUI.BeginChangeCheck();         ProcedureBase pobj=target as ProcedureBase;                 if (GUILayout.Button("更新stepID"))         {             StepBase[] stepBases= pobj.GetComponentsInChildren<StepBase>();             foreach (StepBase _stepBase in stepBases)             {                 _stepBase.StepId = _stepBase.transform.GetSiblingIndex();                 string[] strs= _stepBase.gameObject.name.Split('.');                 _stepBase.gameObject.name= _stepBase.StepId.ToString() + "." + strs[1];             }             Debug.Log("It's alive: " + target.name);         }         if(EditorGUI.EndChangeCheck() && !EditorUtility.IsDirty(target))             EditorUtility.SetDirty(target);               } }       1.特点:   1.针对某个类型inspector 面板Gui 扩展

标签:ProcedureBase,name,unity,Editor,using,stepBase,target
From: https://www.cnblogs.com/AllXzp/p/17602352.html

相关文章

  • 使用快捷键在Unity中快速锁定和解锁Inspector右上角的锁功能
    使用快捷键在Unity中快速锁定和解锁Inspector右上角的锁功能在Unity中,Inspector窗口是一个非常重要的工具,它允许我们查看和编辑选定对象的属性。有时候,我们可能希望锁定Inspector窗口,以防止意外更改对象的属性。幸运的是,Unity提供了一种快捷键的方式来快速锁定和解锁Inspector窗口......
  • Unity第三方插件: OdinInspector简单介绍
    首先,OdinInspector需要在AssetStore付费购买,有的时候打折包也会包含1.Attribute排版更加美观和易于管理,且使用非常方便,只需要加Attribute就能显示在Inspector,并且官方提供了非常多的Attribute,想要使用的时候直接在Unity中查看使用就可以,也提供了代码 ......
  • Unity的IPostprocessBuildWithReport:深入解析与实用案例
    UnityIPostprocessBuildWithReportUnityIPostprocessBuildWithReport是Unity引擎中的一个非常有用的功能,它可以让开发者在构建项目后自动执行一些操作,并且可以获取构建报告。这个功能可以帮助开发提高工作效率,减少手动操作的时间和错误率。在本文中,我们将介绍UnityIPostproces......
  • 用Unity DOTS制作4万飞剑的太极剑阵!
    【USparkle专栏】如果你深怀绝技,爱“搞点研究”,乐于分享也博采众长,我们期待你的加入,让智慧的火花碰撞交织,让知识的传递生生不息!一、演示效果由于DOTS相关Package不同版本变动很大,许多老的教程也已经过时,给想要探索的小伙伴制造了不少麻烦。所以我便尝试用DOTS制作了这样一个由......
  • Unity的IPreprocessBuildWithReport:深入解析与实用案例
    UnityIPreprocessBuildWithReportUnityIPreprocessBuildWithReport是Unity引擎中的一个非常有用的功能,它可以让开发者在构建项目时自动执行一些操作,并且可以获取构建报告。这个功能可以帮助开发者提高工作效率,减少手动操作的时间和错误率。在本文中,我们将介绍UnityIPreprocess......
  • eWebEditor 从word中复制内容带多张图片
    ​ 当前功能基于PHP,其它语言流程大致相同 1.新增上传wordjson配置在ueditor\php\config.json中新增如下配置:     /* 上传word配置 */    "wordActionName":"wordupload",/* 执行上传视频的action名称 */    "wordFieldName":"upfile",/* 提交的......
  • Unity 将UnityWebRequest改为async/await异步
    花了一点时间,对UnityWebRequest进行了简单封装,使用起来更方便一些,顺便实现了post接口轮询、重试的功能usingSystem;usingSystem.Collections;usingSystem.Collections.Generic;usingSystem.Runtime.CompilerServices;usingSystem.Text;usingSystem.Threading.Tasks;......
  • UEditor上传图片word
    ​图片的复制无非有两种方法,一种是图片直接上传到服务器,另外一种转换成二进制流的base64码目前限chrome浏览器使用首先以um-editor的二进制流保存为例:打开umeditor.js,找到UM.plugins['autoupload'],然后找到autoUploadHandler方法,注释掉其中的代码。加入下面的代码://判断剪贴......
  • UMEditor上传图片word
    ​ 这种方法是servlet,编写好在web.xml里配置servlet-class和servlet-mapping即可使用后台(服务端)java服务代码:(上传至ROOT/lqxcPics文件夹下)<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%><%@     page contentType="text/html;cha......
  • Unity的BuildPlayerProcessor:深入解析与实用案例
    UnityBuildPlayerProcessorUnityBuildPlayerProcessor是Unity引擎中的一个非常有用的功能,它可以让开发者在构建项目时自动执行一些操作。这个功能可以帮助开发者提高工作效率,减少手动操作的时间和错误率。在本文中,我们将介绍UnityBuildPlayerProcessor的使用方法,并提供三个使......