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_30f12990a762
unity_docs
ui
What is `tvOS.Remote.allowExitToHome` in Unity? Explain its purpose and usage.
Remote.allowExitToHome public static bool allowExitToHome ; Description Configures how Menu button behaves on Apple TV Remote. When set to true, pressing Menu on the remote will exit the application and naviagte to the system home screen. When set to false, the current application is responsible for handli...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a7b3b1888f3e
unity_docs
scripting
What is `Search.ISearchView.ExecuteAction` in Unity? Explain its purpose and usage.
ISearchView.ExecuteAction Declaration public void ExecuteAction ( Search.SearchAction action , SearchItem[] items , bool endSearch ); Parameters Parameter Description action The search action to execute. items The items to search. endSearch If true, executing this action closes the Search window. Des...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_297c13240e99
unity_docs
scripting
What is `SortingLayer.NameToID` in Unity? Explain its purpose and usage.
SortingLayer.NameToID Declaration public static int NameToID (string name ); Parameters Parameter Description name The name of the layer. Returns int Returns the unique id of the layer with name . Description Returns the id given the name. Will return 0 if an invalid name was given.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0a8df0f264c4
unity_docs
animation
Give me an overview of the `IAnimationClipSource` class in Unity.
IAnimationClipSource interface in UnityEngine Description Use this interface to have a class provide its own list of Animation Clips to the Animation Window. The class must inherit from MonoBehaviour . This interface requires an Animator or Animation component to preview Animation Clips in the Scene. Additio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2e287b9cfe67
unity_docs
scripting
Show me a Unity C# example demonstrating `Windows.WebCam.PhotoCapture`.
PhotoCapture class in UnityEngine.Windows.WebCam / Implemented in: UnityEngine.CoreModule Description Captures a photo from the web camera and stores it in memory or on disk. Demonstrates how to take a photo using the PhotoCapture functionality and display it on a Unity GameObject. ```csharp using UnityEngine;...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_4f4b0ff3b790
github
scripting
Write a Unity C# XR/VR script for VR Map
```csharp using System.Collections; using System.Collections.Generic; using UnityEngine; [System.Serializable] public class VRMap { public Transform vrTarget; public Transform rigTarget; public Vector3 trackingPositionOffset; public Vector3 trackingRotationOffset; public void Map() { r...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_9c294127158c
unity_docs
ui
In Unity's 'Local folder or tarball paths', what is 'Example of a relative path' and how does it work?
After the file: prefix, the path is a standard relative path. In the following example: The project’s Packages folder is C:\Users\my_username\Projects\my_project\Packages . The Projects , github , and Downloads folders are peer folders. my_package_c is an embedded package (a package whose folder was copied into the Pac...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_c24ffea30041_doc_4
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Determines whether the specified is not a reference and has not been destroyed. The to check. if the specified is not a reference and has not been destroyed; otherwise, . Signature: ```csharp public static bool operator !=(Object unityObject, NullComparer @null) => unityObject != null; ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a970799cb194
unity_docs
rendering
What is `AssetImporters.LightDescription.GetIntPropertyNames` in Unity? Explain its purpose and usage.
LightDescription.GetIntPropertyNames Declaration public void GetIntPropertyNames (List<string> names ); Parameters Parameter Description names The list of retrieved property names. Description Retrieves the property names of type int for this light.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cc614016e8a5
unity_docs
editor
Show me a Unity C# example demonstrating `Analytics.AnalyticsSettings.OnRequireInBuildHandler`.
AnalyticsSettings.OnRequireInBuildHandler Description Dispatches whenever a platform build starts. Use this event to enable Analytics in a platform build. ```csharp using UnityEditor;[InitializeOnLoad] internal class SomeNewServiceRequiresAnalyticsDeviceStats { static SomeNewServiceRequiresAnalyticsDeviceStats() ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8ad310b0093c
unity_docs
math
Explain 'Build a structure with prefabs' in Unity.
You can use code to procedurally generate copies of a prefab in a particular configuration. The following example creates a wall of block prefab instances. ## Create a block prefab asset To create a wall of blocks, you must first have a block prefab asset to create the wall with. In the Hierarchy, right-click and sel...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fa838184b9da
unity_docs
editor
Show me a Unity C# example demonstrating `Editor.OnInspectorGUI`.
void OnInspectorGUI (); Description Implement this function to make a custom inspector. Inside this function you can add your own custom IMGUI based GUI for the inspector of a specific object class. Note: This function has to be overridden in order to work. Additional resources: Editor.DrawDefaultInspector . T...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_9712c3e66ad5
unity_docs
scripting
Explain 'Package a UWP app in Visual Studio' in Unity.
Before you distribute your Universal Windows Platform (UWP) application, you need to package it in Visual Studio. For more information, refer to Microsoft documentation on packaging a desktop or UWP app in Visual Studio . ## Create an app package in Visual Studio To create an app package in Visual Studio: Open your b...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_594d3627d453
unity_docs
rendering
What is `ShaderKeywordFilter.ApplyRulesIfTagsNotEqualAttribute` in Unity? Explain its purpose and usage.
ApplyRulesIfTagsNotEqualAttribute class in UnityEditor.ShaderKeywordFilter / Inherits from: ShaderKeywordFilter.TagConstraintAttribute Description Enable or disable shader keyword filter attributes based on shader tags. If you use this attribute, Unity enables filter attributes if the shader compilation conte...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_be75d011c44e
unity_docs
scripting
Show me a Unity C# example demonstrating `ContextMenuItemAttribute`.
ContextMenuItemAttribute class in UnityEngine / Inherits from: PropertyAttribute / Implemented in: UnityEngine.CoreModule Description Use this attribute to add a context menu to a field that calls a named method. ```csharp using UnityEngine;public class Example : MonoBehaviour { [ContextMenuItem("Reset", "Re...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_474e6edc0684
unity_docs
performance
Show me a Unity code example for 'IL2CPP limitations'.
re: struct constraint. This enables some optimizations, but the code will still be slower because the value types can be different sizes. Create a method named UsedOnlyForAOTCodeGeneration and add references to the generic types and methods you want IL2CPP to generate. This method never needs to be called. The followin...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_dc7a73b1f509
unity_docs
scripting
What is `UIElements.IFocusRing.GetFocusChangeDirection` in Unity? Explain its purpose and usage.
IFocusRing.GetFocusChangeDirection Declaration public UIElements.FocusChangeDirection GetFocusChangeDirection ( UIElements.Focusable currentFocusable , UIElements.EventBase e ); Description Get the direction of the focus change for the given event. For example, when the Tab key is pressed, focus should b...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_908b9251f448
unity_docs
ui
Explain 'Create a runtime binding with a type converter' in Unity.
Version : 6000.0+ This example demonstrates how to create a type converter to convert data types between a data source and the UI. ## Example overview This example creates a Label control in UI Builder that binds to a data source asset. The data source asset contains a float property named dangerLevel . The label dis...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_926e005992a6
unity_docs
ui
In Unity's 'Assembly Definition Inspector window reference', what is 'Assembly Definition References' and how does it work?
Property Description Assembly Definition References A list of assemblies to reference from the current assembly. Click the + button to add a new reference. Click the - button to remove a reference. Unity uses these references to compile the assembly and define the dependencies between assemblies. Use GUIDs This setting...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b40757afa7bf
unity_docs
editor
What is `AssetDatabase.CloseCacheServerConnection` in Unity? Explain its purpose and usage.
AssetDatabase.CloseCacheServerConnection Declaration public static void CloseCacheServerConnection (); Description Closes an active cache server connection. If no connection is active, then it does nothing.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_787d269fb5ee
github
scripting
Write a Unity C# script called Camera Input Handler
```csharp using UnityEngine; using System.Linq; using Wrld.MapInput; using Wrld.MapInput.Touch; using Wrld.MapInput.Mouse; using System; using System.Collections.Generic; namespace Wrld.MapCamera { public class CameraInputHandler { struct InputFrame { public Touch[] T...
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_man_e20c7b99a702
unity_docs
rendering
In Unity's 'Importing a model', what is 'Adjusting model settings' and how does it work?
To open a model’s Import Settings, select the model from the Project window . The Inspector then displays the Import Settings for the selected model. Note: A SpeedTree model has different importing settings. For more information, refer to SpeedTree Model tab reference .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_11050e8deaf4
unity_docs
scripting
What is `MonoBehaviour.OnApplicationFocus` in Unity? Explain its purpose and usage.
MonoBehaviour.OnApplicationFocus(bool) Parameters Parameter Description hasFocus True if the GameObjects have focus, else False. Description Sent to all GameObjects when the player gets or loses focus. OnApplicationFocus is called when the application loses or gains focus. Alt-tabbing or Cmd-tabbing can tak...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a5f5ab5069f7
unity_docs
editor
What are the parameters of `AssetDatabase.ValidateMoveAsset` in Unity?
Returns string An empty string if the asset can be moved, otherwise an error message. Description Checks if an asset file can be moved from one folder to another. (Without actually moving the file). All paths are relative to the project folder, for example: "Assets/MyTextures/hello.png". Additional resources: AssetData...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4f2a38a151f4
unity_docs
rendering
Show me a Unity C# example demonstrating `GL.LoadOrtho`.
elper function to set up an orthograhic projection. Loads an orthographic projection into the projection matrix and loads an identity into the model and view matrices. The resulting projection performs the following mappings: 1. x = 0..1 to x = -1..1 (left..right) 2. y = 0..1 to y = -1..1 (bottom..top) 3. z = 1....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d7948dcc5b27
unity_docs
ui
What is `UIElements.TextElement.MeasureTextSize` in Unity? Explain its purpose and usage.
TextElement.MeasureTextSize Declaration public Vector2 MeasureTextSize (string textToMeasure , float width , UIElements.VisualElement.MeasureMode widthMode , float height , UIElements.VisualElement.MeasureMode heightMode ); Parameters Parameter Description textToMeasure The text to measure. width ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_491444769ed9
unity_docs
physics
Show me a Unity C# example demonstrating `VersionControl.Provider.Checkout`.
eckout. asset Asset to checkout. mode Tell the Provider to checkout just the asset file, the .meta file or both. changeset Tell the Provider to checkout the assets to a specific changeset. Description Checkout an asset or a list of assets from the version control system. Some version control systems like Perfo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5f2575f5dab8
unity_docs
physics
In Unity's 'Moving objects with vectors', what is 'Subtraction' and how does it work?
Vector subtraction is most often used to get the direction and distance from one object to another. Note that the order of the two parameters does matter with subtraction: ``` // The vector d has the same magnitude as c but points in the opposite direction. var c = b - a; var d = a - b; ``` As with numbers, adding the ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_235656957cf1
unity_docs
math
What is `LineRenderer.Simplify` in Unity? Explain its purpose and usage.
LineRenderer.Simplify Declaration public void Simplify (float tolerance ); Parameters Parameter Description tolerance This value is used to evaluate which points should be removed from the line. A higher value results in a simpler line (less points). A positive value close to zero results in a line with lit...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d53325d13a56
unity_docs
physics
Explain 'Collision module reference' in Unity.
This module controls how particles collide with GameObjects in the Scene . Property Function Type Use the Type * drop-down to define whether your collision settings apply to Planes or to the World . If you choose World , use the Collision Mode drop-down to define whether your collision settings apply for a 2D or 3D wor...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_3a14debfbe81
github
scripting
Write a Unity Editor script for Curve Data Inspector
```csharp namespace CurvePickerTool.Samples { using System.Collections.Generic; using UnityEngine; using UnityEditor; [CustomEditor(typeof(CurveData))] public class CurveDataInspector : Editor { private CurveData component; private CurvePickerGUI curve1; private CurvePic...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_17ff52b403b0
unity_docs
scripting
What is `UIElements.BaseListView.bindingSourceSelectionMode` in Unity? Explain its purpose and usage.
BaseListView.bindingSourceSelectionMode public UIElements.BindingSourceSelectionMode bindingSourceSelectionMode ; Description This property controls whether every element in the list will get its data source setup automatically to the correct item in the collection's source. When set to AutoAssign , the...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3cfed6b765b9
unity_docs
scripting
What is `AnimatorUtility.DeoptimizeTransformHierarchy` in Unity? Explain its purpose and usage.
AnimatorUtility.DeoptimizeTransformHierarchy Declaration public static void DeoptimizeTransformHierarchy ( GameObject go ); Parameters Parameter Description go GameObject to Deoptimize. Description This function will recreate all transform hierarchy under GameObject. A call to this function at runtime wi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_b575d44cf679
unity_docs
rendering
Explain 'Shape module reference' in Unity.
Explore the Shape module properties to define the volume or surface of particle emission, and the direction of the start velocity. ## Shapes in the Shape module The direction of particle emission varies depending on the shape you choose. Shape Description Sphere Emits particles uniformly in all directions. Hemisphere...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_568e887a22b5
unity_docs
scripting
What is `RenderingLayerMask.NameToRenderingLayer` in Unity? Explain its purpose and usage.
RenderingLayerMask.NameToRenderingLayer Declaration public static int NameToRenderingLayer (string layerName ); Parameters Parameter Description layerName Provide a rendering layer name. Returns int Returns -1 if not found. Description Given a rendering layer name, returns the rendering layer index a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_54f4e80da1c4
unity_docs
editor
What is `AssetImporters.AssetImporterEditor.Awake` in Unity? Explain its purpose and usage.
AssetImporterEditor.Awake Declaration protected void Awake (); Description This function is called when the Editor script is started. Awake is called as the AssetImporterEditor script starts. This happens as the editor is launched and is similar to MonoBehaviour.Awake . ```csharp using UnityEngine; using Unit...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_31c6076f28f4
unity_docs
rendering
In Unity's 'Light Modes', what is 'Realtime Light behavior' and how does it work?
Realtime Lights cast shadows up to the Shadow Distance . By default, Realtime Lights contribute only realtime direct lighting to a Scene. If you’re using the Built-in Render Pipeline and you enable Enlighten Realtime Global Illumination in your Project, Realtime Lights also contribute realtime indirect lighting to your...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ddd053abd44e
unity_docs
performance
What is `TextAsset.GetData` in Unity? Explain its purpose and usage.
TextAsset.GetData Declaration public NativeArray<T> GetData (); Returns NativeArray<T> A reference to an array in native code that provides access to the raw asset data. Description Gets raw text asset data. It works similarly to the bytes property, but TextAsset.GetData doesn't allocate any memory; th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e4240c1f6b0a
unity_docs
rendering
Give me an overview of the `LOD` class in Unity.
LOD struct in UnityEngine / Implemented in: UnityEngine.CoreModule Description Structure for building a LOD for passing to the SetLODs function. Properties Property Description fadeTransitionWidth Width of the cross-fade transition zone (proportion to the current LOD's whole length) [0-1]. Only used if it's ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ac5d30b04b4d
unity_docs
editor
Give me an overview of the `SettingsProvider` class in Unity.
SettingsProvider class in UnityEditor Description SettingsProvider is the configuration class that specifies how a Project setting or a preference should appear in the Settings or Preferences window. In order to add new Project settings or preference pages, define a SettingsProvider. The SettingsProvider class pr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6aa7fa4337c0
unity_docs
scripting
What are the parameters of `Editor.OnPreviewGUI` in Unity?
Description Creates a custom preview for the preview area of the Inspector, the headers of the primary Editor, and the object selector. You must implement Editor.HasPreviewGUI for this method to be called. If you implement OnInteractivePreviewGUI , then this method is only called for non-interactive custom previews. Th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b2c3cd994166
unity_docs
animation
What is `ModelImporterClipAnimation.keepOriginalPositionY` in Unity? Explain its purpose and usage.
ModelImporterClipAnimation.keepOriginalPositionY public bool keepOriginalPositionY ; Description If true, uses the root vertical position from the source animation without modification. If false, Unity derives and applies root vertical motion based on the clip's import settings.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_612f81f40315
unity_docs
ui
What are the parameters of `GUI.FocusWindow` in Unity?
Description Make a window become the active window. Additional resources: GUI.UnfocusWindow . ```csharp // Draw 2 windows. // When the first window is button-clicked focus on the other window.using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { private Rect windowRect = new Rect(2...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a9644ab12ec4
unity_docs
networking
What is `Networking.DownloadHandler.CompleteContent` in Unity? Explain its purpose and usage.
DownloadHandler.CompleteContent Declaration protected void CompleteContent (); Description Callback, invoked when all data has been received from the remote server. This callback is guaranteed to be invoked on the main thread. If not overridden, this callback has no default behavior and will no-op.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1e223f25a929
unity_docs
math
What is `BoundsInt.yMin` in Unity? Explain its purpose and usage.
BoundsInt.yMin public int yMin ; Description The minimal y point of the box. Only points with a y component greater than or equal to this value are contained in the box. Sets the minimum value of BoundsInt 's y point. If you enter a minimum value that is greater than the current maximum value, then the entere...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8801849cf029
unity_docs
physics
What is `ModifiableMassProperties` in Unity? Explain its purpose and usage.
ModifiableMassProperties struct in UnityEngine / Implemented in: UnityEngine.PhysicsModule Description Mass-related modifiable properties of a contact pair. Mostly useful to make a collider appear lighter to the solver than it actually is when the bodies in this contact pair have very different mass values. Pr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_59a07ca57540
unity_docs
scripting
Show me a Unity C# example demonstrating `Renderer.enabled`.
Renderer.enabled public bool enabled ; Description Makes the rendered 3D object visible if enabled. ```csharp using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { public Renderer rend; void Start() { rend = GetComponent<Renderer>(); rend.enabled = true; } // Toggle the Ob...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d007c226e4d4
unity_docs
rendering
What is `RenderSettings.ambientLight` in Unity? Explain its purpose and usage.
RenderSettings.ambientLight public static Color ambientLight ; Description Flat ambient lighting color. Flat ambient lighting mode uses color. It has the same value as ambientSkyColor . ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { // Make the ambient lighting red Ren...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6ee9d6765d7c
unity_docs
input
In Unity's 'DoubleField', what is 'Set a placeholder text' and how does it work?
You can set a placeholder text for the element. You can also hide the placeholder text on focus. Note : The placeholder text won’t display if you set a value for the element. To unset a value in UI Builder, right-click the Value field in the element’s Inspector tab and select Unset . In C#, use the placeholder and the ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_47d412637e3f
unity_docs
scripting
In Unity's 'Vector2Field', what is 'Example' and how does it work?
The following UXML example creates a Vector2Field with a placeholder: ``` <UXML xmlns="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements"> <Vector2Field label="UXML Field" name="the-uxml-field" /> </UXML> ``` The following C# example illustrates some of the customizable functionalities of the Vector2Field: ```...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c054f5faefa2
unity_docs
scripting
What is `AI.NavMeshAgent.updatePosition` in Unity? Explain its purpose and usage.
NavMeshAgent.updatePosition public bool updatePosition ; Description Gets or sets whether the transform position is synchronized with the simulated agent position. The default value is true. When true: changing the transform position will affect the simulated position and vice-versa. When false: the simulated p...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3463df9c0431
unity_docs
physics
What is `Collision.contactCount` in Unity? Explain its purpose and usage.
Collision.contactCount public int contactCount ; Description Gets the number of contacts for this collision. A collision can involve multiple contact points. This property allows you to determine how many are involved. You can use this value when retrieving contacts using GetContact or GetContacts .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_dfc10187d2a0
unity_docs
ui
In Unity's 'RadioButtonGroup', what is 'Examples' and how does it work?
The following UXML example creates a RadioButtonGroup: ``` <UXML xmlns="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements"> <RadioButtonGroup label="UXML Field" name="the-uxml-field" /> </UXML> ``` The following C# example illustrates some of the customizable functionalities of the RadioButtonGroup: ``` /// <s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0ec002dafb9d
unity_docs
xr
Show me a Unity C# example demonstrating `RenderTexture.ctor`.
ds the maximum size, Unity's behavior varies. If the RenderTexture is not a 3D texture, and the requested size is a power of two, Unity automatically scales down the requested size by a factor of 2 until it is below the maximum, and then creates the RenderTexture at that size. Otherwise, Unity fails to create the Rende...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d7258f542862
unity_docs
scripting
What is `ResourcesAPI.FindObjectsOfTypeAll` in Unity? Explain its purpose and usage.
ResourcesAPI.FindObjectsOfTypeAll Declaration protected Object[] FindObjectsOfTypeAll (Type systemTypeInstance ); Description Override for customizing the behavior of the Resources.FindObjectsOfTypeAll function.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2910f9c358b4
unity_docs
animation
What is `Animations.AnimatorState.AddExitTransition` in Unity? Explain its purpose and usage.
AnimatorState.AddExitTransition Declaration public Animations.AnimatorStateTransition AddExitTransition (); Declaration public Animations.AnimatorStateTransition AddExitTransition (bool defaultExitTime ); Parameters Parameter Description defaultExitTime If true, the exit time will be the equivalent o...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5052f7d19580
unity_docs
animation
What is `Tilemaps.ITilemap.RefreshTile` in Unity? Explain its purpose and usage.
ITilemap.RefreshTile Declaration public void RefreshTile ( Vector3Int position ); Parameters Parameter Description position Position of the Tile on the Tilemap . Description Refreshes a Tile at the given XYZ coordinates of a cell in the :Tilemap. The Tilemap will retrieve the rendering data, animation...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_435953a03268
unity_docs
ui
Show me a Unity C# example demonstrating `GUIStyle.wordWrap`.
GUIStyle.wordWrap public bool wordWrap ; Description Should the text be wordwrapped? This will cause any text contrained to be wordwrapped to fit within the width of a control. ```csharp using UnityEngine;public class Example : MonoBehaviour { void OnGUI() { GUI.skin.button.wordWrap = true; } } ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_74329fed033f
unity_docs
rendering
What is `Rendering.BuiltinRenderTextureType.CurrentActive` in Unity? Explain its purpose and usage.
BuiltinRenderTextureType.CurrentActive Description Currently active render target. During command buffer execution, this identifies the render target that is active "right now". During command buffer execution, the active render target might be changed by CommandBuffer.SetRenderTarget or CommandBuffer.Blit comm...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b70f0d2bbf24
unity_docs
editor
What is `Inspector.GraphicsSettingsInspectors.GraphicsSettingsInspectorUtility` in Unity? Explain its purpose and usage.
GraphicsSettingsInspectorUtility class in UnityEditor.Inspector.GraphicsSettingsInspectors Description Utility class for GraphicsSettings page. Static Methods Method Description OpenAndScrollTo Call a method to open GraphicsSettings page and scroll to specified property.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8641735c4772
unity_docs
scripting
What is `Experimental.GraphView.GraphElementScopeExtensions.GetContainingScope` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphElementScopeExtensions.GetContainingScope Declaration public static Experimental.GraphView.Scope GetContainingScope ( Experimental.GraphView.GraphElement element ); Description Returns the scope containing the specif...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1b9095dad5a1
unity_docs
editor
What is `PlayerSettings.Android.useCustomKeystore` in Unity? Explain its purpose and usage.
PlayerSettings.Android.useCustomKeystore public static bool useCustomKeystore ; Description Enable application signing with a custom keystore. When enabled, the Android application is signed with the key specified in keyaliasName from the keystore specified in keystoreName . When disabled, the application i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_17d3932223f5
unity_docs
physics
Give me an overview of the `AnisotropicFiltering` class in Unity.
AnisotropicFiltering enumeration Description Anisotropic filtering mode. Additional resources: QualitySettings.anisotropicFiltering . Properties Property Description Disable Disable anisotropic filtering for all textures. Enable Enable anisotropic filtering, as set for each texture. ForceEnable Enable aniso...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_096801523cfb
unity_docs
physics
What is `Physics.IgnoreRaycastLayer` in Unity? Explain its purpose and usage.
Physics.IgnoreRaycastLayer public static int IgnoreRaycastLayer ; Description Layer mask constant to select ignore raycast layer. This can be used in the layermask field of Physics.Raycast and other methods to select the "ignore raycast" layer (which does not receive raycasts by default). Additional resources...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_824f33da1fc4
unity_docs
rendering
What is `Camera.OnRenderImage` in Unity? Explain its purpose and usage.
Camera.OnRenderImage(RenderTexture,RenderTexture) Parameters Parameter Description source A RenderTexture containing the source image. destination The RenderTexture to update with the modified image. Description Event function that Unity calls after a Camera has finished rendering, that allows you to mo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_67b4e72579f4
unity_docs
editor
Show me a Unity C# example demonstrating `EditorGUI.MaskField`.
ch flag. style Optional GUIStyle . displayedOptions A string array containing the labels for each flag. Returns int The value modified by the user. Description Makes a field for masks. Note: The mask values for the flags associated with each option in the menu will be consecutive powers of 2 starting wit...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c20f8a1a2cf6
unity_docs
math
What is `PhysicsShapeGroup2D.GetShapeData` in Unity? Explain its purpose and usage.
PhysicsShapeGroup2D.GetShapeData Declaration public void GetShapeData (List<PhysicsShape2D> shapes , List<Vector2> vertices ); Parameters Parameter Description shapes A list that will be populated with a copy of all the shapes in the PhysicsShapeGroup2D . vertices A list that will be populated with a cop...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_74d869fbd46d
unity_docs
scripting
Explain 'Basic Layout' in Unity.
In this section we'll look at how you can position UI elements relative to the Canvas and each other. If you want to test yourself while reading, you can create an Image using the menu GameObject -> UI -> Image . ## The Rect Tool Every UI element is represented as a rectangle for layout purposes. This rectangle can b...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_c24ffea30041_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Helper class for checking whether the value of a variable that is of , interface or generictype is , destroyed or inactive.By adding a using static directive it is possible to access the static members of the class without having to qualify the access with the type name, making it possibleto perform safe and reliable n...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_de3dcd0ddf28
unity_docs
ui
Explain 'Create a custom control with two attributes' in Unity.
Version : 2023.2+ This example demonstrates how to create a simple custom control with two attributes. ## Example overview This example creates a custom control called MyElement with two attributes and exposes it to UXML and UI Builder. This example also shows how to add a custom control to a UI in the UI Builder. Yo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_28f0b56841b3
unity_docs
scripting
What are the parameters of `Unity.Collections.LowLevel.Unsafe.UnsafeUtility.Free` in Unity?
Description Frees a block of memory that was previously allocated. The Free method deallocates memory that was allocated using UnsafeUtility.Malloc . This is essential to prevent memory leaks, which can lead to reduced application performance or system instability. Always ensure that any allocated memory is freed when ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6d9bc3d57d06
unity_docs
scripting
What is `LowLevel.PlayerLoop.SetPlayerLoop` in Unity? Explain its purpose and usage.
PlayerLoop.SetPlayerLoop Declaration public static void SetPlayerLoop ( LowLevel.PlayerLoopSystem loop ); Description Set a new custom update order for all engine systems in Unity. Use SetPlayerLoop to specify a custom update order for the Player loop. The PlayerLoopSystem supplied as the loop parameter...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_df580480e42d
unity_docs
scripting
What is `PrefabUtility.IsPartOfModelPrefab` in Unity? Explain its purpose and usage.
PrefabUtility.IsPartOfModelPrefab Declaration public static bool IsPartOfModelPrefab ( Object componentOrGameObject ); Parameters Parameter Description componentOrGameObject The object to check. Must be a component or GameObject. Returns bool True if the object is part of a Model Prefab. Description ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_78773c6d0c99
unity_docs
input
What is `XR.InputDevice.isValid` in Unity? Explain its purpose and usage.
InputDevice.isValid public bool isValid ; Description Read Only. True if the device is currently a valid input device; otherwise false. Use this property to determine whether this device is still valid.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_4dd6d1b42491
unity_docs
ui
In Unity's 'Use UXML instances as templates', what is 'Make a Sub-Document as a template' and how does it work?
You can make a Sub-Document within a UXML Document as a Template Instance , so you can reuse it. Right-click on the Sub-Document. Select Create Template . Select a location to save the file. This also instantiates the Sub-Document as Template Instances in the existing document. Note: The properties of the parent or chi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_17ddc61ff78e
unity_docs
scripting
What is `ParticleSystem.ExternalForcesModule.RemoveAllInfluences` in Unity? Explain its purpose and usage.
ParticleSystem.ExternalForcesModule.RemoveAllInfluences Declaration public void RemoveAllInfluences (); Description Removes every Force Field from the influencers list. When influenceFilter is set to ParticleSystemGameObjectFilter.List then only Force Fields in the influencers list affect the Particle Syst...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_272084516af7
unity_docs
physics
What is `ArticulationBody.jointAcceleration` in Unity? Explain its purpose and usage.
ArticulationBody.jointAcceleration public ArticulationReducedSpace jointAcceleration ; Description The joint acceleration in reduced coordinates. Units of measurement - m/s^2 (meters per second squared) for linear and rad/s^2 (radians per second squared) for angular motion.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_38a1071e82e8_doc_11
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Event invoked after an object is spawned. Signature: ```csharp public event Action<GameObject> objectSpawned; ```
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_3cd36c8448f9
unity_docs
scripting
What is `CreateAssetMenuAttribute.menuName` in Unity? Explain its purpose and usage.
CreateAssetMenuAttribute.menuName public string menuName ; Description The display name for this type shown in the Assets/Create menu. As with other menu item code, use a forward-slash ("/") path separator to group items into submenus. For example, specifying a MenuName of "Gameplay/Objective" will cause the me...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_da48612416df
unity_docs
physics
What is `IMGUI.Controls.MultiColumnHeader.SetSortingColumns` in Unity? Explain its purpose and usage.
MultiColumnHeader.SetSortingColumns Declaration public void SetSortingColumns (int[] columnIndices , bool[] sortAscending ); Parameters Parameter Description columnIndices Column indices of the sorted columns. sortAscending Sorting order for the column indices specified. Description Sets multiple sortin...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8ed3189df6e9
unity_docs
physics
What is `LowLevelPhysics.GeometryHolder` in Unity? Explain its purpose and usage.
GeometryHolder struct in UnityEngine.LowLevelPhysics / Implemented in: UnityEngine.PhysicsModule Description Holds the basic information of a geometric shape and its type. Properties Property Description Type Returns the type of the geometry shape that was saved previously. Public Methods Method Descripti...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_abb790656560
unity_docs
scripting
What is `TextAnchor` in Unity? Explain its purpose and usage.
TextAnchor enumeration Description Where the anchor of the text is placed. This is used by Text.anchor property. Additional resources: GUI Text component . Properties Property Description UpperLeft Text is anchored in upper left corner. UpperCenter Text is anchored in upper side, centered horizontally. Uppe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_7fb8c507cf66
unity_docs
ui
In Unity's 'DropdownField', what is 'Change styles for a DropdownField' and how does it work?
You can override the default Panel Settings fields in a USS file to change the styles of a DropdownField: In the Hierarchy window, select your UI Document (.uxml). Set Panel Settings as your Panel Settings asset. If you don’t have an existing Panel Settings asset, follow the instructions in the dialog to create one. In...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8b16a8217605
unity_docs
audio
What is `AudioChorusFilter.wetMix2` in Unity? Explain its purpose and usage.
AudioChorusFilter.wetMix2 public float wetMix2 ; Description Volume of 2nd chorus tap. This tap is 90 degrees out of phase of the first tap. 0.0 to 1.0. Default = 0.5. ```csharp using UnityEngine;[RequireComponent(typeof(AudioSource))] [RequireComponent(typeof(AudioChorusFilter))] public class Example : MonoBe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_61c501d0a8e1
unity_docs
editor
What is `Accessibility.AssistiveSupport.activeHierarchy` in Unity? Explain its purpose and usage.
AssistiveSupport.activeHierarchy public static Accessibility.AccessibilityHierarchy activeHierarchy ; Description The active AccessibilityHierarchy for the screen reader. May be null if no hierarchy is active. You need an active accessibility hierarchy to present any content to the user through the screen...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e2fdb35fe803
unity_docs
rendering
In Unity's 'Introduction to Reflection Probes', what is 'How Reflection Probes Work' and how does it work?
The visual environment for a point in the scene can be represented by a cubemap . This is conceptually like a box with flat images of the view from six directions (up, down, left, right, forward and backward) painted on its interior surfaces. For an object to show the reflections, its shader must have access to the ima...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_d9642cf9b35c_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Enables and disables a canvas based on the value of a BoolVariable. Signature: ```csharp public class BoolEnabledCanvas : CanvasComponent ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_man_76ddffef12a9
unity_docs
editor
In Unity's 'Project window reference', what is 'Project window toolbar' and how does it work?
Along the top edge of the window is the browser’s toolbar . Property Description Create menu Displays a list of Assets and other sub-folders you can add to the folder currently selected. Search bar Use the search bar to search for a file within your Project. You can choose to search within the entire Project ( All ), i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_797d1a05f474
unity_docs
scripting
What are the parameters of `Handles.CylinderHandleCap` in Unity?
Description Draw a cylinder handle. Pass this into handle functions. On EventType.Layout event, calculates handle distance to mouse and calls HandleUtility.AddControl accordingly. On EventType.Repaint event, draws the handle shape. Cylinder Handle Cap in the Scene View. Add the following script to your Assets folder as...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_bdde3750c287
unity_docs
ui
Explain 'Find a specific version of a package' in Unity.
To find a specific package version: In Unity, open the Package Manager window. Refer to Access the Package Manager window . If you’re looking for a pre-release package , follow these steps: Select Project Settings under the Advanced menu. Project Settings opens the Package Manager project settings window The Package Ma...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5d94cdb678da
unity_docs
scripting
What are the parameters of `MonoBehaviour.OnCollisionExit` in Unity?
Description OnCollisionExit is called when this collider/rigidbody has stopped touching another rigidbody/collider. OnCollisionExit receives an instance of the Collision class as the collision paramter. This parameter contains information about the collision such as contact points and impact velocity. If you don't use ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_a9b35869fca0
unity_docs
editor
In Unity's 'Integrated development environment (IDE) support', what is 'External script editor preference' and how does it work?
The External Script Editor setting in the Preferences window determines which IDE Unity C# script files open in for editing. Unity automatically assigns the IDE included in an installation as the default external script Editor. To change this setting, go to Edit > Preferences (macOS: Unity > Settings ) > External Tools...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_daf24abb168f
unity_docs
scripting
What is `Experimental.Rendering.GraphicsFormat.R16G16B16A16_SNorm` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphicsFormat.R16G16B16A16_SNorm Description A four-component, 64-bit signed normalized format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B component in bytes 4..5, and a 16-bit A c...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2699db93f141
unity_docs
rendering
What is `Unity.Hierarchy.HierarchySearchQueryDescriptor` in Unity? Explain its purpose and usage.
HierarchySearchQueryDescriptor class in Unity.Hierarchy / Implemented in: UnityEngine.HierarchyCoreModule Description Encapsulates all the query filters and text values that are used to filter a hierarchy. Static Properties Property Description Empty The default empty query. InvalidQuery The defaul...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_4009318b89dd
unity_docs
editor
Explain 'Install the platform package for Embedded Linux' in Unity.
Install the platform package for Embedded Linux on Windows, Linux, and macOS. Note: The Unity Editor for Embedded Linux is available under separate terms. For licensing and download information, contact your Account Manager or the Unity Sales team. ## Requirements and compatibility Your system must meet the System re...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_59ff120c8105_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Author: Cameron ReuschelAny BaseBehaviour that is a lazy singleton should only be found at most once per scene.A lazy singleton creates an instance of itself in the scene if there is none.Enables static access to this single object by using Classname.Instance.The implementing type itself Signature: ```csharp public ab...
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_man_de01eed48d4a
unity_docs
scripting
Show me a Unity code example for 'App slicing'.
ts. AssetBundle variants must be lowercase. Create a new script in the Unity Editor folder called BuildiOSAppSlices.cs . Copy and paste the following code, replacing the example label textures and variants hd and sd with your own. In this code example, multiple folders are referenced: one containing HD textures and one...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_ba9c5697f58d
github
scripting
Write a Unity C# UI script for GPU Voxel Terrain
```csharp /* * GPUVoxelTerrain.cs * Created by Arian - GameDevBox * YouTube Channel: https://www.youtube.com/@GameDevBox * * 🎮 Want more Unity tips, tools, and advanced systems? * 🧠 Learn from practical examples and well-explained logic. * 📦 Subscribe to GameDevBox for more game dev content! * * -...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_7362ecb56eb1
unity_docs
editor
What is `WSAUWPBuildType` in Unity? Explain its purpose and usage.
WSAUWPBuildType enumeration Description Determines the output build type when building to Universal Windows Platform. This setting can be changed in the build window when the target platform is set to Universal Windows Platform. You can also use EditorUserBuildSettings.wsaUWPBuildType property to change this set...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6829aab05522
unity_docs
scripting
What is `U2D.SpriteDataAccessExtensions.HasVertexAttribute` in Unity? Explain its purpose and usage.
SpriteDataAccessExtensions.HasVertexAttribute Declaration public static bool HasVertexAttribute ( Sprite sprite , Rendering.VertexAttribute channel ); Returns bool True if the channel exists. Description Checks if a specific channel exists for this Sprite.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.