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的更多相关文章

  1. Spring源码学习(6)——容器的功能扩展

    之前的随笔中借BeanFactory介绍了bean的解析和加载的完整过程,实际上,除了BeanFactory,spring还提供了一种功能更加强大的容器:ApplicationContext Appl ...

  2. Python3.7和数据库MySQL交互(二)SQLyog安装教程

    首先安装MySQL数据库,初学者建议选择图形化客户端. Toad for MySQL.MySQL-Front.Navicat for MySQL.SQLyog. 官方下载链接: Toad for My ...

  3. EDCheckPrefabRef

    using UnityEngine;using System.Collections;using UnityEditor;using UnityEngine.UI;using System.Refle ...

  4. ApplicationContext(四)BeanFactory 功能扩展

    ApplicationContext(四)BeanFactory 功能扩展 上节我们提到容器刷新的第二步初始化 BeanFactory 工厂并解析配制文件,但此时 BeanFactory 的功能还很简 ...

  5. Spring 系列教程之容器的功能

    Spring 系列教程之容器的功能 经过前面几章的分析,相信大家已经对 Spring 中的容器功能有了简单的了解,在前面的章节中我们一直以 BeanFacotry 接口以及它的默认实现类 XmlBea ...

  6. Spring源码分析(二十二)功能扩展

    摘要: 本文结合<Spring源码深度解析>来分析Spring 5.0.6版本的源代码.若有描述错误之处,欢迎指正. 目录 一.增加SPEL语言的支持 二.增加属性注册编辑器 1. 使用自 ...

  7. handsontable-developer guide-cell editor

    单元格编辑 cell editor renderer:展示数据:editor:改变数据:renderer用一个函数表示:后者有一系列的操作,需要用class来表示: EditorManager han ...

  8. [转]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 ...

  9. UE3代码阅读需知

    转自:http://www.cnblogs.com/hmxp8/archive/2012/02/21/2361211.html 掌握一款庞大的引擎,要一下子掌握真的很难,慢慢地从Editor,Scri ...

随机推荐

  1. Intellij IDEA将java源码打成jar包

  2. Eclipse导入MyEclipse创建的WEB项目无法识别的解决方案

    Eclipse导入MyEclipse创建的WEB项目无法识别的解决方案

  3. python的shutil模块-文件的移动、复制、打包、压缩、解压等

    参考https://www.cnblogs.com/xiangsikai/p/7787101.html os模块提供了对目录或者文件的新建.删除.查看文件属性,还提供了对文件以及目录的路径操作,比如说 ...

  4. Ubuntu mysql数据库导入sql文件

    在阿里云Ubuntu系统导入sql数据库文件 首先linux 下查看mysql相关目录 root@ubuntu14:~# whereis mysql mysql:  /usr/bin/mysql--- ...

  5. 18位身份证验证(Java)加入身份证输入验证是否满足18位代码(修订稿)

    package day20181016; /** * 身份证的验证 34052419800101001X * */ import java.util.Scanner; public class Zuo ...

  6. Python3.6.2在线安装pymysql模块

    我是一个python新手刚才使用python写邮件发送代码的时候想着需要连接数据库, 下面的安装步骤 python -m pip install pymysql PS C:\Users\hp> ...

  7. windows2012R2标准版升级到数据中心版,不用重装系统

    windows2012R2标准版升级到数据中心版,不用重装系统 Windows Server 2012 R2是微软的服务器系统,是 Windows Server 2012 的升级版本. Windows ...

  8. centOS 安装 Webmin

    http://www.webmin.com/rpm.html 修改配置文件在这里: /etc/webmin/miniserv.conf

  9. Java排序算法之选择排序

    一.算法原理 简单选择排序的基本思想:给定数组:int[] arr={里面n个数据}:第1趟排序,在待排序数据arr[1]~arr[n-1]中选出最小的数据,将它与arrr[0]交换:第2趟,在待排序 ...

  10. CentOS6.8下安装mysql

    转自https://blog.csdn.net/jeffleo/article/details/53559712?utm_source=itdadao&utm_medium=referral ...