支持同步与异步两个加载接口,支持单对象的UnloadAsset,还有一个清理未被引用的资源的接口。这里UnloadAsset不能卸载GameObject和Component,而且是强制卸载,即使外部仍然在使用这个资源。UnloadUnusedAssets则是一个安全的接口,只清理那些不再被引用的资源,不过这个接口开销较大会引起卡顿。 public static T Load<T>(string pa...
Image 2. Component.GetComponentsInChildren(includeInactive) 上述函数会返回自身和它的所有子物体(包括直接子物体的子物体)的 Transform 组件,并且 includeInactive 必须要设为 true 才会包含禁用物体。 示例: void Start() { var go = GameObject.Find("/物体1"); GetAllChildren(go); } void GetAllChildren(...
支持同步与异步两个加载接口,支持单对象的UnloadAsset,还有一个清理未被引用的资源的接口。这里UnloadAsset不能卸载GameObject和Component,而且是强制卸载,即使外部仍然在使用这个资源。UnloadUnusedAssets则是一个安全的接口,只清理那些不再被引用的资源,不过这个接口开销较大会引起卡顿。 publicstaticTLoad<T>(stringpath)wher...
namespace UnityEngine { using System; using System.Collections.Generic; using System.Runtime.CompilerServices; using UnityEngine.Internal; using UnityEngineInternal; public class Component : UnityEngine.Object { [ExcludeFromDocs] public void BroadcastMessage(string methodName) { SendMessageOptions requireRe...
public voidSetActive(boolvalue); Parameters valueThe active state to set, wheretruesets the GameObject to active andfalsesets it to inactive. Description Activates or deactivates the GameObject locally, according to the value of the supplied parameter. ...
publicComponent AddComponent<XXX>() 获取对象组件 1.获取自身的组件publicComponent GetComponent<XXX>(boolincludeInactive)publicComponent[]GetComponents<XXX>(boolincludeInactive) 2.获取子节点组件publicComponent GetComponentInChildren<XXX>(boolincludeInactive)publicComponent[]GetComponenstInChildren<XXX>(boolinclude...
Text Component:文本组件,Input Field的文本显示输入组件 Text:Input Field的初始值。 Character Limit:字符数量限制,最大输入的字符数,0为不限制。 Content Type:内容类型,限定Input Field的输入内容类型,包括数字、密码等,常用的类型如下: Standard:标准类型,什么字符都能输入,只要是当前字体支持的。
MonoBehaviour is a component, and needs to be attached to a GameObject. UNT0011: ScriptableObject should only be created using CreateInstance(). ScriptableObject needs to be created by the Unity engine to handle Unity message methods. USP0001 for IDE0029: Unity objects shouldn't use null ...
includeInactive Should inactive Components be included in the found set? Description Returns all components of Type type in the GameObject or any of its children. using UnityEngine; using System.Collections; public class Example : MonoBehaviour { public Component[] hingeJoints; void Example() { hi...
Event functions are a set of built-in events that your MonoBehaviourscriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like.More info ...