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_8f802124d268
unity_docs
rendering
What is `PlayerSettings.iOS.cameraUsageDescription` in Unity? Explain its purpose and usage.
PlayerSettings.iOS.cameraUsageDescription public static string cameraUsageDescription ; Description Describes the reason for access to the user's camera. When the OS prompts the user to allow access to the camera, this text is displayed as part of the dialog box.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5bbe5fd64f16
unity_docs
scripting
In Unity's 'JSON Serialization', what is 'Overwriting objects with JSON' and how does it work?
You can also deserialize JSON data over an existing object, which overwrites any existing data: ``` JsonUtility.FromJsonOverwrite(json, myObject); ``` If the JSON data does not contain a value for a field, the serializer does not change that field’s value. This method allows you to keep allocations to a minimum by reus...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b26323ea80ff
unity_docs
physics
What is `LayerMask.value` in Unity? Explain its purpose and usage.
LayerMask.value public int value ; Description Converts a layer mask value to an integer value. ```csharp using UnityEngine;public class Example : MonoBehaviour { // Casts a ray using the layer mask, // which can be modified in the inspector. LayerMask mask = -1; void Update() { if (Physics.Raycast(transfo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_25f40739b5de_doc_2
github
scripting
What does `Get` do in this Unity script? Explain its purpose and signature.
Retrieves an object from the pool and adds it to the active objects list.A pooled object of type T. Signature: ```csharp internal T Get() ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_af3d6dff69fb
unity_docs
rendering
What is `Rendering.BuiltinShaderDefine.UNITY_ENABLE_REFLECTION_BUFFERS` in Unity? Explain its purpose and usage.
BuiltinShaderDefine.UNITY_ENABLE_REFLECTION_BUFFERS Description UNITY_ENABLE_REFLECTION_BUFFERS is set when deferred shading renders reflection probes in deferred mode. With this option set reflections are rendered into a per-pixel buffer. This is similar to the way lights are rendered into a per-pixel buffer. UNITY...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_910364e5c75e
unity_docs
ui
What is `UIElements.Scroller` in Unity? Explain its purpose and usage.
Scroller class in UnityEngine.UIElements / Inherits from: UIElements.VisualElement / Implemented in: UnityEngine.UIElementsModule Description A vertical or horizontal scrollbar. For more information, refer to UXML element Scroller . Static Properties Property Description highButtonUssClassName USS cl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6bd501f7bb91
unity_docs
scripting
Give me an overview of the `Snapping` class in Unity.
Snapping class in UnityEngine / Implemented in: UnityEngine.CoreModule Description Snap values to rounded increments. Static Methods Method Description Snap Rounds value to the closest multiple of snap.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_94c216cb2541_doc_4
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Number of answer (and required buttons). Either One, Two, Three, Four or Differing. Signature: ```csharp public AnswersAmount answersAmount = AnswersAmount.Two; ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_a6558a862fa6
unity_docs
rendering
What is `Rendering.CommandBuffer.SetRayTracingFloatParam` in Unity? Explain its purpose and usage.
CommandBuffer.SetRayTracingFloatParam Declaration public void SetRayTracingFloatParam ( Rendering.RayTracingShader rayTracingShader , string name , float val ); Declaration public void SetRayTracingFloatParam ( Rendering.RayTracingShader rayTracingShader , int nameID , float val ); Parameters Paramet...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6d53884474d9
unity_docs
ui
What is `UIElements.Button.ussClassName` in Unity? Explain its purpose and usage.
Button.ussClassName public static string ussClassName ; Description USS class name of elements of this type. Unity adds this USS class to every instance of the Button element. Any styling applied to this class affects every button located beside, or below the stylesheet in the visual tree.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0015b0d8019b
unity_docs
editor
What is `iOS.Xcode.PBXProject.RemoveFile` in Unity? Explain its purpose and usage.
PBXProject.RemoveFile Declaration public void RemoveFile (string fileGuid ); Parameters Parameter Description fileGuid The GUID of the file or folder reference. Description Removes the given file from project. The file is removed from the list of files to build for each native target and also removed from...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_cf41fd5ba932_doc_3
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Directs the XR Origin's movement when using the hand-relative mode with the left hand. Signature: ```csharp public Transform leftControllerTransform ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_13e1fb6cc11c
unity_docs
scripting
What is `PackageManager.UI.Sample.ImportOptions` in Unity? Explain its purpose and usage.
ImportOptions enumeration Description Sample import options. Properties Property Description None None. OverridePreviousImports Override previous imports of the sample. HideImportWindow Hide the import window when importing a sample that is an asset package (a .unitypackage file).
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_0951a582a776
unity_docs
physics
In Unity's 'Create and apply a custom Physics Material', what is 'Apply a custom Physics Material asset to a collider' and how does it work?
To apply a Physics Material asset to a collider: Navigate to the target collider’s Material property. In the Material property field, select the picker icon. Select the Physics Material asset you want to use. Alternatively, you can click and drag the Physics Material asset file directly from the Project window onto the...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b8aeceb27792
unity_docs
scripting
What is `Rendering.SubMeshDescriptor.indexCount` in Unity? Explain its purpose and usage.
SubMeshDescriptor.indexCount public int indexCount ; Description Index count for this sub-mesh face data. This property, together with indexStart , determines which part of the whole index buffer is used by a particular sub-mesh. Values in the index buffer are interpreted according to the topology property, ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_87675ac803ae
unity_docs
audio
Show me a Unity C# example demonstrating `AudioClip.PCMSetPositionCallback`.
o the clip, Unity does the following: Calls PCMSetPositionCallback . Sets the position parameter to 44,100 regardless of the audio channel count. If the audio clip is stereo (2 channels), each frame has 2 samples- one per channel. The total number of samples at 1 s into the clip is 88200 (44100 frames x 2 channe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_c3fef78314b9
github
scripting
Write a Unity Editor script for Type Drawer
```csharp using UnityEngine; using UnityEditor; using System; namespace EssentialEditor.Internal { public static class TypeDrawer { public static object Draw(Type type, string name, object getValue) { object value = null; if (typeof(int) == type) { ...
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_man_5cf8245450c3
unity_docs
rendering
In Unity's 'Visual effects', what is 'Additional resources and examples' and how does it work?
📖 E-Book : The definitive guide to creating advanced visual effects in Unity (Unity 6 edition) 📖 E-Book : Create popular shaders and visual effects with the Universal Render Pipeline (Unity 6 edition) 📖 E-Book : Introduction to the Universal Render Pipeline for advanced creators (Unity 6 edition) 📺 Video : Compute ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1628d794ec8d
unity_docs
animation
What is `ParticleSystemAnimationMode` in Unity? Explain its purpose and usage.
ParticleSystemAnimationMode enumeration Description The animation mode. Properties Property Description Grid Use a regular grid to construct a sequence of animation frames. Sprites Use a list of sprites to construct a sequence of animation frames.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cba690fdab0a
unity_docs
networking
What is `Networking.PlayerConnection.PlayerConnection.TrySend` in Unity? Explain its purpose and usage.
PlayerConnection.TrySend Declaration public bool TrySend (Guid messageId , byte[] data ); Parameters Parameter Description messageId The type ID of the message that is sent to the Editor. Returns bool Returns true when the Player sends data successfully, and false when there is no space in the socket ri...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ce8afed454d3
unity_docs
rendering
What is `IHVImageFormatImporter.wrapModeV` in Unity? Explain its purpose and usage.
IHVImageFormatImporter.wrapModeV public TextureWrapMode wrapModeV ; Description Texture V coordinate wrapping mode. Controls wrapping mode along texture V (vertical) axis. Additional resources: Texture.wrapModeV , wrapMode , texture assets .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_95a42a9ca65a
unity_docs
scripting
What is `Search.SearchContext.filterId` in Unity? Explain its purpose and usage.
SearchContext.filterId public string filterId ; Description Explicit filter ID. Usually it is the first search token like h:, p: to do an explicit search for a given search provider. Can be null.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_51f8a55d2f1b
unity_docs
scripting
What is `UnityEngine.DirectorModule` in Unity? Explain its purpose and usage.
UnityEngine.DirectorModule Description The Director module implements the PlayableDirector class. Classes Class Description PlayableDirector Instantiates a PlayableGraph from a PlayableAsset and controls playback of Playable objects. This API is mainly designed to provide scheduling and scene binding support a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4773a7e24b84
unity_docs
scripting
What is `Terrain.treeCrossFadeLength` in Unity? Explain its purpose and usage.
Terrain.treeCrossFadeLength public float treeCrossFadeLength ; Description Total distance delta that trees will use to transition from billboard orientation to mesh orientation. Decreasing this value makes the transition happen faster. Setting it to 0 will produce a visible pop when switching from mesh to billb...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_8a655b2b2656
github
scripting
Write a Unity C# audio script for Audio Playback Modulator
```csharp using UnityEngine; namespace LeakyAbstraction.ReactiveScriptables { public class AudioPlaybackModulator : MonoBehaviour { [Header("Identifier (cosmetic):")] [SerializeField] private string _modulatorName = default; [Header("Audio source to modulate:")] [Seria...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_5d9d03c104cf
unity_docs
editor
What are the parameters of `AssetDatabase.ExportPackage` in Unity?
Description Exports the assets identified by assetPathNames to a unitypackage file in fileName . Additional resources: ExportPackageOptions for information on how you can affect what gets exported. ```csharp using System.Collections.Generic; using UnityEditor; using UnityEngine;public class AssetDatabaseExamples : Mono...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7b658e08d30e
unity_docs
rendering
What is `ShaderUtil.GetCallableShaderName` in Unity? Explain its purpose and usage.
ShaderUtil.GetCallableShaderName Declaration public static string GetCallableShaderName ( Rendering.RayTracingShader s , int shaderIndex ); Parameters Parameter Description s The RayTracingShader instance. shaderIndex The callable Shader index for which to retrieve the name. The callable Shaders define...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_d35333d1dcce_doc_2
github
scripting
What does `AddSubscription_internal` do in this Unity script? Explain its purpose and signature.
Subscribes to a GameEvent, and handles all relevant responsibilities, i.e. automatically suspends subscription while the GameObject is disabled.The GameEvent to subscribe to.The method to be called when the event fires. Signature: ```csharp protected void AddSubscription<T>(GameEvent<T> gameEvent, Action<T> callback) ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_38e24ea4c629
unity_docs
input
What is `Search.SearchExpression.GetFormatString` in Unity? Explain its purpose and usage.
SearchExpression.GetFormatString Declaration public static bool GetFormatString ( Search.SearchExpression expr , out string formatStr ); Parameters Parameter Description expr Expression to convert to a format string. formatStr Extracted format string. Returns bool Returns true if the SearchExpression...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e742e1a806e5
unity_docs
xr
What is `Android.Permission.FineLocation` in Unity? Explain its purpose and usage.
Permission.FineLocation public static string FineLocation ; Description Used when requesting permission or checking if permission has been granted to use the users location with high precision.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_23bbc8e8f133
unity_docs
input
Explain 'Input Manager' in Unity.
Important : Input Manager is a legacy feature and not recommended for new projects. For new projects you should use the Input System Package . The Input Manager window allows you to define input axes and their associated actions for your Project. To access it, from Unity’s main menu, go to Edit > Project Settings , the...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a2c65db84d0f
unity_docs
scripting
What is `Experimental.GraphView.StackNode.InsertElement` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. StackNode.InsertElement Declaration public void InsertElement (int index , Experimental.GraphView.GraphElement element ); Parameters Parameter Description index The index where the specified GraphElement will be insert...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_44b011b0da93
github
scripting
Write a Unity C# MonoBehaviour script called Example
```csharp using UnityEngine; using System.Collections.Generic; namespace EssentialEditor.Example { public class Example : MonoBehaviour { public Vector2 foo1; public float foo2; [ExposeProperty] public float Foo { get { return foo2; } set { foo2...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_cf41cb1ca545
unity_docs
physics
Show me a Unity C# example demonstrating `Compilation.CompilationPipeline.compilationFinished`.
he context as a key, and capture start time or relevant state. On compilation finish, you can then look up the same entry via the context , compute duration, summarize results, and clean up. Note: Performing Player builds or triggering additional compilation tasks from callbacks is not supported. This is because th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6dc754aaa91f
unity_docs
input
What is `AndroidInput` in Unity? Explain its purpose and usage.
AndroidInput class in UnityEngine / Implemented in: UnityEngine.InputLegacyModule Description AndroidInput provides support for off-screen touch input, such as a touchpad. Static Properties Property Description secondaryTouchEnabled Property indicating whether the system provides secondary touch input. seco...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_954273f56d4b
unity_docs
scripting
What is `Transform.LookAt` in Unity? Explain its purpose and usage.
Transform.LookAt Declaration public void LookAt ( Transform target ); Declaration public void LookAt ( Transform target , Vector3 worldUp = Vector3.up); Parameters Parameter Description target Object to point towards. worldUp Vector specifying the upward direction. Description Rotates the tra...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_80f9afe2f184
unity_docs
rendering
What is `RenderPickingArgs.renderPickingType` in Unity? Explain its purpose and usage.
RenderPickingArgs.renderPickingType public RenderPickingType renderPickingType ; Description Specifies the type of the current picking rendering the callback is invoked with. Unity picking rendering is categorized into two types that have two different purposes. Your rendering must adhere to this type specifi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b86139204c73
unity_docs
scripting
What is `Experimental.Rendering.GraphicsFormat.R8G8B8A8_SRGB` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphicsFormat.R8G8B8A8_SRGB Description A four-component, 32-bit unsigned normalized format that has an 8-bit R component stored with sRGB nonlinear encoding in byte 0, an 8-bit G component stored with sRGB nonlinear encoding in...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9ac64645ec88
unity_docs
editor
What is `AssetImporters.ScriptedImporterAttribute.overrideFileExtensions` in Unity? Explain its purpose and usage.
ScriptedImporterAttribute.overrideFileExtensions public string[] overrideFileExtensions ; Description List of file name extensions (not including the leading period character) that the scripted importer can handle in addition to the default file name extension(s). This Importer is registered as a Override Impor...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4092446ac3fa
unity_docs
scripting
What is `SceneView.MoveToView` in Unity? Explain its purpose and usage.
SceneView.MoveToView Declaration public void MoveToView (); Declaration public void MoveToView ( Transform target ); Parameters Parameter Description target A transform to place at the scene pivot . Description Transforms all selected object to the scene pivot . If no argument is passed, each selec...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_bf5cf5c5d6e1_doc_7
github
scripting
What does `IsLittleGrabbing` do in this Unity script? Explain its purpose and signature.
Returns true if the given hand's little finger tip is closer to the wrist than the little proximal joint.Hand to check for the required pose.True if the given hand's little finger tip is closer to the wrist than the little proximal joint, false otherwise. Signature: ```csharp static bool IsLittleGrabbing(XRHand hand) ...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_man_58f2ab067d55
unity_docs
xr
In Unity's 'Foveated rendering', what is 'Control foveated rendering' and how does it work?
Control foveated rendering by setting the foveatedRenderingLevel property of the XRDisplaySubsystem to a value between zero and one. You must enable foveated runtime in your project’s provider plug-in settings or the runtime setting is ignored. The following example method sets the foveation level: ```csharp public voi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_c0b55fac7624
unity_docs
scripting
Show me a Unity code example for 'TwoPaneSplitView'.
ent is a container that arranges its children in two panes, either horizontally or vertically. The user can resize the panes by dragging the divider between them. A TwoPaneSplitView must have exactly two children. ## Create a TwoPaneSplitView You can create a TwoPaneSplitView with UXML and C#. To create a TwoPaneSpli...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2555fd29c70d
unity_docs
rendering
What is `LineRenderer.BakeMesh` in Unity? Explain its purpose and usage.
LineRenderer.BakeMesh Declaration public void BakeMesh ( Mesh mesh , bool useTransform ); Declaration public void BakeMesh ( Mesh mesh , Camera camera , bool useTransform ); Parameters Parameter Description mesh A static mesh that will receive the snapshot of the line. camera The camera used f...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1aba88188071
unity_docs
scripting
Show me a Unity C# example demonstrating `Handles.DotHandleCap`.
ents. Description Draw a dot 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. Dot Handle Cap in the Scene View. Add the following script to your Assets fol...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_a2c278b64bb8
unity_docs
editor
In Unity's 'Create a drag-and-drop UI to drag between Editor windows', what is 'Create a manipulator to store event callbacks' and how does it work?
A manipulator is an object that registers and un-registers event callbacks related to the input. Create a custom manipulator in a C# script to register pointer events and drag events for the Editor window. In the drag-and-drop-across-window folder, create a folder named Editor . In the Editor folder, create a C# file n...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d3151b184af9
unity_docs
rendering
Show me a Unity C# example demonstrating `Rendering.CommandBuffer.SetViewProjectionMatrices`.
table Render Pipelines. Note: The camera space in Unity matches OpenGL convention, so the negative z-axis is the camera's forward. This is different from usual Unity convention, where the camera's forward is the positive z-axis. If you are manually creating the view matrix, for example with an inverse of Matrix4x4.Loo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_05817d6baa0d
unity_docs
scripting
What is `UIElements.TabView` in Unity? Explain its purpose and usage.
TabView class in UnityEngine.UIElements / Inherits from: UIElements.VisualElement / Implemented in: UnityEngine.UIElementsModule Description Creates a tab view that groups a one or more Tab elements. A tab view provides additional functionality to the Tab. It allows a group of tabs to interact between e...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e1e35081565b
unity_docs
rendering
Show me a Unity C# example demonstrating `VersionControl.IIconOverlayExtension.DrawOverlay`.
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_76a9c937cb2f
unity_docs
physics
Give me an overview of the `WheelFrictionCurve` class in Unity.
WheelFrictionCurve struct in UnityEngine / Implemented in: UnityEngine.PhysicsModule Description WheelFrictionCurve is used by the WheelCollider to describe friction properties of the wheel tire. The curve takes a measure of tire slip as an input and gives a force as output. The curve is approximated by a two...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_94dbb412d5c5
unity_docs
xr
What is `Camera.SetStereoProjectionMatrix` in Unity? Explain its purpose and usage.
Camera.SetStereoProjectionMatrix Declaration public void SetStereoProjectionMatrix ( Camera.StereoscopicEye eye , Matrix4x4 matrix ); Parameters Parameter Description eye Specifies the stereoscopic eye whose projection matrix needs to be set. matrix The matrix to be set. Description Sets a custom pr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ab89d640f0d0
unity_docs
scripting
What is `UIElements.BaseTreeViewController.GetChildIndexForId` in Unity? Explain its purpose and usage.
BaseTreeViewController.GetChildIndexForId Declaration public int GetChildIndexForId (int id ); Parameters Parameter Description id The item ID. Returns int The child index under the parent. Returns -1 if the item has no parent or doesn't exist in the tree. Description Gets the child index under the ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_600ca2e0914b
unity_docs
editor
Explain 'Create a 3D texture via script' in Unity.
Use the Texture3D API to create a 3D texture via script. For example: ``` // Set the texture parameters int size = 32; TextureFormat format = TextureFormat.RGBA32; bool mipChain = false; // Create a 3D texture with a width, height and depth of 32 pixels Texture3D texture = new Texture3D(size, size, size, format, mipCh...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_95d5c140cdef
unity_docs
xr
Explain 'Git dependencies' in Unity.
When the Package Manager fetches a package from a Git repository, it adds the package locally to your project. This allows you to test unpublished changes, but you can’t use it to contribute to that Git repository. To set up an existing local Git repository as a dependency in your project, use a path to your local Git ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4506cfdb6c2c
unity_docs
editor
What is `Callbacks.RunAfterAssemblyAttribute.ctor` in Unity? Explain its purpose and usage.
RunAfterAssemblyAttribute Constructor Declaration public RunAfterAssemblyAttribute (string assemblyName ); Parameters Parameter Description assemblyName The name of the assembly that should be run before this callback. Description Add this attribute to a callback method to mark that this callback must be r...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8607b89b7b47
unity_docs
rendering
What is `RenderBuffer.GetNativeRenderBufferPtr` in Unity? Explain its purpose and usage.
RenderBuffer.GetNativeRenderBufferPtr Declaration public IntPtr GetNativeRenderBufferPtr (); Description Returns native RenderBuffer. Be warned this is not native Texture, but rather pointer to unity struct that can be used with native unity API. Currently such API exists only on iOS.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1516043e3860
unity_docs
rendering
What is `Search.CustomObjectIndexerAttribute` in Unity? Explain its purpose and usage.
CustomObjectIndexerAttribute class in UnityEditor.Search Description Allows a user to register a custom Indexing function for a specific type. When you have special properties you would like to index for an asset or a Unity Object, Unity suggests Writing a custom indexer routine . The newly indexed words or prop...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2faff7176d17
unity_docs
physics
What is `ArticulationDrive` in Unity? Explain its purpose and usage.
ArticulationDrive struct in UnityEngine / Implemented in: UnityEngine.PhysicsModule Description Drive applies forces and torques to the connected bodies. Drive moves the body along one degree of freedom, be it a linear motion along a particular axis or a rotational motion around a particular axis. The drive wil...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_40062cd9b9b7
unity_docs
scripting
In Unity's 'Inspecting scripts', what is 'Public and private fields' and how does it work?
All public fields are editable in the Inspector window by default. To prevent a public variable from being displayed in the Inspector window, add the HideInInspector attribute to it. To make a private field editable in the Inspector window, add the SerializeField attribute to it. Note : You can change the value of a sc...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ea285223a3c5
unity_docs
animation
What is `SharedBetweenAnimatorsAttribute` in Unity? Explain its purpose and usage.
SharedBetweenAnimatorsAttribute class in UnityEngine / Implemented in: UnityEngine.AnimationModule Description The SharedBetweenAnimatorsAttribute specifies that this StateMachineBehaviour is instantiated only once and shared by all Animator instances. This attribute reduces the memory footprint for each control...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_53af6a1d28c2
unity_docs
editor
What are the parameters of `Build.IProcessSceneWithReport.OnProcessScene` in Unity?
Description Implement this method to receive a callback for each scene during the build. Unity invokes this callback during Player and AssetBundle builds, and also when a scene is reloaded while entering Play mode. Use BuildPipeline.isBuildingPlayer to determine in which context the callback is called. This callback su...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3905b94e1952
unity_docs
rendering
What is `Rendering.ScriptableRenderContext.CreateWireOverlayRendererList` in Unity? Explain its purpose and usage.
ScriptableRenderContext.CreateWireOverlayRendererList Declaration public Rendering.RendererList CreateWireOverlayRendererList ( Camera camera ); Parameters Parameter Description camera The camera that is used for rendering the WireOverlay. Returns RendererList Returns a new RendererList based on the s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6d1b616d65c4
unity_docs
audio
What is `AudioClip.PCMSetPositionCallback` in Unity? Explain its purpose and usage.
AudioClip.PCMSetPositionCallback Declaration public delegate void PCMSetPositionCallback (int position ); Parameters Parameter Description position The audio clip's new playback position in sample frames. Description Unity calls this delegate each time AudioClip changes read position. Unity uses this d...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_90d737558772
unity_docs
audio
Explain 'Audio Flange Effect' in Unity.
The Audio Flange Effect is used to create the audio effect produced by mixing two identical signals together, one signal delayed by a small and gradually changing period, usually smaller than 20 milliseconds. ## Properties Property: Function: Drymix Percentage of original signal to pass to output from 0.0 to 100.0%. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_932c645e7465
unity_docs
math
What is `TerrainData.GetPatchMinMaxHeights` in Unity? Explain its purpose and usage.
TerrainData.GetPatchMinMaxHeights Declaration public PatchExtents[] GetPatchMinMaxHeights (); Returns PatchExtents[] Minimum and maximum height values for each patch. Description Returns an array of min max height values for all the renderable patches in a terrain. The returned array can be modified and th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1aab4e9e318a
unity_docs
scripting
What is `UIElements.CallbackEventHandler.SendEvent` in Unity? Explain its purpose and usage.
CallbackEventHandler.SendEvent Declaration public void SendEvent ( UIElements.EventBase e ); Parameters Parameter Description e The event to send. Description Sends an event to the event handler. UI Toolkit sends events to visual elements through the panel. The event is sent to the event handler's r...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_88ef4b155170
unity_docs
physics
What is `ArticulationBody.jointForce` in Unity? Explain its purpose and usage.
ArticulationBody.jointForce public ArticulationReducedSpace jointForce ; Description The joint force in reduced coordinates. Units of measurement - N (newtons) for linear and Nm (newton-meters) for angular motion.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0d0f07a479b7
unity_docs
input
What are the parameters of `UIElements.KeyboardEventBase_1.GetPooled` in Unity?
Returns T An initialized event. Description Gets a keyboard event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use Dispose() to release them. Declaration public static T G...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2366e5fa68d9
unity_docs
rendering
Give me an overview of the `RendererExtensions` class in Unity.
RendererExtensions class in UnityEngine / Implemented in: UnityEngine.CoreModule Description Extension methods to the Renderer class, used only for the UpdateGIMaterials method used by the Global Illumination System. Static Methods Method Description UpdateGIMaterials Schedules an update of the albedo and em...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e8fd30df0c51
unity_docs
rendering
Explain 'Setup a project for 2D games' in Unity.
Note : For this guide, Unity recommends and assumes that you choose the Universal Render Pipeline (URP) and not the Built-in Render Pipeline . Install Unity version 2019 LTS or a later version; see Installing Unity . Create a new project with the 2D template . In the Package Manager, install the latest URP package vers...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f265541f23c9
unity_docs
animation
What is `Animations.ParentConstraint.GetRotationOffset` in Unity? Explain its purpose and usage.
ParentConstraint.GetRotationOffset Declaration public Vector3 GetRotationOffset (int index ); Parameters Parameter Description index The index of the constraint source. Returns Vector3 The rotation offset, as Euler angles. Description Gets the rotation offset associated with a source by index. Thr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_88f283c5003f
unity_docs
rendering
What is `SystemInfo.maxComputeBufferInputsFragment` in Unity? Explain its purpose and usage.
SystemInfo.maxComputeBufferInputsFragment public static int maxComputeBufferInputsFragment ; Description Determines how many compute buffers Unity supports simultaneously in a fragment shader for reading. (Read Only)
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ccff07ae0873
unity_docs
physics
What is `LowLevelPhysics.CapsuleGeometry` in Unity? Explain its purpose and usage.
CapsuleGeometry struct in UnityEngine.LowLevelPhysics / Implemented in: UnityEngine.PhysicsModule Implements interfaces: IGeometry Description Contains the basic geometric shape of a capsule. When Unity retrieves the geometry from the CapsuleCollider , the CapsuleCollider.direction is not included. For this...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_826645efdb08
unity_docs
animation
What is `Animations.AnimationHumanStream` in Unity? Explain its purpose and usage.
AnimationHumanStream struct in UnityEngine.Animations / Implemented in: UnityEngine.AnimationModule Description The humanoid stream of animation data passed from one Playable to another. The AnimationHumanStream structure is passed through the animation Playable structures, like AnimationClipPlayable and ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7e3565e3522f
unity_docs
rendering
What is `LightTransport.RadeonRaysContext.Flush` in Unity? Explain its purpose and usage.
RadeonRaysContext.Flush Declaration public bool Flush (); Returns bool True if the flush was successful. Description Flush the device context. Start execution of the enqueued operations on the device. On some platforms the underlying implementation or driver flushes automatically, on others it is up to th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3eddce8479c1
unity_docs
editor
Explain 'Troubleshooting the Linux Editor issues' in Unity.
This page lists the known issues for the Linux Unity Editor and provides tested solutions. ## Unity Editor crashes with Pipe error ! message Opening projects with large number of assets crashes the Editor and logs a Pipe error ! message. The error message appears in the terminal if you opened the Editor via the termi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_05c92b93b1a0
unity_docs
scripting
In Unity's 'TagField', what is 'Create a TagField element' and how does it work?
You can create a TagField with UI Builder, UXML, or C#. The following C# example creates a TagField with a default tag: ```csharp using UnityEditor.UIElements; ... var tagField = new TagField(); tagField.label = "Tag"; tagField.value = "Player"; ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_566c28938327
unity_docs
scripting
What is `TerrainData.treeInstances` in Unity? Explain its purpose and usage.
TerrainData.treeInstances public TreeInstance[] treeInstances ; Description Contains the current trees placed in the terrain. Note that setting the treeInstances property will not automatically snap Tree instances onto the surface of the Terrain heightmap. To do so, use SetTreeInstances instead.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_530a710d0709
unity_docs
math
Show me a Unity C# example demonstrating `Mathf.Sign`.
Mathf.Sign Declaration public static float Sign (float f ); Description Returns the sign of f . Returns a value of 1 when f is 0 or greater. Returns a value of -1 when f is negative. ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { Debug.Log(Mathf.Sign(-10)); Debug.L...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1d2d833304b0
unity_docs
rendering
What is `Renderer.GetClosestReflectionProbes` in Unity? Explain its purpose and usage.
Renderer.GetClosestReflectionProbes Declaration public void GetClosestReflectionProbes (List<ReflectionProbeBlendInfo> result ); Description Returns an array of closest reflection probes with weights, weight shows how much influence the probe has on the renderer, this value is also used when blending between re...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3633ef44075e
unity_docs
physics
What is `Time.fixedDeltaTime` in Unity? Explain its purpose and usage.
Time.fixedDeltaTime public static float fixedDeltaTime ; Description The interval in seconds of in-game time at which physics and other fixed frame rate updates (like MonoBehaviour's FixedUpdate ) are performed. The fixedDeltaTime interval is always relative to the in-game time which Time.timeScale affects...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e96c970c2802
unity_docs
ui
What is `UIElements.VisualElement.customStyle` in Unity? Explain its purpose and usage.
VisualElement.customStyle public UIElements.ICustomStyle customStyle ; Description The custom style properties accessor of a VisualElement (Read Only). To get the custom styles properties of an element, call the ICustomStyle.TryGetValue method to query the returned object of this property. For ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_72f2f854baaa
unity_docs
performance
Show me a Unity C# example demonstrating `Profiling.FrameDataView.GetSessionMetaData`.
retrieve the data that the Profiler.EmitSessionMetaData method wrote to the Profiler stream. Profiler data can contain frames from different sessions. Use id to identify the metadata from your Project or package. Use tag to distinguish between different data streams. Use index to retrieve separate data chunks...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3f5a5eea0881
unity_docs
ui
What is `Inspector.GraphicsSettingsInspectors.GraphicsSettingsInspectorUtility.OpenAndScrollTo` in Unity? Explain its purpose and usage.
GraphicsSettingsInspectorUtility.OpenAndScrollTo Declaration public static void OpenAndScrollTo (Type renderPipelineGraphicsSettingsType ); Declaration public static void OpenAndScrollTo (string propertyPath ); Declaration public static void OpenAndScrollTo (string propertyPath ); Declaration public st...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5b4345d98809
unity_docs
physics
What is `ParticleSystem.CollisionModule.GetPlane` in Unity? Explain its purpose and usage.
ParticleSystem.CollisionModule.GetPlane Declaration public Transform GetPlane (int index ); Parameters Parameter Description index The plane to return. Returns Transform The plane. Description Get a collision plane associated with this Particle System.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_b63447500a9a_doc_7
github
scripting
What does `Awake` do in this Unity script? Explain its purpose and signature.
A Unity event function that is called when an enabled script instance is being loaded.Adds the listeners/actions to the buttons that have beenspecified/added to the dialog. Signature: ```csharp protected virtual void Awake() ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_63e5c0a378d0
unity_docs
xr
What is `Networking.UnityWebRequest.redirectLimit` in Unity? Explain its purpose and usage.
UnityWebRequest.redirectLimit public int redirectLimit ; Description Indicates the number of redirects that this UnityWebRequest follows before halting with a Redirect Limit Exceeded system error. If you want to disable redirects altogether, set this property to zero - this UnityWebRequest will then refus...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_0983e190b8a0
github
scripting
Write a Unity C# script called Spatial Hashing
```csharp using UnityEngine; namespace DefaultNamespace { public static class SpatialHashing { public static float CellSize = 1f; public static int Dimensions = 10; public static Vector3Int GetCell(Vector3 position) { Debug.Assert(position.x >= 0f, "Position x must ...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_f63060142679
unity_docs
physics
What is `EditorUserBuildSettings.explicitDivideByZeroChecks` in Unity? Explain its purpose and usage.
EditorUserBuildSettings.explicitDivideByZeroChecks public static bool explicitDivideByZeroChecks ; Description Are divide by zero's actively validated? Divide by zero will trigger a runtime exception.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4e3c00f40eaf
unity_docs
scripting
What is `ParticleSystem.NoiseModule.strength` in Unity? Explain its purpose and usage.
ParticleSystem.NoiseModule.strength public ParticleSystem.MinMaxCurve strength ; Description How strong the overall noise effect is. Additional resources: MinMaxCurve . ```csharp using UnityEngine; using System.Collections;[RequireComponent(typeof(ParticleSystem))] public class ExampleClass : MonoBehaviour...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_b8dde73d7813
github
scripting
Write a Unity C# script called Float Variable Text
```csharp using System; using System.Globalization; using GI.UnityToolkit.Variables; using UnityEngine; namespace GI.UnityToolkit.Components.UI.Variables { public class FloatVariableText : TextComponent { [SerializeField] private FloatVariable floatVariable; [SerializeField] private bool isTime...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_man_a81e9f1ea17c
unity_docs
rendering
In Unity's 'Adding a device', what is 'screen' and how does it work?
Property Required Description width Yes The width, in pixels , of the screen. height Yes The height, in pixels, of the screen. navigationBarHeight No The height, in pixels, of the on-screen Android navigation bar that appears on some devices when not in fullscreen. dpi Yes The dpi of the screen. orientations No A list ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_30b3e2a66d4e
unity_docs
editor
What is `EditorPrefs.SetInt` in Unity? Explain its purpose and usage.
EditorPrefs.SetInt Declaration public static void SetInt (string key , int value ); Parameters Parameter Description key Name of key to write integer to. value Value of the integer to write into the storage. Description Sets the value of the preference identified by key as an integer. Sets the value o...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fa905e98d208
unity_docs
rendering
What is `TerrainTools.TerrainPaintUtility.GetBuiltinPaintMaterial` in Unity? Explain its purpose and usage.
TerrainPaintUtility.GetBuiltinPaintMaterial Declaration public static Material GetBuiltinPaintMaterial (); Returns Material Built-in terrain paint material. Description Returns the built-in in paint material used by the built-in tools.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_9631764bc484
unity_docs
networking
In Unity's 'Unity multiplayer overview', what is 'Multiplayer Center' and how does it work?
The Multiplayer Center provides a starting point to create a multiplayer game. It recommends Unity multiplayer packages and services based on the needs of your game, and gives you access to samples and tutorials to help you use them. The Multiplayer Center package is installed in the Editor by default. It opens automat...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_35f8fb3212ea_doc_8
github
scripting
What does `OnInitializePotentialDrag` do in this Unity script? Explain its purpose and signature.
Initialize drag tracking: cache parent ScrollRect and record starting position.This enables both button clicks and scroll gestures to work together. Signature: ```csharp public void OnInitializePotentialDrag(PointerEventData eventData) ```
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
gh_39f55cb4c314
github
scripting
Write a Unity C# script called Rotation Axis Lock Grab Transformer
```csharp using UnityEngine.XR.Interaction.Toolkit.Transformers; namespace UnityEngine.XR.Interaction.Toolkit.Samples.StarterAssets { /// <summary> /// An XR grab transformer that allows for the locking of specific rotation axes. When an object is grabbed and manipulated, /// this class ensures that rotati...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_201dffc4326b
unity_docs
scripting
What is `Unity.Android.Gradle.ProductFlavors` in Unity? Explain its purpose and usage.
ProductFlavors class in Unity.Android.Gradle / Inherits from: Unity.Android.Gradle.BaseBlock Description The C# definition of acustom productFlavor element in a gradle file. For more information about the element, see Gradle's documentation: ProductFlavor Constructors Constructor Description ProductFlavo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e5ccd8061c14
unity_docs
xr
What is `AssetBundleRequest.allAssets` in Unity? Explain its purpose and usage.
AssetBundleRequest.allAssets public Object[] allAssets ; Description Asset objects with sub assets being loaded. (Read Only) Note that accessing asset before isDone is true will stall the loading process.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_11aee45dc23e
unity_docs
editor
What is `BuildAssetBundleOptions.IgnoreTypeTreeChanges` in Unity? Explain its purpose and usage.
BuildAssetBundleOptions.IgnoreTypeTreeChanges Description Ignore the type tree changes when doing the incremental build check. This allows you to ignore the type tree changes when doing the incremental build check. With this flag set, if the included assets haven't change but type trees have changed, the target ass...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.