id
stringlengths
15
22
source
stringclasses
2 values
category
stringclasses
12 values
instruction
stringlengths
22
180
response
stringlengths
100
46.1k
system
stringclasses
5 values
local_sr_cc55343a1960
unity_docs
rendering
What is `Rendering.RayTracingMeshInstanceConfig.motionVectorMode` in Unity? Explain its purpose and usage.
RayTracingMeshInstanceConfig.motionVectorMode public MotionVectorGenerationMode motionVectorMode ; Description Motion vector mode. Unity configures the following built-in shader uniforms to calculate motion vectors in HLSL code: unity_MotionVectorsParams , unity_MatrixPreviousM and unity_MatrixPreviousMI ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cc1fc29443b4
unity_docs
scripting
Show me a Unity C# example demonstrating `MonoBehaviour.OnDrawGizmos`.
OnDrawGizmos or OnDrawGizmosSelected on the child GameObject’s component. OnDrawGizmos uses a mouse position that is relative to the Scene View. Note : If Auto-hide gizmos is enabled in the Scene View preferences , then OnDrawGizmos is not called on components that are collapsed in the Inspector. Use MonoBeha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5cda55a2cfcc
unity_docs
scripting
Show me a Unity C# example demonstrating `Camera.OnRenderObject`.
Camera.OnRenderObject() Description OnRenderObject is called after camera has rendered the Scene. This can be used to render your own objects using Graphics.DrawMeshNow or other functions. This function is similar to OnPostRender , except OnRenderObject is called on any object that has a script with the functio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1aa1d6e9231d
unity_docs
audio
What is `AudioCompressionFormat` in Unity? Explain its purpose and usage.
AudioCompressionFormat enumeration Description An enum containing different compression types. This enum is used within the AudioImporter to define what type of compression will be used for an imported AudioClip. Properties Property Description PCM Uncompressed pulse-code modulation. Vorbis Vorbis compression...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_0b641e1eaba0
unity_docs
rendering
In Unity's 'Web template variables', what is 'Internal preprocessor variables' and how does it work?
The following internal preprocessor variables refer to data in the Project, and Unity assigns value to them at build time according to the values the Editor supplies. JavaScript macros and conditional directives can use these internal preprocessor variables. Variable Type Description COMPANY_NAME String The Company Nam...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_26412b72ba4c
unity_docs
rendering
In Unity's 'Include sprites in text', what is 'Assign and use Unicode for a sprite' and how does it work?
You can assign a Unicode to a sprite and use the Unicode directly in your text object instead of the <sprite> tag. For example, the Unicode for a smiling face emoji is U+1F60A . To assign it to a sprite in your sprite asset: In the sprite asset’s Inspector window, find the glyph in the Sprite Character Table . You can ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_7fb18244dec7
unity_docs
physics
Explain 'Version Control' in Unity.
You can use Unity in conjunction with most common version control tools, including Unity Version Control and Perforce. This section gives details of the tools and options available and how to work with them. Topic Description Version control integration Integrate Unity with version control systems. PerForce Use the Per...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_eb812b24e571
unity_docs
editor
Show me a Unity C# example demonstrating `Handles.EndGUI`.
Handles.EndGUI Declaration public static void EndGUI (); Description End a 2D GUI block and get back to the 3D handle GUI. Additional resources: Handles.BeginGUI . GUI in the Scene View. ```csharp // Change the transform values for the selected object. // When selected this script starts and the handleExampl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_167e9f533c67
github
scripting
Write a Unity C# UI script for Text Component
```csharp using TMPro; using UnityEngine; namespace GI.UnityToolkit.Components.UI { [RequireComponent(typeof(TMP_Text))] public abstract class TextComponent : MonoBehaviour { protected TMP_Text Text { get; private set; } protected void Awake() { Text = GetComponent<TMP_...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_378f9539bbb9
unity_docs
animation
What is `ModelImporter.resampleCurves` in Unity? Explain its purpose and usage.
ModelImporter.resampleCurves public bool resampleCurves ; Description If set to false, the importer will not resample curves when possible. Read more about animation curve resampling . Notes: - Some unsupported FBX features (such as PreRotation or PostRotation on transforms) will override this setting. In these...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3ca5fc2462b2
unity_docs
networking
What is `Android.AndroidScreenLayoutSize` in Unity? Explain its purpose and usage.
AndroidScreenLayoutSize enumeration Description Options to indicate the size of the device screen. Additional resources: AndroidConfiguration.screenLayoutSize Properties Property Description Undefined Mirrors the Android property value SCREENLAYOUT_SIZE_UNDEFINED. Small Mirrors the Android property value SCR...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c327521ea050
unity_docs
ui
What is `UIElements.MultiColumnController.BindItem` in Unity? Explain its purpose and usage.
MultiColumnController.BindItem Declaration public void BindItem ( UIElements.VisualElement element , int index , T item ); Parameters Parameter Description element The element from that row, created by MakeItem(). index The item index. item The item to bind. Description Binds a row of multiple cell...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b65bb4d50964
unity_docs
rendering
What is `HandleUtility.DistanceToDisc` in Unity? Explain its purpose and usage.
HandleUtility.DistanceToDisc Declaration public static float DistanceToDisc ( Vector3 center , Vector3 normal , float radius ); Description Returns the distance in pixels from the mouse pointer to a 3D disc. Calculates the screen space distance from the mouse pointer to the disc (circle) at given world sp...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0d1f6ec87af4
unity_docs
math
Show me a Unity C# example demonstrating `Matrix4x4.transpose`.
Matrix4x4.transpose public Matrix4x4 transpose ; Description Returns the transpose of this matrix (Read Only). The transposed matrix is the one that has the Matrix4x4's columns exchanged with its rows. ```csharp using UnityEngine;public class ExampleScript : MonoBehaviour { // You construct a Matrix4x4 by p...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8f87944201b4
unity_docs
scripting
What is `Unity.Android.Gradle.Manifest.AttributeString` in Unity? Explain its purpose and usage.
AttributeString class in Unity.Android.Gradle.Manifest / Inherits from: Unity.Android.Gradle.Manifest.BaseAttribute Description An attribute that represents a string value. Public Methods Method Description Equals Determines if this string and specified string have the same values. EqualsTrue Determines i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4bddf46d77e9
unity_docs
networking
What is `Networking.MultipartFormDataSection.fileName` in Unity? Explain its purpose and usage.
MultipartFormDataSection.fileName public string fileName ; Returns string The desired file name of this section, or null if this is not a file section. Description Returns a string denoting the desired filename of this section on the destination server. Additional resources: IMultipartFormSection.fileN...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4c22570065a2
unity_docs
scripting
Show me a Unity C# example demonstrating `Search.QueryEngine_1.RemoveFilter`.
e<T0>.RemoveFilter Declaration public void RemoveFilter (string token ); Declaration public void RemoveFilter (Regex token ); Parameters Parameter Description token The identifier of the filter. Typically what precedes the operator in a filter (for example, "id" in "id>=2"). Description Removes a cust...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e8deaf67ac67
unity_docs
rendering
What are the parameters of `Camera.CopyFrom` in Unity?
Description Makes this camera's settings match other camera. This will copy all camera's variables (field of view, clear flags, culling mask, ...) from the other camera. It will also set this camera's transform to match the other camera, as well as this camera's layer to match the layer of the other camera. This can be...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d4a07766081b
unity_docs
rendering
Show me a Unity C# example demonstrating `Material.mainTexture`.
t using the [MainTexture] attribute, it is not visible in the Game view when you use the texture streaming debugging view mode or a custom debug tool. This is the same as calling Material.GetTexture or Material.SetTexture with the property name of the main texture as a parameter. Additional resources: SetTextu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6fada94cddc1
unity_docs
scripting
Give me an overview of the `PhysicsUpdateBehaviour2D` class in Unity.
PhysicsUpdateBehaviour2D class in UnityEngine / Inherits from: Behaviour / Implemented in: UnityEngine.Physics2DModule Description A base type for 2D physics components that required a callback during FixedUpdate. Inherited Members Properties Property Description enabled Enabled Behaviours are Updated, disa...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_28edc35b75c4
unity_docs
scripting
What is `ConstantForce` in Unity? Explain its purpose and usage.
ConstantForce class in UnityEngine / Inherits from: Behaviour / Implemented in: UnityEngine.PhysicsModule Description A force applied constantly. This is a small physics utility class used to apply a continous force to an object. Rigidbody.AddForce applies a force to the Rigidbody only for one frame, thus...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d93bc0b2ddfa
unity_docs
rendering
In Unity's 'Android Player settings', what is 'Resolution' and how does it work?
Use the Resolution section to customize the screen mode and default size. Property Description Run Without Focus Enable this property to keep your application running even when it’s not in focus but is visible, such as on devices supporting split-screen mode. When disabled, the application pauses but remains visible. F...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ca40ddd97650
unity_docs
scripting
What is `Playables.PlayableBehaviour.ProcessFrame` in Unity? Explain its purpose and usage.
PlayableBehaviour.ProcessFrame Declaration public void ProcessFrame ( Playables.Playable playable , Playables.FrameData info , object playerData ); Parameters Parameter Description playable The Playable that owns the current PlayableBehaviour. info A FrameData structure that contains information a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3c7071298f5f
unity_docs
ui
In Unity's 'Use Toggle to create a conditional UI', what is 'Example overview' and how does it work?
The example creates a custom Editor window with two toggles. You can use the toggles to do the following: Show or hide a label Activate or deactivate a button You can find the completed files that this example creates in this GitHub repository .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b6cd3c06e31a
unity_docs
physics
Give me an overview of the `ParticlePhysicsExtensions` class in Unity.
ParticlePhysicsExtensions class in UnityEngine / Implemented in: UnityEngine.ParticleSystemModule Description Method extension for Physics in Particle System. Static Methods Method Description GetCollisionEvents Get the particle collision events for a GameObject. Returns the number of events written to the a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_37e9695d6a96
unity_docs
scripting
What is `IMGUI.Controls.TreeView.EndRename` in Unity? Explain its purpose and usage.
TreeView.EndRename Declaration public void EndRename (); Description Ends renaming if the rename overlay is shown. If called while the rename overlay is not being shown, this method does nothing. Additional resources: BeginRename .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_161408a1e02f
unity_docs
xr
In Unity's 'Unity scripting symbol reference', what is 'Unity Editor version symbols' and how does it work?
Unity automatically defines certain scripting symbols based on the version of the Unity Editor that you’re currently using. Given a version number X.Y.Z (for example, 6000.0.33), Unity exposes three global scripting symbols in the following formats: UNITY_X , UNITY_X_Y and UNITY_X_Y_Z . Here is an example of scripting ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_794892ea7d1c
unity_docs
physics
Show me a Unity C# example demonstrating `Rigidbody.solverIterations`.
he solverIterations determines how accurately Rigidbody joints and collision contacts are resolved. Overrides Physics.defaultSolverIterations . Must be positive. If you are having trouble with connected Rigidbodies oscillating and behaving erratically setting a higher solver iteration count may improve their stabilit...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_bc72b4c7a3cc
unity_docs
rendering
Explain 'Leaf group reference' in Unity.
The leaf group generates leaves from a built-in geometry or an imported mesh . ## Using curves You can use curves to control some properties. For more information, refer to Editing curves . For many properties, the curve controls the details of the leaf’s shape along the length of the branch or trunk. The slider next...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_89796828f443
unity_docs
scripting
What is `UIElements.SortColumnDescriptions.IndexOf` in Unity? Explain its purpose and usage.
SortColumnDescriptions.IndexOf Declaration public int IndexOf ( UIElements.SortColumnDescription desc ); Parameters Parameter Description desc The description to locate in the <see cref="SortColumnDescriptions" />. Returns int The index of the SortColumnDescriptions if found in the collection; otherwi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_260c602cba29
unity_docs
scripting
What is `Experimental.Rendering.GraphicsFormat.R32G32_SFloat` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphicsFormat.R32G32_SFloat Description A two-component, 64-bit signed floating-point format that has a 32-bit R component in bytes 0..3, and a 32-bit G component in bytes 4..7.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_68b1be2fd290
unity_docs
rendering
What is `Texture2DArray.CopyPixels` in Unity? Explain its purpose and usage.
Texture2DArray.CopyPixels Declaration public void CopyPixels ( Texture src ); Declaration public void CopyPixels ( Texture src , int srcElement , int srcMip , int dstElement , int dstMip ); Declaration public void CopyPixels ( Texture src , int srcElement , int srcMip , int srcX , int srcY , i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6ed35e2cb881
unity_docs
scripting
Show me a Unity C# example demonstrating `Undo.RecordObject`.
operations are stored on the stack. Important: To correctly handle instances where objectToUndo is an instance of a Prefab, PrefabUtility.RecordPrefabInstancePropertyModifications must be called after RecordObject. This is an example of an editor script which allows you to change an effect radius variable. The Und...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_767d880241fe
unity_docs
scripting
Show me a Unity C# example demonstrating `SceneManagement.Scene.name`.
meObject added to scene2 . Click on the GameObject and go to the Inspector. In the My First Scene field and My Second Scene fields, enter the names of the Scenes you would like to switch between, scene1 and scene2 . Select scene1 by double-clicking it in the Project, and press Play . The scene1 scene...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bb06e0eeac90
unity_docs
scripting
What is `Search.SearchColumn.Enumerate` in Unity? Explain its purpose and usage.
SearchColumn.Enumerate Declaration public static List<SearchColumn> Enumerate ( Search.SearchContext context , IEnumerable<SearchItem> items ); Parameters Parameter Description context Search context. items Items for which to fetch a set of columns. Returns List<SearchColumn> Search columns. Descr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c72550ff8a42
unity_docs
math
What is `Mesh.SetIndexBufferData` in Unity? Explain its purpose and usage.
Mesh.SetIndexBufferData Declaration public void SetIndexBufferData (NativeArray<T> data , int dataStart , int meshBufferStart , int count , Rendering.MeshUpdateFlags flags ); Declaration public void SetIndexBufferData (T[] data , int dataStart , int meshBufferStart , int count , Rendering.MeshUpdate...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_464665e7963e
unity_docs
editor
In Unity's 'Assembly metadata and compilation details', what is 'Getting assembly information in build scripts' and how does it work?
Use the CompilationPipeline class to retrieve information about all assemblies built by Unity for a project, including those created based on Assembly Definition assets. For example, the following script uses the CompilationPipeline class to list all the current Player assemblies in a project: ```csharp using UnityEdit...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c5b0dd24c9b6
unity_docs
scripting
What is `BuildTargetGroup` in Unity? Explain its purpose and usage.
BuildTargetGroup enumeration Description Build target group. Additional resources: BuildPipeline.BuildPlayer , BuildTarget . Properties Property Description Unknown Unknown target. Standalone PC (Windows, Mac, Linux) target. iOS Apple iOS target. Android Android target. WebGL WebGL. WSA Windows Store Ap...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c2e0c77484e0
unity_docs
scripting
What is `Search.ParsedQuery_1.Apply` in Unity? Explain its purpose and usage.
ParsedQuery<T0>.Apply Declaration public IEnumerable<T> Apply (IEnumerable<T> data ); Parameters Parameter Description data The data to filter. Returns IEnumerable<T> A filtered IEnumerable. Description Applies the filtering on an IEnumerable data set. See QueryEngine for a complete example.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0ffd9e07da1c
unity_docs
rendering
What is `Texture.wrapMode` in Unity? Explain its purpose and usage.
Texture.wrapMode public TextureWrapMode wrapMode ; Description Texture coordinate wrapping mode. Using wrapMode sets the same wrapping mode on all axes. Different per-axis wrap modes can be set using wrapModeU , wrapModeV , wrapModeW . Querying the value returns the U axis wrap mode (same as wrapModeU ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_427d1bb75330
unity_docs
editor
Explain 'Web introduction' in Unity.
The Web option in the Unity Editor allows you to publish content as JavaScript programs which use HTML5/JavaScript, WebAssembly, WebGL rendering API, and other web standards to run Unity content in a web browser. For a guided tutorial of the Web platform, refer to Getting started with Unity Web . This section covers th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bdfd0514387c
unity_docs
rendering
Show me a Unity C# example demonstrating `QualitySettings.streamingMipmapsRenderersPerFrame`.
ttings window, under Textures > Mipmap Streaming . Note: Do not change streamingMipmapsRenderersPerFrame too frequently at runtime. You should allow enough time between changes for all the renderers to be processed. Updating this value more frequently will lead to unused mips remaining loaded. The following examp...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6b132b4153e5
unity_docs
scripting
What is `ChangeGameObjectOrComponentPropertiesEventArgs.scene` in Unity? Explain its purpose and usage.
ChangeGameObjectOrComponentPropertiesEventArgs.scene public SceneManagement.Scene scene ; Description The Scene that contains the GameObject associated with the change. If a Component is changed, this is the GameObject to which the component belongs.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d8924d174c39
unity_docs
editor
What is `EditorGUI.ChangeCheckScope.changed` in Unity? Explain its purpose and usage.
EditorGUI.ChangeCheckScope.changed public bool changed ; Description True if GUI.changed was set to true, otherwise false. Ends a change check started with ChangeCheckScope. Additional resources: EditorGUI.EndChangeCheck .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ef0bdf54092d
unity_docs
rendering
What is `Rendering.RenderPipelineAsset.defaultUIMaterial` in Unity? Explain its purpose and usage.
RenderPipelineAsset.defaultUIMaterial public Material defaultUIMaterial ; Returns Material Default material. Description Return the default UI Material for this pipeline. This is used whenever a UI object is created in the editor.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bf49ccf0f360
unity_docs
scripting
What is `AI.NavMeshQueryFilter.SetAreaCost` in Unity? Explain its purpose and usage.
NavMeshQueryFilter.SetAreaCost Declaration public void SetAreaCost (int areaIndex , float cost ); Parameters Parameter Description areaIndex The area index to set the cost for. cost The cost for the supplied area index. Description Sets the pathfinding cost multiplier for this filter for a given area ty...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7fa93e03841b
unity_docs
rendering
What is `Search.SearchUtils.GetSceneObjectPreview` in Unity? Explain its purpose and usage.
SearchUtils.GetSceneObjectPreview Declaration public static Texture2D GetSceneObjectPreview ( GameObject obj , Vector2 size , Search.FetchPreviewOptions options , Texture2D thumbnail ); Parameters Parameter Description obj Scene object instance. size Preview size. options Preview options. th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_0977ead27c3d
unity_docs
physics
In Unity's 'Scene visibility', what is 'Isolate selected GameObjects' and how does it work?
The Isolation view temporarily overrides the Scene visibility settings so that only the selected GameObjects are visible, and everything else is hidden. To enter the Isolation view: Press Shift + H . This isolates all selected GameObjects and their children. Isolating hidden GameObjects makes them visible until you exi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_02550c294182
unity_docs
editor
In Unity's 'Introduction to debugging Unity in Windows', what is 'Built-in debugging tools' and how does it work?
In Unity development, built-in debugging refers to the process of debugging unmanaged code, which is code written in low-level languages such as C, C++, or Assembly. This type of debugging is usually needed for Unity’s engine code, built-in plug-ins , or external libraries. On Windows, debugging tools use Program Datab...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_eb5a3b92e85b
unity_docs
rendering
What is `Rendering.RayTracingShader.SetInts` in Unity? Explain its purpose and usage.
RayTracingShader.SetInts Declaration public void SetInts (string name , params int[] values ); Declaration public void SetInts (int nameID , params int[] values ); Parameters Parameter Description name The name of the property being set. nameID The ID of the property as given by Shader.PropertyToID....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_430048057a9b
unity_docs
ui
Explain 'Reuse UXML files' in Unity.
You can create a UXML file as a template and reuse it in other UXML files. ## Import a UXML template When you design a large user interface, you can create template UXML files that define parts of the UI, and use the <Template> and <Instance> elements to import it into another UXML file. For example, if you have a po...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_468b73962794
unity_docs
editor
Show me a Unity C# example demonstrating `PlayerSettings.Android.runWithoutFocus`.
PlayerSettings.Android.runWithoutFocus public static bool runWithoutFocus ; Description Allows your application to continue to run even when it’s not in focus. When enabled, the application keeps running even when not in focus and remains visible on devices that support split-screen mode. When disabled, the ap...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1f1613769c06
unity_docs
ui
Show me a Unity C# example demonstrating `UIElements.InspectorElement.FillDefaultInspector`.
rameters Parameter Description container The parent VisualElement serializedObject The SerializedObject to inspect editor The editor currently used Description Adds default inspector property fields under a container VisualElement. The following example shows how to fill a container with default inspecto...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_625e0a48129e
unity_docs
rendering
Show me a Unity C# example demonstrating `ImageConversion.LoadImage`.
he default, and linear if the parameter was set to true .) Note: In previous versions of Unity, texture data from all PNG textures containing a gAMA block was returned in gamma 2.0 space. If you want to retain this old behavior, for example when working with older projects that dynamically load textures using LoadIma...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_320ff9d741ae
unity_docs
math
Show me a Unity C# example demonstrating `Mathf.Cos`.
an acceptable range for input angle values for this method, beyond which the calculation will fail. On windows, the acceptable range is approximately between -9223372036854775295 to 9223372036854775295. This range may differ on other platforms. For values outside of the acceptable range, the Cos method returns the inpu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a478e80717b5
unity_docs
rendering
What is `Graphics.RenderMesh` in Unity? Explain its purpose and usage.
Graphics.RenderMesh Declaration public static void RenderMesh (ref RenderParams rparams , Mesh mesh , int submeshIndex , Matrix4x4 objectToWorld , Nullable<Matrix4x4> prevObjectToWorld = null); Parameters Parameter Description rparams The parameters Unity uses to render the mesh. mesh The Mesh ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_62ba000843e2
unity_docs
rendering
Show me a Unity C# example demonstrating `Editor.HasPreviewGUI`.
ing on the target asset. The default implementation simply returns false, so if you override OnPreviewGUI you have to override this method as well. Note: Inspector previews are limited to the primary editor of persistent objects (assets), e.g., GameObjectInspector, MaterialEditor, TextureInspector. This means that i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_50a3fedc7764
github
scripting
Write a Unity Editor script for Tool Style
```csharp using UnityEditor; using UnityEngine; namespace CurvePickerTool { public class ToolStyle { public static bool drawLocation = false; // axis public static int AixsNumberX = 7; public static int AixsNumberY = 3; public static SkinnedColor axisTickColor = new S...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8be34bc9b7c7
unity_docs
editor
Show me a Unity C# example demonstrating `Profiling.FrameDataView.GetMarkerMetadataInfo`.
arameters Parameter Description markerId Marker identifier. Returns MarkerMetadataInfo[] Returns an array of metadata information structures. Description Gets Profiler marker metadata information for the specific marker identifier. Use to get name, unit type and value type for the metadata parameters which...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8c1a914d8f36
unity_docs
rendering
In Unity's 'Root node reference', what is 'Geometry' and how does it work?
Property Function LOD Quality Default level of detail (LOD) for the entire tree. Note that you can change the value for specific branch groups. The higher the LOD, the more complex the tree and the higher its performance impact. The Hierarchy Stats field in the Tree hierarchy view shows the mesh ’s complexity as a coun...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3055e61ac9d1
unity_docs
rendering
What is `SceneView.camera` in Unity? Explain its purpose and usage.
SceneView.camera public Camera camera ; Description The Camera that is rendering this SceneView . Note that the SceneView resets Camera properties prior to rendering. Changes made to this object will not be reflected in the Scene view.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d0c29eaa775c
unity_docs
rendering
What is `MaterialProperty.intValue` in Unity? Explain its purpose and usage.
MaterialProperty.intValue public int intValue ; Description Int value of the property. Setting a new value will apply it to all material targets , and will automatically record an undo operation. Additional resources: type , MaterialEditor .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3d7d803754ed
unity_docs
math
What is `Sprite.triangles` in Unity? Explain its purpose and usage.
Sprite.triangles public ushort[] triangles ; Description Returns a copy of the array containing Sprite mesh triangles. The array is a list of triangles that contains indices into the vertex array.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_23787dd7c292
unity_docs
math
What is `Vector3Int.Scale` in Unity? Explain its purpose and usage.
Vector3Int.Scale Declaration public static Vector3Int Scale ( Vector3Int a , Vector3Int b ); Description Multiplies two vectors component-wise. Every component in the result is a component of a multiplied by the same component of b . Declaration public void Scale ( Vector3Int scale ); Descripti...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4f61563da6d5
unity_docs
xr
Show me a Unity C# example demonstrating `Search.SearchService.GetAction`.
GetAction Declaration public static Search.SearchAction GetAction ( Search.SearchProvider provider , string actionId ); Parameters Parameter Description provider Search provider to look up. actionId Unique action ID within the search provider. Returns SearchAction The matching action. Descriptio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_56b482c110b8
unity_docs
scripting
What is `ILogger.IsLogTypeAllowed` in Unity? Explain its purpose and usage.
ILogger.IsLogTypeAllowed Declaration public bool IsLogTypeAllowed ( LogType logType ); Returns bool Retrun true in case logs of LogType will be logged otherwise returns false. Description Check logging is enabled based on the LogType. Additional resources: Logger.IsLogTypeAllowed .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6cfdda46aa38
unity_docs
ui
What is `UIElements.OverflowClipBox` in Unity? Explain its purpose and usage.
OverflowClipBox enumeration Description Boxes against which the VisualElement content is clipped. Properties Property Description PaddingBox Clip the content against the box outside the padding areas but inside the borders. ContentBox Clip the content against the box inside the padding areas.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_067c71962252
unity_docs
rendering
What is `TerrainTools.TerrainPaintUtility.GetBlitMaterial` in Unity? Explain its purpose and usage.
TerrainPaintUtility.GetBlitMaterial Declaration public static Material GetBlitMaterial (); Returns Material Built in "Hidden/BlitCopy" material. Description Returns the default material for blitting operations.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cfbd6b13c009
unity_docs
scripting
What is `Analytics.AnalyticsSettings.RequireInBuildDelegate` in Unity? Explain its purpose and usage.
AnalyticsSettings.RequireInBuildDelegate Declaration public delegate bool RequireInBuildDelegate (); Description Defines the delegate signature to handle AnalyticsSettings.RequireInBuildDelegate events.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3c8a36177691
unity_docs
xr
Show me a Unity C# example demonstrating `Mesh.vertexBufferTarget`.
Mesh.vertexBufferTarget public GraphicsBuffer.Target vertexBufferTarget ; Description The intended target usage of the Mesh GPU vertex buffer. By default, Mesh vertex buffers have GraphicsBuffer.Target.Vertex usage target. If you want to access the mesh vertex buffer from a compute shader, additional targe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bb6b80166dfb
unity_docs
rendering
What is `ParticleSystem.MinMaxGradient.gradient` in Unity? Explain its purpose and usage.
ParticleSystem.MinMaxGradient.gradient public Gradient gradient ; Description Set the gradient. Useful when ParticleSystem.MinMaxGradient.mode is set to ParticleSystemGradientMode.Gradient .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7e624eaa5ef4
unity_docs
scripting
What is `Rect.Overlaps` in Unity? Explain its purpose and usage.
Rect.Overlaps Declaration public bool Overlaps ( Rect other ); Declaration public bool Overlaps ( Rect other , bool allowInverse ); Parameters Parameter Description other Other rectangle to test overlapping with. allowInverse Does the test allow the widths and heights of the Rects to be negative? ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_30bcb5225563
unity_docs
math
Show me a Unity C# example demonstrating `Quaternion.Euler`.
ee floats to a Quaternion. Returns a rotation that rotates z degrees around the z-axis, x degrees around the x-axis, and y degrees around the y-axis. Rotations are applied in ZXY order. The output is represented as a Quaternion. The rotation direction is counter-clockwise when looking from the origin along the axis of...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_397df5a2408b
unity_docs
rendering
What is `Rendering.RayTracingGeometryInstanceConfig.material` in Unity? Explain its purpose and usage.
RayTracingGeometryInstanceConfig.material public Material material ; Description The Material the ray tracing instance uses. This value is optional. If you use ray tracing shaders and don't set a Material, the GPU doesn't execute any code when rays hit the geometry associated with this ray tracing instance.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_87c9cba92986
unity_docs
scripting
What is `Experimental.GraphView.EdgeDragHelper_1.ctor` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. EdgeDragHelper<T0> Constructor Declaration public EdgeDragHelper<T0> ( Experimental.GraphView.IEdgeConnectorListener listener ); Parameters Parameter Description listener The edge connector listener. Description EdgeDr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c514119717a2
unity_docs
rendering
What is `ModelImporter.secondaryUVMinLightmapResolution` in Unity? Explain its purpose and usage.
ModelImporter.secondaryUVMinLightmapResolution public float secondaryUVMinLightmapResolution ; Description The minimum lightmap resolution in texels per unit that the associated model is expected to have.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c4b6e8f93846
unity_docs
xr
What is `Android.PermissionCallbacks.PermissionDeniedAndDontAskAgain` in Unity? Explain its purpose and usage.
PermissionCallbacks.PermissionDeniedAndDontAskAgain Parameters Parameter Description value Permission name. Description Triggered when the user chooses Deny And Don't Ask Again for a permission request or denies the permission twice on newer Android versions, or the operating system determines that it should ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_fe27b8dbe2e1
unity_docs
editor
Explain 'Managed code stripping' in Unity.
During the build process, Unity removes unused or unreachable code through a process called managed code stripping, which can significantly decrease your application’s final size. Managed code stripping removes code from managed assemblies, including assemblies built from the C# scripts in your project, assemblies that...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4f02041953be
unity_docs
audio
Show me a Unity C# example demonstrating `Experimental.Audio.AudioSampleProvider.consumeSampleFramesNativeFunction`.
Pointer to the native function that provides access to audio sample frames. This function pointer can be passed to native plug-ins that need to consume sample frames while avoiding any overhead related to going from native to C# or garbage collection interference. Importing a native function that uses this type, for p...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e1f953448a3a
unity_docs
scripting
Show me a Unity C# example demonstrating `Handles.ScaleHandle`.
ser's interaction with the handle. If the user has not moved the handle, it will return the same value as you passed into the function. Description Make a Scene view scale handle. This will behave like the built-in scale tool Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-siz...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e98c67793b62
unity_docs
scripting
Explain 'Optimize rendering lots of objects' in Unity.
Speed up rendering lots of similar objects by optimizing draw calls, which reduces how often the CPU sends information to the GPU. Page Description Introduction to optimizing draw calls Understand why reducing draw calls improves rendering time. Choose a method for optimizing draw calls Compare the different methods fo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_93fa9354ac8b
unity_docs
math
What is `RectTransformUtility` in Unity? Explain its purpose and usage.
RectTransformUtility class in UnityEngine / Implemented in: UnityEngine.UIModule Description Utility class containing helper methods for working with RectTransform . Static Methods Method Description CalculateRelativeRectTransformBounds Creates a Bounds object that encapsulates all the child RectTransform o...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3cb5cf1380be
unity_docs
rendering
In Unity's 'Android permissions in Unity', what is 'Runtime permissions' and how does it work?
You can request runtime permissions at any time while the application is running. It’s best practice to request permission for restricted data or a device feature when the application requires the data/feature for the first time. You should also show the user a message that explains why the application requires the dat...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_945d3c4b4f0f
unity_docs
math
What is `Unity.Android.Gradle.Manifest.AttributeEnumArray_1` in Unity? Explain its purpose and usage.
AttributeEnumArray<T0> class in Unity.Android.Gradle.Manifest / Inherits from: Unity.Android.Gradle.Manifest.BaseAttribute Description An attribute that represents an Enum[] value. Public Methods Method Description Get Gets the value of the Enum[] attribute. Set Sets a new Enum[] value for the attribute. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4d254876075c
unity_docs
animation
What is `Animations.AnimationHumanStream.SolveIK` in Unity? Explain its purpose and usage.
AnimationHumanStream.SolveIK Declaration public void SolveIK (); Description Execute the IK solver. The humanoid IK solver is executed using the IK goal position, rotation, and weight currently set in the AnimationHumanStream . ```csharp using UnityEngine; using UnityEngine.Playables; using UnityEngine.Animat...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_7f15c09d91d3
unity_docs
physics
Explain 'Physics' in Unity.
Unity helps you simulate physics in your Project to ensure that the objects correctly accelerate and respond to collisions , gravity, and various other forces. Unity provides different physics engine implementations which you can use according to your Project needs: 3D, 2D, object-oriented, or data-oriented. This page ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_404ea3809f42_doc_6
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
The property returns a reference to IWorldContext which contains the entity that's linkedto the view Signature: ```csharp public IWorldContext WorldContext ```
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_man_ddef18ade73a
unity_docs
xr
Show me a Unity code example for 'Dynamic heap allocator example'.
## Example usage report An example usage report for the dynamic heap allocator is as follows: ``` [ALLOC_DEFAULT_MAIN] Peak usage frame count: [16.0 MB-32.0 MB]: 497 frames, [32.0 MB-64.0 MB]: 1 frames Requested Block Size 16.0 MB Peak Block count 2 Peak Allocated memory 54.2 MB Peak Large allocation bytes 40.2 MB ```...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_18595de613c0
unity_docs
scripting
In Unity's 'Change the layout of an overlay', what is 'Expand a collapsed overlay' and how does it work?
Overlays that aren’t toolbars, such as the Orientation overlay, collapse when they are docked to an edge of the Scene view and can’t be expanded. To expand an overlay, right-click the handle ( = ) of a collapsed overlay and select Expand .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b5ec70bc108e
unity_docs
rendering
Show me a Unity C# example demonstrating `Material.SetOverrideTag`.
rs (such as rendering DepthNormals) work even if the original shader only supports a certain render type. For example if a shader only supports a specific render type but renders in many ways using keywords, SetOverrideTag can be used fom a custom material inspector to ensure that the material renders correctly even if...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2e337cd7cfdd
unity_docs
ui
What is `IMGUI.Controls.TreeView.DoFoldoutCallback` in Unity? Explain its purpose and usage.
TreeView.DoFoldoutCallback Declaration public delegate bool DoFoldoutCallback ( Rect position , bool expandedState , GUIStyle style ); Parameters Parameter Description position Rect to draw the foldout. expandedState Current foldout state. style Toggle button style. Returns bool Returns true if ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e134c35ac1c9
unity_docs
rendering
In Unity's 'Tags and Layers', what is 'Layers' and how does it work?
Use Layers throughout the Unity Editor as a way to create groups of objects that share particular characteristics (see documentation on Layers for further details). Use Layers primarily to restrict operations such as raycasting or rendering, so that they are only applied to the relevant groups of objects. Layers marked...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_799451a46822
unity_docs
input
What is `Screen.orientation` in Unity? Explain its purpose and usage.
Screen.orientation public static ScreenOrientation orientation ; Description Specifies logical orientation of the screen. The default value is taken from the Default Orientation property in Player Settings . Currently screen orientation is only relevant on mobile platforms. For example, if a mobile device ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5d86a0f49c49
unity_docs
rendering
What is `Rendering.RayTracingAccelerationStructure.AddInstances` in Unity? Explain its purpose and usage.
RayTracingAccelerationStructure.AddInstances Declaration public int AddInstances (ref Rendering.RayTracingMeshInstanceConfig config , T[] instanceData , int instanceCount = -1, int startInstance = 0, uint id ); Declaration public int AddInstances (ref Rendering.RayTracingMeshInstanceConfig config , L...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b218755baaee
unity_docs
audio
What is `VideoClipImporter.GetSourceAudioChannelCount` in Unity? Explain its purpose and usage.
VideoClipImporter.GetSourceAudioChannelCount Declaration public ushort GetSourceAudioChannelCount (ushort audioTrackIdx ); Parameters Parameter Description audioTrackIdx Index of the audio track to query. Returns ushort Number of channels. Description Number of audio channels in the specified source ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_0a86dd7e33a6
github
scripting
Write a Unity C# script called FB Permission Callback Android
```csharp #if UNITY_EDITOR || UNITY_ANDROID using System.Threading; using UnityEngine; namespace SimpleFileBrowser { public class FBPermissionCallbackAndroid : AndroidJavaProxy { private object threadLock; public int Result { get; private set; } public FBPermissionCallbackAndroid( object threadLock ) : base(...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bd658d5c467b
unity_docs
rendering
What is `Search.SearchService.Request` in Unity? Explain its purpose and usage.
SearchService.Request Declaration public static Search.ISearchList Request (string searchText , Search.SearchFlags options ); Declaration public static Search.ISearchList Request ( Search.SearchContext context , Search.SearchFlags options ); Parameters Parameter Description searchText Search ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b383840f2dc4
unity_docs
rendering
What is `ParticleSystem.ShapeModule.meshMaterialIndex` in Unity? Explain its purpose and usage.
ParticleSystem.ShapeModule.meshMaterialIndex public int meshMaterialIndex ; Description Emit particles from a single Material of a Mesh. Additional resources: ParticleSystem.ShapeModule.shapeType .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_59c19197cc96
unity_docs
scripting
What is `UIElements.VersionChangeType` in Unity? Explain its purpose and usage.
VersionChangeType enumeration Description Value used to signify some changes in the VisualElement Properties Property Description Bindings Some data was bound ViewData persistent data ready Hierarchy changes to hierarchy Layout changes to properties that may have an impact on layout Style...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d45ce7276333
unity_docs
rendering
Explain 'Set the order of multiple cameras' in Unity.
You can create multiple Cameras and assign each one to a different depth. Use the following properties in the Camera Inspector window: Depth if your project uses the Built-In Render Pipeline . Priority if your project uses the Universal Render Pipeline (URP). Cameras are drawn from low depth to high depth. In other wor...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.