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_e63cce9a6eeb
unity_docs
xr
What is `XR.MeshGenerationResult.Attributes` in Unity? Explain its purpose and usage.
MeshGenerationResult.Attributes public XR.MeshVertexAttributes Attributes ; Description The MeshVertexAttributes that were written to the MeshGenerationResult.Mesh . The vertex attributes will be the intersection of those requested by the caller of XRMeshSubsystem.GenerateMeshAsync and what the subsyste...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_2fccf5ba1a75
unity_docs
rendering
In Unity's 'USS common properties', what is 'Margins' and how does it work?
``` margin-left: <length> | auto; margin-top: <length> | auto margin-right: <length> | auto margin-bottom: <length> | auto /* Shorthand */ margin: [<length> | auto]{1,4} ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3f5efdc63e38
unity_docs
input
Show me a Unity C# example demonstrating `Screen.sleepTimeout`.
mes using accelerometer as the main source of input. However, such games should allow screen dimming while in menu or paused. Currently you will only be able to set this property to one of the values predefined in SleepTimeout class. A get will return either one of the predefined values, or the actual number of secon...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_ec2047d10f0b
unity_docs
rendering
In Unity's 'Validate and correct materials in the Built-In Render Pipeline', what is 'Validate albedo' and how does it work?
Unity’s Material charts define the standard luminance range as 50–243 sRGB for non-metals, and 186–255 sRGB for metals. Validate Albedo mode colors any pixels outside of these ranges with different colors to indicate that the value is too low or too high. In the example below, the first texture is below the minimum lum...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e18120367cd8
unity_docs
rendering
Show me a Unity C# example demonstrating `LightTransport.RadeonRaysContext.Initialize`.
text.Initialize Declaration public bool Initialize (); Returns bool True if the device context was initialized successfully. Description Initialize the device context. RadeonRaysContext implements the IDeviceContext interface. It uses the RadeonRays SDK for intersection testing and the OpenCL 1.2 API f...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_31f0bcf29d8d
unity_docs
animation
Show me a Unity C# example demonstrating `Animator.SetTrigger`.
have a true option which automatically returns back to false . A typical example might be to have a Jump option. If this option is entered during run-time the character will jump. At the end of the Jump the previous motion (perhaps a walk or run state) will be returned to. In the example script below, pressing UpAr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9e265f150292
unity_docs
editor
What is `EditorSnapSettings` in Unity? Explain its purpose and usage.
EditorSnapSettings class in UnityEditor Description Control the behavior of handle snapping in the editor. Static Properties Property Description gridSize Gets or sets the grid size used for snapping. gridSnapActive Gets whether grid snapping is active. gridSnapEnabled Gets or sets whether grid snapping is e...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_8f542aebd9f9
github
scripting
Write a Unity C# physics script for Plain Game Object
```csharp using System.Collections.Generic; using UnityEngine; using System.Linq; using System.Text; using System; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace PlainSaveLoad { [Serializable] public class PlainGameObject { [Serializable] public class ScriptProperties ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5ab6f18be58e
unity_docs
scripting
What is `GameObject.GetComponentIndex` in Unity? Explain its purpose and usage.
GameObject.GetComponentIndex Declaration public int GetComponentIndex ( Component component ); Parameters Parameter Description component The component to search for. Returns int The index of the specified Component if it exists. Otherwise, returns -1 . Description Retrieves the index of the speci...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_86a40083c1e4
unity_docs
scripting
Show me a Unity code example for 'Reference type management'.
ged heap and they are subject to garbage collection. Because strings are immutable and can’t change once created, avoid creating temporary strings wherever possible. The following example code combines an array of strings into a single string. Every time a new string is added inside the loop, the previous contents of t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3a31c03de0cd
unity_docs
physics
What is `ShortcutManagement.ShortcutBinding` in Unity? Explain its purpose and usage.
ShortcutBinding struct in UnityEditor.ShortcutManagement Description Represents a key binding used to trigger a shortcut. Static Properties Property Description empty A key combination representing the empty binding. Properties Property Description keyCombinationSequence The sequence of key combinations re...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8d6dc8536a90
unity_docs
math
What is `Compilation.ScriptCompilerOptions.RoslynAdditionalFilePaths` in Unity? Explain its purpose and usage.
ScriptCompilerOptions.RoslynAdditionalFilePaths public string[] RoslynAdditionalFilePaths ; Description Array of strings representing the paths of any additional files defined for Roslyn analyzers in the current assembly. To define additional files for Roslyn analyzers and source generators to use, add them to ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_96dce8f952f7
unity_docs
rendering
Explain 'Material Validator in the Built-In Render Pipeline' in Unity.
Resources on using the Material Validator in the Built-In Render Pipeline to check and fix values in materials that are too large or small. Page Description Introduction to the Material Validator in the Built-In Render Pipeline Understand how the Material Validator can help you make sure materials use values that fall ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3ccc342d832b
unity_docs
scripting
What is `Windows.WebCam.PhotoCaptureFrame.GetUnsafePointerToBuffer` in Unity? Explain its purpose and usage.
PhotoCaptureFrame.GetUnsafePointerToBuffer Declaration public IntPtr GetUnsafePointerToBuffer (); Returns IntPtr A native COM pointer to the IMFMediaBuffer which contains the image data. Description Provides a COM pointer to the native IMFMediaBuffer that contains the image data. This method provides very...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_225919124c58
unity_docs
scripting
What is `Transform.localPosition` in Unity? Explain its purpose and usage.
Transform.localPosition public Vector3 localPosition ; Description Position of the transform relative to the parent transform. If the transform has no parent, it is the same as Transform.position . ```csharp using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { void Examp...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6632799560c7
unity_docs
rendering
Explain 'Example of a DOTS Instancing shader that accesses per-instance data in URP' in Unity.
In this example: The metadata value for Color is 0x80001000 . The instance index is 5 . Data for instance 0 starts at address 0x1000. Data for instance 5 is at address 0x1000 + 5 * sizeof(float4) = 0x1050 Because the most significant bit is already set, the accessor macros don’t load defaults. This means that c0 , c1 ,...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e7e953de14fc
unity_docs
scripting
What is `Windows.WebCam.PhotoCapture.OnPhotoModeStoppedCallback` in Unity? Explain its purpose and usage.
PhotoCapture.OnPhotoModeStoppedCallback Declaration public delegate void OnPhotoModeStoppedCallback ( Windows.WebCam.PhotoCapture.PhotoCaptureResult result ); Parameters Parameter Description result Indicates whether or not photo mode was successfully deactivated. Description Called when photo mode has be...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_2f0a8fff52de
unity_docs
math
In Unity's 'Create a scriptable tile', what is 'Prerequisite' and how does it work?
You must have the 2D Tilemap Editor package installed before proceeding with the task. This package is part of the 2D feature set and is automatically installed if you select one of the 2D templates when creating a new project. You can also manually install this package via Unity’s Package Manager .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3bd66c10e481
unity_docs
physics
What is `Collider2D.density` in Unity? Explain its purpose and usage.
Collider2D.density public float density ; Description The density of the collider used to calculate its mass (when auto mass is enabled). When using Rigidbody2D.useAutoMass , increasing the collider density increases its mass - as does increasing its area - as the collider mass is calculated as a product of d...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2c0c2885e9e8
unity_docs
scripting
What is `Windows.WebCam.PhotoCapture` in Unity? Explain its purpose and usage.
PhotoCapture class in UnityEngine.Windows.WebCam / Implemented in: UnityEngine.CoreModule Description Captures a photo from the web camera and stores it in memory or on disk. Demonstrates how to take a photo using the PhotoCapture functionality and display it on a Unity GameObject. ```csharp using UnityEngine;...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_496d6d482a2d
unity_docs
editor
In Unity's 'Set up live debugging for Unity', what is 'Live debug the Unity Editor' and how does it work?
You can use Visual Studio or WinDbg to debug processes within the Unity Editor itself, rather than your game or application. This is useful if you want to investigate when the Editor behaves unexpectedly. Follow these instructions to attach a debugger to the Editor on launch: Navigate to the folder containing your Unit...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e3500b70b590
unity_docs
scripting
What is `GameObject` in Unity? Explain its purpose and usage.
GameObject class in UnityEngine / Inherits from: Object / Implemented in: UnityEngine.CoreModule Description Base class for all objects that can exist in a scene. Add components to a GameObject to control its appearance and behavior. The GameObject is the fundamental object type in Unity. Use GameObject ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8e2032597cad
unity_docs
rendering
What is `RenderTextureReadWrite` in Unity? Explain its purpose and usage.
RenderTextureReadWrite enumeration Description Color space conversion mode of a RenderTexture . When using Gamma color space , no conversions are done of any kind, and this setting is not used. When Linear color space is used, then by default non-HDR render textures are considered to contain sRGB data (i.e. "reg...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_62956ffa08d9
unity_docs
rendering
In Unity's 'Select colors and color gradients', what is 'Color window types' and how does it work?
The Unity Editor opens the type of Color window that matches the property you’re editing. The window can be one of three types: Single color: Used for most color properties. High Dynamic Range (HDR) color: For example, for the emission color in the standard shader . For more information, refer to the HDR color picker r...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3ccbcc4f8993
unity_docs
scripting
What is `MPE.EventService.UnregisterEventHandler` in Unity? Explain its purpose and usage.
EventService.UnregisterEventHandler Declaration public static void UnregisterEventHandler (string eventType , Func<string,object[],object> handler ); Parameters Parameter Description eventType The event to unregister from. handler The handler to unregister. Description Unregisters a handler from a speci...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_257ccaee6688
unity_docs
scripting
Show me a Unity C# example demonstrating `Random.insideUnitSphere`.
Random.insideUnitSphere public static Vector3 insideUnitSphere ; Description Returns a random point inside or on a sphere with radius 1.0 (Read Only). Note that the probability space includes the surface of the sphere because value , which is inclusive to 1.0, is used to acquire a random radius. ```csharp ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_65cc65225d65
unity_docs
scripting
What is `Unity.Android.Gradle.Manifest.AttributeFloat` in Unity? Explain its purpose and usage.
AttributeFloat class in Unity.Android.Gradle.Manifest / Inherits from: Unity.Android.Gradle.Manifest.BaseAttribute Description An attribute that represents a float value. Public Methods Method Description Get Gets the value of the float attribute. Set Sets a new float value for the attribute. Inherited M...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_005537c4063e
unity_docs
rendering
What is `Rendering.BatchFilterSettings.shadowCastingMode` in Unity? Explain its purpose and usage.
BatchFilterSettings.shadowCastingMode public Rendering.ShadowCastingMode shadowCastingMode ; Description Specifies how instances from the draw commands in this draw range cast shadows. This corresponds to Renderer.shadowCastingMode .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f9199c6f8180
unity_docs
editor
What is `iOS.Xcode.PBXProject.AddCopyFilesBuildPhaseBeforeTargetPostprocess` in Unity? Explain its purpose and usage.
PBXProject.AddCopyFilesBuildPhaseBeforeTargetPostprocess Declaration public string AddCopyFilesBuildPhaseBeforeTargetPostprocess (string targetGuid , string name , string dstPath , string subfolderSpec ); Parameters Parameter Description targetGuid The GUID of the target, such as the one returned by GetU...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d2cee973752c
unity_docs
input
Show me a Unity C# example demonstrating `KeyCode.LeftShift`.
KeyCode.LeftShift Description Left shift key. ```csharp using UnityEngine;public class Example : MonoBehaviour { void Update() { if (Input.GetKeyDown(KeyCode.LeftShift)) { Debug.Log("Left Shift key was pressed"); } if (Input.GetKeyUp(KeyCode.LeftShift)) { Debug.Log("Left Shift key was released"); } if (Inp...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8a617643f211
unity_docs
physics
What is `MPE.ProcessService.SlaveProcessExitedEvent` in Unity? Explain its purpose and usage.
ProcessService.SlaveProcessExitedEvent Parameters Parameter Description value The first parameter is the process ID (PID) of the slave process that exited. The second parameter is the ProcessState of the slave process. Description An event triggered in a master instance of UnityEditor when you start a slave i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_683df6c3b331
unity_docs
rendering
What is `ParticleSystem.MainModule.startRotation3D` in Unity? Explain its purpose and usage.
ParticleSystem.MainModule.startRotation3D public bool startRotation3D ; Description A flag to enable 3D particle rotation. Additional resources: MinMaxCurve . ```csharp using UnityEngine; using System.Collections;[RequireComponent(typeof(ParticleSystem))] public class ExampleClass : MonoBehaviour { private ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a02fc93c5ead
unity_docs
scripting
What is `IMGUI.Controls.TreeView.RowGUI` in Unity? Explain its purpose and usage.
TreeView.RowGUI Declaration protected void RowGUI ( IMGUI.Controls.TreeView.RowGUIArgs args ); Parameters Parameter Description args Row data. Description Override this method to add custom GUI content for the rows in the TreeView. This method is called once per visible row. The See Also section below ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5f96f050f8fe
unity_docs
rendering
Explain 'Projector component reference for the Built-In Render Pipeline' in Unity.
Explore the properties in the Projector component to configure a material’s projection onto a surface. Property: Function: Near Clip Plane Objects in front of the near clip plane will not be projected upon. Far Clip Plane Objects beyond this distance will not be projected upon. Field Of View The field of view in degree...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c9941f368b82
unity_docs
editor
What is `Device.SystemInfo.supportsGyroscope` in Unity? Explain its purpose and usage.
SystemInfo.supportsGyroscope public static bool supportsGyroscope ; Description This has the same functionality as SystemInfo.supportsGyroscope and also mimics platform-specific behavior in the Unity Editor.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e005bdcb8889
unity_docs
editor
What is `Experimental.Rendering.IScriptableBakedReflectionSystem.Tick` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. IScriptableBakedReflectionSystem.Tick Declaration public void Tick ( Experimental.Rendering.SceneStateHash sceneStateHash , Experimental.Rendering.IScriptableBakedReflectionSystemStageNotifier handle ); Parameters Parame...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8393993ca78b
unity_docs
physics
Give me an overview of the `QueryParameters` class in Unity.
QueryParameters struct in UnityEngine / Implemented in: UnityEngine.PhysicsModule Description Creates a struct to set up parameters for batch queries: RaycastCommand , BoxcastCommand , CapsulecastCommand , SpherecastCommand . Use this struct to configure hit flags and layer mask. This supports hit triggers,...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4efcd030248a
unity_docs
animation
What is `AnimationUtility.CalculateTransformPath` in Unity? Explain its purpose and usage.
AnimationUtility.CalculateTransformPath Declaration public static string CalculateTransformPath ( Transform targetTransform , Transform root ); Returns string Returns a string that represents the path from the root Transform to the target Transform. Description Retrieves the path from the root Transfo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_028570c3e347
unity_docs
scripting
What is `Unity.Android.Gradle.Manifest.AttributeBoolean` in Unity? Explain its purpose and usage.
AttributeBoolean class in Unity.Android.Gradle.Manifest / Inherits from: Unity.Android.Gradle.Manifest.BaseAttribute Description An attribute that represents a bool value. Public Methods Method Description Get Gets the value of the bool attribute. Set Sets a new bool value for the attribute. Inherited Me...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d87e7ade11b7
unity_docs
scripting
What are the parameters of `Video.VideoClip.GetAudioSampleRate` in Unity?
Returns uint The sampling rate in hertz. Description Get the audio track sampling rate in hertz (Hz). The audio sampling rate is the number of times per second a sample of audio is captured. Higher sample rates usually result in more realistic sounds and better sound quality, but files are larger. This is useful to kn...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_20d286c9b8d7
unity_docs
editor
What is `PlayerSettings.SetArchitecture` in Unity? Explain its purpose and usage.
PlayerSettings.SetArchitecture Declaration public static void SetArchitecture ( Build.NamedBuildTarget buildTarget , int architecture ); Obsolete Use SetArchitecture(NamedBuildTarget buildTarget, int architecture) instead. Declaration public static void SetArchitecture ( BuildTargetGroup targetGroup , i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7f4bffda5074
unity_docs
scripting
What is `WindZone.mode` in Unity? Explain its purpose and usage.
WindZone.mode public WindZoneMode mode ; Description Defines the type of wind zone to be used (Spherical or Directional). ```csharp // Creates a Directional Wind Zone. using UnityEngine;public class ExampleScript : MonoBehaviour { void Start() { var wind = gameObject.AddComponent<WindZone>(); wind.mode =...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_814ef2a875b0
unity_docs
math
In Unity's 'Parallel tessellation', what is 'Jobified tessellation with allocation in the job' and how does it work?
If it’s computationally expensive to calculate the number of vertices or indices, insert a MeshGenerationNode into the draw sequence. Then provide the node to your job, along with a TempMeshAllocator . You can do so with the following APIs: MeshGenerationContext.InsertMeshGenerationNode MeshGenerationContext.GetTempMes...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7758397c41d8
unity_docs
input
What is `UIElements.IPointerEvent.pressure` in Unity? Explain its purpose and usage.
IPointerEvent.pressure public float pressure ; Description Gets the amount of pressure currently applied by a touch. If the device does not report pressure, the value of this property is 1.0f.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_44e41bce06d8
unity_docs
scripting
What is `IMGUI.Controls.MultiColumnHeader.state` in Unity? Explain its purpose and usage.
MultiColumnHeader.state public IMGUI.Controls.MultiColumnHeaderState state ; Description This is the state of the MultiColumnHeader. It contains state for each column and state for the entire header, for example which columns are sorted and which columns are visible. Parts of this class are serializable other...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_871cdd258bd3
unity_docs
editor
Show me a Unity C# example demonstrating `Search.DisplayMode`.
DisplayMode enumeration Description Options for setting the display mode to use for a search view. ```csharp using UnityEngine; using UnityEditor; using UnityEditor.Search; static class Example_ISearchView_displayMode { [MenuItem("Examples/ISearchView/displayMode")] public static void Run() { // SearchService...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_81de83908e54
unity_docs
rendering
What is `LightmapParameters.clusterResolution` in Unity? Explain its purpose and usage.
LightmapParameters.clusterResolution public float clusterResolution ; Description Controls the resolution at which Enlighten Realtime Global Illumination stores and can transfer input light. Typically this resolution can be slightly lower than the resolution of the real-time lightmap without significantly redu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_1429c9325e5f
unity_docs
editor
In Unity's 'Visualizing profiler counters', what is 'Adding metrics to your code' and how does it work?
The following example assumes that the GameManager class handles high level logic and knows about enemies. To update the value of the counter, in the Update or LateUpdate method (depending on when the logic is performed with spawning or destroying enemies), use the Sample method to push the enemy’s count value to the P...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1085eba29eec
unity_docs
rendering
What is `ShadowQuality` in Unity? Explain its purpose and usage.
ShadowQuality enumeration Description Determines which type of shadows should be used. The available options are Hard and Soft Shadows, Hard Shadows Only and Disable Shadows. Additional resources: QualitySettings.shadows , Light.shadows . Properties Property Description Disable Disable Shadows. HardOnly Har...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f4aea9e90549
unity_docs
scripting
Show me a Unity C# example demonstrating `Compass.trueHeading`.
ng in degrees relative to the geographic North Pole. (Read Only) The value in this property is always measured relative to the top of the screen in its current orientation. Note, that if you want this property to contain a valid value, you must also enable location updates by calling Input.location.Start() . (Read On...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_49d7554b6575_doc_2
github
scripting
What does `ModBusPoll` do in this Unity script? Explain its purpose and signature.
Class constructorThe register address to pollThe active ModBus connection Signature: ```csharp public ModBusPoll(ushort registerAddress, ModBusConnection connection) ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_80240eda28fb
unity_docs
math
Show me a Unity C# example demonstrating `UIElements.MeshGenerationContext.AddMeshGenerationJob`.
onContext.AddMeshGenerationJob Declaration public void AddMeshGenerationJob ( Unity.Jobs.JobHandle jobHandle ); Parameters Parameter Description jobHandle JobHandle to wait for. Description Instructs the renderer to wait for the completion of the provided JobHandle before beginning processing the meshes....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cabb3c64fba8
unity_docs
editor
What is `Rendering.RenderPipelineEditorUtility.TryRemoveLastRenderingLayerName` in Unity? Explain its purpose and usage.
RenderPipelineEditorUtility.TryRemoveLastRenderingLayerName Declaration public static bool TryRemoveLastRenderingLayerName (); Returns bool Returns true if the change was successful. Description Remove a last Layer to Rendering Layers in the Tags and Layers manager . The default Rendering Layer cannot b...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0e42f1f94d54
unity_docs
rendering
What is `TextureImporterSettings.readable` in Unity? Explain its purpose and usage.
TextureImporterSettings.readable public bool readable ; Description Is texture data readable from scripts. Texture has to be set as "readable" in order for Texture2D.GetPixel , Texture2D.GetPixels and similar functions to work. Textures are not set as readable by default. When texture is not readable, it c...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1448339d476c
unity_docs
scripting
What is `index` in Unity? Explain its purpose and usage.
Welcome to the Unity Scripting Reference! This section of the documentation contains details of the scripting API that Unity provides. To use this information, you should be familiar with the basic theory and practice of scripting in Unity which is explained in the Scripting section of our manual. The scripting ref...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_823aeae7b950
unity_docs
math
What is `AsyncInstantiateOperation.Result` in Unity? Explain its purpose and usage.
AsyncInstantiateOperation.Result public Object[] Result ; Description If isDone is true, then Result contains the instantiated objects. The size of the array is the same as the 'count' argument for the InstantiateAsync call.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e116e5fac1db
unity_docs
scripting
What is `Application.AdvertisingIdentifierCallback` in Unity? Explain its purpose and usage.
Application.AdvertisingIdentifierCallback Declaration public delegate void AdvertisingIdentifierCallback (string advertisingId , bool trackingEnabled , string errorMsg ); Parameters Parameter Description advertisingId Advertising ID. trackingEnabled Indicates whether the user has chosen to limit ad track...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_42d5ae13755c
unity_docs
editor
Show me a Unity C# example demonstrating `SettingsProvider.OnInspectorUpdate`.
SettingsProvider.OnInspectorUpdate Declaration public void OnInspectorUpdate (); Description OnInspectorUpdate is called at 10 frames per second to give the inspector a chance to update. See EditorWindow.OnInspectorUpdate for more details. ```csharp using UnityEditor; public static class PresetManagerHelper {...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cb707fb19bc1
unity_docs
rendering
What is `ScriptableObject.OnValidate` in Unity? Explain its purpose and usage.
ScriptableObject.OnValidate() Description Editor-only function that Unity calls when the script is loaded or a value changes in the Inspector. OnValidate is usually used to perform an action after a value changes in the Inspector. For example, making sure that data stays within a certain range. The following oper...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c1c8323188ad
unity_docs
scripting
Give me an overview of the `StackTraceLogType` class in Unity.
StackTraceLogType enumeration Description Stack trace logging options. Additional resources: Application.stackTraceLogType. Properties Property Description None No stack trace will be outputed to log. ScriptOnly Only managed stack trace will be outputed. Full Native and managed stack trace will be logged.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e7b37ae87eb2
unity_docs
scripting
In Unity's 'Manage GameObjects in the Hierarchy window', what is 'Create a new GameObject' and how does it work?
To create a new GameObject in the Hierarchy window: Right-click on empty space in the Hierarchy window under your selected scene. Select the GameObject you want to create from the context menu. You can also use the keyboard shortcut Ctrl + Shift + N (macOS: Command + Shift + N ) to create a new empty GameObject. Note :...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_db5d734c2d46
github
scripting
Write a Unity C# UI script for Canvas Component
```csharp using UnityEngine; namespace GI.UnityToolkit.Components.UI { [RequireComponent(typeof(Canvas))] public abstract class CanvasComponent : MonoBehaviour { protected Canvas Canvas { get; private set; } protected void Awake() { Canvas = GetComponent<Canvas>...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d98602e43d5e
unity_docs
editor
What are the parameters of `iOS.Xcode.PBXProject.AddRemotePackageReferenceWithVersionRange` in Unity?
Returns string Returns the GUID of the remote package reference. Description Adds a reference to the remote package and allows updates in the given version range. ```csharp using UnityEditor; using System.IO; using UnityEditor.Callbacks; using UnityEditor.iOS.Xcode;public class Sample_AddRemotePackageReferenceWithVersi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d5436cf38cd8
unity_docs
scripting
What is `ShortcutManagement.ShortcutManager.defaultProfileId` in Unity? Explain its purpose and usage.
ShortcutManager.defaultProfileId public static string defaultProfileId ; Description A constant defining the ID of the default shortcut profile. See the documentation for the IShortcutManager.activeProfileId property.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_252fe8c15e00
unity_docs
scripting
Explain 'Mobile feature set' in Unity.
Use the Mobile feature set to optimize your apps for mobile devices and provide a performant experience for your users. This feature set includes utilities for debugging on device and support for notifications. ## Getting started To get started with the Mobile feature set, the following setup is required: Enable data...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7682660e14de
unity_docs
math
What is `Mesh.GetVertexAttributes` in Unity? Explain its purpose and usage.
Mesh.GetVertexAttributes Declaration public VertexAttributeDescriptor[] GetVertexAttributes (); Returns VertexAttributeDescriptor[] Array of vertex attribute information. Description Get information about vertex attributes of a Mesh. Many of mesh vertex data attributes are optional, for example a mesh mi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0f2ef678e007
unity_docs
ui
What is `EnumButtonsAttribute.ctor` in Unity? Explain its purpose and usage.
EnumButtonsAttribute Constructor Declaration public EnumButtonsAttribute (bool includeObsolete ); Parameters Parameter Description includeObsolete Whether to display obsolete enum values? Description Attribute to enable editing an enum with a ToggleButtonGroup .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c29dc7c6b91a
unity_docs
ui
Show me a Unity C# example demonstrating `GUIContent.text`.
GUIContent.text public string text ; Description The text contained. ```csharp using UnityEngine;public class ExampleScript : MonoBehaviour { void OnGUI() { GUI.Button(new Rect(0, 0, 100, 20), new GUIContent("Click me!")); } } ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bd4a92da51fa
unity_docs
scripting
What is `SystemLanguage.Hebrew` in Unity? Explain its purpose and usage.
SystemLanguage.Hebrew Description Hebrew. ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { //This checks if your computer's operating system is in the Hebrew language if (Application.systemLanguage == SystemLanguage.Hebrew) { //Outputs into console that the system is Hebrew D...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d2c9cd2a0323
unity_docs
rendering
What is `Sprite.spriteAtlasTextureScale` in Unity? Explain its purpose and usage.
Sprite.spriteAtlasTextureScale public float spriteAtlasTextureScale ; Description The Variant scale of Texture used by the Sprite. This is useful to check when a Variant SpriteAtlas is being used by Sprites.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1da008f62402
unity_docs
scripting
Give me an overview of the `LogOption` class in Unity.
LogOption enumeration Description Option flags for specifying special treatment of a log message. Properties Property Description None Normal log message. NoStacktrace The log message will not have a stacktrace appended automatically.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4b2e6159102a
unity_docs
rendering
What is `AssetImporters.TextureGenerationOutput.thumbNail` in Unity? Explain its purpose and usage.
TextureGenerationOutput.thumbNail public Texture2D thumbNail ; Description Thumbnail version of the generated texture. This may be null depending on the import settings. E.g. cubemaps will not return a thumbnail.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_122c7fe5dd7a
unity_docs
scripting
What is `Experimental.ArtifactKey.ctor` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. ArtifactKey Constructor Declaration public ArtifactKey (GUID g ); Declaration public ArtifactKey (GUID guid , Type importerType ); Parameters Parameter Description g The guid. guid The guid. importerType The man...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f6aa38106e5a
unity_docs
xr
What is `RenderTextureDescriptor.vrUsage` in Unity? Explain its purpose and usage.
RenderTextureDescriptor.vrUsage public VRTextureUsage vrUsage ; Description If this RenderTexture is a VR eye texture used in stereoscopic rendering, this property decides what special rendering occurs, if any. Instead of setting this manually, use the value returned by eyeTextureDesc or other VR functions r...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e6b12a781779
unity_docs
rendering
Show me a Unity C# example demonstrating `BuildAssetBundleOptions.StrictMode`.
BuildAssetBundleOptions.StrictMode Description Do not allow the build to succeed if any errors are reporting during it. Without this flag, non-fatal errors - such as a failure to compile a shader for a particular platform - will not cause the build to fail, but may result in incorrect behaviour at runtime. ```csha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4774a568a800
unity_docs
rendering
What is `Rendering.RenderPipelineAsset.autodeskInteractiveMaskedShader` in Unity? Explain its purpose and usage.
RenderPipelineAsset.autodeskInteractiveMaskedShader public Shader autodeskInteractiveMaskedShader ; Returns Shader Returns the default shader. Description Retrieves the default Autodesk Interactive masked Shader for this pipeline. This method is called whenever a model with Autodesk Interactive masked...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_3212972f7e0d
github
scripting
Write a Unity C# script called Multi State Enabled Canvas
```csharp using UnityEngine; #if UNITY_2019 using System; using System.Collections.Generic; using System.Linq; using GI.UnityToolkit.State; #if ODIN_INSPECTOR using Sirenix.OdinInspector; #else using GI.UnityToolkit.Attributes; #endif #endif namespace GI.UnityToolkit.Components.UI { /// <summary> /// Enables...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_555235d4f78a
unity_docs
rendering
What is `Rendering.CommandBuffer.SetComputeConstantBufferParam` in Unity? Explain its purpose and usage.
CommandBuffer.SetComputeConstantBufferParam Declaration public void SetComputeConstantBufferParam ( ComputeShader computeShader , int nameID , ComputeBuffer buffer , int offset , int size ); Declaration public void SetComputeConstantBufferParam ( ComputeShader computeShader , string name , ComputeBuf...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bd894aa045cd
unity_docs
rendering
What are the parameters of `Search.SearchUtils.GetHierarchyAssetPath` in Unity?
Returns string Returns the path of a scene or prefab. Description Get the path of the scene (or prefab) containing a GameObject. ``` static Texture2D FetchPreview(SearchItem item, SearchContext context, Vector2 size, FetchPreviewOptions options) { var obj = ObjectFromItem(item); if (obj == null) return ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_624b42c5df6f
unity_docs
scripting
What is `Compilation.ScriptCompilerOptions.RoslynAnalyzerDllPaths` in Unity? Explain its purpose and usage.
ScriptCompilerOptions.RoslynAnalyzerDllPaths public string[] RoslynAnalyzerDllPaths ; Description Stores the paths to the .dll files. RoslynAnalyzerDllPaths contain either relative or absolute paths, for example C:\MyUnityProject\Assets\MyRoslynAnalyzer.dll, or Assets\MyRoslynAnalyzer.dll. Your Unity project is...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_477d11855d3f
unity_docs
physics
Explain 'Collider interactions' in Unity.
When two colliders make contact, you can call functions to trigger other events in your project via scripting. The two essential function types for collision interaction are OnCollision and OnTrigger . Topic Description Use collisions to trigger other events Overview of collision events and triggers, and the scripting ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d42182db0739
unity_docs
scripting
Show me a Unity C# example demonstrating `Caching.GetCacheAt`.
Caching.GetCacheAt Declaration public static Cache GetCacheAt (int cacheIndex ); Parameters Parameter Description cacheIndex Index of the cache to get. Returns Cache A reference to the Cache at the index specified. Description Returns the Cache at the given position in the cache list. ```csharp us...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_68044c256107
unity_docs
rendering
In Unity's 'Remove SRP Batcher compatibility for GameObjects in URP', what is 'Removing shader compatibility' and how does it work?
You can make both hand-written and Shader Graph shaders incompatible with the SRP Batcher. However, for Shader Graph shaders, if you change and recompile the Shader Graph often, it’s simpler to make the renderer incompatible instead. To make a Unity shader incompatible with the SRP Batcher, you need to make changes to ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_36e4a3d9e19b_doc_0
github
scripting
What does `RegisterEventCanvas` do in this Unity script? Explain its purpose and signature.
After a raycaster is registered to the provider, an index number of the raycaster will return. Signature: ```csharp public static int RegisterEventCanvas(in GraphicRaycaster raycaster) ```
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_112c1824a7f7
unity_docs
editor
What is `Search.QueryValidationOptions` in Unity? Explain its purpose and usage.
QueryValidationOptions struct in UnityEditor.Search Description Struct containing the available query validation options. Properties Property Description skipIncompleteFilters Boolean indicating if incomplete filters should be skipped. skipUnknownFilters Boolean indicating if unknown filters should be skipped...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a34b80434ba7
unity_docs
physics
What is `BuoyancyEffector2D.density` in Unity? Explain its purpose and usage.
BuoyancyEffector2D.density public float density ; Description The density of the fluid used to calculate the buoyancy forces. Buoyancy forces are calculated by comparing the density of the effector to the Collider2D.density of the Collider2D . If the collider is less dense than the effector then the collider...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_494fb33278be
unity_docs
rendering
What is `Vector2` in Unity? Explain its purpose and usage.
Vector2 struct in UnityEngine / Implemented in: UnityEngine.CoreModule Description Representation of 2D vectors and points. This structure is used in some places to represent 2D positions and vectors (e.g. texture coordinates in a Mesh or texture offsets in Material ). In the majority of other cases a Vector...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_eb104e912f53
unity_docs
editor
What is `Search.QueryEngine_1.SetNestedQueryHandler` in Unity? Explain its purpose and usage.
QueryEngine<T0>.SetNestedQueryHandler Declaration public void SetNestedQueryHandler (Func<string,string,IEnumerable<TNestedQueryData>> handler ); Parameters Parameter Description handler The function that handles nested queries. It receives the nested query and the filter token on which the query is applied,...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ea69f4383141
unity_docs
editor
What is `EditorTools.ToolAttribute.defaultPriority` in Unity? Explain its purpose and usage.
ToolAttribute.defaultPriority public static int defaultPriority ; Description The default value for ToolAttribute.toolPriority and ToolAttribute.variantPriority . Specify a priority lower than this value to display a tool before the default entries, or specify a higher value to display it after the default en...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_607065b4e483
unity_docs
rendering
Explain 'Lines and trails' in Unity.
Unity uses specialized components to configure and render lines, trails, and billboards . Topic Description Rendering lines Techniques for rendering individual lines in 3D space, and applying materials to those lines. Rendering trails Techniques for rendering trails that appear behind moving GameObjects , and applying ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5a03aa2b7da3
unity_docs
physics
What is `Collider.attachedRigidbody` in Unity? Explain its purpose and usage.
Collider.attachedRigidbody public Rigidbody attachedRigidbody ; Description The rigidbody the collider is attached to. Returns null if the collider is attached to no rigidbody. Colliders are automatically connected to the rigidbody attached to the same game object or attached to any parent game object. ```cs...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_44d792667a62
unity_docs
editor
Explain 'Prefabs' in Unity.
Unity’s prefab system allows you to create, configure, and store a GameObject complete with all its components, property values, and child GameObjects as a reusable asset. The prefab asset acts as a template from which you can create new prefab instances in the Scene . Topic Description Introduction to prefabs Understa...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_234e1d160cb2
unity_docs
performance
In Unity's 'Job system overview', what is 'Multithreading' and how does it work?
Unity uses its own native job system to process its own native code over multiple worker threads , which are dependent on the number of CPU cores available on the device your application runs on. Usually Unity executes your code on one thread which runs by default at the start of the program, called the main thread . H...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6b04141680c1
unity_docs
xr
What is `XR.XRDisplaySubsystem.reprojectionMode` in Unity? Explain its purpose and usage.
XRDisplaySubsystem.reprojectionMode public XR.XRDisplaySubsystem.ReprojectionMode reprojectionMode ; Description The kind of reprojection the app requests to stabilize its holographic rendering relative to the user's head motion.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2ca2df977fe3
unity_docs
scripting
What is `Unity.Profiling.Memory.MemorySnapshotMetadata` in Unity? Explain its purpose and usage.
MemorySnapshotMetadata class in Unity.Profiling.Memory / Implemented in: UnityEngine.CoreModule Description Container for memory snapshot metadata. Code that subscribes to the MemoryProfiler.CreatingMetadata event receives a MemorySnapshotMetadata object to populate with meta data for a memory snapshot that i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bc500d6edee1
unity_docs
rendering
What is `Tilemaps.TilemapRenderer.detectChunkCullingBounds` in Unity? Explain its purpose and usage.
TilemapRenderer.detectChunkCullingBounds public Tilemaps.TilemapRenderer.DetectChunkCullingBounds detectChunkCullingBounds ; Description Returns whether the TilemapRenderer automatically detects the bounds to extend chunk culling by.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_48a94aa45c87
unity_docs
scripting
What is `Experimental.Rendering.GraphicsFormat.R16_SFloat` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphicsFormat.R16_SFloat Description A one-component, 16-bit signed floating-point format that has a single 16-bit R component.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3a1ef88a248b
unity_docs
ui
Show me a Unity code example for 'ScrollView'.
( #unity-content-container ) of the ScrollView. ## Create a ScrollView You can create a ScrollView with UI Builder, UXML, or C#. The following C# example creates a ScrollView with both horizontal and vertical scroll capabilities, that contains a title Label, and a number of Toggle elements. It also adds a button that...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3f93c11e8929
unity_docs
editor
What is `Device.SystemInfo.processorFrequency` in Unity? Explain its purpose and usage.
SystemInfo.processorFrequency public static int processorFrequency ; Description This has the same functionality as SystemInfo.processorFrequency and also mimics platform-specific behavior in the Unity Editor.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f01a53f3a0c0
unity_docs
scripting
Give me an overview of the `AudioReverbZone` class in Unity.
AudioReverbZone class in UnityEngine / Inherits from: Behaviour / Implemented in: UnityEngine.AudioModule Description Reverb Zones are used when you want to create location based ambient effects in the Scene. As the Audio Listener moves into a Reverb Zone, the ambient effect associated with the zone is gradu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.