效果图: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; [CustomEditor(typeof(test))] public class Edit_test : Editor { test test_scripts; //脚本本体 SerializedObject serObj;//用来获取各脚本变量 SerializedProperty int
原文:[Unity]贝塞尔曲线关于点.长度.切线计算在 Unity中的C#实现 写在前面 最近给项目做了个路径编辑,基本思路是满足几个基本需求: [额外说明]其实本篇和这个没关系,可以跳过"写在前面"这部分,跨到正文部分 编辑时: ① 随意增减.插入.删除路点,只要路点数量大于1,绘制曲线,曲线必定经过路点. ② 调整路点的Forward方向,控制曲线的入线切线方向.出线切线方向.这样可以通过旋转直接调整曲线形状. ③ 控制Forward方向的基础上,增添描述切线"强度&qu
需求 为Unity的Editor窗口添加右键菜单 实现代码 // This example shows how to create a context menu inside a custom EditorWindow. class MyGenericMenu extends EditorWindow { @MenuItem("Game/Open Window") static function Init () { var window = GetWindow (MyGenericMe
1.首先定义一个需要控制数值的类,类中定义若干个变量 using UnityEngine;using System.Collections; using UnityEngine; using System.Collections; // This is not an editor script. public class MyPlayer : MonoBehaviour { public int Jump; void Update () { // Update logic here... } }
在unity写了一个编辑类,基于iTweenpath插件,为了更方便的操作iTweenpath,顺便练习UnityEditor的操作,写了一个CreateiTweenPath,放在Editor文件夹中. using UnityEngine; using System.Collections; using System.Collections.Generic; using UnityEditor; public class CreateiTweenPath :EditorWindow { [Men
http://www.cnblogs.com/zhaoqingqing/p/3812368.html 1.Apply to Prefab [把改动应用到Prefab] if (GUILayout.Button("Apply Collider To Prefab")) { PrefabUtility.ReplacePrefab(simActor.Preview, PrefabUtility.GetPrefabParent(simActor.Preview), ReplacePrefabO
在我们做项目的过程中 经常会有预设中出现空的脚本 例如: 导致的原因是因为 脚本的丢失 现在我们来做一个检查工程中有空脚本的预设工具 老规矩直接上代码 放到工程就能用 using UnityEngine; using UnityEditor; using System.IO; using System.Collections.Generic; public class PrefabTool : EditorWindow { [MenuItem("Prefab Tool/Check Missing