c#代码:
using System.Collections;
using System.IO;
public class FileIO
{
public static bool WriteStringToFile(string filePath, string data, bool append)
{
try
{
StreamWriter sw = new StreamWriter(filePath, append);
sw.Write(data);
sw.Close();
return true;
}
catch (System.Exception err)
{
return false;
}
}
// Reads each line of a text file to a separate string which is stored
// in an ArrayList and returned.
public static ArrayList ReadFileToStrings(string filePath)
{
ArrayList list = new ArrayList();
string line;
// Read a file
try
{
StreamReader sr = new StreamReader(filePath);
line = sr.ReadLine();
if (line != null)
list.Add(string.Copy(line));
while (line != null)
{
line = sr.ReadLine();
if (line != null)
list.Add(string.Copy(line));
}
sr.Close();
return list;
}
catch (System.Exception err)
{
return list;
}
}
}
js代码:
import System.IO;
static function WriteStringToFile (filePath : String, data : String, append : boolean) : boolean {
try {
var sw = new StreamWriter(filePath, append);
sw.Write(data);
sw.Close();
return true;
}
catch (err) {
return false;
}
}
// Reads each line of a text file to a separate string which is stored
// in an array and returned.
function ReadFileToStrings (filePath : String) : Array {
var list = new Array();
// Read a file
try {
var sr = new StreamReader(filePath);
var line = sr.ReadLine();
while (line != null) {
list.Add(line);
line = sr.ReadLine();
}
sr.Close();
return list;
}
catch (err) {
return list;
}
}
引用位置:
http://forum.unity3d.com/viewtopic.php?t=15196&postdays=0&postorder=asc&start=0
分享到:
相关推荐
u3d文件格式转换
U3D中文界面翻译
最新U3D中文教程--最新U3D中文教程--最新U3D中文教程--
U3D 实现信息传递 机制 简单的实例 高效的
U3d程序读取excel功能
U3D圣典中文脚本,学习用,可以下载看看如何,自己感觉初学者还行
U3d 狮鹫坐骑 动物 模型,用来做暂代资源非常实用
U3D汉化语言包,,最新更新的,,学习unity的好工具,,安装方法已包含,,按说明操作.
里边有U3D从入门到精通PDF高清版,还有百度网盘分享的资源链接地址,欢迎大家下载学习
unity3d的基础学习资源,从零开始学习u3d技术
这不是大家想找的资源,这是给我的一个帖子用的。当然可以使用u3d自带编译器打开。这是给wpf 嵌入u3d的例子贴用http://bbs.csdn.net/topics/391853486?page=1#post-400536434
U3d菜单操作中英文对照表,将unity3d的菜单操作有中文的对照。
最适合初入u3d门径的人学习了解。 第一讲 Unity基础 第二讲 Unity地形基础 第三讲 Unity脚本入门 第四讲 Unity物理引擎和粒子系统 第五讲 Unity GUI 第六讲 Unity脚本概览 第七讲 Unity运行时类
U3D自带刷地形 直接转OBJ模型,MAX MAYA 通用 U3D自带刷地形 直接转OBJ模型,MAX MAYA 通用
入门教程u3d
本来想发另外一部分的,太大了 不让上传!
U3D单机RPG
横向移动的跑酷游戏项目,包括代码,并且游戏可以在任何安装了u3d的平台中导入
UINTY3D的中文版帮助手册,包括UNITY3D 5版本的帮助手车。
U3D导入地形