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_4121aa27a856
unity_docs
performance
Show me a Unity C# example demonstrating `Unity.IO.LowLevel.Unsafe.AsyncReadManager.Read`.
metrics for this read operation. When you enable metrics collection with AsyncReadManagerMetrics.StartCollectingMetrics , Unity includes this information as part of the AsyncReadManagerMetrics , allowing you to analyze how different types of assets affect performance. The AsyncReadManager copies the data referenced ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_10b24b66d150
unity_docs
ui
Show me a Unity code example for 'ListView'.
A ListView is a vertically scrollable area that links to and displays a list of items. Note : The horizontal and vertical Scroller elements are standard UI Toolkit Scrollers. ## Create a ListView You can create a ListView with UI Builder, UXML, and C#. The following C# example creates a ListView: ``` var listView = n...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2a9f6e72bb38
unity_docs
math
What is `IMGUI.Controls.PrimitiveBoundsHandle.HandleDirection` in Unity? Explain its purpose and usage.
HandleDirection enumeration Description An enumeration of directions the handle moves in. Properties Property Description PositiveX This value corresponds to the handle moving in a positive direction away from PrimitiveBoundsHandle.center along the x-axis. NegativeX This value corresponds to the handle moving ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_15a20f760b78
unity_docs
rendering
What is `Build.IPreprocessComputeShaders` in Unity? Explain its purpose and usage.
IPreprocessComputeShaders interface in UnityEditor.Build Implements interfaces: IOrderedCallback Description Implement this interface to receive a callback before a compute shader is compiled. For more information about build callbacks, refer to Use build callbacks . Public Methods Method Description OnP...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f274f81816fd
unity_docs
math
What is `Vector2.sqrMagnitude` in Unity? Explain its purpose and usage.
Vector2.sqrMagnitude public float sqrMagnitude ; Description Returns the squared length of this vector (Read Only). Calculating the squared magnitude instead of the magnitude is much faster. Often if you are comparing magnitudes of two vectors you can just compare their squared magnitudes. Additional resource...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c2fb8345fa72
unity_docs
scripting
Show me a Unity C# example demonstrating `Hash128.ToString`.
Hash128.ToString Declaration public string ToString (); Description Convert a Hash128 to string. This creates a string that is 32 characters long. Each of the 16 hash bytes is represented as two hexadecimal characters. ```csharp using UnityEngine;public class ExampleScript : MonoBehaviour { void Start() { v...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_4d855da66171
unity_docs
rendering
In Unity's 'Web performance considerations', what is 'Web content in background tabs' and how does it work?
Your content continues to run when the canvas or browser window loses focus if one of the following options is enabled: Run in background in the Player settings for the Web platform Application.runInBackground However, some browsers can throttle content running in background tabs. If the tab with your content isn’t vis...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_b10827107f7c
unity_docs
audio
In Unity's 'Supported codecs for transparent videos (per-pixel alpha)', what is 'Supported per-pixel alpha codecs' and how does it work?
Unity supports two codecs that have per-pixel alpha: Apple ProRes 4444 WebM with VP8 Note : If you’re not sure what codec your video uses, your operating system’s video playback software might have the functionality to identify it.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ce4d51367202
unity_docs
physics
What is `UIElements.DropdownMenuEventInfo` in Unity? Explain its purpose and usage.
DropdownMenuEventInfo class in UnityEngine.UIElements / Implemented in: UnityEngine.UIElementsModule Description Provides information about the event that caused the dropdown menu to display. Properties Property Description localMousePosition The position of the mouse if the event that triggered the dro...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_9055363c7f75
github
scripting
Write a Unity C# MonoBehaviour script called Coroutine Handler
```csharp using System; using System.Collections; using UnityEngine; namespace THEBADDEST.Coroutines { public class CoroutineHandler { static MonoRunner mono; /// <summary> /// Creates a new <see cref="MonoRunner"/> instance to run all coroutines on. /// </summary> /// <remarks> /// ...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_9745011664b3
unity_docs
scripting
What is `Search.SearchIndexer.IndexDocument` in Unity? Explain its purpose and usage.
SearchIndexer.IndexDocument Declaration public void IndexDocument (string document , bool checkIfDocumentExists ); Parameters Parameter Description document Path of the document to index. checkIfDocumentExists Verifies if the document exists. Description Function to override in a concrete SearchIndexer ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7fc01fba91ec
unity_docs
scripting
What is `Rendering.GraphicsSettings.isScriptableRenderPipelineEnabled` in Unity? Explain its purpose and usage.
GraphicsSettings.isScriptableRenderPipelineEnabled public static bool isScriptableRenderPipelineEnabled ; Description If the value is true , a Scriptable Render Pipeline is active. Additional resources: GraphicsSettings.currentRenderPipeline .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_562892759ccc_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Provides the description for an OpenXR CameraRig node element. Signature: ```csharp public class OpenXRNodeRecord : BaseDeviceDetailsRecord ```
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_22ed9a8e6216
unity_docs
editor
What is `Profiling.FrameDataView.UnityObjectInfo` in Unity? Explain its purpose and usage.
UnityObjectInfo struct in UnityEditor.Profiling Description Unity Object information. ```csharp using UnityEditorInternal; using UnityEditor.Profiling;public class Example { public static string GetInstanceName(int frame, int instanceId) { using (var frameData = ProfilerDriver.GetRawFrameDataView(frame, 0)) {...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f94ae513871e
unity_docs
physics
What is `Rigidbody2D.inertia` in Unity? Explain its purpose and usage.
Rigidbody2D.inertia public float inertia ; Description The Rigidbody's resistance to changes in angular velocity (rotation). Rotational inertia controls a Rigidbody's resistance to changes in angularVelocity . It is similar to how mass controls a Rigidbody's resistance to changes in linearVelocity . The rot...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_a7b80feca4fa
unity_docs
xr
Show me a Unity code example for 'Submit a license request from a command line and browser (macOS, Linux)'.
scribed earlier. On macOS, you’ll add /Contents/MacOS/Unity to this path for this procedure. Note : On macOS, although you don’t need Finder for this step, this latter subdirectory structure isn’t visible in Finder, unless you right-click the Unity application ( Unity.app ) and select Show Package Contents . For exampl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_51ddbeeadee8
unity_docs
editor
Show me a Unity C# example demonstrating `AssetImporters.ScriptedImporter.GatherDependenciesFromSourceFile`.
tation of this method, or any methods that you call from your implementation, you must not call any of the following APIs: AssetDatabase.CreateAsset AssetDatabase.LoadAllAssetRepresentationsAtPath AssetDatabase.LoadAllAssetsAtPath AssetDatabase.LoadAssetAtPath AssetDatabase.LoadMainAssetAtPath Unity throws an exception...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2a6ba932af02
unity_docs
scripting
Show me a Unity C# example demonstrating `AudioSettings.Reset`.
on Changes the device configuration and invokes the AudioSettings.OnAudioConfigurationChanged delegate with the argument deviceWasChanged=false . There's no guarantee that the exact settings specified are used, but Unity automatically uses the closest match that it supports. Note: This can cause main thread stall...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0ac514ee8a07
unity_docs
scripting
Show me a Unity C# example demonstrating `GameObject.TryGetComponent`.
null . Returns bool Returns true if the component is found, false otherwise. Description Retrieves the component of the specified type, if it exists. TryGetComponent attempts to retrieve the component of the given type. The notable difference compared to GameObject.GetComponent is that this method does ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_35028de0e2d6
unity_docs
scripting
What is `Rendering.RenderStateBlock.depthState` in Unity? Explain its purpose and usage.
RenderStateBlock.depthState public Rendering.DepthState depthState ; Description Specifies the new depth state. Unity applies these values to the GPU's render state if RenderStateBlock.mask includes a value of RenderStateMask.Depth . The default value is DepthState.defaultValue .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_547f0e63c6b8
unity_docs
physics
What is `AndroidPreferredInstallLocation` in Unity? Explain its purpose and usage.
AndroidPreferredInstallLocation enumeration Description Options for preferred storage location for the application installation on Android devices. These options indicate whether the application should be installed on an internal or external storage of the Android device. You can pass a value from this enum to Pl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_a4123adb47bb
unity_docs
input
Explain 'Work with text' in Unity.
Text objects are defined by the following attributes of a UI control: The text attribute of some UI controls, such as Label or TextElement , that sets the display text. The value attribute of the TextField that accepts the input text, and the label attribute that sets the display text for TextField . You can use USS te...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6bf55405eb4d
unity_docs
animation
Explain 'Sub-State Machines' in Unity.
It is common for a character to have complex actions that consist of a number of stages. Rather than handle the entire action with a single state, it makes sense to identify the separate stages and use a separate state for each. For example, a character may have an action called “Trickshot” where it crouches to take a ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a0609def8df2
unity_docs
rendering
What is `CustomRenderTexture.GetUpdateZones` in Unity? Explain its purpose and usage.
CustomRenderTexture.GetUpdateZones Declaration public void GetUpdateZones (List<CustomRenderTextureUpdateZone> updateZones ); Parameters Parameter Description updateZones Output list of Update Zones. Description Returns the list of Update Zones. Additional resources: CustomRenderTextureUpdateZone .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fe27e1b0d4e9
unity_docs
rendering
What is `MaterialGlobalIlluminationFlags.RealtimeEmissive` in Unity? Explain its purpose and usage.
MaterialGlobalIlluminationFlags.RealtimeEmissive Description The emissive lighting will affect Enlighten Realtime Global Illumination. It emits lighting into real-time lightmaps and real-time Light Probes. The flags are mutually exclusive so if you are using real-time Emissive lighting, you must remove the Emissive...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_88ddd67054e6
unity_docs
editor
What are the parameters of `AssetDatabase.AssetPathToGUID` in Unity?
Returns string GUID of the asset. Description Get the GUID for the asset at path . All paths are relative to the project folder, for example: "Assets/MyTextures/hello.png". When you delete an asset, the GUID for that asset remains in Unity's asset database until you close the Editor. As a result, by default this method...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_76a3cf5860b6
unity_docs
math
What is `Tilemaps.ITilemap.GetTileFlags` in Unity? Explain its purpose and usage.
ITilemap.GetTileFlags Declaration public Tilemaps.TileFlags GetTileFlags ( Vector3Int position ); Parameters Parameter Description position Position of the Tile on the Tilemap . Returns TileFlags TileFlags from the Tile . Description Gets the Tile Flags of the Tile at the given position. Refer ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7ef053b4de56
unity_docs
math
What is `UIElements.Painter2D.BezierCurveTo` in Unity? Explain its purpose and usage.
Painter2D.BezierCurveTo Declaration public void BezierCurveTo ( Vector2 p1 , Vector2 p2 , Vector2 p3 ); Parameters Parameter Description p1 The first control point of the cubic bezier. p2 The second control point of the cubic bezier. p3 The final position of the cubic bezier. Description Adds a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6fa294286b06
unity_docs
math
What is `ModifiableContactPair.GetTargetVelocity` in Unity? Explain its purpose and usage.
ModifiableContactPair.GetTargetVelocity Declaration public Vector3 GetTargetVelocity (int i ); Parameters Parameter Description i Index of the contact point. Returns Vector3 The target velocity at a contact point. Description Get the target velocity the solver should aim reaching at a particular co...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7186fd357a22
unity_docs
scripting
What is `WindZone.radius` in Unity? Explain its purpose and usage.
WindZone.radius public float radius ; Description Radius of the Spherical Wind Zone (only active if the WindZoneMode is set to Spherical). ```csharp // Creates a Spherical Wind Zone and sets its radius to 10. using UnityEngine;public class ExampleScript : MonoBehaviour { void Start() { var wind = gameObject...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_c43f3d43a7bc
github
scripting
Write a Unity C# UI script for Dropdown Sample
```csharp using TMPro; using UnityEngine; public class DropdownSample: MonoBehaviour { [SerializeField] private TextMeshProUGUI text = null; [SerializeField] private TMP_Dropdown dropdownWithoutPlaceholder = null; [SerializeField] private TMP_Dropdown dropdownWithPlaceholder = null; public void OnButtonClic...
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_0880a93b4b28
unity_docs
editor
What is `Build.IPostprocessBuildWithReport` in Unity? Explain its purpose and usage.
IPostprocessBuildWithReport interface in UnityEditor.Build Implements interfaces: IOrderedCallback Description Implement this interface to receive a callback after the build is complete. Public Methods Method Description OnPostprocessBuild Implement this function to receive a callback after the build is compl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_2bfd5d63094d
unity_docs
physics
In Unity's 'Line Renderer Scene Tools panel reference', what is 'Scene Editing Mode: Edit Points' and how does it work?
To set the Scene Editing Mode to Edit Points , select the Edit Points button. Select it again to set the Scene Editing Mode to None . Control Description Show Wireframe When enabled, Unity draws a wireframe in the Scene view that visualizes the line. Subdivide Selected This button is enabled when you select two or more...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2ee5d015cd5a
unity_docs
rendering
What is `TextureMipmapLimitGroups` in Unity? Explain its purpose and usage.
TextureMipmapLimitGroups class in UnityEngine / Implemented in: UnityEngine.CoreModule Description Script interface for texture mipmap limit groups. Use this class to add, remove or detect texture mipmap limit groups in C#. Additional resources: TextureMipmapLimitSettings , QualitySettings.globalTextureMipmap...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_985cc23f96ee
unity_docs
rendering
Explain 'Batch static meshes at build time' in Unity.
To batch static GameObjects at build time, enable static batching . For more information about batching, refer to Introduction to batching meshes . Follow these steps: Go to Edit > Project Settings > Player . In Other Settings , enable Static Batching . In the Scene view or Hierarchy window, select the GameObject that ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d40087f2730b
unity_docs
editor
Explain 'Embedded systems' in Unity.
Embedded systems are specialized platforms designed for hardware products where the software supports the functionality of the device. The Unity Editor for Embedded Platforms is available under separate terms. For download information and licensing, contact your Account Manager or the Unity Sales team. Topic Descriptio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_838969bc49a9
unity_docs
scripting
What is `Playables.PlayableOutputExtensions.IsOutputValid` in Unity? Explain its purpose and usage.
PlayableOutputExtensions.IsOutputValid Declaration public static bool IsOutputValid (U output ); Parameters Parameter Description output The PlayableOutput used by this operation. Returns bool True if the PlayableOutput has not yet been destroyed and false otherwise.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4632b53734f1
unity_docs
scripting
Show me a Unity C# example demonstrating `ParticleSystem.NoiseModule.quality`.
ParticleSystem.NoiseModule.quality public ParticleSystemNoiseQuality quality ; Description Generate 1D, 2D or 3D noise. ```csharp using UnityEngine; using System.Collections;[RequireComponent(typeof(ParticleSystem))] public class ExampleClass : MonoBehaviour { private ParticleSystem ps; public bool moduleE...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_99a2bb129c4f
unity_docs
physics
In Unity's 'Enable or disable asynchronous shader compilation', what is 'In a CommandBuffer scope' and how does it work?
In a CommandBuffer scope, you can use ShaderUtil.SetAsyncCompilation and ShaderUtil.RestoreAsyncCompilation . Immediately before you call the rendering commands, call ShaderUtil.SetAsyncCompilation , and set it to false . Subsequent commands in the CommandBuffer won’t allow asynchronous compilation. Add the rendering c...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_31ccd09476c3
unity_docs
math
What is `SerializedProperty.Next` in Unity? Explain its purpose and usage.
SerializedProperty.Next Declaration public bool Next (bool enterChildren ); Description Move to next property. Update the SerializedProperty so that it points to the next property, in the order of serialization. This is can be used to traverse the state of objects without prior knowledge of their data structur...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_16a21de82b79
unity_docs
scripting
Give me an overview of the `VideoBitrateMode` class in Unity.
VideoBitrateMode enumeration Description Bit rate after the clip is transcoded. Values are labeled assuming a HD 1080P stream. Properties Property Description Low Low value, safe for slower internet connections or clips where visual quality is not critical. Medium Typical bit rate supported by internet connec...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a95459898ce9
unity_docs
rendering
What is `Rendering.CullMode` in Unity? Explain its purpose and usage.
CullMode enumeration Description Determines which faces Unity culls. The following example shows how to use this enum to set the culling mode of a GameObject from a C# script. Use the following code in your shader to declare the _Cull property that you can change from a C# script: ``` Shader "Example/SetCullMo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_dfbf382908fd
unity_docs
math
What is `Mesh.SetVertices` in Unity? Explain its purpose and usage.
Mesh.SetVertices Declaration public void SetVertices (Vector3[] inVertices ); Declaration public void SetVertices (List<Vector3> inVertices ); Declaration public void SetVertices (NativeArray<T> inVertices ); Parameters Parameter Description inVertices Per-vertex positions. Description Assigns a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_957d751da6d7
unity_docs
physics
In Unity's 'Distribution size and code stripping', what is 'Hints and tips specific to Web' and how does it work?
Specify the Crunch texture compression format for all your compressed textures in the Texture Importer . Don’t deploy development builds ; they’re not compressed or minified , and so have much larger file sizes. In the Player settings window, (click Edit > Project Settings > Web ) expand Publishing Settings , and set E...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7386521a8cf5
unity_docs
ui
What is `EditorApplication.isPaused` in Unity? Explain its purpose and usage.
EditorApplication.isPaused public static bool isPaused ; Description Whether the Editor is paused. This returns true if the Editor is paused. Use this to change the pause state programmatically, like pressing the Pause button in the main toolbar. This also returns true when you press the Step button in the main...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_44d09a410167
unity_docs
rendering
In Unity's 'Optimize Web platform for mobile', what is 'Use C# to enable the optimize for size setting' and how does it work?
If you have a script that edits settings and you want to enable the Disk Size with LTO setting with C#, add the following code to your script: ``` // Set Platform Settings to optimize for disk size (LTO) UnityEditor.WebGL.UserBuildSettings.codeOptimization = UnityEditor.WebGL.WasmCodeOptimization.DiskSizeLTO; ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_858b3741405b
unity_docs
math
In Unity's 'Debug Web builds in development', what is 'Debug your build in a browser’s JavaScript console' and how does it work?
The Unity Web platform doesn’t have access to your file system, so it doesn’t write a log file like other platforms. However, it does write all logging information such as Debug.Log , Console.WriteLine or Unity’s internal logging to the browser’s JavaScript console. To open the JavaScript console: OS Browser Instructio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_83b7c3540080
unity_docs
scripting
Show me a Unity C# example demonstrating `SystemLanguage.Chinese`.
SystemLanguage.Chinese Description Chinese. ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { //This checks if your computer's operating system is in the Chinese language if (Application.systemLanguage == SystemLanguage.Chinese) { //Outputs into console that the system is in Ch...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_21a5e60fe745
unity_docs
rendering
In Unity's 'Light halos', what is 'Render pipeline information' and how does it work?
How you work with light halos depends on the render pipeline you use. Feature name Universal Render Pipeline (URP) High Definition Render Pipeline (HDRP) Built-in Render Pipeline Halos Yes Use a Lens Flare (SRP) Data Asset and a Lens Flare (SRP) component . Yes Use a Lens Flare (SRP) Data Asset and a Lens Flare (SRP) c...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6601f53d518e
unity_docs
math
What is `Ray.GetPoint` in Unity? Explain its purpose and usage.
Ray.GetPoint Declaration public Vector3 GetPoint (float distance ); Description Returns a point at distance units along the ray. ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { Ray r = new Ray(); print(r.GetPoint(10)); // a point 10 units along the ray } } ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_61ac6045c8fb
unity_docs
ui
What is `UIElements.VisualElement.RemoveFromClassList` in Unity? Explain its purpose and usage.
VisualElement.RemoveFromClassList Declaration public void RemoveFromClassList (string className ); Parameters Parameter Description className The name of the class to remove to the list. Description Removes a class from the class list of the element.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_7a5ba99162bb
unity_docs
ui
Explain 'Control textures of the dynamic atlas' in Unity.
To reduce the number of batches broken by texture changes and achieve good performance, use an atlas to group together textures used at the same time. You can achieve this with either of the following methods: Use a sprite atlas . With this method, you have more control over the sprites but you need to manually create ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_7be392100fbd
unity_docs
scripting
Show me a Unity code example for 'Create a car with Wheel colliders'.
owing: Control car movement : Send steering, torque, and brake values to the Wheel colliders based on user input. Control wheel movement : Move and rotate the wheel meshes according to each Wheel collider’s state. In this example, we use two scripts to do this: CarControl.cs and WheelControl.cs . ## Add control for ca...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f75674bf26fa
unity_docs
rendering
In Unity's 'XR Plug-in Management settings', what is 'Settings reference' and how does it work?
You can use the XR Plug-in Management section to Enable a provider . Refer to the following image and table to understand the key regions of the section that you can use to enable XR providers: The XR Plug-in Management settings: Label Setting Purpose Build target tabs A tab is shown for each platform build target inst...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_754b70307dbf
github
scripting
Write a Unity C# script called Text Switcher
```csharp using System.Collections.Generic; using TMPro; using UnityEngine; namespace UIStateSwitcher { public class TextSwitcher : SwitchableElement { [SerializeField] protected TextMeshProUGUI textElement; [SerializeField] protected List<SwitchableText> switchableTexts; p...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_b5fd96d0ecb1
unity_docs
scripting
What is `ParticleSystem.LimitVelocityOverLifetimeModule.separateAxes` in Unity? Explain its purpose and usage.
ParticleSystem.LimitVelocityOverLifetimeModule.separateAxes public bool separateAxes ; Description Set the velocity limit on each axis separately. This module uses ParticleSystem.LimitVelocityOverLifetimeModule.drag to dampen a particle's velocity if the velocity exceeds this value. ```csharp using UnityEngi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_d35a59146c58
github
scripting
Write a Unity C# script called Object Active Bool Value Provider
```csharp using System; using UnityEngine; namespace Examples { public interface IBoolValueProvider { bool GetValue(); } [Serializable] public class ObjectActiveBoolValueProvider : IBoolValueProvider { [SerializeField] private GameObject gameObject; public bool Get...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_man_f6fe88916e1d
unity_docs
scripting
In Unity's 'TreeView', what is 'Create a TreeView' and how does it work?
You can create a TreeView with UI Builder, UXML, and C#. The following C# example creates a TreeView: ``` var treeView = new TreeView(); ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_23a55b0f8dd9
unity_docs
physics
Give me an overview of the `JointProjectionMode` class in Unity.
JointProjectionMode enumeration Description Determines how to snap physics joints back to its constrained position when it drifts off too much. Additional resources: ConfigurableJoint . Properties Property Description None Don't snap at all. PositionAndRotation Snap both position and rotation.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_9105bf8348ac
unity_docs
rendering
Explain 'High dynamic range (HDR)' in Unity.
Resources and techniques for applying high dynamic range (HDR) to increase the range of colour and luminosity values available in all rendering pipelines. Page Description Introduction to high dynamic range Understand HDR and how HDR works in Unity. HDR color picker reference Explore the properties in the HDR color pic...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7259794be930
unity_docs
math
What is `Rendering.SubPassDescriptor` in Unity? Explain its purpose and usage.
SubPassDescriptor struct in UnityEngine.Rendering / Implemented in: UnityEngine.CoreModule Description Structure discribing a single native subpass. Properties Property Description colorOutputs Array of attachment indices to be used as the color render targets in this sub pass. These are specificed as indice...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e3d27f6cff97
unity_docs
rendering
What are the parameters of `Editor.OnInteractivePreviewGUI` in Unity?
Description Implement to create your own interactive custom preview. Interactive custom previews are used in the preview area of the inspector and the object selector. Implement this method, instead of OnPreviewGUI , to display interactive custom previews. You can implement both methods when some previews are interacti...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_ea6ad274d7f8
unity_docs
networking
Explain 'Unity multiplayer overview' in Unity.
Unity has a number of multiplayer packages and services available to help you create a multiplayer project. If you’re just getting started with multiplayer games, the recommended entry point is the Multiplayer Center package . ## Multiplayer Center The Multiplayer Center provides a starting point to create a multipla...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_23a6944aabd5
unity_docs
scripting
In Unity's 'Transcode your video files', what is 'Access and configure the transcoding settings' and how does it work?
To transcode your video files: Select your video clip asset . The Inspector window shows the Video Clip Import Settings . Enable Transcode . Configure the transcoding settings in the Video Clip Import Settings . Once you’re satisfied with your settings, select Apply . Unity transcodes your video file with your new sett...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b8baa9dff710
unity_docs
scripting
What is `Search.PropertyDatabase.GetInfo` in Unity? Explain its purpose and usage.
PropertyDatabase.GetInfo Declaration public string GetInfo (); Returns string The formatted information. Description Returns a formatted string showing various information of the PropertyDatabase .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3b899b391afd
unity_docs
input
In Unity's 'Create a custom control', what is 'Initialize a custom control' and how does it work?
Custom controls inherit from VisualElement . A VisualElement isn’t a MonoBehaviour and therefore doesn’t receive any of the callbacks that a MonoBehaviour receives, such as Awake() , OnEnable() , OnDisable() , and OnDestroy() . You can initialize a custom control in its constructor. However, if your application needs i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_359a6158011c
unity_docs
rendering
What is `Experimental.GlobalIllumination.PointLight.falloff` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. PointLight.falloff public Experimental.GlobalIllumination.FalloffType falloff ; Description The falloff model to use for baking the point light. Additional resources: FalloffType . NOTE: This only applies to the Progressi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_46ac15deb485
unity_docs
editor
Explain 'Search logs' in Unity.
The Logs search provider searches the Unity Editor logs. ## Query syntax Provider token: log: Query example: Searches the logs for the text adpative . ``` log: adaptive ``` ## Provider filters The Logs provider has no additional filters. ## Results Search window tab: Logs . ## Actions The context menu for the L...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ac8eaf094b90
unity_docs
scripting
What is `Search.SearchExpressionContext.args` in Unity? Explain its purpose and usage.
SearchExpressionContext.args public SearchExpression[] args ; Description Arguments of passed to the SearchExpression being evaluated. ```csharp [SearchExpressionEvaluator(SearchExpressionType.Iterable | SearchExpressionType.Variadic)] [SearchExpressionEvaluatorSignatureOverload(SearchExpressionType.Number, S...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_31fc9355f7ff
unity_docs
rendering
In Unity's 'Reflective Vertex-Lit', what is 'Vertex-Lit Properties' and how does it work?
Note. Unity 5 introduced the Standard Shader which replaces this shader. This shader is Vertex-Lit , which is one of the simplest shaders. All lights shining on it are rendered in a single pass and calculated at vertices only. Because it is vertex-lit, it won’t display any pixel-based rendering effects, such as light c...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_628e574b52f2
unity_docs
scripting
What is `Build.Reporting.CommonRoles.managedEngineApi` in Unity? Explain its purpose and usage.
CommonRoles.managedEngineApi public static string managedEngineApi ; Description The BuildFile.role value of files that provide the managed API for Unity. These files are referenced by your compiled script DLL and provide the interface layer between your scripts and the engine itself.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_66c4209efaf3
unity_docs
rendering
In Unity's 'Recommended Graphics settings to optimize your Web build', what is 'Fog Modes' and how does it work?
Use the Fog Modes setting to change the shader variant stripping behavior for shaders that relate to built-in Unity fog effect. For examples of fog shader variants and more information, refer to Graphics . The recommended setting is Automatic (Default) , which removes unused fog shaders from your build. It’s best to re...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b19de2fc241f
unity_docs
scripting
What is `ShortcutManagement.ActiveProfileChangedEventArgs.ctor` in Unity? Explain its purpose and usage.
ActiveProfileChangedEventArgs Constructor Declaration public ActiveProfileChangedEventArgs (string previousActiveProfileId , string currentActiveProfileId ); Parameters Parameter Description previousActiveProfileId Previous active profile ID. currentActiveProfileId Current active profile ID. Description ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c5115cb9d33a
unity_docs
ui
What is `UIElements.TreeView.ctor` in Unity? Explain its purpose and usage.
TreeView Constructor Declaration public TreeView (); Description Creates a TreeView with all default properties. Use BaseTreeView.SetRootItems_1 to add content. Declaration public TreeView (Func<VisualElement> makeItem , Action<VisualElement,int> bindItem ); Parameters Parameter Description ma...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d79335418bf6
unity_docs
rendering
In Unity's 'Android permissions in Unity', what is 'Unity-handled permissions' and how does it work?
Depending on the Player Settings and Unity APIs that the application uses, Unity automatically adds some required permissions to the Android App Manifest and sends permission requests at runtime. This also applies to any plug-ins that the application uses. To stop Unity from automatically sending permission requests at...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_407ab8b67c37
unity_docs
editor
Explain 'Install Unity from the command line' in Unity.
If you want to automate the deployment of Unity in an organization, you can install the Unity Editor and other components from the command line. The components are normal installer executable programs and packages which you can use to automate the deployment of Unity. To automate the Unity deployment through the comman...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6dda425c6857
unity_docs
scripting
What is `SettingsProvider.HasSearchInterest` in Unity? Explain its purpose and usage.
SettingsProvider.HasSearchInterest Declaration public bool HasSearchInterest (string searchContext ); Parameters Parameter Description searchContext Search terms that the user entered in the search box on the Settings window. Returns bool True if the SettingsProvider matched the search term and if it sho...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ea10b476e53f
unity_docs
scripting
What are the parameters of `Unity.Collections.LowLevel.Unsafe.UnsafeUtility.ReleaseGCObject` in Unity?
Description Releases a GC handle obtained from UnsafeUtility.PinGCObjectAndGetAddress or UnsafeUtility.PinGCArrayAndGetDataAddress . The ReleaseGCObject method unpins an object, allowing the garbage collector to manage its memory freely. Use this method to prevent resource leaks. Ensure you release each handle after fi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_41116149b342
unity_docs
editor
What is `TerrainTools.TerrainPaintToolWithOverlaysBase.OnPaint` in Unity? Explain its purpose and usage.
TerrainPaintToolWithOverlaysBase.OnPaint Declaration public bool OnPaint ( Terrain terrain , TerrainTools.IOnPaint editContext ); Parameters Parameter Description terrain Active Terrain object. editContext Interface used to communicate between Editor and Paint tools. Returns bool Return true to tem...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_020af093e701
unity_docs
rendering
In Unity's 'Managing importers with scripts', what is 'Create custom importers' and how does it work?
To add your own support for file formats that aren’t natively supported by Unity, you can use a ScriptedImporter to write custom asset importers in C#. A scripted importer is a class that inherits from the abstract class ScriptedImporter and has the [ScriptedImporter] attribute. This registers your custom importer to h...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_88c85a6cdf2e
github
scripting
Write a Unity C# MonoBehaviour script called Mono Behaviour T1
```csharp using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using Sisus.Init.Internal; using UnityEngine; using Debug = UnityEngine.Debug; namespace Sisus.Init { /// <summary> /// A base class for <see cref="MonoBehaviour">MonoBehaviours</see> that...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_man_203e60feef54
unity_docs
rendering
Explain 'High Definition Render Pipeline' in Unity.
com.unity.render-pipelines.high-definition ## Description The High Definition Render Pipeline (HDRP) is a high-fidelity Scriptable Render Pipeline built by Unity to target modern (Compute Shader compatible) platforms. HDRP utilizes Physically-Based Lighting techniques, linear lighting, HDR lighting, and a configurabl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_139cdf08c69d
unity_docs
rendering
In Unity's 'Functions reference', what is 'Math' and how does it work?
Expression Description avg {Selector, Variadic | Iterable} Finds the average value for each expression. count {Variadic | Iterable} Counts the number of results in an expression. max {Selector, Variadic | Iterable} Finds the maximum value for each expression. min {Selector, Variadic | Iterable} Finds the minimal value ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f2d893c9a561
unity_docs
scripting
What is `Android.DownloadAssetPackAsyncOperation` in Unity? Explain its purpose and usage.
DownloadAssetPackAsyncOperation class in UnityEngine.Android / Inherits from: CustomYieldInstruction / Implemented in: UnityEngine.AndroidJNIModule Description Represents an asynchronous Android asset pack download operation. AndroidAssetPacks.DownloadAssetPackAsync returns an instance of this class. You ca...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6b23a3949af0
unity_docs
scripting
Show me a Unity C# example demonstrating `ParticleSystem.CustomDataModule.SetVector`.
of the custom data stream to apply the curve to. component The component index to apply the curve to (0-3, mapping to the xyzw components of a Vector4 or float4). curve The curve to be used for generating custom data. Description Set a MinMaxCurve , in order to generate custom data. Additional resources: Parti...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7c2e0fb01b25
unity_docs
editor
What is `UIElements.LibraryVisibility` in Unity? Explain its purpose and usage.
LibraryVisibility enumeration Description Controls the visibility of the UxmlElement in the UI Builder Library projects tab. Properties Property Description Default The element's visibility is not specified and is determined by the UI Builder. Unity hides elements with namespaces that start with "Unity"...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e6b2c48c68b2
unity_docs
rendering
Explain 'Optimize for untethered XR devices in URP' in Unity.
Understand the ways you can optimize your URP project for XR devices. This page describes the optimization techniques for universal render pipeline (URP) projects that target untethered extended reality (XR) devices. An untethered XR device is an XR device that aren’t connected to a desktop with a wire. Most untethered...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6c683aea62d8
unity_docs
math
What is `HumanPose.bodyPosition` in Unity? Explain its purpose and usage.
HumanPose.bodyPosition public Vector3 bodyPosition ; Description The human body position for that pose. Center of mass of the humanoid. The center of mass is approximated using a human average body parts mass distribution.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e231a88c8701
unity_docs
math
In Unity's 'Build a structure with prefabs', what is 'Create a script that instantiates blocks' and how does it work?
Create a MonoBehaviour script and name it Wall . Add the following code into the Wall script: ```csharp using UnityEngine; public class Wall : MonoBehaviour { public GameObject block; public int width = 10; public int height = 4; void Start() { for (int y=0; y<height; ++y) { for (int x=0; x<width; ++x) { Ve...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_eb16c15c4f14
unity_docs
math
What is `Mesh.colors32` in Unity? Explain its purpose and usage.
Mesh.colors32 public Color32[] colors32 ; Description Vertex colors of the Mesh. Same as colors , except using Color32 structure is better for performance. Note: The Mesh.colors32 array has to be modified or created externally from the Mesh. See, for example, the note on the uv page.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_dcd025c62afb_doc_10
github
scripting
What does `DrawAddNewBackground` do in this Unity script? Explain its purpose and signature.
Draws background behind new input controls.Absolute position of the background. Signature: ```csharp protected virtual void DrawAddNewBackground(Rect position) ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5f0c33ddf739
unity_docs
rendering
What is `Experimental.GlobalIllumination.DirectionalLight` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. DirectionalLight struct in UnityEngine.Experimental.GlobalIllumination / Implemented in: UnityEngine.CoreModule Description A helper structure used to initialize a LightDataGI structure as a directional light. Properties Pr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1155f72d2152
unity_docs
rendering
Show me a Unity C# example demonstrating `ParticleSystemRenderer.renderMode`.
ParticleSystemRenderer.renderMode public ParticleSystemRenderMode renderMode ; Description Specifies how the system draws particles. ```csharp using UnityEngine; using System.Collections;[RequireComponent(typeof(ParticleSystem))] public class ExampleClass : MonoBehaviour { private ParticleSystem ps; private ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_36b8b9ff13ba_doc_5
github
scripting
What does `EstimateAssetBytes` do in this Unity script? Explain its purpose and signature.
Estimate the in-memory size (bytes) of a splat file once decoded to Float32 quality.Uses file size as a heuristic since the exact splat count isn't known without reading. Signature: ```csharp public static long EstimateAssetBytes(string filePath) ```
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_man_6125c2f96e01
unity_docs
rendering
In Unity's 'Render Texture Inspector window reference', what is 'Filter Mode dropdown' and how does it work?
Value Description Point Use the nearest pixel. This makes the texture appear pixelated. Bilinear Use a weighted average of the four nearest texels. This makes the texture appear blurry when you magnify it. Trilinear Use a weighted average of the two nearest mipmap levels, which Unity filters using bilinear filtering. T...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_14cc27bce16a
unity_docs
scripting
What is `Experimental.GraphView.StickyNote.OnResized` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. StickyNote.OnResized Declaration public void OnResized (); Description Called when the [StickyNote] is about to be resized.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f238f9ea11d9
unity_docs
xr
In Unity's 'XR input options', what is 'XR Hand tracking input' and how does it work?
The XR Hands package provides access to hand tracking data from XR devices that support it. To access this data, you must also use an XR provider plug-in that has been updated to support hand tracking, such as OpenXR version 1.12 . The XR Hands package provides the following: The XRHandTrackingSubsystem which allows an...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_9231d0c2af9b
unity_docs
editor
Show me a Unity code example for 'Call native plug-ins for iOS'.
y Editor, return placeholder values. Refer to the following sections for simple implementations of these methods. For a more detailed implementation, download the Bonjour Browser sample . ## Use conditional compilation Platform dependent compilation is faster than Application.platform as it’s evaluated at compile tim...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_eb855d2c4cd4
unity_docs
rendering
What is `TerrainExtensions.UpdateGIMaterials` in Unity? Explain its purpose and usage.
TerrainExtensions.UpdateGIMaterials Declaration public static void UpdateGIMaterials ( Terrain terrain ); Declaration public static void UpdateGIMaterials ( Terrain terrain , int x , int y , int width , int height ); Description Schedules an update of the albedo and emissive Textures of a system that...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b2f31bb59a56
unity_docs
rendering
What is `ParticleSystem.SubEmittersModule.GetSubEmitterType` in Unity? Explain its purpose and usage.
ParticleSystem.SubEmittersModule.GetSubEmitterType Declaration public ParticleSystemSubEmitterType GetSubEmitterType (int index ); Parameters Parameter Description index The index of the desired sub-emitter. Returns ParticleSystemSubEmitterType The type of sub-emitter at the index. Description Get...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.