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_0c0897df5ce7
unity_docs
scripting
What is `Resources` in Unity? Explain its purpose and usage.
Resources class in UnityEngine / Implemented in: UnityEngine.CoreModule Description The Resources class allows you to find and access objects including assets. When you build your project, all assets in any Resources folders are included in the built Player. You can then load these assets at runtime using Re...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_85290bba35d4
unity_docs
rendering
What is `Rendering.RayTracingAABBsInstanceConfig` in Unity? Explain its purpose and usage.
RayTracingAABBsInstanceConfig struct in UnityEngine.Rendering / Implemented in: UnityEngine.CoreModule Description The parameters you use to add an instance of ray tracing axis-aligned bounding boxes (AABBs) to a RayTracingAccelerationStructure . Use this structure to share parameters across different ray trac...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_f522b91ce703_doc_4
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Represents an object which can receive five arguments as part of its initialization process.-derived classes that implement this interface can be instantiated with their dependency using the function.-derived classes that implement this interface can be added to a with their dependency using the function.If the class ...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_23d70e17b6f4
unity_docs
editor
What is `Unity.Profiling.LowLevel.Unsafe.ProfilerRecorderHandle.GetAvailable` in Unity? Explain its purpose and usage.
ProfilerRecorderHandle.GetAvailable Declaration public static void GetAvailable (List<ProfilerRecorderHandle> outRecorderHandleList ); Description Gets all available handles which can be accessed with ProfilerRecorder. Enumerates all available built-in or dynamically created handles of Profiler markers and cou...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ded4e37b7209
unity_docs
math
What is `XR.CommonUsages.secondary2DAxisClick` in Unity? Explain its purpose and usage.
CommonUsages.secondary2DAxisClick public static InputFeatureUsage<bool> secondary2DAxisClick ; Description Represents the secondary 2D axis being clicked or otherwise depressed. The secondary 2D axis is the Vector2 input feature tagged with CommonUsages.secondary2DAxis .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ad03b54ba715
unity_docs
animation
What is `Animations.AnimatorStateMachine.GetStateMachineTransitions` in Unity? Explain its purpose and usage.
AnimatorStateMachine.GetStateMachineTransitions Declaration public AnimatorTransition[] GetStateMachineTransitions ( Animations.AnimatorStateMachine sourceStateMachine ); Parameters Parameter Description sourceStateMachine The source state machine. Description Gets the list of all outgoing state machine t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7bf0802f7a95
unity_docs
scripting
What is `UIElements.Experimental.StyleValues.borderBottomRightRadius` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. StyleValues.borderBottomRightRadius public float borderBottomRightRadius ; Description The radius of the bottom-right corner when a rounded rectangle is drawn in the element's box.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_173ba33b0d5e
unity_docs
xr
What is `Networking.DownloadHandlerTexture.GetContent` in Unity? Explain its purpose and usage.
DownloadHandlerTexture.GetContent Declaration public static Texture2D GetContent ( Networking.UnityWebRequest www ); Parameters Parameter Description www A finished UnityWebRequest object with DownloadHandlerTexture attached. Returns Texture2D The same as DownloadHandlerTexture.texture Description...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f353d4f46b1c
unity_docs
rendering
Show me a Unity code example for 'Sample a 2D texture array in a shader'.
To sample a texture array in a custom shader , follow these steps: To create a texture array material property, add a 2DArray material property declaration. For example: ``` Properties { _MainTex ("Texture array", 2DArray) = "" {} } ``` To set the texture array as a shader input, add a UNITY_DECLARE_TEX2DARRAY macro. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_98a7b76fa2a1
unity_docs
scripting
What is `Search.SearchService.SetActive` in Unity? Explain its purpose and usage.
SearchService.SetActive Declaration public static void SetActive (string providerId , bool active ); Parameters Parameter Description providerId Search provider ID to activate or deactivate. active Activation state. Description Activates or deactivates a search provider. Call Refresh after this to take ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_c5564a9cc8a9_doc_3
github
scripting
What does `SetAR` do in this Unity script? Explain its purpose and signature.
Set video see through mode.True (default) to set video see through mode. False to set VR mode. Signature: ```csharp public void SetAR(bool isAR = true) ```
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_fd4b2cfc3687
unity_docs
scripting
What is `Device.Application.isBatchMode` in Unity? Explain its purpose and usage.
Application.isBatchMode public static bool isBatchMode ; Description This has the same functionality as Application.isBatchMode . At the moment, the Device Simulator doesn't support simulation of this property.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_44863acade36_doc_9
github
scripting
What does `SetElevation` do in this Unity script? Explain its purpose and signature.
Set the elevation of this Positioner, in meters. The behaviour of this depends on the ElevationMode.The elevation, in meters. Signature: ```csharp public void SetElevation(double elevation) ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_37b3449c8d3b
unity_docs
rendering
Show me a Unity C# example demonstrating `Rendering.CommandBuffer.SetRayTracingAccelerationStructure`.
r Inline Ray Tracing (Ray Queries). This functionality is available on platforms where this feature is supported. Use SystemInfo.supportsInlineRayTracing to check this. In compute shaders, ray queries can be used to perform acceleration structure traversal and geometry intersection tests. To access this functionality...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_320c811166bd
unity_docs
rendering
What is `Matrix4x4.Perspective` in Unity? Explain its purpose and usage.
Matrix4x4.Perspective Declaration public static Matrix4x4 Perspective (float fov , float aspect , float zNear , float zFar ); Parameters Parameter Description fov Vertical field-of-view in degrees. aspect Aspect ratio (width divided by height). zNear Near depth clipping plane value. zFar Far depth...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a0c21a682304
unity_docs
physics
What is `SimulationMode2D.Script` in Unity? Explain its purpose and usage.
SimulationMode2D.Script Description Use this enumeration to specify to Unity that it should execute the physics simulation manually when you call Physics2D.Simulate . Executing the physics simulation in a script provides full control over when the simulation runs and the time over which it runs. Using this mode, y...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8fa3623be810
unity_docs
scripting
What is `AssetImporters.AssetImportContext.LogImportError` in Unity? Explain its purpose and usage.
AssetImportContext.LogImportError Declaration public void LogImportError (string msg , Object obj ); Parameters Parameter Description msg The error message. obj Optional Object that is targeted by the error. Description Logs an error message encountered during import. Use this method to notify the us...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e622ae35149d
unity_docs
audio
Explain 'Audio Effects' in Unity.
You can modify the output of Audio Mixer components by applying Audio Effects . These can filter the frequency ranges of the sound or apply reverb and other effects. The effects are applied by adding effect components to the relevant section of the Audio Mixer. The ordering of the components is important, since it refl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_77149f0ea784
unity_docs
xr
Show me a Unity C# example demonstrating `Networking.UnityWebRequest.EscapeURL`.
when present in URLs. If you need to include those characters in URL parameters then you must represent them with escape sequences. It is recommended that you use this function on any text supplied by a user before passing the text as a URL parameter. This will ensure that a malicious user can't manipulate the contents...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5648ed9ee5d8
unity_docs
scripting
What is `Experimental.GraphView.Orientation.Horizontal` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. Orientation.Horizontal Description Horizontal orientation used for nodes and connections flowing to the left or right.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_77cac53c676c
unity_docs
physics
In Unity's 'Link XML formatting reference', what is 'Supported XML elements' and how does it work?
The following XML elements are supported in link.xml files: Element Description <linker></linker> Must be used in all link.xml files as the outermost element enclosing all other elements. <assembly></assembly> Declare code preservation annotations specific to an assembly. <type></type> Declare code preservation annotat...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a6f39e5fb36f
unity_docs
physics
Show me a Unity C# example demonstrating `Collider2D.OnTriggerEnter2D`.
and GameObject2 . These both have script files which makes the example work. The first script, Example1 , creates a Sprite and adds a BoxCollider2D and a Rigidbody2D . This object falls under gravity and collides with Example2 . Example2 has no visibility. (The rectangle it creates is visible in the Scene win...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_97fefd39f6d0
unity_docs
editor
What is `EditorApplication.RepaintProjectWindow` in Unity? Explain its purpose and usage.
EditorApplication.RepaintProjectWindow Declaration public static void RepaintProjectWindow (); Description Can be used to ensure repaint of the ProjectWindow. Additional resources: ProjectWindowItemCallback , EditorApplication.projectWindowItemOnGUI .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5aff1b17afbe
unity_docs
scripting
What is `IMGUI.Controls.TreeView.RowGUIArgs.isRenaming` in Unity? Explain its purpose and usage.
TreeView.RowGUIArgs.isRenaming public bool isRenaming ; Description This value is true when the ::item is currently being renamed. By default the item's displayName is not rendered when the rename overlay is showing by using an empty string instead of item.displayName.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6a4745533245
unity_docs
editor
Show me a Unity C# example demonstrating `SerializedProperty.DeleteCommand`.
SerializedProperty.DeleteCommand Declaration public bool DeleteCommand (); Description Deletes the array element referenced by the SerializedProperty. The serialized property can't be used anymore after calling this function. A new iterator must be created in that case. Additional resources: DeleteArrayElemen...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_2f1a7d93f35f
unity_docs
rendering
In Unity's 'Check how many shader variants you have', what is 'Get a list of shader variants the Editor uses' and how does it work?
You can generate a list of shader variants that the Editor uses in the Scene view and the Game view. To do this: Go to Edit > Project Settings > Graphics . Under Shader Loading , you can see how many shaders and shader variants you have next to Currently tracked: . Select Save to asset… to create a shader variant colle...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6e19668900c5
unity_docs
xr
Explain 'XR project set up' in Unity.
To set up a Unity project for XR : Use the XR Plug-in Management settings to enable and configure the plug-ins needed for the XR devices and platforms supported by the project Add XR support packages, such as AR Foundation and the XR Interaction Toolkit Add the components and GameObjects needed to support XR to your sc...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_400559e1c09e
unity_docs
scripting
What is `Camera.pixelRect` in Unity? Explain its purpose and usage.
Camera.pixelRect public Rect pixelRect ; Description Where on the screen is the camera rendered in pixel coordinates. ```csharp //Attach this script to an empty GameObject //Create a new Camera (Create>Camera) and position it appropriately. Attach it to the Second Camera field in the Inspector of the GameObj...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3a9e22f9468e
unity_docs
editor
What are the parameters of `AssetDatabase.SetImporterOverride` in Unity?
Description Sets a specific importer to use for the asset. Multiple Importers may be registered to a single asset by using either the override extension list, or composite extensions. ```csharp using UnityEngine; using UnityEditor; using UnityEditor.AssetImporters; using UnityEngine.Assertions;public class AssetDatabas...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f2c7122067ee
unity_docs
physics
Show me a Unity C# example demonstrating `Search.SearchIndexer.LoadBytes`.
Binary buffer containing the index representation. finished Callback that triggers when the index is fully loaded. The callback parameters indicates if loading was succesful. Returns bool Returns false if the index is of an unsupported version or if there was a problem initializing the reading thread. Descript...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_de5920466c1b
unity_docs
rendering
Show me a Unity C# example demonstrating `GUI.Button`.
for the button. text Text to display on the button. image Texture to display on the button. content Text, image and tooltip for this button. style The style to use. If left out, the button style from the current GUISkin is used. Returns bool true when the users clicks the button. Description Make a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_20906937bc3d
unity_docs
scripting
What is `Cloth.SetEnabledFading` in Unity? Explain its purpose and usage.
Cloth.SetEnabledFading Declaration public void SetEnabledFading (bool enabled , float interpolationTime ); Parameters Parameter Description enabled Fading enabled or not. Description Fade the cloth simulation in or out.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_74adf0720668
unity_docs
scripting
What are the parameters of `Apple.ReplayKit.ReplayKit.StartBroadcasting` in Unity?
Description Initiates and starts a new broadcast When StartBroadcast is called, user is presented with a broadcast provider selection screen, and then a broadcast setup screen. Once it is finished, a broadcast will be started, and the callback will be invoked. It will also be invoked in case of any error. ```csharp usi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_026f827a90a2
unity_docs
editor
What is `Search.IPropertyDatabaseRecordValue` in Unity? Explain its purpose and usage.
IPropertyDatabaseRecordValue interface in UnityEditor.Search Description Interface of a record value. A record value contains the property value that is stored in the record. If the data is serializable (see PropertyDatabase.IsPersistedType ), the record value contains the serialized data, otherwise it contains ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0e5cdafaba51
unity_docs
scripting
What is `ObjectChangeKind.CreateGameObjectHierarchy` in Unity? Explain its purpose and usage.
ObjectChangeKind.CreateGameObjectHierarchy Description A change of this type indicates that a GameObject has been created, possibly with additional objects below it in the hierarchy. This happens for example when Undo.RegisterCreatedObjectUndo is used with a GameObject .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1ed45e556d53
unity_docs
editor
What is `Help.HasHelpForObject` in Unity? Explain its purpose and usage.
Help.HasHelpForObject Declaration public static bool HasHelpForObject ( Object obj ); Description Is there a help page for this object? Additional resources: Help.ShowHelpForObject , Help.GetHelpURLForObject . Editor Window that lets you load docs for any Selected GameObject. ```csharp using UnityEngine; ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_14ff70b42ca3
unity_docs
scripting
What is `AI.NavMesh.IsLinkValid` in Unity? Explain its purpose and usage.
NavMesh.IsLinkValid Declaration public static bool IsLinkValid ( AI.NavMeshLinkInstance handle ); Parameters Parameter Description handle The identifier of the link instance to check. Returns bool True if the NavMesh link is added to the navigation system - otherwise false. Description Determines wh...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e9a772745766
unity_docs
rendering
What is `SceneView.GetAllSceneCameras` in Unity? Explain its purpose and usage.
SceneView.GetAllSceneCameras Declaration public static Camera[] GetAllSceneCameras (); Returns Camera[] Returns an array of camera components. Description Retrieves an array of all camera components from all open Scene views.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e6bb1c8306b9
unity_docs
performance
What is `Unity.Jobs.IJobParallelFor.Execute` in Unity? Explain its purpose and usage.
IJobParallelFor.Execute Declaration public void Execute (int index ); Parameters Parameter Description index The index of the Parallel for loop at which to perform work. Description Performs work against a specific iteration index.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e05697dc215f
unity_docs
input
In Unity's 'Large screen and foldable device support', what is 'Application and Configuration APIs' and how does it work?
The AndroidApplication API provides information on your Android application while it runs on a device. You can use this API to perform the following actions: Access the current activity’s Java instance. Invoke events on the UI thread or main thread of your application. Detect and handle configuration changes while your...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3d3c0f4898d5
unity_docs
scripting
What is `Undo.GetCurrentGroup` in Unity? Explain its purpose and usage.
Undo.GetCurrentGroup Declaration public static int GetCurrentGroup (); Returns int The index of the current undo group. Description Unity automatically groups undo operations by the current group index. The current group index is automatically increased on mouse down, clicking on menu items and other oper...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_60a61f4f66d8
unity_docs
rendering
What is `Sprite.GetSecondaryTextureCount` in Unity? Explain its purpose and usage.
Sprite.GetSecondaryTextureCount Declaration public int GetSecondaryTextureCount (); Returns int Returns the number of Secondary Textures that the Sprite is using. Description Gets the number of Secondary Textures that the Sprite is using. ```csharp using UnityEngine;// Create a Sprite with Secondary Text...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d8dee07e3484
unity_docs
ui
Show me a Unity code example for 'MinMaxSlider'.
values for various parameters, such as volume levels, character stats, or other numerical values in your UI. To use it, define the minimum and maximum values, and then slide the handle to select the range you want. ## Create a MinMaxSlider You can create a MinMaxSlider with UI Builder, UXML, or C#. The following C# e...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_08c7adde1bb6
unity_docs
rendering
What are the parameters of `WebCamTexture.GetPixels32` in Unity?
Returns Color32[] An array that contains the pixel colors. Description Gets the pixel color data for a mipmap level as Color32 structs. This method gets pixel data from the texture in CPU memory. Texture.isReadable must be true . The array contains the pixels row by row, starting at the bottom left of the texture. The ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1cae2037d1b1
unity_docs
math
What is `SceneVisibilityManager.Isolate` in Unity? Explain its purpose and usage.
SceneVisibilityManager.Isolate Declaration public void Isolate ( GameObject gameObject , bool includeDescendants ); Parameters Parameter Description gameObject GameObject to isolate. includeDescendants Whether to include descendants. Description Isolates a GameObject and its descendants. If a GameObje...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0c493c795e6a
unity_docs
editor
Show me a Unity C# example demonstrating `Build.IPreprocessBuildWithReport.OnPreprocessBuild`.
Description report A report containing information about the build, such as its target platform and output path. Description Implement this function to receive a callback before the build is started. This callback is invoked during Player builds, but not during AssetBundle builds. Additional resources: IPos...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_83deffa4bb3e
unity_docs
audio
Show me a Unity C# example demonstrating `Gyroscope.rotationRate`.
Description Returns rotation rate as measured by the device's gyroscope. The rotation rate is given as a Vector3 representing the speed of rotation around each of the three axes in radians per second. This is the value as it is reported by the gyroscope hardware - a more accurate measurement that has been processed...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_0e7f6c8f6ffe
unity_docs
editor
Explain 'Create an aspect ratio custom control' in Unity.
The aspect ratio is the ratio between the width and height of the display. The aspect ratio is used to maintain the proportions of the display. For example, if you have a 4:3 aspect ratio, then the display is 4 pixels wide for every 3 pixels in height. If you have a 16:9 aspect ratio, then the display is 16 pixels wide...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_eb07a0f615e2
unity_docs
animation
What is `ModelImporterClipAnimation.ConfigureMaskFromClip` in Unity? Explain its purpose and usage.
ModelImporterClipAnimation.ConfigureMaskFromClip Declaration public void ConfigureMaskFromClip (ref AvatarMask mask ); Parameters Parameter Description mask AvatarMask to which the masking values will be saved. Description Copy the current masking settings from the clip to an AvatarMask . When writing...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_0253a6a9f765
github
scripting
Write a Unity C# MonoBehaviour script called Board Highlights
```csharp using System.Collections; using System.Collections.Generic; using UnityEngine; public class BoardHighlights : MonoBehaviour { private BoardManager _BoardManager; private void Start() { _BoardManager = gameObject.GetComponent<BoardManager>(); } public void HighlightSquares(bo...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_756d3db368b3
unity_docs
editor
What is `Search.IQueryHandlerFactory_3` in Unity? Explain its purpose and usage.
IQueryHandlerFactory<T0,T1,T2> interface in UnityEditor.Search Description Interface for query handler factories. Public Methods Method Description Create Implement this function to create a new query handler for a specific query graph.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f26c58e197f4
unity_docs
scripting
What is `Random.onUnitSphere` in Unity? Explain its purpose and usage.
Random.onUnitSphere public static Vector3 onUnitSphere ; Description Returns a random point on the surface of a sphere with radius 1.0 (Read Only). ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { // Sets the rigidbody velocity to 10 and in a random direction. GetComponent...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_90e2ddf4e030
unity_docs
rendering
What is `Experimental.Rendering.GraphicsFormatUtility.GetRenderTextureFormat` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphicsFormatUtility.GetRenderTextureFormat Declaration public static RenderTextureFormat GetRenderTextureFormat ( Experimental.Rendering.GraphicsFormat format ); Description Translates GraphicsFormat into RenderTextureF...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7fe5e6781b93
unity_docs
scripting
Show me a Unity C# example demonstrating `KeyCode.UpArrow`.
KeyCode.UpArrow Description Up arrow key. Use this as a parameter to a function like Input.GetKey to detect when the user presses the up arrow key. Additional resources: Input.GetKey , Input.GetKeyDown , Input.GetKeyUp . ```csharp //Attach this to a GameObject //This script tells when the up arrow key is pres...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e3661564daf8
unity_docs
rendering
Show me a Unity C# example demonstrating `Renderer.sortingOrder`.
e it, the further back the GameObject appears. The higher the number, the closer the GameObject looks to the Camera. This is very effective when creating 2D scroller games, as you may want certain GameObjects on the same layer but certain parts to appear in front of others, for example, layering clouds and making them ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_75a704c6691f
unity_docs
editor
What is `Search.SearchValue` in Unity? Explain its purpose and usage.
SearchValue struct in UnityEditor.Search Description Search value is used to extend a query engine with custom type parsers and filters to search results by value. Static Properties Property Description invalid Represent an invalid search value. Properties Property Description boolean Boolean value. float...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f76b70c95bf3
unity_docs
editor
What is `VersionControl.Provider.GetLatestIsValid` in Unity? Explain its purpose and usage.
Provider.GetLatestIsValid Declaration public static bool GetLatestIsValid ( VersionControl.AssetList assets ); Parameters Parameter Description assets List of assets to test. Description The task tests the given asset list and returns true if Provider.GetLatest is valid operation for one or more assets....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8babbfd074df
unity_docs
xr
In Unity's 'Run an XR application', what is 'Play mode' and how does it work?
On the Windows platform, some XR provider plug-ins support a “hybrid” play mode in which the project runs on a connected XR device when you enter Play mode. The Unity Game view mirrors the headset display. You have the choice of the following options for the Game view: Left Eye : shows the left eye only Right Eye : sho...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2c9687e63484
unity_docs
xr
Show me a Unity C# example demonstrating `Search.SearchService.GetItems`.
search items matching the search query. Description Initiates a search and returns all search items matching the search context. Other items can be found later using asynchronous searches. Unity suggests using SearchService.Request to execute a search query. GetItems usually requires setting up more context to...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_a5aa115d5c5b
unity_docs
rendering
In Unity's 'Scene view Draw Modes and View Options overlays', what is 'The Draw Modes overlay' and how does it work?
Change the way meshes render in the Scene view. Draw Mode Description Shading Mode Wireframe Draw meshes with a wireframe representation. Shaded Wireframe Show meshes textured and with wireframes overlaid. Unlit Don’t use scene lighting. Shaded Show surfaces with their textures visible. Debug Refer to the Debug Mode op...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e77688425e98
unity_docs
physics
In Unity's 'Mesh collider component reference', what is 'Layer overrides' and how does it work?
The Layer Overrides section provides properties that allow you to override the project-wide Layer-based collision detection settings for this collider. Property Description Layer Override Priority Define the priority of this collider override. When two colliders have conflicting overrides, the settings of the collider ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cec6c508b901
unity_docs
math
Show me a Unity C# example demonstrating `Vector4.operator_Vector3`.
Vector4.Vector4 Description Converts a Vector3 to a Vector4. Vector3s can be implicitly converted to Vector4 (w is set to zero in the result). ```csharp using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { void Start() { // color as a Vector3 (red, green, blue) Vector3 colo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_24a1e43b6165
unity_docs
editor
What is `Handles.SnapToGrid` in Unity? Explain its purpose and usage.
Handles.SnapToGrid Declaration public static void SnapToGrid (Transform[] transforms , SnapAxis axis ); Declaration public static void SnapToGrid (Vector3[] positions , SnapAxis axis ); Parameters Parameter Description transforms The transforms to snap. positions The positions to snap. axis Th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_127b18e29eb3
unity_docs
scripting
What is `UIElements.DataBinding.UpdateUI` in Unity? Explain its purpose and usage.
DataBinding.UpdateUI<TValue>(BindingContext,TValue) Parameters Parameter Description context Context object containing the necessary information to resolve a binding. value The resolved value from the data source. Returns void A BindingResult indicating if the binding update succeeded or not. Descripti...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_86111bfc1237
unity_docs
performance
What is `Unity.Collections.NativeArray_1.GetSubArray` in Unity? Explain its purpose and usage.
NativeArray<T0>.GetSubArray Declaration public NativeArray<T> GetSubArray (int start , int length ); Parameters Parameter Description start The start index of the sub array. length The length of the sub array. Returns NativeArray<T> A view into the array that aliases the original array, which can't be...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1bd798e3261d
unity_docs
scripting
Show me a Unity C# example demonstrating `Quaternion.ctor`.
Quaternion Constructor Declaration public Quaternion (float x , float y , float z , float w ); Description Constructs new Quaternion with given x,y,z,w components. ```csharp //Create three Sliders (Create>UI>Slider) and three Text GameObjects (Create>UI>Text). These are for manipulating the x, y, and z val...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_04cb43fb487a
unity_docs
scripting
In Unity's 'Enter Play mode with domain reload disabled', what is 'Effects of disabling domain reload when entering Play mode' and how does it work?
When you disable domain reload: Non-serialized fields keep the values assigned to them during Play mode on returning to Edit mode. This applies for fields of all script types, including MonoBehaviours (including those on prefab assets), ScriptableObjects, and your own custom C# types. For detailed information on what i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_6910d9d9a9ea_doc_27
github
scripting
What does `OnBecameInvisibleAsObservable` do in this Unity script? Explain its purpose and signature.
OnBecameInvisible is called when the renderer is no longer visible by any camera. Signature: ```csharp public static IObservable<Unit> OnBecameInvisibleAsObservable(this Component component) ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_50ec082b68d2
unity_docs
rendering
What is `MaterialProperty.displayName` in Unity? Explain its purpose and usage.
MaterialProperty.displayName public string displayName ; Description Display name of the property (Read Only). This is the user-visible property name, for example "Main Texture" that is declared in the shader's Properties block. Additional resources: name .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_72a80a817442
unity_docs
scripting
What is `PlayerPrefs.GetInt` in Unity? Explain its purpose and usage.
PlayerPrefs.GetInt Declaration public static int GetInt (string key ); Parameters Parameter Description key The key used to retrieve the corresponding int value in the player preferences. Returns int The int value that corresponds to the given key . Returns 0 if no int value is found for the given ke...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9c9e232c9795
unity_docs
ui
What is `UIElements.PanelSettings.themeStyleSheet` in Unity? Explain its purpose and usage.
PanelSettings.themeStyleSheet public UIElements.ThemeStyleSheet themeStyleSheet ; Description Specifies a style sheet that Unity applies to every UI Document attached to the panel. By default this is the main Unity style sheet, which contains default styles for Unity-supplied elements such as buttons, sl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ca553181a603
unity_docs
scripting
What is `Camera.SetStereoViewMatrix` in Unity? Explain its purpose and usage.
Camera.SetStereoViewMatrix Declaration public void SetStereoViewMatrix ( Camera.StereoscopicEye eye , Matrix4x4 matrix ); Parameters Parameter Description eye Specifies the stereoscopic view matrix to set. matrix The matrix to be set. Description Sets a custom view matrix for a specific stereoscopic...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_617a74e30414
unity_docs
editor
What are the parameters of `EditorPrefs.SetInt` in Unity?
Description Sets the value of the preference identified by key as an integer. Sets the value of the preference identified by key as an integer. Additional resources: GetInt . ```csharp // A small editor window that allows an integer value to be // read and written to the EditorPrefs online storage. // // SetIntExample ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9ace3020f0e1
unity_docs
audio
What is `Rendering.SplashScreen.Begin` in Unity? Explain its purpose and usage.
SplashScreen.Begin Declaration public static void Begin (); Description Initializes the splash screen so it is ready to begin drawing. Call this before you start calling SplashScreen.Draw . Internally this function resets the timer and prepares the logos for drawing. ```csharp using System.Collections; using U...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ac08288f40ca
unity_docs
xr
Show me a Unity C# example demonstrating `Scripting.RequireImplementorsAttribute`.
RequireImplementorsAttribute class in UnityEngine.Scripting / Implemented in: UnityEngine.CoreModule Description When the interface type is marked, all types implementing that interface will be marked. ```csharp using System; using UnityEngine; using UnityEngine.Scripting;public class NewBehaviourScript : MonoB...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_283b79527e4b
unity_docs
xr
What is `Windows.WebCam.VideoCapture.CaptureResultType` in Unity? Explain its purpose and usage.
CaptureResultType enumeration Description Contains the result of the capture request. Properties Property Description Success Specifies that the desired operation was successful. UnknownError Specifies that an unknown error occurred.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d23de58a14d6
unity_docs
animation
What is `Animations.GameObjectRecorder.currentTime` in Unity? Explain its purpose and usage.
GameObjectRecorder.currentTime public float currentTime ; Description Returns the current time of the recording. (Read Only) The returned time is 0.0f when TakeSnapshot is called for the first time and delta time is added for every subsequent call.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5ba17da8514e
unity_docs
scripting
What is `ArticulationBody.SetDriveTarget` in Unity? Explain its purpose and usage.
ArticulationBody.SetDriveTarget Declaration public void SetDriveTarget ( ArticulationDriveAxis axis , float value ); Parameters Parameter Description axis The drive axis. value The value to set the target to. Description Sets the target value of the specified drive. Additional resources: Articulatio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_abd090015bed_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
When an object is tilted, run some functionalityUsed with a grabable object Signature: ```csharp public class OnTilt : MonoBehaviour ```
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_man_8e09d12df2a9
unity_docs
rendering
Explain 'Web graphics' in Unity.
WebGL is an API for rendering graphics in web browsers, which is based on the functionality of the OpenGL ES graphics library. WebGL 2.0 roughly matches with the OpenGL ES 3.0 functionality. ## Camera clear By default, Unity Web clears the drawing buffer after each frame, which means the content of the frame buffer c...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f4132312b77b
unity_docs
physics
Explain 'Importing a model with humanoid animations' in Unity.
When Unity imports Model files that contain Humanoid Rigs and Animation, it needs to reconcile the bone structure of the Model to its Animation. It does this by mapping each bone in the file to a Humanoid Avatar so that it can play the Animation properly. For this reason, it is important to carefully prepare your Model...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c71c9a731cd9
unity_docs
animation
What is `Animations.AnimationStreamHandleUtility` in Unity? Explain its purpose and usage.
AnimationStreamHandleUtility class in UnityEngine.Animations / Implemented in: UnityEngine.AnimationModule Description Static class providing utility functions for animation stream handles. Additional resources: AnimationStream and PropertyStreamHandle . Static Methods Method Description ReadFloats Reads...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_bc1c4f888d03
unity_docs
rendering
Explain 'Introduction to shadow cascades' in Unity.
Shadow cascades let you improve the visual fidelity of shadows without increasing the shadow map resolution. For example, the following illustration shows shadow rendering with different numbers of shadow cascades. The shadow resolution is 2048 in all cases. Shadow rendering with different cascade numbers. A: 1 (no cas...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_7dcbadfcfcba
unity_docs
rendering
In Unity's 'Introduction to prefabs', what is 'Working with prefabs' and how does it work?
To work with prefabs, you create a prefab asset , which you then use to create prefab instances within a scene. You can nest prefabs inside other prefabs to create complex hierarchies of objects that you can edit at multiple levels. However, not all prefab instances need to be identical. You can override settings on in...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cd990ee0aa25
unity_docs
physics
What is `Collider2D.IsTouchingLayers` in Unity? Explain its purpose and usage.
Collider2D.IsTouchingLayers Declaration public bool IsTouchingLayers (int layerMask = Physics2D.AllLayers); Parameters Parameter Description layerMask Any colliders on any of these layers count as touching. Returns bool Whether this collider is touching any collider on the specified layerMask or not. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_b098ce50d299
unity_docs
scripting
Explain 'Memory in Unity' in Unity.
To ensure your application runs with no performance issues, it’s important to understand how Unity uses and allocates memory. Topic Description Memory in Unity introduction Understand the different ways that Unity manages memory. Managed memory Automatically manage the release and allocation of memory in your applicati...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_f3d90b097b1b
github
scripting
Write a Unity C# MonoBehaviour script called Sample Default Mono Behaviour
```csharp using UnityEngine; namespace FieldSearch.Samples { /// <summary> /// Sample monobehaviour without specific inspector /// </summary> public class SampleDefaultMonoBehaviour : MonoBehaviour { [SerializeField] private Transform Receiver; [SerializeField] private Transform Se...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_9e729ee05f66
unity_docs
editor
What is `Build.Content.SceneBundleInfo` in Unity? Explain its purpose and usage.
SceneBundleInfo class in UnityEditor.Build.Content Description Container for holding asset loading information for a streamed Scene AssetBundle to be built. Note: this class and its members exist to provide low-level support for the Scriptable Build Pipeline package. This is intended for internal use only; use ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_59e2038ccb74
unity_docs
scripting
Explain 'The GameObject class' in Unity.
Unity’s GameObject class represents anything that can exist in a Scene . GameObjects are the building blocks for scenes in Unity and act as a container for functional components which determine how the GameObject looks and what it does. The GameObject class class provides a collection of methods which allow you to work...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_cf41fd5ba932_doc_5
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Whether to use the specified head transform or controller transform to direct the XR Origin's movement for the right hand. Signature: ```csharp public MovementDirection rightHandMovementDirection ```
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_man_48b8430b4a35
unity_docs
physics
Explain 'Introduction to Mesh colliders' in Unity.
Mesh colliders match the shape of a Mesh exactly, for extremely accurate collision simulation. The Mesh collider builds its collision geometry to match an assigned Mesh , including its shape, position and scale. The benefit of this is that you can make the shape of the collider exactly the same as the shape of the visi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9a788d9613de
unity_docs
performance
What is `Unity.Jobs.IJobForExtensions.EarlyJobInit` in Unity? Explain its purpose and usage.
IJobForExtensions.EarlyJobInit Declaration public static void EarlyJobInit (); Description Gathers and caches reflection data for the internal job system's managed bindings. Unity is responsible for calling this method - don't call it yourself. When the Jobs package is included in the project, Unity generates c...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6a393958b29a
unity_docs
scripting
What is `ProfilerWindow` in Unity? Explain its purpose and usage.
ProfilerWindow class in UnityEditor / Inherits from: EditorWindow Implements interfaces: IHasCustomMenu Description Use the ProfilerWindow class for interactions with the Profiler Window such as checking which frame it currently shows and controlling the selected Profiler sample in the CPU or GPU Usage ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1a0c0617caf2
unity_docs
editor
What is `Search.QueryEngine_1.SetDefaultFilter` in Unity? Explain its purpose and usage.
QueryEngine<T0>.SetDefaultFilter Declaration public void SetDefaultFilter (Func<TData,string,string,string,bool> handler ); Parameters Parameter Description handler Callback used to handle the filter. Takes an object of type TData, the filter identifier, the operator, and the filter value, and returns a bool...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_223b5e324439
unity_docs
editor
Show me a Unity C# example demonstrating `WebGLInput.stickyCursorLock`.
ursorLock ; Description Set cursor lock behavior to be "sticky" or "unsticky". Sticky cursor lock means if the browser unlocks the cursor when the user presses the ESC key, the cursor will remain locked in Unity. To match the browser's behavior, this property can be set to false, which will "unstick" the cursor lo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_beed4e2cce16
unity_docs
ui
In Unity's 'Runtime UI event system and input handling', what is 'Set the active input handling system' and how does it work?
To set the active input handling system in your project: Select Edit > Project Settings > Player . In the Player window, under Other Settings > Configuration , set Active Input Handling to one of the following options: Input Manager (Old) : Use the legacy Input Manager. Input System Package (New) : Use the Input System...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0104dc3f43f8
unity_docs
scripting
What is `PlayerSettings.GetIl2CppCompilerConfiguration` in Unity? Explain its purpose and usage.
PlayerSettings.GetIl2CppCompilerConfiguration Declaration public static Il2CppCompilerConfiguration GetIl2CppCompilerConfiguration ( Build.NamedBuildTarget buildTarget ); Parameters Parameter Description buildTarget The NamedBuildTarget . Returns Il2CppCompilerConfiguration Returns compiler configur...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_87fcd774de34
unity_docs
rendering
In Unity's 'Create a particle material in the Built-In Render Pipeline', what is 'Types of particle shader' and how does it work?
Unity has the following types of particle shader: Standard Particles Surface Shader - This comes with functionality similar to the Standard Shader, but works especially well with particles. Like the Standard Shader, it supports Physically Based Shading . It does not include features that are unsuitable for dynamic part...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_2872143296cb
unity_docs
scripting
Explain 'Navigation panel reference' in Unity.
Use the Package Manager’s navigation panel to select which subset of packages you want to view. Select a context from the navigation panel (A) to list those types of packages in the list panel (B) . When you select a package from the list panel, its details display in the details view (C) . ## Context list Select the...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ba1a88d8844e
unity_docs
rendering
What is `Rendering.GizmoSubset` in Unity? Explain its purpose and usage.
GizmoSubset enumeration Description Specifies whether gizmos render before or after postprocessing for a camera render. Properties Property Description PreImageEffects Specifies gizmos that are rendered before ImageEffects. PostImageEffects Specifies gizmos that are rendered after ImageEffects.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.