AssetImporter 资源导入器

 

Inherits from Object

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继承类函数

 

operator bool
Does the object exist?
物体是否存在?

 

Instantiate
Clones the object original and returns the clone.
克隆原始物体,并返回克隆的物体

 

Instantiate.<T>
 

 

Destroy
Removes a gameobject, component or asset.
删除一个游戏物体、组件或资源

 

DestroyImmediate
Destroys the object obj immediately. It is strongly recommended to use Destroy instead.
立即销毁物体obj,强烈建议使用Destroy代替。

 

FindObjectsOfType
Returns a list of all active loaded objects of Type type.
返回Type类型的所有激活的加载的物体列表

 

FindObjectOfType
Returns the first active loaded object of Type type.
返回Type类型第一个激活的加载的物体。

 

operator ==
Compares if two objects refer to the same
比较如果两个物体相同

 

operator !=
Compares if two objects refer to a different object
比较如果两个物体不同

 

DontDestroyOnLoad
Makes the object target not be destroyed automatically when loading a new scene.
加载新场景的时候使目标物体不被自动销毁。

 

AssetImporter.assetPath 资源路径

var assetPath : string

Description描述

The path name of the asset for this importer (Read Only)

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

AssetImporter.GetAtPath 获取路径资源

static function GetAtPath (path : string) : AssetImporter

Description描述

Retrieves the asset importer for the asset at path.

通过资源路径 ,导入器重新获取资源。

简单的说,通过指定路径来导入资源。

 

转载于:https://www.cnblogs.com/cyct/p/10705016.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值