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_23ab2df25818
unity_docs
scripting
Show me a Unity C# example demonstrating `Windows.WebCam.PhotoCaptureFrame.CopyRawImageDataIntoBuffer`.
, you may want to copy the raw IMFMediaBuffer data into your own byte list. For more information about the WinRT IMFMediaBuffer object, please vist https://msdn.microsoft.com/en-us/library/windows/desktop/ms696261(v=vs.85).aspx This example will capture an Image from the Web Camera and manually copy the image data out...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_10668bf19c9b
unity_docs
scripting
What are the parameters of `Serialization.ManagedReferenceUtility.GetManagedReference` in Unity?
Returns object Returns the C# object referenced on the specified host and identified with provided Id. Returns null if no reference object is found. Description Retrieves an object based on its managed reference Id. Use this method to efficiently retrieve a specific referenced object when, for example, its exact locati...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_38e1fc17ecd9_doc_4
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Get first FieldInfo for by type of Signature: ```csharp public static FieldInfo GetFirstAttributeFieldByType<T>(Attribute attribute) where T : Type ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4f75d22519dc
unity_docs
physics
What is `PhysicsShape2D.shapeType` in Unity? Explain its purpose and usage.
PhysicsShape2D.shapeType public PhysicsShapeType2D shapeType ; Description The shape type determines how the vertices and radius are used by this PhysicsShape2D . Refer to the PhysicsShapeType2D documentation for more information about the different shape types. ```csharp using UnityEngine; using UnityEng...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_969772648aeb
unity_docs
rendering
What is `VersionControl.IIconOverlayExtension.DrawOverlay` in Unity? Explain its purpose and usage.
IIconOverlayExtension.DrawOverlay Declaration public void DrawOverlay (string assetPath , VersionControl.IconOverlayType type , Rect rect ); Parameters Parameter Description assetPath Asset path. type Icon overlay type. rect Icon bounding box. Description Draws icon overlay. Unity calls this met...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_00ae353e4fe6
unity_docs
ui
What is `GUIStyle.hover` in Unity? Explain its purpose and usage.
GUIStyle.hover public GUIStyleState hover ; Description Rendering settings for when the mouse is hovering over the control. ```csharp using UnityEngine;public class Example : MonoBehaviour { // Prints the text color that button is using // when the mouse is hovering over a control void OnGUI() { Debug.Lo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_37dbfc7cb3bb
unity_docs
scripting
What is `MPE.EventDataSerialization.JsonUtility` in Unity? Explain its purpose and usage.
EventDataSerialization.JsonUtility Description Use JsonUtility.ToJson to serialize a message argument. Additional metadata is added to the message to specify which type to convert the JSON to when it is received.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7daf60b0e982
unity_docs
editor
Show me a Unity C# example demonstrating `VersionControl.VersionControlAttribute.displayName`.
VersionControlAttribute.displayName public string displayName ; Description Version control system display name. Can be localized. Used in UI. ```csharp using UnityEditor.VersionControl; using UnityEngine;public class CustomVersionControlAttribute : VersionControlAttribute { static string GetDisplayName() { ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7e06e5b484c1
unity_docs
physics
Show me a Unity C# example demonstrating `PhysicsShapeGroup2D.GetShape`.
ith the shape group having a quantity of shapes specified by shapeCount . Returns PhysicsShape2D Returns the shape stored at the specified shapeIndex . Description Gets the PhysicsShape2D stored at the specified shapeIndex . NOTE : Because the PhysicsShape2D is a struct, this is a copy of the shape ther...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7a1b4cb992fb
unity_docs
networking
What is `Device.Application.internetReachability` in Unity? Explain its purpose and usage.
Application.internetReachability public static NetworkReachability internetReachability ; Description This has the same functionality as Application.internetReachability and also mimics platform-specific behavior in the Unity Editor.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f2c20767c7fa
unity_docs
rendering
Explain 'Default project directories' in Unity.
When you create a project, Unity creates a project folder which contains default subfolders. These default subfolders each have a specific role in organizing your project’s files, settings, and data. Important: Using cloud-based storage methods to store your project is an unsupported workflow. It can cause synchronizat...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ed9abd89d322
unity_docs
scripting
What is `AndroidJNI.GetStringUTFLength` in Unity? Explain its purpose and usage.
AndroidJNI.GetStringUTFLength Declaration public static int GetStringUTFLength (IntPtr str ); Description Returns the length in bytes of the modified UTF-8 representation of a string. 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_791e526ecca4
unity_docs
editor
What are the parameters of `QualitySettings.GetRenderPipelineAssetsForPlatform` in Unity?
Description [Editor Only] Obtains a set with the non null Render Pipeline Assets selected on all the Quality Levels for the given platform. Declaration public static void GetRenderPipelineAssetsForPlatform (string buildTargetGroupName , out HashSet<T> uniqueRenderPipelineAssets , out bool allLevelsAreOverridden ); Para...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b1462815aea5
unity_docs
rendering
What is `SystemInfo.constantBufferOffsetAlignment` in Unity? Explain its purpose and usage.
SystemInfo.constantBufferOffsetAlignment public static int constantBufferOffsetAlignment ; Description Minimum buffer offset (in bytes) when binding a constant buffer using Shader.SetConstantBuffer or Material.SetConstantBuffer . If the currently active renderer supports binding constant buffers directly (see ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_6910d9d9a9ea_doc_20
github
scripting
What does `OnTriggerEnter2DAsObservable` do in this Unity script? Explain its purpose and signature.
Sent when another object enters a trigger collider attached to this object (2D physics only). Signature: ```csharp public static IObservable<Collider2D> OnTriggerEnter2DAsObservable(this Component component) ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_148cd3fd2bb7
unity_docs
animation
What is `HumanTrait.MuscleName` in Unity? Explain its purpose and usage.
HumanTrait.MuscleName public static string[] MuscleName ; Description Array of the names of all human muscle types defined by Mecanim. ```csharp using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { void Start() { string[] muscleName = HumanTrait.MuscleName; for (int i = 0;...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_10c61ae1b76e
github
scripting
Write a Unity C# script called Observable End Drag Trigger
```csharp // for uGUI(from 4.6) #if !(UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5) using System; // require keep for Windows Universal App using UnityEngine; using UnityEngine.EventSystems; namespace UniRx.Triggers { [DisallowMultipleComponent] public class ObservableEndDragTri...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
gh_2329a7941cc1_doc_17
github
scripting
What does `SetState` do in this Unity script? Explain its purpose and signature.
Attempts to set the current state of a controller.The state that we wish to transition to Signature: ```csharp public void SetState(ControllerStates nextState) ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_man_c313dc3b3542
unity_docs
rendering
Explain 'Cameras in the Built-In Render Pipeline' in Unity.
Resources for using cameras in the Built-In Render Pipeline . Page Description Set the camera background with Clear Flags in the Built-In Render Pipeline Set the camera background as a skybox or a solid color. Camera Inspector window reference for the Built-In Render Pipeline Explore the properties in the Camera compon...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ad3a010bbfba
unity_docs
scripting
Show me a Unity C# example demonstrating `EditorTools.EditorToolContext.PopulateMenu`.
EditorToolContext.PopulateMenu Declaration public void PopulateMenu ( UIElements.DropdownMenu menu ); Parameters Parameter Description menu The Scene view context menu to add menu items to. Description Adds menu items to the Scene view context menu. Refer to MenuUtility for utility functions that add men...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_ce18c80a41a9
unity_docs
editor
In Unity's 'Define logging levels', what is 'In C# scripts' and how does it work?
You can set the global and per-panel configurations to customize logging behavior in C# scripts . The following example sets the global log level of all panels or windows. ``` Binding.SetGlobalLogLevel(BindingLogLevel.Once); ``` The following example sets the log level per panel: ``` Binding.SetPanelLogLevel(myElement....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_15f1297d1bcb
unity_docs
rendering
What is `Material.SetColor` in Unity? Explain its purpose and usage.
Material.SetColor Declaration public void SetColor (string name , Color value ); Declaration public void SetColor (int nameID , Color value ); Parameters Parameter Description nameID Property name ID, use Shader.PropertyToID to get it. name Property name. For example, "_Color" in Built-in Ren...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6128eb6643dc
unity_docs
scripting
What is `Application.CanStreamedLevelBeLoaded` in Unity? Explain its purpose and usage.
Application.CanStreamedLevelBeLoaded Declaration public static bool CanStreamedLevelBeLoaded (int levelIndex ); Description Checks if the built scene can be loaded. Test if a scene with the provided index exists in the Player build. Returns true if the index value is greater than or equal to zero, and less tha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_de322a529c6d
unity_docs
scripting
What are the parameters of `Search.SearchExpression.ProcessValues` in Unity?
Returns IEnumerable<SearchItem> Yield a new list of items that have been transformed. Description Take a group of SearchItems and apply a processHandler transformer function to the item in order to sets its internal value or an outputValueField. Note that these items are processed in the main thread thus allowing you t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_98a1c6d8adc8
unity_docs
rendering
Explain 'BlendOp command in ShaderLab reference' in Unity.
Specifies the blending operation used by the Blend command. For this command to have any effect, there must also be a Blend command in the same Pass block (if this command is in a Pass block) or SubShader block (if this command is in a SubShader block). Not all blending operations are supported on all devices, and supp...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9fc90ee1c19b
unity_docs
math
Show me a Unity C# example demonstrating `Unity.Collections.LowLevel.Unsafe.UnsafeUtility.ArrayElementAsRef`.
tion Obtains a reference to a value of type T in an array at a specified index in memory. The ArrayElementAsRef method allows direct access to an array element by its index in memory. This method provides a reference to the element, enabling efficient data manipulation without copying. Use this method with care, ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cdc25351cf97
unity_docs
input
What is `tvOS.Remote` in Unity? Explain its purpose and usage.
Remote class in UnityEngine.tvOS / Implemented in: UnityEngine.CoreModule Description A class for Apple TV remote input configuration. Static Properties Property Description allowExitToHome Configures how Menu button behaves on Apple TV Remote. allowRemoteRotation Configures if Apple TV Remote should autor...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_4cd3e827a962
github
scripting
Write a Unity C# script called Button Menu
```csharp // // Copyright (c) Sandro Figo // using System; using System.Collections.Generic; using System.Linq; using UnityEngine; namespace DebugMenu { public class ButtonMenu : Singleton<ButtonMenu> { [SerializeField] private GameObject menuButtonPrefab = null; public DebugMenuItem...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_man_07fb45b3f666
unity_docs
ui
Show me a Unity code example for 'Class selectors'.
USS class selectors match elements that have specific USS classes assigned. USS class selectors are analogous to CSS class selectors. ## Syntax A class selector consists of the class name prefixed with a period. Class names are case-sensitive and can’t begin with a numeral. ```.className { ... } ``` Only use a period...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_86691d8f2c7b
unity_docs
scripting
What is `AndroidJNI.SetStaticFloatField` in Unity? Explain its purpose and usage.
AndroidJNI.SetStaticFloatField Declaration public static void SetStaticFloatField (IntPtr clazz , IntPtr fieldID , float val ); Description Sets the value of a static field in the specified object. 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_782387994fd0
unity_docs
rendering
What is `Experimental.Rendering.GraphicsFormatUtility.GetAlphaComponentCount` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphicsFormatUtility.GetAlphaComponentCount Declaration public static uint GetAlphaComponentCount ( Experimental.Rendering.GraphicsFormat format ); Declaration public static uint GetAlphaComponentCount ( TextureFormat fo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_86f7e82e3229
unity_docs
scripting
Give me an overview of the `WaitTimeoutMode` class in Unity.
WaitTimeoutMode enumeration Description Determines which mode of time measurement to use in wait operations. Properties Property Description Realtime Evaluates timeout values as units of real time. InGameTime Evaluates timeout values as units of in-game time, which is scaled according to the value of ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6f185a471797
unity_docs
ui
In Unity's 'IMGUI Controls', what is 'Label' and how does it work?
The Label is non-interactive. It is for display only. It cannot be clicked or otherwise moved. It is best for displaying information only. ```csharp /* GUI.Label example */ using UnityEngine; using System.Collections; public class GUITest : MonoBehaviour { void OnGUI () { GUI.Label (new Rect (25, 25, 100, 30),...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_2229ec48bfbe
unity_docs
rendering
In Unity's 'Configure Gate Fit', what is 'Vertical' and how does it work?
When Gate Fit is set to Vertical , Unity fits the resolution gate to the height (Y axis) of the film gate. Any change you make to the sensor width ( Sensor Size > X ) has no effect on the rendered image.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_e86ebf2b0978_doc_2
github
scripting
What does `Initialize` do in this Unity script? Explain its purpose and signature.
Initializes the PoolService by creating the parent for MonoBehaviour pools and initializing all pools based on the provided configuration. Signature: ```csharp public void Initialize() ```
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_b436be920d80
unity_docs
scripting
What are the parameters of `PhysicsScene.Simulate` in Unity?
Returns void Whether the simulation was run or not. Running the simulation during physics callbacks will always fail. Description Simulate physics associated with this PhysicsScene . Calling this method causes the physics to be simulated over the specified step time. Only the physics associated with this PhysicsScene...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bf4d2d08da52
unity_docs
rendering
What is `ParticleSystemRenderer.EnableVertexStreams` in Unity? Explain its purpose and usage.
Method group is Obsolete ParticleSystemRenderer.EnableVertexStreams Obsolete EnableVertexStreams is deprecated. Use SetActiveVertexStreams instead. Declaration public void EnableVertexStreams ( ParticleSystemVertexStreams streams ); Parameters Parameter Description streams Streams to enable. Descriptio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_c13463c0845a_doc_3
github
scripting
What does `Instantiate` do in this Unity script? Explain its purpose and signature.
Instantiate this instance. 1. Attempts to find an existing GameObject that matches (There will be 0 or 1 at any time) 2. Creates GameObject with name of subclass 3. Persists by default (optional) 4. Predictable life-cycle. Signature: ```csharp public static T Instantiate () ```
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_42e94441a3e8
unity_docs
scripting
What is `Android.AndroidProjectFilesModifier.callbackOrder` in Unity? Explain its purpose and usage.
AndroidProjectFilesModifier.callbackOrder public int callbackOrder ; Description Callback order when there are multiple implementations of AndroidProjectFilesModifier. The lower number has a higher priority. Default is 0.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8fa396482464
unity_docs
rendering
What are the parameters of `Texture3D.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.
gh_3d13c89661d4_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Base class for a serializable ordered dictionary asset. Custom dictionary assetclasses should inherit from the generic class instead. Signature: ```csharp public abstract class OrderedDictionary ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_man_dd408807b5da
unity_docs
scripting
In Unity's 'TagField', what is 'Example' and how does it work?
The following UXML example creates a TagField: ``` <UXML xmlns="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements"> <uie:TagField label="UXML Field" name="the-uxml-field" /> </UXML> ``` The following C# example illustrates some of the customizable functionalities of the TagField: ``` /// <sample> // Get a refe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_11eeb66ed442
unity_docs
rendering
What is `RenderTexture.antiAliasing` in Unity? Explain its purpose and usage.
RenderTexture.antiAliasing public int antiAliasing ; Description The antialiasing level for the RenderTexture. Anti-aliasing value indicates the number of samples per pixel. The value can be 1 , 2 , 4 or 8 . If unsupported by the hardware or rendering API, the greatest supported number of samples less tha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1a9cf3fea17e
unity_docs
editor
What is `EditorUserSettings.desiredImportWorkerCount` in Unity? Explain its purpose and usage.
EditorUserSettings.desiredImportWorkerCount public static int desiredImportWorkerCount ; Description The desired number of processes to use when importing assets, during an Asset Database refresh. The actual count of running worker processes may be higher or lower, but the asset pipeline aims to achieve this nu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1215a9d18e84
unity_docs
scripting
What is `AndroidShowActivityIndicatorOnLoading` in Unity? Explain its purpose and usage.
AndroidShowActivityIndicatorOnLoading enumeration Description Application should show ActivityIndicator when loading. Additional resources: PlayerSettings.Android.showActivityIndicatorOnLoading . Properties Property Description Large Large. InversedLarge Inversed Large. Small Small. InversedSmall Inversed ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a6e4e13182ff
unity_docs
editor
What is `PlayerSettings.Android.runWithoutFocus` in Unity? Explain its purpose and usage.
PlayerSettings.Android.runWithoutFocus public static bool runWithoutFocus ; Description Allows your application to continue to run even when it’s not in focus. When enabled, the application keeps running even when not in focus and remains visible on devices that support split-screen mode. When disabled, the ap...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_643e0d1aabbb
unity_docs
editor
Show me a Unity C# example demonstrating `AssetPostprocessor.OnPostprocessGameObjectWithUserProperties`.
the final Prefab is created and before it is written to disk, thus you have full control over the generated game objects and components. Any references to game objects or meshes will become invalid after the import has been completed. Thus it is not possible to create a new Prefab in a different file from OnPostprocess...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ceb2ed3c1201
unity_docs
scripting
Show me a Unity C# example demonstrating `Application.systemLanguage`.
ing in. Use this property to select localized content based on the user's system language. Query the current system language with Application.systemLanguage . Note : Changes to the device's language setting might not appear immediately at runtime. On some platforms, Application.systemLanguage updates only after you...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7bcd7c342177
unity_docs
editor
What is `iOS.Xcode.PBXProject.GetTargetProductFileRef` in Unity? Explain its purpose and usage.
PBXProject.GetTargetProductFileRef Declaration public string GetTargetProductFileRef (string targetGuid ); Parameters Parameter Description targetGuid The GUID of the target, such as the one returned by TargetGuidByName . Returns string The file reference of the artifact created by building target. D...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3988be732b1b
unity_docs
rendering
What is `GUI.depth` in Unity? Explain its purpose and usage.
GUI.depth public static int depth ; Description The sorting depth of the currently executing GUI behaviour. Set this to determine ordering when you have different scripts running simultaneously. GUI elements drawn with lower depth values will appear on top of elements with higher values (ie, you can think of th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_fffed0862fad
unity_docs
input
Explain 'Event reference' in Unity.
UI Toolkit raises an event when a user interacts with and changes the state of elements from UI Toolkit. The event design is similar to the Event interface for HTML elements. Event types fit into a hierarchy based on the EventBase class. Each event family implements an interface that defines the common characteristics ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a49585d89dd7
unity_docs
editor
What is `SearchService.ObjectSelectorSearchEndSessionModes.CloseSelector` in Unity? Explain its purpose and usage.
ObjectSelectorSearchEndSessionModes.CloseSelector Description The session is ending because the current object selector needs to be closed. Here is an example of an object selector engine using CloseSelector to close the currently opened selector: ```csharp using System; using UnityEditor.SearchService; using Ob...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9736c6c73dff
unity_docs
input
What is `UIElements.PointerCaptureEventBase_1.pointerId` in Unity? Explain its purpose and usage.
PointerCaptureEventBase<T0>.pointerId public int pointerId ; Description Identifies the pointer that sends the event. If the mouse sends the event, this property is set to 0. If a touchscreen device sends the event, this property is set to the finger ID, which ranges from 1 to the number of touches the devi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a4b1c011d32f
unity_docs
physics
What is `Build.BuildPipelineContext.DependOnAsset` in Unity? Explain its purpose and usage.
BuildPipelineContext.DependOnAsset Declaration public static void DependOnAsset ( Object asset ); Parameters Parameter Description asset The Unity Object from an asset. Description Allows you to specify that a Scene depends on contents of an asset directly provided. Scene rebuild will be triggered if the...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9d1b5ef82abc
unity_docs
physics
What are the parameters of `AssetImporters.ScriptedImporterAttribute.ctor` in Unity?
Description Use the ScriptedImporter attribute to register a custom importer derived from ScriptedImporter with Unity's Asset import pipeline. Always increment a scripted importer's version number whenever the script changes. This forces Assets imported with lower version numbers to be re-imported. If the Editor's Auto...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b1d5a88e6a5c
unity_docs
scripting
What is `AudioType` in Unity? Explain its purpose and usage.
AudioType enumeration Description The format type of the imported (native) data. Use this enumeration to specify the format type of the audio file you want to play. This is mostly useful if you stream your audio from a server with UnityWebRequestMultimedia.GetAudioClip . For example, if you want to stream a file ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_efe4ce6af473
unity_docs
physics
What is `Rigidbody2D.freezeRotation` in Unity? Explain its purpose and usage.
Rigidbody2D.freezeRotation public bool freezeRotation ; Description Controls whether physics will change the rotation of the object. If freezeRotation is enabled, the rotation in Z is not modified by the physics simulation. Additional resources: Rigidbody2D.constraints .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_60e344249239
unity_docs
audio
What is `AudioImporter.GetOverrideSampleSettings` in Unity? Explain its purpose and usage.
AudioImporter.GetOverrideSampleSettings Declaration public AudioImporterSampleSettings GetOverrideSampleSettings ( BuildTargetGroup platformGroup ); Declaration public AudioImporterSampleSettings GetOverrideSampleSettings (string platform ); Parameters Parameter Description platformGroup The platfo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_066677a575e3
unity_docs
scripting
What is `SettingsScope` in Unity? Explain its purpose and usage.
SettingsScope enumeration Description Sets the scope of a SettingsProvider. The Scope determines where it appears in the UI. For example, whether it appears with the Project settings in the Settings window, or in the Preferences window, or in both windows. Additional resources: SettingsProvider.scope , SettingsP...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_673cae585950
unity_docs
xr
In Unity's 'XR packages', what is 'XR provider plug-ins' and how does it work?
The Unity XR plug-in framework provides the basis for XR development in Unity. You can add support for an XR device to a project by installing and enabling the relevant XR plug-in. You can add or remove plug-ins to the project at any time. For instructions on how to add XR plug-ins to your project using the XR Plug-in ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_876306f2799c
unity_docs
rendering
Explain 'Enable Enlighten Realtime Global Illumination' in Unity.
To enable Enlighten Realtime Global Illumination in your Scene, open the Lighting window (menu: Window > Rendering > Lighting ) and enable Realtime Global Illumination . To disable the effect of Realtime GI on a specific Light, select the Light GameObject and, in the Light component, set the Indirect Multiplier to 0. T...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_94ab27e9b1d4
unity_docs
physics
Explain 'Discrete collision detection' in Unity.
The Discrete collision detection mode uses a discrete collision detection algorithm, which checks for collisions on each physics timestep. Discrete is the default collision detection mode, and by far the least computationally demanding. However, it can miss collisions that occur between physics steps, so it’s usually n...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3737218bce12
unity_docs
editor
Explain 'Model file formats reference' in Unity.
Unity uses the.fbx file format as its internal importing chain. It’s best practice to use the.fbx file format whenever possible, and not use proprietary model file formats in production. ## Supported model file formats Unity supports the following standard and proprietary model file formats. ## Standard file formats...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_61f19dd8d8ca
unity_docs
scripting
Show me a Unity C# example demonstrating `DrawGizmo.ctor`.
DrawGizmo Constructor Declaration public DrawGizmo ( GizmoType gizmo ); Parameters Parameter Description gizmo Flags to denote when the gizmo should be drawn. Description Defines when the gizmo should be invoked for drawing. Additional resources: GizmoType , DrawGizmo . ```csharp using UnityEngine; us...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_469b740aa000
unity_docs
scripting
What is `PlayerSettings.GetVirtualTexturingSupportEnabled` in Unity? Explain its purpose and usage.
PlayerSettings.GetVirtualTexturingSupportEnabled Declaration public static bool GetVirtualTexturingSupportEnabled (); Returns bool True if virtual texturing is enabled, false otherwise. Description Is virtual texturing enabled. This returns the user prefered state excluding platform support.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0f621ba6611b
unity_docs
rendering
What is `Experimental.Rendering.GraphicsStateCollection.GetGraphicsStateCountForVariant` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphicsStateCollection.GetGraphicsStateCountForVariant Declaration public int GetGraphicsStateCountForVariant ( Shader shader , Rendering.PassIdentifier passId , LocalKeyword[] keywords ); Declaration public int GetGra...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_76821c29a86e
unity_docs
rendering
Show me a Unity C# example demonstrating `LightTransport.IProbeIntegrator.IntegrateValidity`.
lidity calculation: Value 1.0: Probe is in an open area with good visibility. Values between 0-1: Probe has partial validity. Value 0.0: Probe is inside geometry or in an invalid location. Validity is determined by whether rays hit front-facing vs back-facing surfaces. Invalid probes (low validity) should be exclud...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d71713fe9e58
unity_docs
editor
Give me an overview of the `ConvertToPrefabInstanceSettings` class in Unity.
ConvertToPrefabInstanceSettings class in UnityEditor Description Settings controlling the behavior of PrefabUtility.ConvertToPrefabInstance . Properties Property Description changeRootNameToAssetName Change the name of the root GameObject to match the name of the Prefab Asset used when converting. components...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_14725cb37946
unity_docs
animation
What is `WrapMode` in Unity? Explain its purpose and usage.
WrapMode enumeration Description Determines how time is treated outside of the keyframed range of an AnimationClip or AnimationCurve . The WrapMode that the animation system uses for a specific animation is determined this way: You can set the WrapMode of an AnimationClip in the import settings of the clip. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_eedcc9dd4c4d
unity_docs
ui
What is `UIElements.Button.clicked` in Unity? Explain its purpose and usage.
Button.clicked Description Callback triggered when the button is clicked. This is a shortcut for modifying Clickable.clicked . It is provided as a convenience. When you add or remove actions from clicked, it adds or removes them from Clickable.clicked automatically. The following example shows how to use...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_95c6fb33a527
unity_docs
scripting
What is `Experimental.GraphView.GraphElement.IsDroppable` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphElement.IsDroppable Declaration public bool IsDroppable (); Returns bool Returns true if the GraphElement is droppable. Returns false otherwise. Description The GraphElement is drag&droppable.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4703f5a899e3
unity_docs
physics
What are the parameters of `Physics2D.CapsuleCast` in Unity?
Returns RaycastHit2D The cast results returned. Description Casts a capsule against Colliders in the Scene, returning the first Collider to contact with it. A CapsuleCast is conceptually like dragging a capsule through the Scene in a particular direction. Any object making contact with the capsule can be detected and ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_8cff7e614c87
github
scripting
Write a Unity C# script called I Setting
```csharp using UnityEngine; namespace DebugMenu { public interface ISetting { string Key { get; } string DisplayName { get; } string Tooltip { get; } object DefaultValue { get; } void Set(object value); object Get(); GUIContent GetGuiContent(); } } `...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_0500c6e8037a
unity_docs
performance
In Unity's 'Android thread configuration', what is 'Thread affinity' and how does it work?
The affinity of a thread controls which CPU cores the thread should run on. For Android devices, cores usually fit into two categories: Big: Powerful cores that are battery power-intensive. Little: Slower cores that are less battery power-intensive than big cores. Important : For typical applications that target a vari...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6368ea51f25d
unity_docs
ui
What is `Experimental.GraphView.EdgeConnector` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. EdgeConnector class in UnityEditor.Experimental.GraphView / Inherits from: UIElements.PointerManipulator Description Manipulator for creating new edges. Properties Property Description edgeDragHelper Reference to the edge...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bc513018fcc9
unity_docs
physics
What is `AssetImporters.TextureGenerationSettings` in Unity? Explain its purpose and usage.
TextureGenerationSettings struct in UnityEditor.AssetImporters Description Represents how a texture should be generated from calling TextureGenerator.GenerateTexture . Properties Property Description assetPath Path where the Asset will be placed. enablePostProcessor When set to true, the AssetPostprocessor h...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_43bf90c2779a
unity_docs
math
Show me a Unity C# example demonstrating `Graphics.RenderPrimitivesIndexedIndirect`.
number of indexed primitives and instances. Use RenderParams.worldBounds to define bounds to cull and sort the geometry rendered with the method as a single entity. This function only works on platforms that support compute shaders . Add the following lines in the pass section of a shader to access command, instance...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_796383a60d27
unity_docs
scripting
What is `Windows.WebCam.WebCamMode.VideoMode` in Unity? Explain its purpose and usage.
WebCamMode.VideoMode Description Resource is in Video Mode. This mode is entered when calling VideoCapture.StartVideoModeAsync and this mode is exited when calling VideoCapture.StopVideoModeAsync .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_844fd291b6ce
unity_docs
xr
What is `Networking.MultipartFormDataSection` in Unity? Explain its purpose and usage.
MultipartFormDataSection class in UnityEngine.Networking / Implemented in: UnityEngine.UnityWebRequestModule Implements interfaces: IMultipartFormSection Description A helper object for form sections containing generic, non-file data. This helper object is used similarly to the WWWForm method WWWForm.AddBin...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_1c7c3a69dc3b
unity_docs
physics
Explain 'Layout events' in Unity.
GeometryChangedEvent is currently the only layout event. The base class for GeometryChangedEvent is the EventBase class. Event Description Trickles down Bubbles up Cancellable GeometryChangedEvent Sent when the position or the dimensions of an element changes. ## Unique properties oldRect : The former position and di...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5267d5339a7f
unity_docs
rendering
In Unity's 'RenderingLayerMaskField', what is 'Create a RenderingLayerMaskField' and how does it work?
You can create a RenderingLayerMaskField with UXML and C#. The following C# example creates a RenderingLayerMaskField with the default value: ```csharp using UnityEditor.UIElements; ... RenderingLayerMaskField myElement = new RenderingLayerMaskField("Label text"); // Sets the default value. myElement.value = UnityEngin...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_83f4565bc2a8
unity_docs
math
What is `AI.NavMeshData.rotation` in Unity? Explain its purpose and usage.
NavMeshData.rotation public Quaternion rotation ; Description Gets or sets the orientation of the NavMesh data. The default value is Quaternion.identity - that is, the NavMesh up axis is the same as the world space y-axis.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e127d86392e8
unity_docs
scripting
Explain 'Lens Flare component reference' in Unity.
Explore the properties in the Lens Flare component to create a lens flare with a Flare asset . Property: Function: Flare The Flare asset to render. Note : The other properties in the Lens Flare Inspector are stored in this Flare asset. They are not stored in the Lens Flare component. Color The color to tint the Flare t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2ba8f805372a
unity_docs
scripting
Show me a Unity C# example demonstrating `ParticleSystem.InheritVelocityModule.mode`.
ParticleSystem.InheritVelocityModule.mode public ParticleSystemInheritVelocityMode mode ; Description Specifies how to apply emitter velocity to particles. ```csharp using UnityEngine; using System.Collections;[RequireComponent(typeof(ParticleSystem))] public class ExampleClass : MonoBehaviour { private Par...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f290e155f46b
unity_docs
scripting
What is `ModelImporterMeshCompression.Medium` in Unity? Explain its purpose and usage.
ModelImporterMeshCompression.Medium Description Medium amount of mesh compression. Vertex positions, normals/tangents and UVs will be quantized to respectively 16, 8, 10 bits per component. Skinning information will be compressed. Additional resources: ModelImporter.meshCompression .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_57bcd0c6758f
github
scripting
Write a Unity C# MonoBehaviour script called Toggle Light
```csharp using UnityEngine; /// <summary> /// Toggles a light /// </summary> [RequireComponent(typeof(Light))] public class ToggleLight : MonoBehaviour { [Tooltip("Controls the state of the light")] public bool isOn = false; private Light currentLight = null; private void Awake() { curre...
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_e43df6236304
unity_docs
animation
What is `Tilemaps.Tilemap.GetAnimationFrame` in Unity? Explain its purpose and usage.
Tilemap.GetAnimationFrame Declaration public int GetAnimationFrame ( Vector3Int position ); Parameters Parameter Description position Grid cell position. Returns int Returns the current animation frame. Returns -1 when there is no animation for the Tile at the given position. Description Retrieves t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ea3989a87b72
unity_docs
scripting
Show me a Unity C# example demonstrating `Collision.collider`.
Collision.collider public Collider collider ; Description The Collider we hit (Read Only). Fetch the Collider of the GameObject your GameObject hits. To find all colliders that were hit in detail you have to iterate the contact points ( contacts property). ```csharp //In this example, the name of the Game...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_cbd37c636968
unity_docs
rendering
In Unity's 'Texture properties', what is 'Texture tiling & offset' and how does it work?
Materials often have Tiling and Offset fields for their texture properties. This information is passed into shaders in a float4 {TextureName} _ST property: x contains X tiling value y contains Y tiling value z contains X offset value w contains Y offset value For example, if a shader contains texture named _MainTex , t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1192360d4d60
unity_docs
scripting
What is `AI.NavMeshBuildMarkup.overrideGenerateLinks` in Unity? Explain its purpose and usage.
NavMeshBuildMarkup.overrideGenerateLinks public bool overrideGenerateLinks ; Description Use this to specify whether the default links generation condition for the GameObject and its children should be overridden by the generateLinks option specified in this struct.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e69a3473581a
unity_docs
editor
Explain 'Assembly Definition file format reference' in Unity.
Assembly Definition and Assembly Definition Reference assets are JSON files. You can edit the asset files inside the Unity Editor using the Inspector window, but you can also modify the JSON content directly with an external tool. ## Assembly Definition JSON An Assembly Definition is a JSON object with the following ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8e2b3e30522b
unity_docs
rendering
Explain 'Deferred rendering path in the Built-In Render Pipeline' in Unity.
When using deferred shading, there is no limit on the number of lights that can affect a GameObject . All lights are evaluated per-pixel, which means that they all interact correctly with normal maps , etc. Additionally, all lights can have cookies and shadows. Deferred shading has the advantage that the processing ove...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d009622f4ee2
unity_docs
scripting
What is `EditorGUI.Vector2Field` in Unity? Explain its purpose and usage.
EditorGUI.Vector2Field Declaration public static Vector2 Vector2Field ( Rect position , string label , Vector2 value ); Declaration public static Vector2 Vector2Field ( Rect position , GUIContent label , Vector2 value ); Parameters Parameter Description position Rectangle on the screen t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_67008fb98e6d
unity_docs
physics
What is `CustomRenderTextureManager` in Unity? Explain its purpose and usage.
CustomRenderTextureManager class in UnityEngine / Implemented in: UnityEngine.CoreModule Description Custom Render Texture Manager. It will allow you to retrieve a lot of information about running Custom Render Textures. Static Methods Method Description GetAllCustomRenderTextures Populate the list in param...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f1113b0e97f1
unity_docs
editor
What are the parameters of `AssetDatabase.GetImplicitAssetBundleVariantName` in Unity?
Returns string Returns the name of the AssetBundle Variant that a given asset belongs to. See the method description for more details. Description Returns the name of the AssetBundle Variant that a given asset belongs to. If the asset has been explicitly assigned to an AssetBundle Variant, then that value is returned. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_0e5fd0568c2a
github
scripting
Write a Unity Editor script for FB Body Tracking Build Hook
```csharp using System; using System.Collections.Generic; using Unity.XR.Management.AndroidManifest.Editor; using UnityEditor; using UnityEditor.Build.Reporting; using UnityEditor.XR.OpenXR.Features; using UnityEngine.XR.OpenXR; namespace OpenXR.Extensions.Editor { public class FBBodyTrackingBuildHook : OpenXRFeat...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_4707ed94d64f
unity_docs
rendering
What is `Experimental.Rendering.GraphicsStateCollection.isTracing` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphicsStateCollection.isTracing public bool isTracing ; Description Flag indicating if the collection is actively tracing shader variants and graphics states.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_34f5e84bbd62
unity_docs
physics
Show me a Unity C# example demonstrating `ControllerColliderHit.moveDirection`.
odies. Note that this is not necessarily the same as the movement vector passed to CharacterController.Move or CharacterController.SimpleMove . The CharacterController uses a sequence of motions to perform a move in accordance with the move direction and the step Offset, in order to step over obstacles. moveDirectio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9964ca591859
unity_docs
scripting
What is `IMGUI.Controls.TreeView.IsSelected` in Unity? Explain its purpose and usage.
TreeView.IsSelected Declaration public bool IsSelected (int id ); Parameters Parameter Description id TreeViewItem ID. Description Returns true if the TreeViewItem with ID id is currently selected.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_72affb812421
unity_docs
rendering
In Unity's 'Mesh vertex data', what is 'Normal' and how does it work?
The vertex normal represents the direction that points directly “out” from the surface at the position of the vertex. Unity uses this value to calculate the way that light reflects off the surface of a mesh. This vertex attribute is optional. In the Mesh class, the simplest way to access this data is with Mesh.GetNorma...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.