Tools 工具

Inherits from ScriptableObject

工具类,可以更好的自定义编辑器。

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"引用。

Class Variables类变量

  • viewTool
    Global getter for the singleton tool object
       为单件工具对象的全局获得者。
  • handlePosition
    The position of the tool handle in world space.
       在世界空间工具句柄的位置。
  • handleRotation
    The rotation of the tool handle in world space.
       在世界空间工具句柄的旋转。
  • visibleLayers
    Which layers are visible in the scene view.
       场景中的视图中那层可见。

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

  • CreateInstance
    Creates an instance of a scriptable object with className.
          创建一个名为className的脚本化对象的一个实例。
  • CreateInstance.<T>
    Creates an instance of a scriptable object with T.
          创建一个带有T参数脚本化对象的实例。
  • 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.
        克隆原始物体,并返回克隆的物体

Inherited Messages Sent继承发送消息

  • OnEnable
    Creates an instance of a scriptable object with T.
          创建一脚本化对象T的一个实例。
  • OnDisable
    This function is called when the scriptable object goes out of scope
          当脚本化对象超出范围时调用这个函数。
  • OnDestroy
    This function is called when the scriptable object will be destroyed.
           当脚本化对象将被销毁,这个函数被调用。
,