BaseEditor
using UnityEngine;
using System.Collections.Generic;
using UnityEditor;
using System.Text;
using System.IO;
using System;
namespace Daemo
{
public class BaseEditor : Editor
{
/// <summary>
/// 切割路径
/// </summary>
protected static string SplitPath(string path, string s)
{
string[] ss = path.Split('/');
string result = "";
bool flat = false;
for (int i = 0; i < ss.Length; i++)
{
if (flat)
{
result = result + "/" + ss[i];
}
if (!flat && ss[i] == s)
{
flat = true;
}
}
return result;
}
#region 遍历文件夹
//遍历文件夹
public static void HandlelDirections(string path, Action<string> action)
{
HandleLocalFiles(path, action);
string[] childrenPaths = Directory.GetDirectories(path);
foreach (string childPath in childrenPaths)
{
HandlelDirections(childPath, action);
}
}
public static void HandleLocalFiles(string path, Action<string> action)
{
string[] files = Directory.GetFiles(path);
for (int i = 0; i < files.Length; i++)
{
string file = files[i];
file = file.Replace(@"\",@"/");
action(file);
}
}
#endregion
#region 遍历子节点
public static void CycleChild(Transform t, Action<Transform> action)
{
action(t);
for (int i = 0; i < t.childCount; i++)
{
if (t.childCount > 0)
CycleChild(t.GetChild(i), action);
}
}
#endregion
}
}
BaseEditor的更多相关文章
- Spring源码学习(6)——容器的功能扩展
之前的随笔中借BeanFactory介绍了bean的解析和加载的完整过程,实际上,除了BeanFactory,spring还提供了一种功能更加强大的容器:ApplicationContext Appl ...
- Python3.7和数据库MySQL交互(二)SQLyog安装教程
首先安装MySQL数据库,初学者建议选择图形化客户端. Toad for MySQL.MySQL-Front.Navicat for MySQL.SQLyog. 官方下载链接: Toad for My ...
- EDCheckPrefabRef
using UnityEngine;using System.Collections;using UnityEditor;using UnityEngine.UI;using System.Refle ...
- ApplicationContext(四)BeanFactory 功能扩展
ApplicationContext(四)BeanFactory 功能扩展 上节我们提到容器刷新的第二步初始化 BeanFactory 工厂并解析配制文件,但此时 BeanFactory 的功能还很简 ...
- Spring 系列教程之容器的功能
Spring 系列教程之容器的功能 经过前面几章的分析,相信大家已经对 Spring 中的容器功能有了简单的了解,在前面的章节中我们一直以 BeanFacotry 接口以及它的默认实现类 XmlBea ...
- Spring源码分析(二十二)功能扩展
摘要: 本文结合<Spring源码深度解析>来分析Spring 5.0.6版本的源代码.若有描述错误之处,欢迎指正. 目录 一.增加SPEL语言的支持 二.增加属性注册编辑器 1. 使用自 ...
- handsontable-developer guide-cell editor
单元格编辑 cell editor renderer:展示数据:editor:改变数据:renderer用一个函数表示:后者有一系列的操作,需要用class来表示: EditorManager han ...
- [转]50 Tips for Working with Unity (Best Practices)
About these tips These tips are not all applicable to every project. They are based on my experience ...
- UE3代码阅读需知
转自:http://www.cnblogs.com/hmxp8/archive/2012/02/21/2361211.html 掌握一款庞大的引擎,要一下子掌握真的很难,慢慢地从Editor,Scri ...
随机推荐
- 前端 html css
HTML 一个完整的网页是由html(超文本标记语言),css(层叠样式表)JavaScript(动态脚本语言)三部分组成 一.html 概念:超文本标记语言,“超文本”就是指页面内可以包含图片.链接 ...
- HDU 1879 继续畅通工程(最小生成树)
省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可).现得到城镇道路统计表,表中列出了任意两城镇间修建道路的费用,以及该道路是否已经 ...
- 前端框架VUE----nodejs中npm的使用
NPM是什么? 简单的说,npm就是JavaScript的包管理工具.类似Java语法中的maven,gradle,python中的pip. 安装 傻瓜式的安装. 第一步:打开https://node ...
- oracle之存储过程和存储函数的使用和区别
#存储过程:封装在服务器上一段sql片段,已经编译好了的代码. 1.客户端调存储过程,执行效率就会非常高效. 语法: create [or replace] procedure 存储过程名称 (参数名 ...
- Hbuilder安装
---恢复内容开始--- ---恢复内容结束---
- css overflow和float
float:使元素向左或向右移动(不能上下移动),直到它的外边缘碰到包含框或另一个浮动框的边框为止,浮动元素之前的元素将不会受到影响,之后的元素将围绕它. float之后的元素脱离文档流. 默认为no ...
- P2564 [SCOI2009]生日礼物(尺取法)
P2564 [SCOI2009]生日礼物 三个字.尺取法......... 坐标按x轴排序. 蓝后尺取一下.......... #include<iostream> #include< ...
- nvgre
GRE RFC2784 工作原理 Structure of a GRE Encapsulated Packet A GRE encapsulated packet has the form: ---- ...
- [c/c++] programming之路(5)、吓人小程序、变量、进制等
一.设计一个吓人的东西 首先创建MFC项目(勾选“基于对话框”后点击完成即可) 添加三个按钮 双击按钮进入响应代码段 void CMFCWindowsDlg::OnBnClickedButton1() ...
- Codeforces 833A The Meaningless Game - 数论 - 牛顿迭代法 - 二分法
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting. T ...