找回密码
 注册帐号

扫一扫,访问微社区

assetimporter 资源导入器

2015-1-1 04:11| 发布者: 杨炎| 查看: 1761| 评论: 0|原作者: 蛮牛|来自: unity3d脚本manual

摘要: assetimporter 资源导入器inherits fromobjectbase class from which asset importers for specific asset types derive.作为特殊资源类型派生的资源导入器的基类。note: this is an editor class. to use it you ha ...

assetimporter 资源导入

inherits fromobject

base class from which asset importers for specific asset types derive.

作为特殊资源类型派生的资源导入器的基类。

note: this is an editor class. to use it you have to place your script in assets/editor inside your project folder. editor classes are in the unityeditor namespace so for c# scripts you need to add "using unityeditor;" at the beginning of the script.

注意:这是一个编辑器类,如果想使用它你需要把它放到工程目录下的assets/editor文件夹下。编辑器类在unityeditor命名空间下。所以当使用c#脚本时,你需要在脚本前面加上 "using unityeditor"引用。

variables变量

assetpath

the path name of the asset for this importer (read only)

用于这个导入器,资源的路径名(只读)。

class functions类函数

getatpath

retrieves the asset importer for the asset at path.

为所在路径的资源,导入器重新获取资源。

inherited members继承成员

inherited variables继承变量

name

the name of the object. //物体的名字

hideflags

should the object be hidden, saved with the scene or modifiable by the user?

物体是否被隐藏、保存在场景中或被用户修改?

inherited functions继承函数

getinstanceid

returns the instance id of the object.

返回物体的实例id

tostring

returns the name of the game object.

返回游戏物体的名称。

inherited class functions继承类函数

destroy

removes a gameobject, component or asset.

删除一个游戏物体、组件或资源

destroyimmediate

destroys the object obj immediately. it is strongly recommended to use destroy instead.

立即销毁物体obj,强烈建议使用destroy代替。

dontdestroyonload

makes the object target not be destroyed automatically when loading a new scene.

加载新场景的时候使目标物体不被自动销毁。

findobjectoftype

returns the first active loaded object of type type.

返回type类型第一个激活的加载的物体。

findobjectsoftype

returns a list of all active loaded objects of type type.

返回type类型的所有激活的加载的物体列表

instantiate

clones the object original and returns the clone.

克隆原始物体,并返回克隆的物体

相关阅读

文章点评
相关文章