using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Text; public class BuildTool
{
[MenuItem("BuildTool/BuildCloth/BuildSelect")]
static void LgsTest()
{
string defaultPath = getDefaultPath();
string buildPath = EditorUtility.SaveFolderPanel("Build Select Cloth", defaultPath, ""); if (buildPath.Length > )
{
saveDefaultPath(buildPath);
}
} static void saveDefaultPath(string defaultPath)
{
string configPath = System.Environment.CurrentDirectory + "/path.init";
using (FileStream fs = new FileStream(configPath, FileMode.Create))
{
using (StreamWriter sw = new StreamWriter(fs, Encoding.UTF8))
{
sw.Write(defaultPath);
}
}
} static string getDefaultPath()
{
// System.Environment.CurrentDirectory : 在Unity中指工程的跟目录,即与Assets目录是平级的。
string configPath = System.Environment.CurrentDirectory + "/path.init";
string result = string.Empty;
if (File.Exists(configPath))
{
using (FileStream fs = new FileStream(configPath, FileMode.Open))
{
using (StreamReader sr = new StreamReader(fs, Encoding.UTF8))
{
result = sr.ReadToEnd();
}
}
}
else
{
//Application.dataPath 指Assets目录
result = Application.dataPath;
} return result;
}
}

Unity打包的时候保存默认的输出路径,再次使用该路径的时候读取之的更多相关文章

  1. UNITY 打包安卓APK

    1,安装JDK.这个直接下就行了. 2,安装android sdk相关.这个比较蛋疼,官网是被墙的.有些网站的包还是需要访问墙外下载的.关键是找对那个能用的包(对我来说就是不FQ). http://p ...

  2. 关于如何在 Unity 的 UI 菜单中默认创建出的控件 Raycast Target 属性默认为 false

    关于如何在 Unity 的 UI 菜单中默认创建出的控件 Raycast Target 属性默认为 false 我们在 Unity 中通过 UI 菜单创建的各种控件,比如 Text, Image 等, ...

  3. Unity日常记录-本地保存未来时间实现倒计时

    本地保存未来时间实现倒计时 TimeTool工具类:获取当前时间.未来时间.两时间差 using System; using UnityEngine; public class TimeTool { ...

  4. 实力封装:Unity打包AssetBundle(大结局)

    →→前情提要:让用户选择要打包的文件←← 大结局:更多选择 Unity打包AssetBundle从入门到放弃系列终于要迎来大结局了[小哥哥表示实在写不动了o(╥﹏╥)o]... 经过上一次的教程,其实 ...

  5. unity 打包资源及网络请求资源包

    第一步 导包 在Assets新建一个Editor目录 新建一个Test类 using UnityEngine; using System.Collections; using UnityEditor; ...

  6. linux下保存下位机输出的串口信息为文件

    linux下保存下位机输出的串口信息为文件 1.stty -F /dev/ttyUSB0 raw (转换成raw模式) 2.stty -F /dev/ttyUSB0 speed 115200 (设置波 ...

  7. unity 打包apk安装失败

    Unity 打包Apk安装失败,错误提示:安卓未完成. 解决方案:检查BundleID是否一致

  8. TP框架模板中默认值输出

    TP框架模板中默认值输出 我们可以给变量输出提供默认值,例如: {$user.nickname|default="这家伙很懒,什么也没留下"} 对系统变量依然可以支持默认值输出,例 ...

  9. SDK,JDk,Unity打包安卓apk

    SDK:软件开发工具包(缩写:SDK.外语全称:Software Development Kit)一般都是一些软件工程师为特定的软件包.软件框架.硬件平台.操作系统等建立应用软件时的开发工具的集合. ...

随机推荐

  1. LeetCode-MinimumDepthOfBinaryTree

    题目: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the ...

  2. A7架构

    以Cortex-A7 MPCore processor来进行说明,这是一款主打低功耗的多核处理器,采用ARMv7-A架构,最多支持4个core. 每个core都有L1级的Cache,分为instruc ...

  3. Asp.net Mvc5的认识

    前言:以前总说自己玩mvc,但是对mvc的认识还是不够透彻,也没有好好看微软自带的mvc项目中的精妙,最近闲了下来,好好看了看. 通过上图,我们可以清晰地了解到MVC 5应用程序的项目结构,接下来我们 ...

  4. byte、二进制、十进制数值之间的转换

    项目中遇到将字节数据文件解析成可展示的十进制,经过调查和测试得出下面的转换方法 1.将byte值转换为二进制字符串: byte byteValue = -1; // 将byte转换为8位二进制字符串 ...

  5. 数据仓库基础(七)Informatica PowerCenter介绍

    本文转载自:http://www.cnblogs.com/evencao/p/3140938.html  Infromatica PowerCenter介绍: 1993年在美国加利福尼亚州成立,一年后 ...

  6. python2.7运行selenium webdriver api报错Unable to find a matching set of capabilities

    在火狐浏览器33版本,python2.7运行selenium webdriver api报错:SessionNotCreatedException: Message: Unable to find a ...

  7. Win10安装MySQL5.7.22 解压缩版(手动配置)方法

    1.下载地址:https://dev.mysql.com/downloads/mysql/5.7.html#downloads 直接点击下载项 下载后: 2.可以把解压的内容随便放到一个目录,我的是如 ...

  8. TED #09# You don't have to be an expert to solve big problems

    Tapiwa Chiwewe: You don't have to be an expert to solve big problems Collection noticed a haze hangi ...

  9. mysql 触发器 trigger用法 two (稍微复杂的)

    触发器(trigger):监视某种情况,并触发某种操作. 触发器创建语法四要素:1.监视地点(table) 2.监视事件(insert/update/delete) 3.触发时间(after/befo ...

  10. Python Web学习笔记之多线程编程

    本次给大家介绍Python的多线程编程,标题如下: Python多线程简介 Python多线程之threading模块 Python多线程之Lock线程锁 Python多线程之Python的GIL锁 ...