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_b3abcfd3459c
unity_docs
rendering
What is `Rendering.VirtualTexturing.Streaming.GetTextureStackSize` in Unity? Explain its purpose and usage.
Virtual Texturing is experimental and not ready for production use. The feature and documentation might be changed or removed in the future. Streaming.GetTextureStackSize Declaration public static void GetTextureStackSize ( Material mat , int stackNameId , out int width , out int height ); Parameters Param...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_138fdb84a130_doc_7
github
scripting
What does `CircleLocale` do in this Unity script? Explain its purpose and signature.
Circles the locale by 1 either forward or backwards by increasing the locale index.The function handles rotation over the bounds of the array by starting at the other site.The order is determined by the order of enabled locales.If true the locale will circle forward and backwards otherwise. Signature: ```csharp public...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
gh_90743ef166e6
github
scripting
Write a Unity C# script called Scene Scoped Tests
```csharp using System.Collections; using NUnit.Framework; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.TestTools; namespace SiegfriedWagner.Singletons.Tests.Runtime { public class SceneScopedTests { private const string SceneScoped1Path = "Tests/Runtime/SceneScoped1"; ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8ae01b1fcdc5
unity_docs
performance
Show me a Unity C# example demonstrating `Unity.Profiling.ProfilerRecorder.LastValue`.
ing the frame. Therefore, it is impossible to get the final value of draw calls until the frame is fully rendered. In such cases, you can use the LastValue property for quick access to the final metric value in the last frame. The equivalent call is GetSample(Count - 1).Value . Note: The property requires that the s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_96e9a260016b
unity_docs
rendering
Show me a Unity C# example demonstrating `Renderer.OnBecameVisible`.
Renderer.OnBecameVisible() Description OnBecameVisible is called when the object became visible by any camera. This message is sent to all scripts attached to the renderer. OnBecameVisible and OnBecameInvisible are useful to avoid computations that are only necessary when the object is visible. ```csharp usin...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_d0cfa8d0bd5e
github
scripting
Write a Unity C# script called Game Object Switcher
```csharp using System; using System.Collections.Generic; using UnityEngine; using Utils; namespace UIStateSwitcher { public class GameObjectSwitcher : SwitchableElement { [Tooltip("GameObject'ы, которые будут включаться и выключаться.")] [SerializeField] private List<GameObject> _tar...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_dfdd0eda8e97
unity_docs
rendering
What is `GL.TexCoord3` in Unity? Explain its purpose and usage.
GL.TexCoord3 Declaration public static void TexCoord3 (float x , float y , float z ); Description Sets current texture coordinate (x,y,z) for all texture units. In OpenGL this matches glMultiTexCoord for all texture units or glTexCoord when no multi-texturing is available. On other graphics APIs the same...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_149e81c5e082
unity_docs
editor
Show me a Unity code example for 'Check the consistency of the import process'.
log output When Unity detects importer inconsistencies, you can find more information about the issue in the Editor log. This includes information such as: Which asset caused the failed consistency check and its GUID. The content hash for the asset import result. A comparison of the previous revision of the asset. The...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8f99adc064c8
unity_docs
xr
What is `Progress.Item.RegisterPauseCallback` in Unity? Explain its purpose and usage.
Progress.Item.RegisterPauseCallback Declaration public void RegisterPauseCallback (Func<bool,bool> callback ); Parameters Parameter Description callback This function is called when a progress indicator's task is paused. It takes a boolean parameter that specifies whether the task needs to pause or resume. W...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fe19ed69008b
unity_docs
scripting
What is `Rendering.CompareFunction` in Unity? Explain its purpose and usage.
CompareFunction enumeration Description Depth or stencil comparison function. Properties Property Description Disabled Depth or stencil test is disabled. Never Never pass depth or stencil test. Less Pass depth or stencil test when new value is less than current value. Equal Pass depth or stencil test when va...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_aa0960ec12c2
unity_docs
rendering
Explain 'Panoramic Skybox Shader Material Inspector Window reference' in Unity.
For information on how to create a Material that uses this skybox Shader , as well as details on how to render the skybox in your Scene , see Using skyboxes . ## Render pipeline compatibility Feature Built-in Render Pipeline Universal Render Pipeline (URP) High Definition Render Pipeline (HDRP) Panoramic skybox Yes Y...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a9b442c18354
unity_docs
scripting
What is `SerializedObject.CopyFromSerializedProperty` in Unity? Explain its purpose and usage.
SerializedObject.CopyFromSerializedProperty Declaration public void CopyFromSerializedProperty ( SerializedProperty prop ); Description Copies a value from a SerializedProperty to the corresponding serialized property on the serialized object.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4bdb5a51cb01
unity_docs
math
What is `HumanLimit.center` in Unity? Explain its purpose and usage.
HumanLimit.center public Vector3 center ; Description The default orientation of a bone when no muscle action is applied. The vector value represents the bone's rotation in degrees around the X, Y and Z axes relative to the initial position of the bone in the skeleton. Any muscle rotation subsequently applied...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5f71088e4270
unity_docs
ui
Show me a Unity code example for 'Create a pie chart in the Editor and runtime UI'.
pleted files that this example creates in this GitHub repository . ## Create the pie chart graph Create a C# script that uses the Arc and Fill methods in the Vector API to draw a pie chart into a visual element . Create a Unity project with any template. Create a folder named pie-chart to store your files. In the pie...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8c0eafd88076
unity_docs
math
What is `SessionState` in Unity? Explain its purpose and usage.
SessionState class in UnityEditor Description SessionState is a Key-Value Store intended for storing and retrieving Editor session state that should survive assembly reloading. The state information stored in SessionState is cleared when Unity exits. For storing state information that should be persistent across ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2f06fbe0a9c3
unity_docs
scripting
What is `Event.isKey` in Unity? Explain its purpose and usage.
Event.isKey public bool isKey ; Description Is this event a keyboard event? (Read Only) ```csharp using UnityEngine;public class Example : MonoBehaviour { // Detects any keyboard event void OnGUI() { Event e = Event.current; if (e.isKey) { Debug.Log("Detected a keyboard event!"); } } } ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5de41f78fa02
unity_docs
animation
What is `Animations.AnimatorJobExtensions.OpenAnimationStream` in Unity? Explain its purpose and usage.
AnimatorJobExtensions.OpenAnimationStream Declaration public static bool OpenAnimationStream ( Animator animator , ref Animations.AnimationStream stream ); Parameters Parameter Description animator The Animator instance that calls this method. stream The new stream. Returns bool Returns whether o...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cd23b6b367c2
unity_docs
scripting
What is `ArmDof` in Unity? Explain its purpose and usage.
ArmDof enumeration Description Enumeration of all the muscles in an arm. These muscles are a sub-part of a human part. Additional resources: HumanPartDof . Properties Property Description ShoulderDownUp The shoulder down-up muscle. ShoulderFrontBack The shoulder front-back muscle. ArmDownUp The arm down-up ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d76088631f68
unity_docs
networking
What is `Android.AndroidConfiguration.screenLayoutDirection` in Unity? Explain its purpose and usage.
AndroidConfiguration.screenLayoutDirection public Android.AndroidScreenLayoutDirection screenLayoutDirection ; Description Mirrors the Android property screenLayout based on the SCREENLAYOUT_LAYOUTDIR_MASK value. For information about this property, refer to the Android developer documentation on screenL...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_38da9788960c
unity_docs
rendering
What is `EditorGUIUtility.GetIconForObject` in Unity? Explain its purpose and usage.
EditorGUIUtility.GetIconForObject Declaration public static Texture2D GetIconForObject ( Object obj ); Parameters Parameter Description obj The GameObject or MonoScript to query Returns Texture2D Returns the custom icon associated with the object. If there is no custom icon associated with the obj...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1a1c06cbb297
unity_docs
rendering
What is `ComputeShader.FindKernel` in Unity? Explain its purpose and usage.
ComputeShader.FindKernel Declaration public int FindKernel (string name ); Parameters Parameter Description name Name of kernel function. Returns int The Kernel index. If the kernel is not found, Unity logs a "FindKernel failed" error message and raises an ArgumentException. Description Find Comput...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6e1d20aca56d
unity_docs
scripting
What is `Profiling.HierarchyFrameDataView.GetItemMergedSamplesInstanceID` in Unity? Explain its purpose and usage.
HierarchyFrameDataView.GetItemMergedSamplesInstanceID Declaration public void GetItemMergedSamplesInstanceID (int id , List<int> outInstanceIds ); Parameters Parameter Description id Hierarchy item identifier. outInstanceIds List filled with InstanceID values of merged samples as a result of a method call...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_2d9dd27892c0
github
scripting
Write a Unity C# script called Zoom Level Helpers
```csharp using UnityEngine; namespace Wrld.MapCamera { public static class ZoomLevelHelpers { private static double[] ms_zoomToDistances = new double[] { 27428700, 14720762, 8000000, 4512909, 2087317, 1248854,...
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_man_d0e221dd66b5
unity_docs
rendering
In Unity's 'Introduction to normal maps (bump mapping)', what is 'Difference between bump maps, normal maps and height maps' and how does it work?
Normal Maps and Height Maps are both types of Bump Map. They both contain data for representing apparent detail on the surface of simpler polygonal meshes, but they each store that data in a different way. Above, on the left, you can see a height map used for bump mapping a stone wall. A height map is a simple black an...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3fb17d69c77f
unity_docs
rendering
What is `Rendering.ShadowCastersCullingInfos` in Unity? Explain its purpose and usage.
ShadowCastersCullingInfos struct in UnityEngine.Rendering / Implemented in: UnityEngine.CoreModule Description This structure contains the information to perform shadow casters culling for one camera. Additional resources: ScriptableRenderContext.CullShadowCasters . Properties Property Description perLight...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_fb4790a99975
unity_docs
scripting
In Unity's 'Scene picking controls', what is 'Pickability icons' and how does it work?
You can toggle pickability for a whole branch of GameObjects or a single GameObject, so you can have GameObjects that are selectable but have children or parents that you can’t select. To help you track what is pickable or not, the pickability icon changes to show the status of each GameObject. Any scene picking change...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f3c8a5058ab7
unity_docs
editor
What are the parameters of `PrefabUtility.LoadPrefabContents` in Unity?
Returns GameObject The root of the loaded contents. Description Loads a Prefab Asset at a given path into an isolated Scene and returns the root GameObject of the Prefab. You can use this to get the content of the Prefab and modify it directly instead of going through an instance of the Prefab. This is useful for batch...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b2d342368fe8
unity_docs
scripting
Show me a Unity C# example demonstrating `Mesh.GetVertexBufferStride`.
is stream, or zero if the stream is not present. Description Get vertex buffer stream stride in bytes. Meshes usually use a single vertex buffer stream. But it is possible to setup a vertex layout where some attributes use different vertex buffers (see SetVertexBufferParams , VertexAttributeDescriptor ). You can...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7714e7c765f8
unity_docs
editor
What is `Experimental.GraphView.IDropTarget` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. IDropTarget interface in UnityEditor.Experimental.GraphView Description Drop target interface. Public Methods Method Description CanAcceptDrop Indicates if the dragged source can be dropped on the target interface. DragEnt...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b4487f128a85
unity_docs
scripting
What is `UIElements.IBindingExtensions.IsBound` in Unity? Explain its purpose and usage.
IBindingExtensions.IsBound Declaration public static bool IsBound ( UIElements.IBindable control ); Parameters Parameter Description control This Bindable object. Returns bool True if this IBindable is bound to a property. Description Checks if a IBindable is bound to a property.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_291f5c02f15c
unity_docs
rendering
Explain 'Create a Movie Texture' in Unity.
To create a Movie Texture, place a video file in your project’s Assets Folder . Unity uses this video file in the same way as a regular Texture . Unity imports video files using Apple QuickTime. On Windows, you need to install Quicktime to import a video file. Download Quicktime from Apple Support Downloads . Unity sup...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4def9f9a9f96
unity_docs
scripting
What is `Unity.Android.Gradle.SigningConfigs` in Unity? Explain its purpose and usage.
SigningConfigs class in Unity.Android.Gradle / Inherits from: Unity.Android.Gradle.BaseBlock Description The C# definition of the signingConfigs element in a gradle file. This element is a block and contains signingConfig elements. For more information about the file, see Android's documentation: SigningCo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_24c076d77d82
unity_docs
scripting
What is `Experimental.GraphView.StackNode.hasMultipleSelectionSupport` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. StackNode.hasMultipleSelectionSupport protected bool hasMultipleSelectionSupport ; Description Returns true if the StackNode supports multiselection. Default behavior: returns false.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_52eaeaf0b264
unity_docs
scripting
What is `SpriteMaskInteraction` in Unity? Explain its purpose and usage.
SpriteMaskInteraction enumeration Description This enum controls the mode under which the sprite will interact with the masking system. Sprites by default do not interact with masks SpriteMaskInteraction.None . A sprite can also be setup to be visible in presence of one or more masks SpriteMaskInteraction.Visibl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_becc881d8878
unity_docs
input
What is `KeyCode.Space` in Unity? Explain its purpose and usage.
KeyCode.Space Description Space key. Keyboard code for the Space key, used in Input.GetKeyDown and Input.GetKeyUp . It can also be used as a string for Event.KeyboardEvent by adding .ToString() . Examples for both usage types can be found on the KeyCode page.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_37486b95b394
unity_docs
physics
What are the parameters of `ArticulationBody.GetAccumulatedForce` in Unity?
Returns Vector3 Accumulated force expressed in ForceMode.Force . Description Returns the force that the ArticulationBody has accumulated before the simulation step. The accumulated force is reset during each physics simulation step. ```csharp using UnityEngine;public class AddForceScript : MonoBehaviour { private A...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_28d544a45b30
unity_docs
scripting
Show me a Unity C# example demonstrating `ParticleSystem.MainModule.startSize`.
ParticleSystem.MainModule.startSize public ParticleSystem.MinMaxCurve startSize ; Description The initial size of particles when the Particle System first spawns them. Additional resources: MinMaxCurve . ```csharp using UnityEngine; using System.Collections;[RequireComponent(typeof(ParticleSystem))] public...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_04ec65ec4c68
unity_docs
physics
What is `SpringJoint` in Unity? Explain its purpose and usage.
SpringJoint class in UnityEngine / Inherits from: Joint / Implemented in: UnityEngine.PhysicsModule Description The spring joint ties together 2 rigid bodies, spring forces will be automatically applied to keep the object at the given distance. The Spring attempts to maintain the distance it has when it star...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0b66d0f98db8
unity_docs
rendering
What is `UIElements.Vertex.tint` in Unity? Explain its purpose and usage.
Vertex.tint public Color32 tint ; Description A color value for the vertex. This value is multiplied by any other color information of the VisualElement (e.g. texture). Use Color.white to disable tinting on the vertex.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_34504658d687
unity_docs
scripting
What is `Rendering.RenderTargetBinding.depthLoadAction` in Unity? Explain its purpose and usage.
RenderTargetBinding.depthLoadAction public Rendering.RenderBufferLoadAction depthLoadAction ; Description Load action for the depth/stencil buffer. Not all platforms support load actions. If the platform you are using does not support load actions, RenderBufferLoadAction.Load will be used instead.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e8485418d4c3
unity_docs
rendering
What is `Search.SearchItem.GetThumbnail` in Unity? Explain its purpose and usage.
SearchItem.GetThumbnail Declaration public Texture2D GetThumbnail ( Search.SearchContext context , bool cacheThumbnail ); Parameters Parameter Description context Search context used to fetch the search item thumbnail. cacheThumbnail Indicates if the search item thumbnail should be cached for next time...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a994acfe90ec
unity_docs
scripting
What is `Graphics.ExecuteCommandBuffer` in Unity? Explain its purpose and usage.
Graphics.ExecuteCommandBuffer Declaration public static void ExecuteCommandBuffer ( Rendering.CommandBuffer buffer ); Parameters Parameter Description buffer The buffer to execute. Description Execute a command buffer. All commands in the buffer will be executed immediately. Additional resources: Comman...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b1d6e5db0690
unity_docs
editor
What is `Handles.secondaryColor` in Unity? Explain its purpose and usage.
Handles.secondaryColor public static Color secondaryColor ; Description Soft color to use for for general things. This is for used for example to draw the arc selection while dragging the rotation gizmo.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_808960af6947
unity_docs
rendering
Show me a Unity code example for 'Smart merge'.
ions of the file. Then, use these with the default merge tool. Ask : enable smart merging but when a conflict occurs, show a dialog to let the user resolve it (this is the default setting). ## Setting up UnityYAMLMerge for use with third-party tools The UnityYAMLMerge tool is shipped with the Unity editor; assuming U...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_96184b0c2bab
unity_docs
editor
What is `Search.QueryValidationOptions.validateFilters` in Unity? Explain its purpose and usage.
QueryValidationOptions.validateFilters public bool validateFilters ; Description Boolean indicating if filters should be validated. Default is false. If true and skipUnknownFilters is false, unknown filters will generate errors if no default handler is provided with QueryEngine.SetDefaultFilter . ```csharp ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a5b1918012a0
unity_docs
editor
What is `Search.QueryGraph` in Unity? Explain its purpose and usage.
QueryGraph class in UnityEditor.Search Description Class that represents a query graph. A parsed query is converted into a graph with each node in the graph corresponding to a filter. Properties Property Description empty Returns true if the graph is empty. root Root node of the graph. Can be null. Construc...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7654fd297070
unity_docs
editor
What is `EditorApplication.DirtyHierarchyWindowSorting` in Unity? Explain its purpose and usage.
EditorApplication.DirtyHierarchyWindowSorting Declaration public static void DirtyHierarchyWindowSorting (); Description Set the hierarchy sorting method as dirty. Causes the hierarchy to reset the avaliable sorting methods.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ab3e89cb0d14
unity_docs
xr
What are the parameters of `Search.SearchService.CreateContext` in Unity?
Returns SearchContext Returns a new SearchContext. Description Creates context from a list of search provider IDs. ```csharp using UnityEditor; using UnityEditor.Search; using UnityEngine; static class Example_SearchService_CreateContext { [MenuItem("Examples/SearchService/CreateContext")] public static void R...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_903bdcf13c72
unity_docs
editor
What are the parameters of `iOS.Xcode.PBXProject.AddHeadersBuildPhase` in Unity?
Returns string Returns the GUID of the new phase. Description Creates a new headers build phase for a given target. If the headers build phase is already configured for a target, the function returns the existing phase. The new phase is placed at the end of the list of build phases configured for the target. ```csharp ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4631c89ec5a2
unity_docs
scripting
What is `Unity.Collections.LowLevel.Unsafe.UnsafeUtility.AddressOf` in Unity? Explain its purpose and usage.
UnsafeUtility.AddressOf Declaration public static void* AddressOf (ref T output ); Parameters Parameter Description output The managed object for which you need the memory address. Ensure the object remains valid and exists throughout the use of its address. Returns void* A void pointer that represents t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6317333f3f79
unity_docs
rendering
What is `ShaderUtil` in Unity? Explain its purpose and usage.
ShaderUtil class in UnityEditor Description Utility functions to assist with working with shaders from the editor. Static Properties Property Description allowAsyncCompilation When true, asynchronous Shader compilation is allowed at the current call site. anythingCompiling When true, the Editor is compiling s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_32eecd389b56
unity_docs
scripting
What is `UIElements.BaseTreeView.GetItemDataForId` in Unity? Explain its purpose and usage.
BaseTreeView.GetItemDataForId Declaration public T GetItemDataForId (int id ); Parameters Parameter Description id The TreeView item id. Returns T The TreeView item data. Description Gets data for the specified TreeView item id.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c92e269937b7
unity_docs
rendering
What is `ScalableBufferManager.widthScaleFactor` in Unity? Explain its purpose and usage.
ScalableBufferManager.widthScaleFactor public static float widthScaleFactor ; Description Width scale factor to control dynamic resolution. This is a scale factor between epsilon and 1.0 that is applied to the width of all render textures that you have marked as DynamicallyScalable.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cfa8fea22ae2
unity_docs
ui
What is `UIElements.Foldout.contentUssClassName` in Unity? Explain its purpose and usage.
Foldout.contentUssClassName public static string contentUssClassName ; Description The USS class name for the content element in a Foldout. Unity adds this USS class to the VisualElement that contains the elements to be shown or hidden. Any styling applied to this class affects every foldout container lo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_7a8ca1c8ea19
unity_docs
scripting
In Unity's 'How Unity builds Android applications', what is 'The build process' and how does it work?
To build Android applications: Unity calls AndroidProjectFilesModifier.Setup for all AndroidProjectFilesModifier interfaces. You can use this callback to set up prerequisites for modifying custom Android Gradle project files. For more information, refer to AndroidProjectFilesModifier.Setup . Unity collects project reso...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2ee2544fe78b
unity_docs
editor
Show me a Unity C# example demonstrating `EditorApplication.pauseStateChanged`.
s changed into. Note that the Editor may be paused or unpaused in both edit mode and play mode, so you should test isPlaying inside your event handler if you need to discriminate between these two conditions. The following example script logs the Editor's pause state to the console whenever if changes. Copy it into a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_2a311b2b3f69
github
scripting
Write a Unity C# XR/VR script for Dont Create New Singleton
```csharp // Copyright 2024 URAV ADVANCED LEARNING SYSTEMS PRIVATE LIMITED // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unles...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_acd3f2a87d62
unity_docs
scripting
Show me a Unity C# example demonstrating `Vector3.forward`.
Vector3.forward public static Vector3 forward ; Description Shorthand for writing Vector3(0, 0, 1) . ```csharp using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { void Example() { transform.position += Vector3.forward * Time.deltaTime; } } ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_997b5028a896
unity_docs
editor
What is `EditorGUIUtility.singleLineHeight` in Unity? Explain its purpose and usage.
EditorGUIUtility.singleLineHeight public static float singleLineHeight ; Description Get the height used for a single Editor control such as a one-line EditorGUI.TextField or EditorGUI.Popup. When creating your own multi-line controls, such as controls for custom classes with multiple fields, you can use Edito...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_07e6c47e5310
unity_docs
xr
What is `PackageManager.Client.Search` in Unity? Explain its purpose and usage.
Client.Search Declaration public static PackageManager.Requests.SearchRequest Search (string packageIdOrName ); Declaration public static PackageManager.Requests.SearchRequest Search (string packageIdOrName , bool offlineMode ); Parameters Parameter Description packageIdOrName The name or ID of ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e4f0d3804b09
unity_docs
editor
What is `AI.NavMeshBuilder.Cancel` in Unity? Explain its purpose and usage.
NavMeshBuilder.Cancel Declaration public static void Cancel ( AI.NavMeshData data ); Parameters Parameter Description data The data associated with asynchronous updating. Description Cancels an asynchronous update of the specified NavMesh data. Additional resources: NavMeshBuilder.UpdateNavMeshDataAsync...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e0ab68103e4f
unity_docs
physics
In Unity's 'Event functions', what is 'Regular update events' and how does it work?
A playing game continuously renders a series of frames. A key concept in games programming is making changes to position, state, and behavior of objects just before each frame is rendered. The Update function is the main place for this kind of code in Unity. Update is called before the frame is rendered and also before...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3371b67df54d
unity_docs
editor
Show me a Unity C# example demonstrating `Search.SearchIndexer.resolveDocumentHandler`.
SearchIndexer.resolveDocumentHandler public Func<string,string> resolveDocumentHandler ; Description Handler used to resolve a document ID to some other data string. ```csharp using System.Linq; using UnityEditor; using UnityEditor.Search; using UnityEngine; /// <summary> /// Since the search indexes only cont...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_e8a85acc3f05
github
scripting
Write a Unity C# MonoBehaviour script called Instantiate_Mono Behaviour T_Tests
```csharp using NUnit.Framework; using UnityEngine; using static UnityEngine.Object; namespace Sisus.Init.Tests { public class Instantiate_MonoBehaviourT_Tests { private GameObject original; [SetUp] public void SetUp() => original = new(GetType().Name); [TearDown] public void TearDown() => DestroyImmedi...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_4b4a949fafc2
unity_docs
scripting
What is `Search.SearchMonitor.sceneChanged` in Unity? Explain its purpose and usage.
SearchMonitor.sceneChanged Parameters Parameter Description value Handler invoked when the current scene changes. Description Event raised when the current loaded scene changes that might affect search results.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1351a55c0ff9
unity_docs
rendering
Show me a Unity C# example demonstrating `Search.SearchViewFlags.TableView`.
SearchViewFlags.TableView Description The Search Picker window will open in table view. This can be useful if you want to use a search expression to display selected (that is using a select{} statement) values in a Search table. ```csharp [SearchContext("select{p:t:material, @label, @size}", "expression;asset", Se...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_110b23558758
unity_docs
scripting
What is `UIElements.MaskField.ctor` in Unity? Explain its purpose and usage.
MaskField Constructor Declaration public MaskField (List<string> choices , int defaultMask , Func<string,string> formatSelectedValueCallback , Func<string,string> formatListItemCallback ); Parameters Parameter Description choices A list of choices to populate the field. defaultValue The initial mask val...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_16a23617f8a4
unity_docs
xr
What is `XR.Hand` in Unity? Explain its purpose and usage.
Hand struct in UnityEngine.XR / Implemented in: UnityEngine.XRModule Description A tracked hand on the device at an XRNode in the XR input subsystem. The Hand type represents a body element hierarchy corresponding to a human hand. It is comprised of Bone type elements. Public Methods Method Description ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_876148044ec7
unity_docs
math
What is `Vector3` in Unity? Explain its purpose and usage.
Vector3 struct in UnityEngine / Implemented in: UnityEngine.CoreModule Description Representation of 3D vectors and points. This structure is used throughout Unity to pass 3D positions and directions around. It also contains functions for doing common vector operations. Besides the functions listed below, other...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_d585d54188c4_doc_4
github
scripting
What does `LoginWithTokenAsync` do in this Unity script? Explain its purpose and signature.
A login API call that uses the Note: this method only returns a response from the server and does not set the itselfCloud access token. Can be retrieved by calling Signature: ```csharp public static async Task<APIResult> LoginWithTokenAsync(string token) ```
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_aafca1db10c5
unity_docs
physics
Give me an overview of the `Collider2D` class in Unity.
Collider2D class in UnityEngine / Inherits from: Behaviour / Implemented in: UnityEngine.Physics2DModule Description Parent class for collider types used with 2D gameplay. Additional resources: BoxCollider2D , CircleCollider2D , PolygonCollider2D , EdgeCollider2D , CapsuleCollider2D & CompositeCollider...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_ce9446a44365_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Singleton class that schedules -enabled jobs from registered "/> objects every frame using Unity's Job System.Any C# object can be registered for updates, including MonoBehaviours, pure C# classes and structs, as long as they implement .This class runs jobs in parallel, so don't rely on jobs being executed in any order...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_man_eb6d6f2ad766
unity_docs
ui
In Unity's 'Web template structure and instantiation', what is 'The instantiation function: createUnityInstance()' and how does it work?
The createUnityInstance() function creates a new instance of your content. You can use it like this: lang-js createUnityInstance(canvas, config, onProgress).then(onSuccess).catch(onError); This function returns a Promise object, where: Object Use canvas Unity runtime uses the canvas object to render the game. config Th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_247aea7f0894
unity_docs
animation
What is `Animations.AnimatorStateTransition.exitTime` in Unity? Explain its purpose and usage.
AnimatorStateTransition.exitTime public float exitTime ; Description If AnimatorStateTransition.hasExitTime is true, exitTime represents the exact time at which the transition can take effect. This is represented in normalized time, so for example an exit time of 0.75 means that on the first frame where 75%...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1c260e4a02ef
unity_docs
rendering
What is `ShaderUtil.GetShaderMessageCount` in Unity? Explain its purpose and usage.
ShaderUtil.GetShaderMessageCount Declaration public static int GetShaderMessageCount ( Shader s ); Parameters Parameter Description s The Shader instance to check for messages. Returns int The number of errors and warnings generated by the Unity Shader Compiler. Description Returns the number of e...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_63f0dfc42f2a
unity_docs
editor
What are the parameters of `SettingsProvider.OnGUI` in Unity?
Description Use this function to draw the UI based on IMGUI. This assumes you haven't added any children to the rootElement passed to the OnActivate function. ```csharp using UnityEditor; using UnityEngine; using UnityEngine.UIElements;class SimpleIMGUISettingsProvider : SettingsProvider { SerializedObject m_Settin...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_e86ebf2b0978_doc_7
github
scripting
What does `IPoolable` do in this Unity script? Explain its purpose and signature.
Destroys the specified MonoBehaviour object and removes it from the pool.The type of the MonoBehaviour object to destroy.The object to destroy. Signature: ```csharp public void DestroyMono<T>(T obj) where T : MonoBehaviour, IPoolable => GetPool<MonoPool<T>, T>(_monoPools).Destroy(obj); ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8ebede8de79d
unity_docs
scripting
What are the parameters of `Caching.ClearCache` in Unity?
Returns bool True when cache clearing succeeded, false if cache was in use. Description Removes all AssetBundle content that has been cached by the current application. This method is not available to WebPlayer applications that use the shared cache. Additional resources: Downloading Asset Bundles . ```csharp using Sys...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3d70f8bab84e
unity_docs
xr
What is `Android.AndroidUIModeType` in Unity? Explain its purpose and usage.
AndroidUIModeType enumeration Description Options to indicate the user interface mode of the device. Additional resources: AndroidConfiguration.uiModeType Properties Property Description Undefined Mirrors the Android property value UI_MODE_TYPE_UNDEFINED. Normal Mirrors the Android property value UI_MODE_TYP...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_05b0e835ce9a
unity_docs
editor
Show me a Unity C# example demonstrating `Build.IFilterBuildAssemblies.OnFilterAssemblies`.
ilding script assemblies, but makes it possible to filter away unwanted scripts to be included. Each implementation will be called in the order sorted by callbackOrder. The result of each invocation is piped through on the next call to OnFilterAssemblies. You are not allowed to add new assemblies. Additional resources...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_81ed3c1bf29f
unity_docs
scripting
What is `iOS.Xcode.PBXProject.AddKnownRegion` in Unity? Explain its purpose and usage.
PBXProject.AddKnownRegion Declaration public void AddKnownRegion (string code ); Parameters Parameter Description code The identifier of the provided Locale. Description Adds the provided regions to the Xcode Project.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_7d1872ef532c
github
scripting
Write a Unity C# MonoBehaviour script called Pickup
```csharp using UnityEngine; namespace RMC.Mini.Samples.RollABall.WithoutMini { /// <summary> /// The Pickup is a spinning yellow cube which the player /// can collide with to collect to earn points /// </summary> public class Pickup : MonoBehaviour { // Events ---------------------------------------- ...
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_70b769164aa1
unity_docs
rendering
What is `ResourcesAPI` in Unity? Explain its purpose and usage.
ResourcesAPI class in UnityEngine / Implemented in: UnityEngine.CoreModule Description Derive from this base class to provide alternative implementations to the C# behavior of specific Resources methods. The example provided logs the time taken to handle slower Resources APIs to the player or editor log. ```...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_71653bac38dc
unity_docs
physics
What is `Physics.OverlapSphereNonAlloc` in Unity? Explain its purpose and usage.
Physics.OverlapSphereNonAlloc Declaration public static int OverlapSphereNonAlloc ( Vector3 position , float radius , Collider[] results , int layerMask = AllLayers, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal); Parameters Parameter Description position Center...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e547cdd57fb4
unity_docs
physics
What is `AI.NavMeshCollectGeometry` in Unity? Explain its purpose and usage.
NavMeshCollectGeometry enumeration Description Used for specifying the type of geometry to collect. Used with NavMeshBuilder.CollectSources . Properties Property Description RenderMeshes Collect meshes form the rendered geometry. PhysicsColliders Collect geometry from the 3D physics collision representation.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a2ee475a33a6
unity_docs
scripting
What is `Unity.Collections.LowLevel.Unsafe.DisposeSentinel.Dispose` in Unity? Explain its purpose and usage.
DisposeSentinel.Dispose Declaration public static void Dispose (ref Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle safety , ref Unity.Collections.LowLevel.Unsafe.DisposeSentinel sentinel ); Parameters Parameter Description safety The AtomicSafetyHandle returned when invoking the Create method....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d28cd5934c18
unity_docs
performance
What is `Unity.Jobs.LowLevel.Unsafe.JobsUtility.ScheduleParallelFor` in Unity? Explain its purpose and usage.
JobsUtility.ScheduleParallelFor Declaration public static Unity.Jobs.JobHandle ScheduleParallelFor (ref Unity.Jobs.LowLevel.Unsafe.JobsUtility.JobScheduleParameters parameters , int arrayLength , int innerloopBatchCount ); Returns JobHandle A JobHandle to the new job. Description Schedules a IJob...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ec0e11d3c231
unity_docs
performance
What is `ParticleSystem.emission` in Unity? Explain its purpose and usage.
ParticleSystem.emission public ParticleSystem.EmissionModule emission ; Description Script interface for the EmissionModule of a Particle System. This module provides control over how many particles are emitted. Particle System modules do not need to be reassigned back to the system; they are interfaces and ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_171103c4da56
unity_docs
rendering
What is `Material.ComputeCRC` in Unity? Explain its purpose and usage.
Material.ComputeCRC Declaration public int ComputeCRC (); Description Computes a CRC hash value from the content of the material. The computation of CRC values may change in future Unity releases. Therefore, do not use CRC values for serialization.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7d7fd2f0b857
unity_docs
scripting
What are the parameters of `ArticulationBody.AddForce` in Unity?
Description Applies a force to the ArticulationBody . Note that the force accumulates over the duration of a simulation frame. It is only physically applied to the articulation body during the simulation step, after FixedUpdate has been called to scripts. Specifying the ForceMode mode allows the type of force to be cha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cee250eb7895
unity_docs
editor
What is `Build.BuildPlayerContext` in Unity? Explain its purpose and usage.
BuildPlayerContext class in UnityEditor.Build Description Get a BuildPlayerContext object from a BuildPlayerProcessor.PrepareForBuild callback. Properties Property Description BuildPlayerOptions The player build options associated with this build. Public Methods Method Description AddAdditionalPathToStre...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8fb8b217c91f
unity_docs
rendering
Show me a Unity code example for 'Replace shaders at runtime in the Built-In Render Pipeline'.
r depth or depth+normals texture, if you need that in some of your effects. See Camera Depth Texture page. Note that in some cases (depending on the hardware), the depth and depth+normals textures can internally be rendered using shader replacement. So it is important to have the correct “ RenderType ” tag in your shad...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_14ce030c18ed
unity_docs
rendering
What is `Experimental.GlobalIllumination.LightDataGI.indirectColor` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. LightDataGI.indirectColor public Experimental.GlobalIllumination.LinearColor indirectColor ; Description The indirect color of the light.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_02b3ee8a2d28
unity_docs
rendering
What are the parameters of `GUI.SelectionGrid` in Unity?
Returns int The index of the selected button. Description Make a grid of buttons. ```csharp using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { public int selGridInt = 0; public string[] selStrings = new string[] {"Grid 1", "Grid 2", "Grid 3", "Grid 4"}; void OnGUI() {...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_281991cc8dff
unity_docs
editor
What is `TerrainLayerInspector.OnPreviewGUI` in Unity? Explain its purpose and usage.
TerrainLayerInspector.OnPreviewGUI Declaration public void OnPreviewGUI ( Rect r , GUIStyle background ); Description Draws the default Terrain Layer preview GUI. Additional resources: Editor.OnPreviewGUI .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b2f2619ea773
unity_docs
scripting
What is `PackageManager.PackageInfo.FindForAssembly` in Unity? Explain its purpose and usage.
PackageInfo.FindForAssembly Declaration public static PackageInfo FindForAssembly ( Compilation.Assembly assembly ); Parameters Parameter Description assembly The assembly. Returns PackageInfo The PackageInfo instance describing the package, or null if the assembly or its assembly definition is not i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4f6f35e3417e
unity_docs
scripting
What is `GameObject.GetComponentInParent` in Unity? Explain its purpose and usage.
GameObject.GetComponentInParent Declaration public T GetComponentInParent (bool includeInactive = false); Parameters Parameter Description includeInactive Whether to include inactive parent GameObjects in the search. Returns T A Component of the matching type T , otherwise null if no matching Compon...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a318768224f7
unity_docs
scripting
What is `Playables.PlayableExtensions.IsDone` in Unity? Explain its purpose and usage.
PlayableExtensions.IsDone Declaration public static bool IsDone (U playable ); Parameters Parameter Description playable The Playable used by this operation. Returns bool True if the playable has completed its operation, false otherwise. Description Returns a flag indicating that a playable has com...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_c69b2198bdae
unity_docs
rendering
In Unity's 'Particle System Force Field component reference', what is 'Gravity' and how does it work?
Property Function Strength Set the amount of attraction that particles have towards the focal point within the shape. The higher the value, the greater the strength. You can specify a constant strength or vary the strength over time. For more information, see Varying properties over time documentation. Gravity Focus Se...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_81267d468b09
unity_docs
scripting
What is `Experimental.GraphView.EdgeManipulator.OnPointerMove` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. EdgeManipulator.OnPointerMove Declaration protected void OnPointerMove ( UIElements.PointerMoveEvent evt ); Parameters Parameter Description evt The pointer move event. Description Called when a pointer move event occu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.