Unity3D游戏开发之AssetImporter资源导入器.docx
上传人:qw****27 上传时间:2024-09-11 格式:DOCX 页数:3 大小:16KB 金币:15 举报 版权申诉
预览加载中,请您耐心等待几秒...

Unity3D游戏开发之AssetImporter资源导入器.docx

Unity3D游戏开发之AssetImporter资源导入器.docx

预览

在线预览结束,喜欢就下载吧,查找使用更方便

15 金币

下载此文档

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

Unity3D游戏开发之AssetImporter资源导入器AssetImporter资源导入器InheritsfromObjectBaseclassfromwhichassetimportersforspecificassettypesderive.作为特殊资源类型派生的资源导入器的基类。Note:Thisisaneditorclass.TouseityouhavetoplaceyourscriptinAssets/Editorinsideyourprojectfolder.EditorclassesareintheUnityEditornamespacesoforC#scriptsyouneedtoadd“usingUnityEditor;”atthebeginningofthescript.注意:这是一个编辑器类,如果想使用它你需要把它放到工程目录下的Assets/Editor文件夹下。编辑器类在UnityEditor命名空间下。所以当使用C#脚本时,你需要在脚本前面加上“usingUnityEditor”引用。文章出处HYPERLINK"http://www.gopedu.com/"【狗刨学习网】Variables变量assetPathThepathnameoftheassetforthisimporter(ReadOnly)用于这个导入器,资源的路径名(只读)。ClassFunctions类函数GetAtPathRetrievestheassetimporterfortheassetatpath.为所在路径的资源,导入器重新获取资源。Inheritedmembers继承成员InheritedVariables继承变量nameThenameoftheobject.//物体的名字hideFlagsShouldtheobjectbehidden,savedwiththesceneormodifiablebytheuser?物体是否被隐藏、保存在场景中或被用户修改?InheritedFunctions继承函数GetInstanceIDReturnstheinstanceidoftheobject.返回物体的实例IDToStringReturnsthenameofthegameobject.返回游戏物体的名称。InheritedClassFunctions继承类函数operatorboolDoestheobjectexist?物体是否存在?InstantiateClonestheobjectoriginalandreturnstheclone.克隆原始物体,并返回克隆的物体Instantiate.<T>DestroyRemovesagameobject,componentorasset.删除一个游戏物体、组件或资源DestroyImmediateDestroystheobjectobjimmediately.ItisstronglyrecommendedtouseDestroyinstead.立即销毁物体obj,强烈建议使用Destroy代替。FindObjectsOfTypeReturnsalistofallactiveloadedobjectsofTypetype.返回Type类型的所有激活的加载的物体列表FindObjectOfTypeReturnsthefirstactiveloadedobjectofTypetype.返回Type类型第一个激活的加载的物体。operator==Comparesiftwoobjectsrefertothesame比较如果两个物体相同operator!=Comparesiftwoobjectsrefertoadifferentobject比较如果两个物体不同DontDestroyOnLoadMakestheobjecttargetnotbedestroyedautomaticallywhenloadinganewscene.加载新场景的时候使目标物体不被自动销毁。AssetImporter.assetPath资源路径varassetPath:stringDescription描述Thepathnameoftheassetforthisimporter(ReadOnly)用于这个导入器,资源的路径名(只读)。AssetImporter.GetAtPath获取路径资源staticfunctionGetAtPath(path:string):AssetImporterDescription描述Retrievestheassetimporterfortheassetatpath.通过资源路径,导入器重新获取资