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.

通過資源路徑 ,導入器重新獲取資源。

簡單的說,通過指定路徑來導入資源。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM