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_5766ba876284
unity_docs
xr
What is `XR.XRSettings.eyeTextureWidth` in Unity? Explain its purpose and usage.
XRSettings.eyeTextureWidth public static int eyeTextureWidth ; Description The current width of an eye texture for the loaded device. This value will be the product of the default eye texture size for the HMD and XRSettings.eyeTextureResolutionScale . If XR isn't enabled this value will be zero.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_412c29ee9994
unity_docs
scripting
Give me an overview of the `ContextMenuItemAttribute` class in Unity.
ContextMenuItemAttribute class in UnityEngine / Inherits from: PropertyAttribute / Implemented in: UnityEngine.CoreModule Description Use this attribute to add a context menu to a field that calls a named method. ```csharp using UnityEngine;public class Example : MonoBehaviour { [ContextMenuItem("Reset", "Re...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4f228801d29b
unity_docs
scripting
Show me a Unity C# example demonstrating `ParticleSystemForceField`.
ber of forces can be applied to particles that are within this volume: directional, gravitational, rotational, drag, and a vector field. The settings for each type of force make use of the MinMaxCurve type, which is also used in the Particle System. This type allows you to set simple uniform values, or more complicat...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6c56f59c934d
unity_docs
editor
Show me a Unity C# example demonstrating `Android.AndroidPluginImporterUtilities.GetAndroidSharedLibraryType`.
dPluginImporterUtilities.GetAndroidSharedLibraryType Declaration public static Android.AndroidSharedLibraryType GetAndroidSharedLibraryType ( PluginImporter importer ); Returns AndroidSharedLibraryType Returns the AndroidSharedLibraryType that represents the type of content that the shared library contai...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6cedbb1575ae
unity_docs
scripting
Show me a Unity C# example demonstrating `EditorUtility.DisplayPopupMenu`.
EditorUtility.DisplayPopupMenu Declaration public static void DisplayPopupMenu ( Rect position , string menuItemPath , MenuCommand command ); Description Displays a popup menu. Menu is shown at position pos , generated from a submenu specified by menuItemPath using a MenuCommand as menu context. ```...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_feb8b4f62115
unity_docs
scripting
Show me a Unity code example for 'Vector2IntField'.
ield lets users enter a Vector2Int value. Note : To align a Vector2IntField with other fields in an Inspector window, simply apply the.unity-base-field__aligned USS class to it. For more information, refer to BaseField . ## Create a Vector2IntField You can create a Vector2IntField with UI Builder, UXML, and C#. The f...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a430338c89dc
unity_docs
scripting
What is `Build.Content.ObjectIdentifier.operator_ne` in Unity? Explain its purpose and usage.
ObjectIdentifier.operator != public static bool operator != ( Build.Content.ObjectIdentifier a , Build.Content.ObjectIdentifier b ); Description Returns true if the ObjectIdentifiers are different. Internal use only. See ObjectIdentifier .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1397c4465d52
unity_docs
rendering
What is `Light.AddCommandBufferAsync` in Unity? Explain its purpose and usage.
Light.AddCommandBufferAsync Declaration public void AddCommandBufferAsync ( Rendering.LightEvent evt , Rendering.CommandBuffer buffer , Rendering.ComputeQueueType queueType ); Declaration public void AddCommandBufferAsync ( Rendering.LightEvent evt , Rendering.CommandBuffer buffer , Rendering.Shad...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_aca1c0ebbfee
unity_docs
rendering
Explain 'DirectX' in Unity.
Unity supports the DirectX graphics API including both DirectX 11 and DirectX 12. However, not all features are available in DirectX 11. For more information, refer to Feature comparison of DirectX 11 and DirectX 12 in Unity . ## Set your default graphics API to DirectX You can choose to set DirectX 11 (DX11) or Dire...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_02e8dd62f2b3_doc_1
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Gets the unique identifier of the active new entry control. Signature: ```csharp public static Guid ActiveControlID ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bc96e8c6b627
unity_docs
scripting
What is `Rendering.FastMemoryFlags` in Unity? Explain its purpose and usage.
FastMemoryFlags enumeration Description Control Fast Memory render target layout. Properties Property Description None Use the default fast memory layout. SpillTop Sections of the render target not placed in fast memory will be taken from the top of the image. SpillBottom Sections of the render target not pla...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8145d43af25c
unity_docs
scripting
What is `UIElements.BaseBoolField.ToggleValue` in Unity? Explain its purpose and usage.
BaseBoolField.ToggleValue Declaration protected void ToggleValue (); Description Inverts the BaseBoolField.value property. Override this method to change the logic of toggling the value in your subclass.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8dec42c16397
unity_docs
scripting
In Unity's 'Vector3Field', what is 'Example' and how does it work?
The following UXML example creates a Vector3Field with a placeholder: ``` <UXML xmlns="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements"> <Vector3Field label="UXML Field" name="the-uxml-field" /> </UXML> ``` The following C# example illustrates some of the customizable functionalities of the Vector3Field: ```...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9ed71938e1ce
unity_docs
rendering
What is `SystemInfo.supportsMipStreaming` in Unity? Explain its purpose and usage.
SystemInfo.supportsMipStreaming public static bool supportsMipStreaming ; Description Is streaming of texture mip maps supported? (Read Only) Additional resources: QualitySettings.streamingMipmapsActive .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bed04ca836ba
unity_docs
scripting
What is `Gizmos.DrawLine` in Unity? Explain its purpose and usage.
Gizmos.DrawLine Declaration public static void DrawLine ( Vector3 from , Vector3 to ); Description Draws a line starting at from towards to . If you need to draw many lines consider the Gizmos.DrawLineList or Gizmos.DrawLineStrip functions which are much faster than repeatedly calling this function ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2d136b7ff554
unity_docs
rendering
Give me an overview of the `MaterialPropertyType` class in Unity.
MaterialPropertyType enumeration Description The type of a given material property. Properties Property Description Float A Float Property. Int An Integer Property. Vector A Vector Property. Matrix A Matrix Property. Texture A Texture Property. ConstantBuffer A Constant Buffer Property. ComputeBuffer A Co...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_65b91af99c8a
unity_docs
physics
What is `SpringJoint2D.autoConfigureDistance` in Unity? Explain its purpose and usage.
SpringJoint2D.autoConfigureDistance public bool autoConfigureDistance ; Description Should the distance be calculated automatically? When true, the distance property will be calculated automatically to match the distance between the anchor and connectedAnchor properties. When false, the distance can be ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a606bf974e83
unity_docs
animation
What is `AnimationState.enabled` in Unity? Explain its purpose and usage.
AnimationState.enabled public bool enabled ; Description Enables / disables the animation. For the animation to take any effect the weight also needs to be set to a value higher than zero. If the animation is disabled, time will be paused until the animation is enabled again. ```csharp using UnityEngine; using...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_42b3b13fe773
unity_docs
scripting
What is `Unity.Android.Gradle.Dependencies.AddDependencyImplementationRaw` in Unity? Explain its purpose and usage.
Dependencies.AddDependencyImplementationRaw Declaration public Unity.Android.Gradle.Element AddDependencyImplementationRaw (string value ); Parameters Parameter Description value Raw string implementation value. Returns Element The added dependency. Description Adds a plugin implementation element ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3928c36b1227
unity_docs
physics
In Unity's 'Aspect Ratio Fitter', what is 'Properties' and how does it work?
Property: Function: Aspect Mode How the rectangle is resized to enforce the aspect ratio. None Do not make the rect fit the aspect ratio. Width Controls Height The height is automatically adjusted based on the width. Height Controls Width The width is automatically adjusted based on the height. Fit In Parent The width,...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_93dfdf98dd04
unity_docs
performance
In Unity's 'Visual Studio project generation for Windows', what is 'Create a Visual Studio Solution' and how does it work?
Warning: Make sure you save and back up any changes you make in Visual Studio before rebuilding your Unity project. If you do not back up your changes, Unity overwrites them during the build process. Open the Build Profiles window (menu: File > Build Profiles ). From the list of platforms in the Platforms panel, select...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_cf23b15716ab
unity_docs
rendering
In Unity's 'Search GameObjects with the Hierarchy search provider', what is 'Query examples' and how does it work?
Query example Description h: camera Find all GameObjects in the scene that have the word camera in their name. h: t=MeshFilter vertices>4096 Find all meshes in the scene that are bigger than 4096 vertices. h: t=MeshRenderer ref="Assets/Art/Environment/Materials/Architect/M_Metal01.mat" Find all renderers in the scene u...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_36799db31ac1
unity_docs
performance
What is `MPE.ProcessService.EnableProfileConnection` in Unity? Explain its purpose and usage.
ProcessService.EnableProfileConnection Declaration public static int EnableProfileConnection (string dataPath ); Parameters Parameter Description dataPath Where to save profiling data. Normally this is set to Application.dataPath . Returns int Greater than 0 if successful. Description Enables a conn...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6416c2600dde
unity_docs
performance
What is `Unity.Profiling.ProfilerRecorderOptions.CollectOnlyOnCurrentThread` in Unity? Explain its purpose and usage.
ProfilerRecorderOptions.CollectOnlyOnCurrentThread Description Use to collect samples only on the thread ProfilerRecorder was initialized on. ```csharp using System; using Unity.Profiling; using UnityEngine;public class CollectGCAllocCountExample { static void PrintGCAllocCount(Action a) { using (var gcAllocReco...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_45ea94d8827d
unity_docs
editor
Show me a Unity C# example demonstrating `Undo.RegisterImporterUndo`.
Undo.RegisterImporterUndo Declaration public static void RegisterImporterUndo (string path , string name ); Parameters Parameter Description path Path of the asset importer to register for Undo. name The name of the undo operation. Description Copies the state of the importer for the given asset path. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_be6752b3900d
unity_docs
editor
What is `SerializedProperty.minArraySize` in Unity? Explain its purpose and usage.
SerializedProperty.minArraySize public int minArraySize ; Description The smallest number of elements in the array across all target objects. (Read Only) If the SerializedObject contains multiple objects, this property returns the smallest number of elements. Unlike SerializedProperty.arraySize the minimum si...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_609f6c97819e
unity_docs
scripting
What is `Rendering.RenderStateBlock.stencilState` in Unity? Explain its purpose and usage.
RenderStateBlock.stencilState public Rendering.StencilState stencilState ; Description Specifies the new stencil state. Unity applies these values to the GPU's render state if RenderStateBlock.mask includes a value of RenderStateMask.Stencil . The default value is StencilState.defaultValue .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_36b8b9ff13ba_doc_10
github
scripting
What does `static` do in this Unity script? Explain its purpose and signature.
Check whether there is enough free system RAM (estimated) to load all files.Returns (fitsInRam, estimatedBytes, availableBytes). Signature: ```csharp public static (bool fits, long estimatedBytes, long availableBytes) CheckMovieRamFit(IReadOnlyList<string> files) ```
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_man_842587fec52d
unity_docs
rendering
Explain 'Fallback block in ShaderLab reference' in Unity.
This page contains information on using a Fallback block in your ShaderLab code to assign a fallback Shader object. For information on how a Shader object works, and how Unity chooses when to use a fallback, see Shader objects introduction . ## Render pipeline compatibility Feature name Universal Render Pipeline (URP...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e6b071b69658
unity_docs
physics
Explain 'Introduction to layerMasks' in Unity.
Every GameObject exists on a single layer, but Unity APIs that let you set which layers the API affect don’t directly use layers. Instead, they use layerMasks. A layer is a standard integer, but a layerMask is an integer formatted as a bitmask where every 1 represents a layer to include and every 0 represents a layer t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a75239e702dd
unity_docs
scripting
What is `TerrainTools.PaintDetailsToolUtility.FindDetailPrototype` in Unity? Explain its purpose and usage.
PaintDetailsToolUtility.FindDetailPrototype Declaration public static int FindDetailPrototype ( Terrain terrain , Terrain sourceTerrain , int sourceDetail ); Parameters Parameter Description terrain The target terrain. sourceTerrain The source terrain. sourceDetail The index of the source detail. R...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9e0ebd811282
unity_docs
rendering
What is `ParticleSystem.LightsModule.useRandomDistribution` in Unity? Explain its purpose and usage.
ParticleSystem.LightsModule.useRandomDistribution public bool useRandomDistribution ; Description Randomly assign Lights to new particles based on ParticleSystem.LightsModule.ratio . When this property is false, the system assigns Lights at regular intervals according to the ParticleSystem.LightsModule.ratio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d744deab90dc
unity_docs
ui
In Unity's 'Create a pie chart in the Editor and runtime UI', what is 'Add the pie chart in the Editor UI' and how does it work?
Create a folder named Editor to store your files. In the Editor folder, create a C# script named PieChartWindow.cs with the following contents: ```csharp using UnityEditor; using UnityEngine; using UnityEngine.UIElements; public class PieChartWindow : EditorWindow { [MenuItem("UI Toolkit Examples/PieChart Window")] ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_102942c1b467
unity_docs
scripting
What is `UIElements.DragLeaveEvent` in Unity? Explain its purpose and usage.
DragLeaveEvent class in UnityEngine.UIElements / Inherits from: UIElements.DragAndDropEventBase_1 / Implemented in: UnityEngine.UIElementsModule Description Use the DragLeaveEvent class to manage events sent when dragging leaves an element or one of its descendants. The DragLeaveEvent does not trickle down an...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5c30708a55c0
unity_docs
rendering
In Unity's 'Sample a 3D texture in a shader', what is 'Example' and how does it work?
The following is an example of a shader that uses raymarching to sample a 3D texture and render it as a semi-transparent volume. To use the example, follow these steps: In the Project window, use Add > Shader > Unlit Shader to create a new basic shader. Replace the shader code with the example code. Right-click the sha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1887e517a937
unity_docs
math
What is `TrailRenderer.SetPositions` in Unity? Explain its purpose and usage.
TrailRenderer.SetPositions Declaration public void SetPositions (Vector3[] positions ); Declaration public void SetPositions (NativeArray<Vector3> positions ); Declaration public void SetPositions (NativeSlice<Vector3> positions ); Parameters Parameter Description positions The array of positions ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_4d7a47681ebb
unity_docs
xr
In Unity's 'Set up your Nginx server configuration for Web builds', what is 'Handle requests for data files' and how does it work?
For on-disk gzip-precompressed data files, add the following code: ``` location ~ .+\.(data|symbols\.json)\.gz$ { gzip off; # Do not attempt dynamic gzip compression on an already compressed file add_header Content-Encoding gzip; default_type application/gzip; } ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bad428542a52
unity_docs
scripting
What are the parameters of `Vector3.Angle` in Unity?
Returns float The angle in degrees between the two vectors. Description Calculates the angle between two vectors. The angle returned is the angle of rotation from the first vector to the second, when treating these two vector inputs as directions. Note: The angle returned will always be between 0 and 180 degrees, becau...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_58f95ad6e9ba
unity_docs
scripting
What is `AssetBundleRecompressOperation.success` in Unity? Explain its purpose and usage.
AssetBundleRecompressOperation.success public bool success ; Description True if the recompress operation is complete and was successful, otherwise false (Read Only). Note that accessing before isDone will return false.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f6e53b226ba2
unity_docs
scripting
What is `SpriteRenderer.flipX` in Unity? Explain its purpose and usage.
SpriteRenderer.flipX public bool flipX ; Description Flips the sprite on the X axis. Only the rendering is affected. Use negative Transform.scale, if you want to affect all the other components (for example colliders).
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_864ef32bb950
unity_docs
xr
In Unity's 'Install a UPM package by name', what is 'Procedure' and how does it work?
To install a UPM package by name, follow these steps: Open the Package Manager window , if it’s not already open. Click the install button in the toolbar . The options for installing packages appear. Select Install package by name from the install menu. Two text boxes and an Install button appear. Enter the package Nam...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_dc14515e956b
github
scripting
Write a Unity Editor script for Tonemapping Editor
```csharp using System; using UnityEditor; using UnityEngine; namespace UnityStandardAssets.ImageEffects { [CustomEditor (typeof(Tonemapping))] class TonemappingEditor : Editor { SerializedObject serObj; SerializedProperty type; // CURVE specific parameter Se...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2cc1919b564e
unity_docs
scripting
What is `AndroidJNI.FindClass` in Unity? Explain its purpose and usage.
AndroidJNI.FindClass Declaration public static IntPtr FindClass (string name ); Description This function loads a locally-defined class. Additional resources: Java Native Interface Specification (Oracle)
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_88ce611ad79f
unity_docs
scripting
What is `Graphics.preserveFramebufferAlpha` in Unity? Explain its purpose and usage.
Graphics.preserveFramebufferAlpha public static bool preserveFramebufferAlpha ; Description True when rendering over native UI is enabled in Player Settings (readonly). Additional resources: PlayerSettings.preserveFramebufferAlpha .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_23ba69262518
github
scripting
Write a Unity C# MonoBehaviour script called Boid
```csharp using UnityEngine; using System.Collections; public class Boid : MonoBehaviourPlus<Boid> { Vector3[] pos = new Vector3[2]; Quaternion[] rotation = new Quaternion[2]; public Vector3 Position; public Vector3 Velocity = Vector3.zero; BoidsManager manager; public BoidsManager SetManager { set { ma...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_man_fdc15f5938e5
unity_docs
editor
Explain 'Assign icons to inspected items' in Unity.
Use the Inspector window to assign an icon to the item you’re inspecting. The icon appears in the Scene view, making it easier to identify the item. The icon’s behavior in the Scene view depends on the item type: GameObject : The icon appears over that GameObject, and any duplicates. Prefab : The icon appears over any ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ddd8eefd3a3a
unity_docs
editor
What is `AssetDatabase.AssetEditingScope.ctor` in Unity? Explain its purpose and usage.
AssetDatabase.AssetEditingScope Constructor Declaration public AssetDatabase.AssetEditingScope (); Description Instantiates AssetEditingScope. Equivalent to calling AssetDatabase.StartAssetEditing ().
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e6abbfe601f1
unity_docs
rendering
What is `CustomRenderTexture.wrapUpdateZones` in Unity? Explain its purpose and usage.
CustomRenderTexture.wrapUpdateZones public bool wrapUpdateZones ; Description When this parameter is set to true, Unity wraps Update zones around the border of the Custom Render Texture. Otherwise, Unity clamps Update zones at the border of the Custom Render Texture.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_660023ed2e1a
unity_docs
rendering
What is `Rendering.RayTracingGeometryInstanceConfig.subMeshFlags` in Unity? Explain its purpose and usage.
RayTracingGeometryInstanceConfig.subMeshFlags public Rendering.RayTracingSubMeshFlags subMeshFlags ; Description Flags that determine the ray-geometry intersection behavior relative to Material type during ray tracing. The Material type can influence the value of this flag. For example if Unity considers the ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f6e7039d2844
unity_docs
scripting
What is `GameObject.GetComponentAtIndex` in Unity? Explain its purpose and usage.
GameObject.GetComponentAtIndex Declaration public Component GetComponentAtIndex (int index ); Parameters Parameter Description index The index position in the array of components at which to find the requested object. Returns Component A reference to a component at the specified index. If no component...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f6754771c3a6
unity_docs
input
What is `GUIUtility` in Unity? Explain its purpose and usage.
GUIUtility class in UnityEngine / Implemented in: UnityEngine.IMGUIModule Description Utility class for making new GUI controls. Unless you are creating your own GUI controls from scratch, you should not use these functions. Static Properties Property Description hasModalWindow A global property, which is t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_c1eee01c1a26
github
scripting
Write a Unity C# XR/VR script for Register Visualizer Object
```csharp // Copyright 2020 The Tilt Brush Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicab...
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_5286445ae3f3
unity_docs
physics
What is `ArticulationBody.GetJointCoriolisCentrifugalForces` in Unity? Explain its purpose and usage.
ArticulationBody.GetJointCoriolisCentrifugalForces Declaration public int GetJointCoriolisCentrifugalForces (List<float> forces ); Parameters Parameter Description forces Supplied list of floats to store the counteracting Coriolis/centrifugal force data. Returns int Total degrees of freedom (DoF) for th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3f7a59d3a9be
unity_docs
rendering
What is `GUILayout.RepeatButton` in Unity? Explain its purpose and usage.
GUILayout.RepeatButton Declaration public static bool RepeatButton ( Texture image , params GUILayoutOption[] options ); Declaration public static bool RepeatButton (string text , params GUILayoutOption[] options ); Declaration public static bool RepeatButton ( GUIContent content , params GUILayoutOpt...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ad16cfc4d55f
unity_docs
scripting
What is `UIElements.ScrollViewMode.VerticalAndHorizontal` in Unity? Explain its purpose and usage.
ScrollViewMode.VerticalAndHorizontal Description Configure ScrollView for vertical and horizontal scrolling. Requires elements with the height property explicitly defined. A ScrollView configured with this mode has the ScrollView.verticalHorizontalVariantUssClassName class in its class list. The differenc...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_716201bb707e
github
scripting
Write a Unity C# MonoBehaviour script called Initiator Behaviour
```csharp using UnityEngine; using System.Collections; using BehaviourInject; public class InitiatorBehaviour : MonoBehaviour { private Context _context1; // Use this for initialization void Awake () { Network networker = new Network(); _context1 = Context.Create() .RegisterDependencyAs<Net...
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_man_654734bda0ef
unity_docs
networking
In Unity's 'Package manifest file', what is 'Required properties' and how does it work?
If these properties aren’t present, either the registry refuses the package when it’s published, or the Package Manager can’t fetch or load the package. Property JSON Type Description name String A unique identifier that conforms to the Unity Package Manager naming convention, which uses reverse domain name notation. F...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_34d6ad701115
unity_docs
rendering
What is `Rendering.CommandBuffer.SetProjectionMatrix` in Unity? Explain its purpose and usage.
CommandBuffer.SetProjectionMatrix Declaration public void SetProjectionMatrix ( Matrix4x4 proj ); Parameters Parameter Description proj Projection (camera to clip space) matrix. Description Add a command to set the projection matrix. The projection matrix is the matrix that transforms from view space int...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_08480de209a9
unity_docs
physics
What is `CollisionDetectionMode` in Unity? Explain its purpose and usage.
CollisionDetectionMode enumeration Description The collision detection mode constants used for Rigidbody.collisionDetectionMode . ```csharp //This script allows you to switch collision detection mode at the press of the space key, and move your GameObject. It also outputs collisions that occur to the console. //A...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_00bf244ab599
unity_docs
xr
Give me an overview of the `AssetPreview` class in Unity.
AssetPreview class in UnityEditor Description Utility for fetching asset previews by instance ID of assets, See AssetPreview.GetAssetPreview . Since previews are loaded asynchronously methods are provided for requesting if all previews have been fully loaded, see AssetPreview.IsLoadingAssetPreviews . Loaded prev...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4ce52f7ee0bf
unity_docs
rendering
What is `LightingSettings.denoiserTypeDirect` in Unity? Explain its purpose and usage.
LightingSettings.denoiserTypeDirect public LightingSettings.DenoiserType denoiserTypeDirect ; Description Determines the denoiser that the Progressive Lightmapper applies to direct lighting. (Editor only). Use denoising to remove visual noise from your lightmaps. Denoising can reduce the number of samples ne...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1cbad60b6d24
unity_docs
physics
What is `PhysicsScene2D.subStepLostTime` in Unity? Explain its purpose and usage.
PhysicsScene2D.subStepLostTime public float subStepLostTime ; Description The amount of simulation time that has been "lost" due to simulation sub-stepping hitting the maximum number of allowed sub-steps. When simulation sub-stepping occurs, the number of sub-steps that run are limited to Physics2D.maxSubStepC...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_25a91f2cb064
unity_docs
rendering
What is `LightShadows` in Unity? Explain its purpose and usage.
LightShadows enumeration Description Shadow casting options for a Light . Additional resources: light component . Properties Property Description None Do not cast shadows (default). Hard Cast "hard" shadows (with no shadow filtering). Soft Cast "soft" shadows (with 4x PCF filtering).
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_05acdb19f029
unity_docs
scripting
In Unity's 'Web Build folder', what is 'File extensions' and how does it work?
If you enable a Compression Method for your build, Unity identifies the extension that corresponds with the compression method and adds this extension to the names of the files inside the Build sub folder. If you enable Decompression Fallback , Unity appends the extension.unityweb to the build file names. Otherwise, Un...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3e6b789c5649
unity_docs
rendering
Show me a Unity C# example demonstrating `Texture2D.Apply`.
either at import/construction time or by using Texture2D.ignoreMipmapLimit at runtime. You usually only set updateMipmaps to false if you've already updated the mipmap levels, for example using SetPixels . Apply is an expensive operation because it copies all the pixels in the texture even if you've only change...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e17556d562f9
unity_docs
math
What is `Unity.Collections.LowLevel.Unsafe.WriteAccessRequiredAttribute` in Unity? Explain its purpose and usage.
WriteAccessRequiredAttribute class in Unity.Collections.LowLevel.Unsafe / Implemented in: UnityEngine.CoreModule Description Specify which struct method and property requires write access to be invoked. Used in conjunction with the ReadOnlyAttribute , WriteAccessRequiredAttribute lets you specify which struct ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f50a3f3de803
unity_docs
scripting
What are the parameters of `Mesh.GetVertexAttributeOffset` in Unity?
Returns int The byte offset within a atream of the data attribute, or -1 if it is not present. Description Get offset within a vertex buffer stream of a specific vertex data attribute on this Mesh. Meshes usually use a single vertex buffer stream, but it is possible to set up a vertex layout where attributes use differ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1a8179ccf669
unity_docs
editor
Show me a Unity C# example demonstrating `SerializedProperty.numericType`.
as SerializedPropertyType.Float . This property exposes the precise type, for example SerializedPropertyNumericType.UInt8 and SerializedPropertyNumericType.Double , and is more efficient than using the string-based type property. For enum properties ( SerializedPropertyType.Enum ) it returns the underlying type...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cf0fa299aa73
unity_docs
rendering
What is `DynamicGI.materialUpdateTimeSlice` in Unity? Explain its purpose and usage.
DynamicGI.materialUpdateTimeSlice public static int materialUpdateTimeSlice ; Description The number of milliseconds that can be spent on material updates. Material updates render albedo and emissive textures per system on the GPU, read them back and pass the buffers to Enlighten Realtime Global Illumination. T...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_d585d54188c4_doc_9
github
scripting
What does `UploadPackageAsync` do in this Unity script? Explain its purpose and signature.
Upload a content file (.unitypackage) to a provided package versionName of the package. Only used for identifying the package in classPath to the .unitypackage fileThe value of the main content folder for the provided packageThe local path (relative to the root project folder) of the main content folder for the provi...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_b952d44de1e3
unity_docs
rendering
Show me a Unity C# example demonstrating `SpriteRenderer.color`.
SpriteRenderer.color public Color color ; Description Rendering color for the Sprite graphic. The selected vertex color becomes the rendering color, and is accessible in a pixel shader. The default color is white when no color is selected. ```csharp //This example outputs Sliders that control the red green a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4180fa1c1a9c
unity_docs
scripting
Give me an overview of the `RenderMode` class in Unity.
RenderMode enumeration Description RenderMode for the Canvas. ```csharp //Attach this script to your Canvas GameObjectusing UnityEngine;public class Example : MonoBehaviour { enum RenderModeStates { camera, overlay, world }; RenderModeStates m_RenderModeStates; Canvas m_Canvas; // Use this for initialization vo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2484aaf68527
unity_docs
scripting
What is `ParticleSystem.LimitVelocityOverLifetimeModule.limitYMultiplier` in Unity? Explain its purpose and usage.
ParticleSystem.LimitVelocityOverLifetimeModule.limitYMultiplier public float limitYMultiplier ; Description Change the limit multiplier on the y-axis. Changing this property is more efficient than accessing the entire curve, if you only want to change the overall limit multiplier. ```csharp using UnityEngine;...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_212f4d57477e
unity_docs
animation
What is `Animations.CurveFilterOptions.floatError` in Unity? Explain its purpose and usage.
CurveFilterOptions.floatError public float floatError ; Description The amount the float animation curve is allowed to deviate from its original curve. This amount is expressed as a percentage: a positive value between 0 and 100.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_45efa63f4d08
unity_docs
rendering
What is `Sprites.SpriteUtility` in Unity? Explain its purpose and usage.
SpriteUtility class in UnityEditor.Sprites Description Helper utilities for accessing Sprite data. Static Methods Method Description GetSpriteTexture Returns the generated Sprite texture. If Sprite is packed, it is possible to query for both source and atlas textures. GetSpriteUVs Returns the generated Spri...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b07113494415
unity_docs
math
What is `Unity.Android.Gradle.Manifest.AttributeStringArray` in Unity? Explain its purpose and usage.
AttributeStringArray class in Unity.Android.Gradle.Manifest / Inherits from: Unity.Android.Gradle.Manifest.BaseAttribute Description An attribute that represents a string[] value. Public Methods Method Description Get Gets the value of the string[] attribute. Set Sets a new string[] value for the attribut...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f8a5cc995182
unity_docs
editor
What is `VersionControl.Task` in Unity? Explain its purpose and usage.
Task class in UnityEditor.VersionControl Description A Task describes an instance of a version control operation. An object of this type allows you to process operations such as Provider.Checkout , Provider.GetLatest , and Provider.Submit . Unity creates this item almost every time you ask Provider to perfor...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_435e68eb3ba6
unity_docs
scripting
Show me a Unity C# example demonstrating `Search.QueryEngine_1.RemoveOperator`.
QueryEngine<T0>.RemoveOperator Declaration public void RemoveOperator (string op ); Parameters Parameter Description op The operator identifier. Description Removes a custom operator that was added on the QueryEngine . ``` // Remove an operator based on its token var operatorToken = "%"; queryEngine.Remo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f28fa58850a0
unity_docs
scripting
Show me a Unity C# example demonstrating `Handles.DrawDottedLine`.
Handles.DrawDottedLine Declaration public static void DrawDottedLine ( Vector3 p1 , Vector3 p2 , float screenSpaceSize ); Parameters Parameter Description p1 The start point. p2 The end point. screenSpaceSize The size in pixels for the lengths of the line segments and the gaps between them. Descrip...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_021ba1b067f8
unity_docs
rendering
What is `Rendering.LightProbeUsage.CustomProvided` in Unity? Explain its purpose and usage.
LightProbeUsage.CustomProvided Description The light probe shader uniform values are extracted from the material property block set on the renderer. Property unity_SHAr , unity_SHAg , unity_SHAb , unity_SHBr , unity_SHBg , unity_SHBb and unity_SHC will be set to zero if they are not part of the MaterialPro...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7c30b24f6f3c
unity_docs
rendering
What is `Profiling.Profiler.GetTotalAllocatedMemoryLong` in Unity? Explain its purpose and usage.
Profiler.GetTotalAllocatedMemoryLong Declaration public static long GetTotalAllocatedMemoryLong (); Returns long The amount of memory allocated by Unity. This returns 0 if the Profiler is not available. Description The total memory allocated by the internal allocators in Unity. Unity reserves large pools o...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2e4da3e01470
unity_docs
xr
Show me a Unity C# example demonstrating `Networking.DownloadHandlerBuffer.ctor`.
DownloadHandlerBuffer Constructor Declaration public DownloadHandlerBuffer (); Description Default constructor. ```csharp using System.Collections; using UnityEngine; using UnityEngine.Networking;public class Example : MonoBehaviour { IEnumerator Start() { using (var uwr = new UnityWebRequest("https://unity3...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d57d35703c93
unity_docs
rendering
In Unity's 'Materials tab', what is 'Location and Materials' and how does it work?
Property Description Location Define how the materials are accessed. These options aren’t available for .st9 files, which only use embedded materials. The following options are available: Use Embedded Materials - Import materials as sub-assets inside the SpeedTree model. This is the default and recommended option. Use ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_520de6cad829
unity_docs
math
What is `Mathf.PerlinNoise1D` in Unity? Explain its purpose and usage.
Mathf.PerlinNoise1D Declaration public static float PerlinNoise1D (float x ); Parameters Parameter Description x The X-coordinate of the given sample point. Returns float A value in the range of 0.0 and 1.0. The value might be slightly higher or lower than this range. Description Generates a 1D pseu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fea85e760c85
unity_docs
math
What is `Mathf.Repeat` in Unity? Explain its purpose and usage.
Mathf.Repeat Declaration public static float Repeat (float t , float length ); Description Loops the value t, so that it is never larger than length and never smaller than 0. This is similar to the modulo operator but it works with floating point numbers. For example, using 3.0 for t and 2.5 for length , ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_255eafb52995_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
This is a simple behavior that can be attached to a parent of the CameraRig in orderto provide movement via the gamepad. This is useful when testing an application inthe Unity editor without the HMD.To use it, create a game object in your scene and drag your CameraRig to be a childof the game object. Then, add the OVRD...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_e0b1b403fa39
unity_docs
performance
Show me a Unity C# example demonstrating `Unity.Profiling.ProfilerFlowEventType.Begin`.
iler samples which belong to the same flow. Next denotes the next point of the flow and End denotes the flow termination. Flow identifier starts from 1 and is incremented by 1 for each new Begin . An example of a flow start point is job scheduling. For instance, IJobExtensions.Schedule generates an implicit Beg...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_315bae97615c
unity_docs
editor
What is `EditorGUIUtility.wideMode` in Unity? Explain its purpose and usage.
EditorGUIUtility.wideMode public static bool wideMode ; Description Is the Editor GUI currently in wide mode? Wide mode is a mode for Editor GUI where the controls for structs such as Vector3 and Rect are inlined so they take up less vertical space. For example, in wide mode a Vector3Field takes up one line hei...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3c14bcc29592
unity_docs
scripting
What is `PrefabUtility.GetPrefabInstanceHandle` in Unity? Explain its purpose and usage.
PrefabUtility.GetPrefabInstanceHandle Declaration public static Object GetPrefabInstanceHandle ( Object instanceComponentOrGameObject ); Parameters Parameter Description instanceComponentOrGameObject An object from the Prefab instance. Returns Object The Prefab instance handle. Description Retrieves...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_eb733de6fa3a
unity_docs
math
Explain 'Debug Web builds in development' in Unity.
Inspect logs, use development builds , and configure exception support to diagnose problems during development. ## Debug your build in a browser’s JavaScript console 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 ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_acd51561696d
unity_docs
rendering
What is `Renderer.SetSharedMaterials` in Unity? Explain its purpose and usage.
Renderer.SetSharedMaterials Declaration public void SetSharedMaterials (List<Material> materials ); Parameters Parameter Description m A list of materials to assign to this object. Description Assigns the shared materials of this object using the list of materials provided. Use this method to set the mate...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_47ea6db30d98
unity_docs
scripting
What is `UIElements.BaseTreeView.GetIdForIndex` in Unity? Explain its purpose and usage.
BaseTreeView.GetIdForIndex Declaration public int GetIdForIndex (int index ); Parameters Parameter Description index The TreeView item index. Returns int The TreeView item's identifier. Description Gets the specified TreeView item's identifier.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1af06c7f1e48
unity_docs
rendering
What is `TextureImporter.SetPlatformTextureSettings` in Unity? Explain its purpose and usage.
TextureImporter.SetPlatformTextureSettings Declaration public void SetPlatformTextureSettings ( TextureImporterPlatformSettings platformSettings ); Parameters Parameter Description platformSettings A TextureImporterPlatformSettings instance that contains the platform settings. Description Sets specific...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7b2d2e277a28
unity_docs
audio
What is `Windows.WebCam.VideoCapture.AudioState` in Unity? Explain its purpose and usage.
AudioState enumeration Description Specifies what audio sources should be recorded while recording the video. Properties Property Description MicAudio Only include the mic audio in the video recording. ApplicationAudio Only include the application audio in the video recording. ApplicationAndMicAudio Include b...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2dc8d784f249
unity_docs
scripting
What are the parameters of `AI.NavMeshAgent.SamplePathPosition` in Unity?
Returns bool True if terminated before reaching the position at maxDistance, false otherwise. Description Sample a position along the current path. This function looks ahead a specified distance along the current path. Details of the mesh at that position are then returned in a NavMeshHit object. This could be used, f...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7e677d6dfbbf
unity_docs
scripting
What is `Rendering.CommandBufferExecutionFlags` in Unity? Explain its purpose and usage.
CommandBufferExecutionFlags enumeration Description Flags describing the intention for how the command buffer will be executed. Set these via CommandBuffer.SetExecutionFlags . Properties Property Description None When no flags are specified, the command buffer is considered valid for all means of execution. Th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_362ab199fb09_doc_3
github
scripting
What does `Post` do in this Unity script? Explain its purpose and signature.
Generic POST request Signature: ```csharp public void Post(string endpoint, string jsonData, Action<string> onSuccess, Action<string> onError) ```
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_man_4e0f58c7e484
unity_docs
performance
Explain 'Job dependencies' in Unity.
Often, one job depends on the results of another job. For example, Job A might write to a NativeArray that job B uses as input. You must tell the job system about such a dependency when you schedule a dependent job. The job system won’t run the dependent job until the job it depends upon is finished. One job can depend...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_df10fe9b3038
unity_docs
input
What is `Screen.sleepTimeout` in Unity? Explain its purpose and usage.
Screen.sleepTimeout public static int sleepTimeout ; Description A power saving setting, allowing the screen to dim some time after the last active user interaction. Most useful for handheld devices, allowing OS to preserve battery life in most efficient ways. Does nothing on non-handheld devices. sleepTimeout ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f0123039d74d
unity_docs
ui
What is `Experimental.GraphView.StackNode.headerContainer` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. StackNode.headerContainer public UIElements.VisualElement headerContainer ; Description Use this property to customize the header for this StackNode.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.