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 ...
随机推荐
- jenkins3
Jenkins是基于java开发的. GitHub Git (熟练使用) Doocker (了解) Jenkins (熟练使用) Django (熟练使用) Angularjs (了解) Sentry ...
- Autel MaxiSYS PRO MS908P Diagnostic System with Wireless VCI J-2534
You’re a professional mechanic, an enthusiast or and mechanic shop owner? Then you are here on the r ...
- nvidia-docker
参考资料 https://github.com/NVIDIA/nvidia-docker/wiki/Installation#prerequisites https://github.com/NVID ...
- maven编译项目报错,提示找不到符号或程序包XXX不存在
我的原因是maven依赖的jar包都下载了,但是引用的同一个项目下其他模块jar包找不到 解决方法: 把需要的jar包在pom里添加依赖 再次运行项目,Maven Dependencies下就会多了几 ...
- Java中五种遍历HashMap的方式
import java.util.HashMap; import java.util.Iterator; import java.util.Map; public class Java8Templat ...
- golang Format string by key.
example: $ go get github.com/hoisie/mustache package main import ( "github.com/hoisie/mustache& ...
- ajax返回数据
在使用远程js验证检测账户是否存在时,直在发请求后返回值无效,怎样把值返回回来呢重点注意两点 第一点:type不能省略,不能是异步,async: false 第二点:不能在直接请求成功后返回 var ...
- Eclipse中已安装的插件如何卸载
最近在Eclipse中安装了一个插件,导致Eclipse使用的时候有些问题,就找了资料,原来Eclipse中的插件也是可以卸载的. 方法是点击菜单“Help”,“Install New Softwar ...
- (12网络化部署深化下)自己动手,编写神经网络程序,解决Mnist问题,并网络化部署
网络化部署一直是我非常想做的,现在已经基本看到了门路.今天早上实验,发现在手机上的支持也非常好(对于相机的支持还差一点),证明B/S结构的框架是非常有生命力的.下一步就是要将这个过程深化.总结,并且封 ...
- 20145208 蔡野 《网络对抗》Exp6 信息搜集与漏洞扫描
20145208 蔡野 <网络对抗>Exp6 信息搜集与漏洞扫描 本实践的目标是掌握信息搜集的最基础技能.具体有(1)各种搜索技巧的应用(2)DNS IP注册信息的查询 (3)基本的扫描技 ...