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_57d98f669a14
unity_docs
performance
What is `FrameTiming.cpuFrameTime` in Unity? Explain its purpose and usage.
FrameTiming.cpuFrameTime public double cpuFrameTime ; Description This is the total CPU frame time calculated as the time between ends of two frames, which includes all waiting time and overheads, in ms. This metric is also exposed as CPU Total Frame Time profiler counter. Additional resources: Get frame tim...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b56e1480786f
unity_docs
scripting
What is `SystemInfo.deviceUniqueIdentifier` in Unity? Explain its purpose and usage.
SystemInfo.deviceUniqueIdentifier public static string deviceUniqueIdentifier ; Description A unique device identifier. It's guaranteed to be unique for every device (Read Only). iOS : Uses UIDevice.identifierForVendor to generate a unique device identifier. macOS : Uses kIOPlatformUUIDKey to generate a ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_b41ba591034f
unity_docs
scripting
Show me a Unity code example for 'Supported data types for Java/Kotlin and C# code'.
ransform ) ## Code examples to transfer data between Java and C# code The following code examples demonstrate how you can send all the supported data types between Java and C# code. You can save these Java and C# code files anywhere in your Unity project. ## Example 1: Transfer basic data types The following C# scr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_4b380585d3db
unity_docs
rendering
In Unity's 'Metallic and specular workflows', what is 'Smoothness' and how does it work?
In both workflows, a smoothness value controls the clarity of the specular effect. Smoothness represents the microsurface detail of the material. A low smoothness value means the surface is microscopically rough with many different surface angles, so light rays bounce off at a wide range of angles, and fewer reflection...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_79cf636e0a62
unity_docs
input
What is `IMGUI.Controls.TreeView.KeyEvent` in Unity? Explain its purpose and usage.
TreeView.KeyEvent Declaration protected void KeyEvent (); Description Override this method to handle events when the TreeView has keyboard focus. The TreeView should not handle key events if it does not have keyboard focus therefore this method is only called when GUIUtility.keyboardControl == treeViewContro...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d5bc98fdc83e
unity_docs
rendering
Give me an overview of the `ParticleSystemSortMode` class in Unity.
ParticleSystemSortMode enumeration Description The sorting mode for particle systems. Properties Property Description None No sorting. Distance Sort based on distance to the camera position. For orthographic cameras, this mode is the same as sorting by depth. OldestInFront Sort the oldest particles to the fro...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_114e7fbdc3cf
unity_docs
scripting
Explain 'Android keystores' in Unity.
A keystore is a binary file that contains private keys and public key certificates. Android uses the keys in a keystore to sign an application for security reasons. For more information, see Keystores, keys, and certificates . ## Android keystores in Unity To interface with keystores, Unity provides the Keystore Mana...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cfd26cf5f68b
unity_docs
scripting
What is `Progress.Item.cancellable` in Unity? Explain its purpose and usage.
Progress.Item.cancellable public bool cancellable ; Description Returns true if the progress indicator's associated event can be canceled. Additional resources: Progress.IsCancellable , Progress.Item.Cancel , Progress.Item.RegisterCancelCallback , Progress.Item.UnregisterCancelCallback .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7d1114e99111
unity_docs
scripting
What is `SortingLayer.value` in Unity? Explain its purpose and usage.
SortingLayer.value public int value ; Description This is the relative value that indicates the sort order of this layer relative to the other layers. You may use this to determine the sort order of the layer. Additional resources: GetLayerValueFromID .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6139acca9b16
unity_docs
scripting
Show me a Unity C# example demonstrating `Unity.Collections.LowLevel.Unsafe.UnsafeUtility.PinGCObjectAndGetAddress`.
g garbage collection. The PinGCObjectAndGetAddress method pins a managed object, preventing the garbage collector from relocating it. This is particularly useful when you need to maintain stable memory addresses while interfacing with unmanaged code or performing low-level memory operations. Ensure that you release ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ec1d2d9e09d1
unity_docs
scripting
Give me an overview of the `Tools` class in Unity.
Tools class in UnityEditor / Inherits from: ScriptableObject Description Class used to manipulate the tools used in Unity's Scene View. Static Properties Property Description current The tool that is currently selected for the Scene View. handlePosition The position of the tool handle in world space. handl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_71bded8c1c8a
unity_docs
scripting
What is `CullingGroup.Dispose` in Unity? Explain its purpose and usage.
CullingGroup.Dispose Declaration public void Dispose (); Description Clean up all memory used by the CullingGroup immediately. The CullingGroup can no longer be used after this method has been called.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_4d5a7e0dcf33_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Runtime color lookup for cell state ids.Baked from ScriptableObject authoring and used in minimap hot paths (array lookup, no dictionary). Signature: ```csharp public struct GridStateColorPaletteData ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_1966b872c026
unity_docs
rendering
Explain 'Enable or disable Dynamic Resolution for render targets' in Unity.
With dynamic resolution , render targets have the DynamicallyScalable flag. You can set this to state whether Unity should scale this render texture as part of the dynamic resolution process or not. Cameras also have the allowDynamicResolution flag, which you can use to set up dynamic resolution so that there is no nee...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ec97381602c2
unity_docs
ui
What is `UIElements.VisualElement.GetBinding` in Unity? Explain its purpose and usage.
VisualElement.GetBinding Declaration public UIElements.Binding GetBinding ( UIElements.BindingId bindingId ); Parameters Parameter Description bindingId The binding ID. Returns Binding The binding instance, if it exists. Description Gets the binding instance for the provided targeted property.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_af8061234b5e
unity_docs
scripting
What is `Media.MediaTime.ctor` in Unity? Explain its purpose and usage.
MediaTime Constructor Declaration public MediaTime (long seconds ); Parameters Parameter Description seconds The number of seconds in the time value. Description Creates a time value with an integer number of seconds, using 1Hz for the rate. Declaration public MediaTime (long count , uint rateNumerator...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_27768faa7e57
unity_docs
physics
In Unity's 'Event functions', what is 'Initialization events' and how does it work?
It’s often useful to be able to call initialization code in advance of any updates that occur during gameplay. The Start function is called before the first frame or physics update on an object. The Awake function is called for each object in the scene at the time when the scene loads. Note that although the various ob...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_64dec93b8088
unity_docs
editor
What is `AssetDatabase.IsMetaFileOpenForEdit` in Unity? Explain its purpose and usage.
AssetDatabase.IsMetaFileOpenForEdit Declaration public static bool IsMetaFileOpenForEdit ( Object assetObject , StatusQueryOptions statusOptions = StatusQueryOptions.UseCachedIfPossible); Declaration public static bool IsMetaFileOpenForEdit ( Object assetObject , out string message , StatusQueryOptions...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_718eba360c89
unity_docs
scripting
What is `QualitySettings.antiAliasing` in Unity? Explain its purpose and usage.
QualitySettings.antiAliasing public static int antiAliasing ; Description Choose the level of Multi-Sample Anti-aliasing (MSAA) that the GPU performs. The value indicates the number of samples per pixel. Valid values are 0 (no MSAA), 2, 4, and 8. If the graphics API does not support the value you provide, it u...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_696a147ab518
unity_docs
scripting
Explain 'Create a native plug-in for iOS' in Unity.
Create a native plug-in for iOS and import it into your Unity project. ## Define an extern method For each native function you want to call, define an extern method in the C# file as follows: ``` [DllImport ("__Internal")] private static extern float FooPluginFunction(); ``` ## Use C linkage to prevent name mangl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5ff08259550f
unity_docs
physics
What is `Physics.interCollisionStiffness` in Unity? Explain its purpose and usage.
Physics.interCollisionStiffness public static float interCollisionStiffness ; Description Sets the cloth inter-collision stiffness. Inter-collision stiffness controls how much two particles repel each other when they are closer than the inter-collision distance.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_718971759d7b
github
scripting
Write a Unity C# script called State Enabled Canvas Generic
```csharp #if !UNITY_2019 using GI.UnityToolkit.State; using GI.UnityToolkit.State.Components; using UnityEngine; #endif namespace GI.UnityToolkit.Components.UI { #if !UNITY_2019 [RequireComponent(typeof(Canvas))] public abstract class StateEnabledCanvasGeneric<TState> : StateEnabledComponent<TState> where TSt...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_69d8f9225198
unity_docs
animation
What is `ModelImporterClipAnimation.lockRootPositionXZ` in Unity? Explain its purpose and usage.
ModelImporterClipAnimation.lockRootPositionXZ public bool lockRootPositionXZ ; Description Enable to make horizontal root motion be baked into the movement of the bones. Disable to make horizontal root motion be stored as root motion.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1169a0b25ae3
unity_docs
scripting
What is `Unity.Properties.IDictionaryPropertyVisitor.Visit` in Unity? Explain its purpose and usage.
IDictionaryPropertyVisitor.Visit Declaration public void Visit (Property<TContainer,TDictionary> property , ref TContainer container , ref TDictionary dictionary ); Parameters Parameter Description property The property being visited. container The container being visited. dictionary The dictionary val...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_85c42ebeac4e
unity_docs
scripting
What is `UIElements.Columns.GetEnumerator` in Unity? Explain its purpose and usage.
Columns.GetEnumerator Declaration public IEnumerator<Column> GetEnumerator (); Returns IEnumerator<Column> The enumerator. Description Returns an enumerator that iterates through the collection.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0e98759a222d
unity_docs
rendering
What is `Rendering.CullingOptions.Stereo` in Unity? Explain its purpose and usage.
CullingOptions.Stereo Description When this flag is set, Unity culls both eyes together for stereo rendering. Default value: based on the Camera from which you obtained the CullingParameters. Additional resources: ScriptableCullingParameters.cullingOptions , ScriptableRenderContext.Cull , CullingResults .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9dbbb43d0ed0
unity_docs
scripting
What is `Animation.animatePhysics` in Unity? Explain its purpose and usage.
Animation.animatePhysics public bool animatePhysics ; Description When enabled, the physics system uses animated transforms from GameObjects with kinematic Rigidbody components to influence other GameObjects. For example, enable animatePhysics to apply velocity and friction from an animated platform to GameObj...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0ad2de4183e3
unity_docs
rendering
What is `UIElements.StyleTextShadow.ctor` in Unity? Explain its purpose and usage.
StyleTextShadow Constructor Declaration public StyleTextShadow ( UIElements.TextShadow v ); Description Creates from either a TextShadow or StyleKeyword . Declaration public StyleTextShadow ( UIElements.StyleKeyword keyword ); Description Creates from either a TextShadow or StyleKeyword .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_debb718f9490
unity_docs
ui
What is `UIElements.VisualElementExtensions.AddManipulator` in Unity? Explain its purpose and usage.
VisualElementExtensions.AddManipulator Declaration public static void AddManipulator ( UIElements.VisualElement ele , UIElements.IManipulator manipulator ); Parameters Parameter Description ele VisualElement associated to the manipulator. manipulator Manipulator to be added to the VisualElement. Descr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c0a0ec5a052e
unity_docs
scripting
What is `Search.SearchIndexer.Write` in Unity? Explain its purpose and usage.
SearchIndexer.Write Declaration public void Write (Stream stream ); Parameters Parameter Description stream Stream to write the index. Description Writes a binary representation of the index on a stream.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ec6c7f6ace81
unity_docs
scripting
What is `U2D.SpriteAtlasUtility.CleanupAtlasPacking` in Unity? Explain its purpose and usage.
SpriteAtlasUtility.CleanupAtlasPacking Declaration public static void CleanupAtlasPacking (); Description Cleanup internal states after packing SpriteAtlas assets. Must be called after a call to SpriteAtlasUtility.PackAllAtlases .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f42bdd89a710
unity_docs
physics
What is `Physics.bounceThreshold` in Unity? Explain its purpose and usage.
Physics.bounceThreshold public static float bounceThreshold ; Description Two colliding objects with a relative velocity below this will not bounce (default 2). Must be positive. This value is usually changed in Edit->Project Settings->Physics inspector instead of from scripts. ```csharp using UnityEngine;pu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_697ff52946e6
unity_docs
scripting
What is `Unity.Android.Gradle.Manifest.Queries` in Unity? Explain its purpose and usage.
Queries class in Unity.Android.Gradle.Manifest / Inherits from: Unity.Android.Gradle.Manifest.BaseElement Description The C# definition of the <queries> Android Manifest element. For more information about the element, see Android's documentation: Queries element Properties Property Description Attribu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4d698f7987cd
unity_docs
rendering
Show me a Unity C# example demonstrating `GUI.Toolbar`.
to show on the toolbar buttons. images An array of textures on the toolbar buttons. contents An array of text, image and tooltips for the toolbar buttons. style The style to use. If left out, the button style from the current GUISkin is used. buttonSize Determines how toolbar button size is calculated. Ret...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_81850650ff85
unity_docs
rendering
What is `TextureImporter.DoesSourceTextureHaveAlpha` in Unity? Explain its purpose and usage.
TextureImporter.DoesSourceTextureHaveAlpha Declaration public bool DoesSourceTextureHaveAlpha (); Description Allows you to check whether the texture source image has an alpha channel. This method throws an exception if the texture has not finished importing. For example, it would throw an exception if you cal...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_64f1128109fe
unity_docs
animation
What is `Animations.AnimatorState.timeParameter` in Unity? Explain its purpose and usage.
AnimatorState.timeParameter public string timeParameter ; Description If timeParameterActive is true, the value of this Parameter will be used instead of normalized time. Parametrized Time and Root motion are not compatible. Root motion relies on previous and current time to compute a delta displacement. When y...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ef2d95e262a1
unity_docs
scripting
Show me a Unity C# example demonstrating `PrefabUtility`.
PrefabUtility class in UnityEditor Description Utility class for any Prefab related operations. ```csharp // This script creates a new menu item Examples>Create Prefab in the main menu. // Use it to create Prefab(s) from the selected GameObject(s). // It is placed in the root Assets folder. using System.IO; using...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2a8abbf08f31
unity_docs
rendering
What is `LightingWindowTab.HasHelpGUI` in Unity? Explain its purpose and usage.
LightingWindowTab.HasHelpGUI Declaration public bool HasHelpGUI (); Returns bool Returns true if window has a doc button in the header. Description Returns true if window has a doc button in the header.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_60e397f2f76e
unity_docs
scripting
Show me a Unity C# example demonstrating `Handles.CylinderHandleCap`.
Draw a cylinder handle. Pass this into handle functions. On EventType.Layout event, calculates handle distance to mouse and calls HandleUtility.AddControl accordingly. On EventType.Repaint event, draws the handle shape. Cylinder Handle Cap in the Scene View. Add the following script to your Assets folder as Cyl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fc6401adc9e5
unity_docs
scripting
What is `XR.MeshGenerationResult.Position` in Unity? Explain its purpose and usage.
MeshGenerationResult.Position public Vector3 Position ; Description The position associated with the generated mesh relative to the session origin. This value will be zero unless the MeshGenerationOptions.ConsumeTransform flag was provided to XRMeshSubsystem.GenerateMeshAsync .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9fb885c3278f
unity_docs
editor
What is `Search.SearchIndexer.ctor` in Unity? Explain its purpose and usage.
SearchIndexer Constructor Declaration public SearchIndexer (); Declaration public SearchIndexer (string name ); Parameters Parameter Description name Name of the indexer. Description Creates a new default SearchIndexer. ```csharp using UnityEditor; using UnityEditor.Search; using UnityEngine; static ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e327dadfc44b
unity_docs
math
Show me a Unity C# example demonstrating `Mathf.Infinity`.
Mathf.Infinity public static float Infinity ; Description A representation of positive infinity (Read Only). ```csharp using UnityEngine;public class Example : MonoBehaviour { // Casts a ray from (0,0,0) towards (0,0,1) to the infinity and prints a message // if any object has touched the ray. // To test it...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_81b904b8700b
unity_docs
scripting
What is `Experimental.GraphView.RectUtils.Encompass` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. RectUtils.Encompass Declaration public static Rect Encompass ( Rect a , Rect b ); Parameters Parameter Description a Rect a. b Rect b. Returns Rect New rectangle. Description Create rectangle that encompas...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_218c5e8303f3
unity_docs
rendering
Explain 'Introduction to GameObjects' in Unity.
The GameObject is the most important concept in the Unity Editor. Every object in your game is a GameObject , from characters and collectible items to lights, cameras and special effects. However, a GameObject can’t do anything on its own; you need to give it properties before it can become a character, an environment,...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_228ccee284a8
unity_docs
physics
What is `EditorUserBuildSettings.managedDebuggerFixedPort` in Unity? Explain its purpose and usage.
EditorUserBuildSettings.managedDebuggerFixedPort public static int managedDebuggerFixedPort ; Description Force the port used by the managed debugger. Default is 0 which means platform-specific auto-selection of a port.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c35b5f520d10
unity_docs
scripting
Show me a Unity C# example demonstrating `Audio.AudioResource`.
rces don’t provide direct access to properties like length . However, if your audio resource is an AudioClip , you can access these properties through AudioSource.clip . Other types of resources might not provide direct access to these properties because the resources are dynamic or the values might change every tim...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f97a06a2d421
unity_docs
ui
Show me a Unity C# example demonstrating `GUILayout.Height`.
GUILayout.Height Declaration public static GUILayoutOption Height (float height ); Description Option passed to a control to give it an absolute height. Note: This option will override the Automatic height Layout parameter Fixed Height for a GUI Control. ```csharp using UnityEngine;public class ExampleScr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c9722442c7e0
unity_docs
ui
What is `Connect.ProjectBindDrawer.ctor` in Unity? Explain its purpose and usage.
ProjectBindDrawer Constructor Declaration public ProjectBindDrawer (); Description The default constructor for the Drawer that subscribes to the callback events for the Link and Create buttons.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8d0c41e2b74f
unity_docs
rendering
In Unity's 'PackageRequirements block in ShaderLab reference', what is 'Syntax' and how does it work?
Note : if you provide a PackageRequirements block, it must come before all other declarations inside the SubShader or Pass. Signature Function PackageRequirements{ [requirement definition]} Defines the package requirements for the Pass or SubShader. There are multiple ways to declare package requirements. Each one prov...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f4f134b59e74
unity_docs
scripting
Show me a Unity C# example demonstrating `Selection.GetFiltered`.
nd mode. For a selected GameObject that has multiple Components of type , only the first one will be included in the results. If type is a subclass of Component or GameObject the full SelectionMode is supported. If type does not subclass from Component or GameObject (eg. Mesh or ScriptableObject ) ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e0d80d7fdff6
unity_docs
rendering
What is `Cubemap.GetPixelData` in Unity? Explain its purpose and usage.
Cubemap.GetPixelData Declaration public NativeArray<T> GetPixelData (int mipLevel , CubemapFace face ); Parameters Parameter Description mipLevel The mipmap level to read from. The range is 0 through the texture's Texture.mipmapCount . The default value is 0 . face The CubemapFace to read from. R...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_7926c8c34020
unity_docs
rendering
In Unity's 'Set a shader to require GPU features', what is 'Limit the requirement to specific shader variants' and how does it work?
To compile shader variants only when the runtime platform supports a GPU feature or shader model, use the following syntax: In #pragma target , add the keywords of the shader variants, separated by spaces. For example #pragma target 4.0 EXAMPLE_KEYWORD . In #pragma require , add a colon ( : ), followed by the keywords ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3cf42dff7f3e
unity_docs
scripting
Explain 'Leaderboards Building Block' in Unity.
The Leaderboards Unity Building Block demonstrates score-keeping in a game and generates a leaderboard to display player scores. Each score is stored as player data on the cloud. The Leaderboards Building Block uses the following Unity Gaming Services (UGS): Unity Gaming Service Description Leaderboards Stores, retriev...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_53ade8678284
unity_docs
scripting
What is `Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.SetAllowReadOrWriteAccess` in Unity? Explain its purpose and usage.
AtomicSafetyHandle.SetAllowReadOrWriteAccess Declaration public static void SetAllowReadOrWriteAccess ( Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle , bool allowReadWriteAccess ); Parameters Parameter Description handle The AtomicSafetyHandle to set read and write access on. allowReadWriteA...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_723ad90ff99e
unity_docs
scripting
What is `UIElements.BaseTreeView.ctor` in Unity? Explain its purpose and usage.
BaseTreeView Constructor Declaration public BaseTreeView (); Description Creates a TreeView with all default properties. Use SetRootItems_1 to add content. Declaration public BaseTreeView (int itemHeight ); Parameters Parameter Description itemHeight The item height to use in FixedHeight virtu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_d5f9d370f872_doc_5
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Controls which turn style of locomotion to use. Signature: ```csharp public TurnStyle turnStyle ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_man_371084b71bb5
unity_docs
scripting
Explain 'PSO tracing and warming example' in Unity.
Get started with PSO tracing and warm up using the Universal Render Pipeline (URP) sample. Important : GraphicsStateCollection is an experimental API and might be changed or removed in the future. The Universal 3D sample uses the GraphicsStateCollection API. You can use this sample to help you get started with PSO trac...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_ab88da69d0e5
unity_docs
input
Explain 'FloatField' in Unity.
A FloatField lets users input a numerical float value into an application. It accepts and displays text input. You can set placeholder text to provide hints or instructions to the user on what to enter. You can also add validation functions to ensure that the entered data meets certain requirements. Note : To align a F...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_74180fe4244a
unity_docs
scripting
In Unity's 'Vector3IntField', what is 'Example' and how does it work?
The following UXML example creates a Vector3IntField with a placeholder: ``` <UXML xmlns="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements"> <Vector3IntField label="UXML Field" name="the-uxml-field" /> </UXML> ``` The following C# example illustrates some of the customizable functionalities of the Vector3IntF...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d26f4263a20b
unity_docs
physics
Explain 'Introduction to physics articulations' in Unity.
A physics articulation is a set of Articulation Bodies organized in a logical tree, in which each parent-child relationship reflects mutually constrained relative motion. The main purpose of physics articulations is to provide a realistic physics behavior for commercial and industrial non-gaming applications that invol...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_83f0d4bdd491
unity_docs
rendering
What is `Video.VideoPlayer.targetCamera` in Unity? Explain its purpose and usage.
VideoPlayer.targetCamera public Camera targetCamera ; Description Camera component to draw to when VideoPlayer.renderMode is set to either VideoRenderMode.CameraFarPlane or VideoRenderMode.CameraNearPlane .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a0dfae525733
unity_docs
scripting
What is `UIElements.DragExitedEvent.GetPooled` in Unity? Explain its purpose and usage.
DragExitedEvent.GetPooled Declaration public static UIElements.DragExitedEvent GetPooled ( Event systemEvent ); Parameters Parameter Description systemEvent An IMGUI drag exited event. Returns DragExitedEvent An initialized event. Description Gets an event from the event pool and initializes it w...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_2e273347f4d0
unity_docs
rendering
Explain 'Particle appearance' in Unity.
Resources for configuring particle appearance and particle rendering. Topic Description Particle size Understand how the Particle System can change a particle’s size based on its speed or lifetime. Particle color Understand how the Particle System can change a particle’s color based on its speed or lifetime. Particle l...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_10d6f92d8aca
unity_docs
rendering
Give me an overview of the `SecondarySpriteTexture` class in Unity.
SecondarySpriteTexture struct in UnityEngine / Implemented in: UnityEngine.CoreModule Description Encapsulates a Texture2D and its shader property name to give Sprite-based renderers access to a secondary texture, in addition to the main Sprite texture. Properties Property Description name The shader propert...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_830f8c1bff16
unity_docs
input
What is `Experimental.GraphView.SelectionDragger.OnMouseDown` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. SelectionDragger.OnMouseDown Declaration protected void OnMouseDown ( UIElements.MouseDownEvent e ); Parameters Parameter Description e The event. Description Called on mouse down event.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_731438f2c63e
unity_docs
scripting
Show me a Unity C# example demonstrating `Application.OpenURL`.
ng Application.OpenURL . Refer to Interaction with browser scripting for more information and examples. Android: Due to security changes in Android 7.0 ( More information ), Application.OpenURL can no longer be used for opening local app files. To share files with other applications, you must use ( FileProvider )...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cc5337cb15c5
unity_docs
xr
What is `PackageManager.Client.List` in Unity? Explain its purpose and usage.
Client.List Declaration public static PackageManager.Requests.ListRequest List (); Declaration public static PackageManager.Requests.ListRequest List (bool offlineMode ); Declaration public static PackageManager.Requests.ListRequest List (bool offlineMode , bool includeIndirectDependencies ); Pa...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c01a3572a1d2
unity_docs
scripting
What is `Mesh.vertexBufferCount` in Unity? Explain its purpose and usage.
Mesh.vertexBufferCount public int vertexBufferCount ; Description Gets the number of vertex buffers present in the Mesh. (Read Only) Most Meshes contain only one vertex buffer, but some (such as skinned Meshes on some platforms) might contain more than one. This property is mostly useful together with GetNati...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_62922b51f9df
unity_docs
scripting
Show me a Unity C# example demonstrating `SpaceAttribute`.
SpaceAttribute class in UnityEngine / Inherits from: PropertyAttribute / Implemented in: UnityEngine.CoreModule Description Use this PropertyAttribute to add some spacing in the Inspector. The spacing is done using a DecoratorDrawer . ```csharp using UnityEngine;public class Example : MonoBehaviour { int...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9d77d2324844
unity_docs
scripting
What is `Unity.Properties.TypeUtility.SetExplicitInstantiationMethod` in Unity? Explain its purpose and usage.
TypeUtility.SetExplicitInstantiationMethod Declaration public static void SetExplicitInstantiationMethod (Func<T> constructor ); Parameters Parameter Description constructor The instantiation method. Description Sets an explicit instantiation method for the T type.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_cac5ade43fa3
unity_docs
rendering
Explain 'Validate and upload a UPM package for the Asset Store' in Unity.
To validate a UPM package for the Asset Store , perform the following steps. ## Validate and upload to the Editor Install Asset Store Publishing Tools . Open the Unity Editor and go to Window > Tools > Asset Store > Validator . Select UPM as the Validation Type and run the Validator. After you’ve fixed any issues the...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a78c19f196b6
unity_docs
rendering
What is `U2D.SpriteAtlasExtensions` in Unity? Explain its purpose and usage.
SpriteAtlasExtensions class in UnityEditor.U2D Description Method extensions for SpriteAtlas in Editor. This method is only exposed to Editor scripts. It is not exposed during Play mode. Static Methods Method Description Add Add an array of Assets to the packable objects list. GetMasterAtlas Gets the Maste...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5fdfa640040b
unity_docs
physics
What is `Hash128` in Unity? Explain its purpose and usage.
Hash128 struct in UnityEngine / Implemented in: UnityEngine.CoreModule Description Represents a 128-bit hash value. Use Hash128 to uniquely identify a piece of data. A 128-bit hash value has an extremely low probability of hash collisions, so you can assume that if the hash values of two pieces of data are id...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d2e1a2441c3e
unity_docs
math
In Unity's 'Profiling low-level native plug-ins', what is 'IUnityProfiler API reference' and how does it work?
Use the IUnityProfiler plug-in API to add instrumentation to the C/C++ code of your native plug-ins. The plug-in API is represented by IUnityProfiler interface, which is declared in the IUnityProfiler.h header. Unity stores the header in the <UnityInstallPath>\Editor\Data\PluginAPI folder of your Unity installation. (O...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7bf012273dc8
unity_docs
animation
What is `AssetImporters.LightDescription.HasAnimationCurveInClip` in Unity? Explain its purpose and usage.
LightDescription.HasAnimationCurveInClip Declaration public bool HasAnimationCurveInClip (string clipName , string propertyName ); Parameters Parameter Description propertyName The name of the light's animated property. clipName The name of the AnimationClip. Returns bool Returns true if the light pro...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f15bf9460ddb
unity_docs
rendering
What are the parameters of `Texture2DArray.GetPixelData` in Unity?
Returns NativeArray<T> A native array that points directly to the texture's data buffer in CPU memory. Description Gets the raw data from a texture. This method returns a NativeArray<T0> that points directly to the texture's data on the CPU and has the size of the mipmap level. The array doesn't contain a copy of the d...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1c1b0b453b7f
unity_docs
rendering
Give me an overview of the `LightmapCompression` class in Unity.
LightmapCompression enumeration Description A set of options for the level of compression the Editor uses for lightmaps. Properties Property Description None Does not compress lightmaps. LowQuality Compresses lightmaps in a low-quality format. This may use less memory and storage than Normal Quality, but can a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b77fdf82c6dd
unity_docs
scripting
What is `Events.UnityEventTools.RegisterObjectPersistentListener` in Unity? Explain its purpose and usage.
UnityEventTools.RegisterObjectPersistentListener Declaration public static void RegisterObjectPersistentListener ( Events.UnityEventBase unityEvent , int index , UnityAction<T> call , T argument ); Parameters Parameter Description unityEvent Event to modify. index Index to modify. call Function to ca...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_b8c7a2a97d1d
github
scripting
Write a Unity C# script called Virtual Input
```csharp using System; using System.Collections.Generic; using UnityEngine; namespace UnityStandardAssets.CrossPlatformInput { public abstract class VirtualInput { public Vector3 virtualMousePosition { get; private set; } protected Dictionary<string, CrossPlatfor...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_man_d600ffdc5c43
unity_docs
editor
In Unity's 'Native memory allocators reference', what is 'Main Allocator' and how does it work?
The primary allocator Unity uses for most allocations. It has the following settings: Setting Description Command line argument Default value Main Thread Block Size Block size of dedicated main thread allocator. memorysetup-main-allocator-block-size 16777216 bytes Shared Thread Block Size Block size of shared thread al...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3e2f268b7d0a
unity_docs
rendering
In Unity's 'Strip shader variants', what is 'Limit shader variants when you declare shader keywords' and how does it work?
The way that you declare shader keywords can limit the number of variants that they produce: Use shader_feature instead of multi_compile where possible - see How Unity compiles branching shaders . Ensure that you don’t define unused keywords with multi_compile . For information on declaring keywords in hand-coded shade...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_145f8f60277a
unity_docs
xr
What is `EditorGUI.CanCacheInspectorGUI` in Unity? Explain its purpose and usage.
Method group is Obsolete EditorGUI.CanCacheInspectorGUI Obsolete CanCacheInspectorGUI has been deprecated and is no longer used. Declaration public static bool CanCacheInspectorGUI ( SerializedProperty property ); Parameters Parameter Description property The SerializedProperty in question. Returns ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a784a0dc9609
unity_docs
math
What is `Mesh.boneWeights` in Unity? Explain its purpose and usage.
Mesh.boneWeights public BoneWeight[] boneWeights ; Description The BoneWeight for each vertex in the Mesh, which represents 4 bones per vertex. The size of this array is either Mesh.vertexCount or zero. The array is sorted by vertex index. Note that this property uses BoneWeight structs, which represent ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_183df9bc9e49
unity_docs
math
What is `GridBrushBase.Pick` in Unity? Explain its purpose and usage.
GridBrushBase.Pick Declaration public void Pick ( GridLayout gridLayout , GameObject brushTarget , BoundsInt position , Vector3Int pivot ); Parameters Parameter Description grid Grid used for layout. brushTarget Target of the paint operation. By default the currently selected GameObject. positi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e68ef2ec99e6
unity_docs
rendering
In Unity's 'Linear textures', what is 'Legacy GUI' and how does it work?
Rendering of elements of the Legacy GUI System is always done in gamma space. This means that for the legacy GUI system, Textures with their Texture Type set to Editor GUI and Legacy GUI do not have their gamma removed on import.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9ab9bb40c600
unity_docs
rendering
What is `WebCamTexture.isDepth` in Unity? Explain its purpose and usage.
WebCamTexture.isDepth public bool isDepth ; Description This property is true if the texture is based on depth data. Additional resources: WebCamDevice.depthCameraName , WebCamTexture.WebCamTexture .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e18446fffd72
unity_docs
rendering
Explain 'Web template variables' in Unity.
During the build process, Unity pre-processes template files and evaluates all macros and conditional directives included in those files. As part of this process, Unity finds and replaces all macro declarations with the values the Unity Editor supplies. Unity automatically pre-processes all .html, .php, .css, .js and ....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b969056c1b27
unity_docs
rendering
What is `ShaderKeywordFilter.RemoveIfNotAttribute` in Unity? Explain its purpose and usage.
RemoveIfNotAttribute class in UnityEditor.ShaderKeywordFilter / Inherits from: ShaderKeywordFilter.FilterAttribute Description Remove the specified shader keywords from the build if the data field doesn't match the condition. If the data field under RemoveIf doesn't match the value of condition , Unity remov...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c5bd5d81c02a
unity_docs
rendering
What is `Texture.GenerateAllMips` in Unity? Explain its purpose and usage.
Texture.GenerateAllMips public static int GenerateAllMips ; Description Can be used with Texture constructors that take a mip count to indicate that all mips should be generated. The value of this field is -1.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_95be4b3eb74d
unity_docs
editor
Show me a Unity C# example demonstrating `PlayerSettings.Android.renderOutsideSafeArea`.
PlayerSettings.Android.renderOutsideSafeArea public static bool renderOutsideSafeArea ; Description Extends rendering layout into display cutout area, utilizing all of the available screen space. ```csharp using UnityEngine; using UnityEditor; using UnityEditor.Build;public class RenderOutsideSafeAreaSample : ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_21b5b31f391d
unity_docs
scripting
What is `Categorization.CategoryInfoAttribute.Order` in Unity? Explain its purpose and usage.
CategoryInfoAttribute.Order public int Order ; Description The position this category should use. If categories with different name are at same Order, they are sorted by their Name. If Order is not specified, int.MaxValue will be used. If several different order are provided through different attribute, first f...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c98de4bcefff
unity_docs
scripting
What is `Search.PropertyDatabase.GetValueFromRecord` in Unity? Explain its purpose and usage.
PropertyDatabase.GetValueFromRecord Declaration public TValue GetValueFromRecord ( Search.IPropertyDatabaseRecordValue recordValue ); Parameters Parameter Description recordValue A serialized record value. Returns TValue The deserialized value. Description Deserialize a record value into its proper ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5abee599a5d5
unity_docs
scripting
Show me a Unity C# example demonstrating `RigidbodyConstraints.FreezePosition`.
RigidbodyConstraints.FreezePosition Description Freeze motion along all axes. ```csharp //Attach this script to a GameObject with a Rigidbody. Press the up and down keys to move the Rigidbody up and down. //Press the space key to freeze all positions.using UnityEngine;public class Example : MonoBehaviour { Rigidbo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_edc0d2fc702a
unity_docs
rendering
Explain 'Remove unused resources from your Web build' in Unity.
Remove unused packages, shaders , and engine code from a project to make the build smaller. A smaller build reduces application load times and improves the performance of your application. ## Remove or disable unused packages Unused packages might affect the final output size of the build. Remove or disable all packa...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f8ed9e0d0dcc
unity_docs
editor
In Unity's 'Contextual menu events', what is 'Respond to the user selection' and how does it work?
When an element receives a ContextualMenuPopulateEvent , it calls either DropdownMenu.InsertAction() or DropdownMenu.AppendAction() to add menu items to the contextual menu. DropdownMenu.InsertAction() and DropdownMenu.AppendAction() take two callbacks as parameters. The first callback executes when the user selects th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_779f9b93c6dd
unity_docs
scripting
In Unity's 'Naming scripts', what is 'Class names and namespaces' and how does it work?
Naming conflicts arise when multiple classes with the same name are declared in different parts of your project. The likelihood of naming conflicts increases with the scale of a project and the number of contributors. For example, one developer might write code to control the main player character while another writes ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b32fbdb5dea8
unity_docs
scripting
What is `ParticleSystem.CollisionModule.radiusScale` in Unity? Explain its purpose and usage.
ParticleSystem.CollisionModule.radiusScale public float radiusScale ; Description A multiplier that Unity applies to the size of each particle before collisions are processed. Useful for improving the visual accuracy of collisions, for example when there is an alpha border in the particle texture. Additional r...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7cc2fd8a81c6
unity_docs
ui
What is `Experimental.GraphView.Attacher.ctor` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. Attacher Constructor Declaration public Attacher ( UIElements.VisualElement anchored , UIElements.VisualElement target , SpriteAlignment alignment ); Parameters Parameter Description anchored The element that will ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1d59716367cf
unity_docs
physics
What are the parameters of `Physics2D.OverlapBox` in Unity?
Returns Collider2D The Collider overlapping the box. Description Checks if a Collider falls within a box area. The box is defined by its center coordinate in world space and by its size. The optional layerMask allows the test to check only for objects on specific layers. Although the Z axis is not relevant for renderin...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d0261a6efcea
unity_docs
scripting
What is `SceneManagement.SceneManager.LoadSceneAsync` in Unity? Explain its purpose and usage.
SceneManager.LoadSceneAsync Declaration public static AsyncOperation LoadSceneAsync (string sceneName , SceneManagement.LoadSceneMode mode = LoadSceneMode.Single); Declaration public static AsyncOperation LoadSceneAsync (int sceneBuildIndex , SceneManagement.LoadSceneMode mode = LoadSceneMode.Singl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.