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_man_9e3910916a04
unity_docs
scripting
Show me a Unity code example for 'Bind a custom control to custom data type'.
hrenheit. You can find the completed files that this example creates in this GitHub repository . ## Create a custom data type Create a custom data type Temperature , and use it as a serialized property. Create a Unity project with any template. Create a folder named bind-custom-data-type to store all the files. Creat...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_e933d1c9ca2f
github
scripting
Write a Unity C# MonoBehaviour script called Identification
```csharp using System.Collections; using System.Collections.Generic; using UnityEngine; namespace PlainSaveLoad { /// <summary> /// This is a very basic version of an ID system for GameObjects. /// Manually setting IDs like this is not desirable. For the demo, it is sufficient. /// </summary> pu...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_man_f199e62ccf9a
unity_docs
xr
Explain 'VR and MR development in Unity' in Unity.
Get started with virtual reality and mixed reality development in Unity. Virtual Reality (VR) and Mixed Reality (MR) both refer to extended reality experiences where specialized devices provide a way for the user to interact with a virtual environment. In VR experiences, the environment is closed. This means that the u...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ee7debc59e94
unity_docs
math
What is `SerializedProperty.arrayElementType` in Unity? Explain its purpose and usage.
SerializedProperty.arrayElementType public string arrayElementType ; Description Type name of the element in an array property. (Read Only) Returns the C# type name of the element in an array property. In the case of SerializedPropertyType.ObjectReference and other internal values of SerializedPropertyType, t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8dfa1919b032
unity_docs
scripting
What is `Search.SearchExpression.ProcessValues` in Unity? Explain its purpose and usage.
SearchExpression.ProcessValues Declaration public static IEnumerable<SearchItem> ProcessValues (IEnumerable<SearchItem> items , string outputValueFieldName , Func<SearchItem,T> processHandler ); Parameters Parameter Description items Group of items to transform. outputValueFieldName Name of the field in ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_87d5261e427c
unity_docs
math
What is `TrailRenderer.GetVisiblePositions` in Unity? Explain its purpose and usage.
TrailRenderer.GetVisiblePositions Declaration public int GetVisiblePositions (out Vector3[] positions ); Declaration public int GetVisiblePositions (out NativeArray<Vector3> positions ); Declaration public int GetVisiblePositions (out NativeSlice<Vector3> positions ); Parameters Parameter Descriptio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_709b94f26011
unity_docs
math
What is `Animator.rightFeetBottomHeight` in Unity? Explain its purpose and usage.
Animator.rightFeetBottomHeight public float rightFeetBottomHeight ; Description Get right foot bottom height. ```csharp using UnityEngine;public class Example : MonoBehaviour { Animator animator; void Start() { animator = GetComponent<Animator>(); } void LateUpdate() { if (animator) { Vector3 rightFoot...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_716d67b286fe
unity_docs
physics
Show me a Unity C# example demonstrating `Rigidbody2D.linearVelocityX`.
omponents in the X and Y directions (there is no Z direction in 2D physics). This property lets you read and write only the X component of the Rigidbody2D.linearVelocity without affecting the Y component of the Rigidbody2D.linearVelocity . This is convenient when dealing with X and Y directions in isolation. Additio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3a2e6701f9b1
unity_docs
physics
In Unity's 'External Forces module reference', what is 'Properties' and how does it work?
For some properties in this section, you can use different modes to set their value. For information on the modes you can use, refer to Vary Particle System properties over time . Property Function Multiplier Scale value applied to wind zone forces. Influence Filter Choose whether to include Force Fields based on a Lay...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_bafa6d048ed3
unity_docs
audio
In Unity's 'Audio Reverb Filter', what is 'Properties' and how does it work?
Property: Function: Reverb Preset Custom reverb presets, select user to create your own customized reverbs. Dry Level Mix level of dry signal in output in mB. Ranges from –10000.0 to 0.0. Default is 0. Room Room effect level at low frequencies in mB. Ranges from –10000.0 to 0.0. Default is 0.0. Room HF Room effect high...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5305cc278e62
unity_docs
scripting
Explain 'Host a scoped registry for your organization' in Unity.
As a custom package provider, you can host a scoped registry, so the location of your registry is available within Package Manager. ## Supported use cases and complying with Terms of Service The intended scenario for scoped registries is to distribute custom packages within your organization, so your organization mem...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d535e28922a3
unity_docs
input
What is `Playables.PlayableExtensions.GetInput` in Unity? Explain its purpose and usage.
PlayableExtensions.GetInput Declaration public static Playables.Playable GetInput (U playable , int inputPort ); Parameters Parameter Description playable The Playable used by this operation. inputPort The port index. Returns Playable Playable connected at the index specified, or null if the index...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_e473328d6237
github
scripting
Write a Unity C# ScriptableObject for Sprite Animations
```csharp using Unity.Entities; using UnityEngine; #if UNITY_EDITOR using UnityEditor; #endif [CreateAssetMenu(fileName = "spriteAnim", menuName = "Farmer/Sprite Animation")] public class SpriteAnimations : ScriptableObject { [System.Serializable] public struct Animation : ISharedComponentData { p...
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_6814ca514318
unity_docs
editor
What is `PlayerSettings.WSA.tileShortName` in Unity? Explain its purpose and usage.
PlayerSettings.WSA.tileShortName public static string tileShortName ; Description An alternative, shorter title name to display in the application's tile. In the Editor, Unity displays this under Tile section in UWP Player Settings . This property is useful when the full display name doesn't fit on a tile. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_586ecd04dd47_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
The workhorse for updating any UIComponent children. This component must be updated by another component to provide fine control over when the objects are ticked. Signature: ```csharp public class UIComponentManager : MonoBehaviour ```
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_9b050f861b21
unity_docs
editor
Show me a Unity C# example demonstrating `EditorApplication.Beep`.
EditorApplication.Beep Declaration public static void Beep (); Description Plays system beep sound. ```csharp // Play beep sound on menu clickusing UnityEditor; using UnityEngine;public class BeepExample { [MenuItem("Examples/Play beep")] static void DoBeep() { EditorApplication.Beep(); } } ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_339211430544
unity_docs
editor
Show me a Unity C# example demonstrating `FileUtil.ReplaceDirectory`.
FileUtil.ReplaceDirectory Declaration public static void ReplaceDirectory (string src , string dst ); Description Replaces a directory. Replaces the directory located at dst with the directory located at src . if dst doesnt exists it copies the file. If dst exists then it deletes it and copies the dire...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_34facef37d44
unity_docs
rendering
In Unity's 'Customizing native memory allocators', what is 'Using the Editor' and how does it work?
Open the Project Settings window ( Edit > Project Settings ). Select the Memory Settings panel. Select the lock icon next to the value you want to edit. For more information on how the values affect each allocator, refer to Native memory allocator examples .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d391cab7d6cf
unity_docs
scripting
What is `Presets.Preset.ApplyTo` in Unity? Explain its purpose and usage.
Preset.ApplyTo Declaration public bool ApplyTo ( Object target ); Declaration public bool ApplyTo ( Object target , string[] selectedPropertyPaths ); Parameters Parameter Description target The target object that will be updated with the Preset serialized values. selectedPropertyPaths Optional list...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_168a6b98c28b
unity_docs
animation
What is `Animations.TransformStreamHandle.GetRotation` in Unity? Explain its purpose and usage.
TransformStreamHandle.GetRotation Declaration public Quaternion GetRotation ( Animations.AnimationStream stream ); Parameters Parameter Description stream The AnimationStream that holds the animated values. Returns Quaternion The rotation of the transform in world space. Description Gets the rot...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5424b39b3117
unity_docs
physics
Give me an overview of the `ArticulationDriveType` class in Unity.
ArticulationDriveType enumeration Description The drive type applied to a particular drive of an ArticulationBody . Additional resources: ArticulationDrive.driveType . Properties Property Description Force Drives in this mode output forces and torques. Acceleration Drives in this mode output accelerations i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_dd311a5c0f46
unity_docs
ui
What is `Experimental.GraphView.ClickSelector` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. ClickSelector class in UnityEditor.Experimental.GraphView / Inherits from: UIElements.MouseManipulator Description Selects element on single click. Constructors Constructor Description ClickSelector Constructor for ClickS...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5abaa057e2fa
unity_docs
rendering
Explain 'Normal mapping Surface Shader example in the Built-In Render Pipeline' in Unity.
```csharp Shader "Example/Diffuse Bump" { Properties { _MainTex ("Texture", 2D) = "white" {} _BumpMap ("Bumpmap", 2D) = "bump" {} } SubShader { Tags { "RenderType" = "Opaque" } CGPROGRAM #pragma surface surf Lambert struct Input { float2 uv_MainTex; float2 uv_BumpMap; }; sampler2D _MainTex; sampler2D _Bum...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_95b2e6fae340
unity_docs
ui
In Unity's 'Customize the grid', what is 'Resize the grid' and how does it work?
You can set the size of the grid lines that display in the Scene view window. The size of the grid affects how your grid looks and how your GameObjects automatically snap to the grid and how your GameObjects move, rotate, or scale using snap increments . If you set a size for all axes at once, you display a uniform, sq...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c74f63fb8c97
unity_docs
rendering
What is `RenderTexture.depthStencilFormat` in Unity? Explain its purpose and usage.
RenderTexture.depthStencilFormat public Experimental.Rendering.GraphicsFormat depthStencilFormat ; Description The format of the depth/stencil buffer. The returned format is the actual format that is used when RenderTexture.Create is called. This format can be different than the depth/stencil format that ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e2f1b79746c8
unity_docs
audio
Give me an overview of the `AudioClipLoadType` class in Unity.
AudioClipLoadType enumeration Description Determines how the audio clip is loaded in. Determines whether the audio clip will be either loaded in memory in compressed form, such that every playback will decode the data on the fly ("CompressedInMemory"), decompressed at Scene startup such that the clip can be played...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f6f654f2dc7d
unity_docs
scripting
In Unity's 'Build your application for tvOS', what is 'Incremental build pipeline' and how does it work?
Unity uses the incremental build pipeline when it builds the Player for tvOS. This means that Unity incrementally builds/generates files such as Information Property List (plist) files and Entitlement files. If you implement callbacks that modify or move any iOS file or asset that the incremental build pipeline uses, s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_44502ce0cac8
unity_docs
rendering
Give me an overview of the `MipmapLimitDescriptor` class in Unity.
MipmapLimitDescriptor struct in UnityEngine / Implemented in: UnityEngine.CoreModule Description Determines whether a texture uses a mipmap limit, and which mipmap limit the texture uses, when you create the texture using a constructor. Properties Property Description groupName The TextureMipmapLimitGroup to...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_046fff98abbc
unity_docs
animation
Give me an overview of the `AvatarTarget` class in Unity.
AvatarTarget enumeration Description Target. Additional resources: Animator.SetTarget and Animator.MatchTarget . Properties Property Description Root The root, the position of the game object. Body The body, center of mass. LeftFoot The left foot. RightFoot The right foot. LeftHand The left hand. Right...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2942f00a0c8a
unity_docs
xr
What is `Android.Permission` in Unity? Explain its purpose and usage.
Permission struct in UnityEngine.Android / Implemented in: UnityEngine.AndroidJNIModule Description Structure describing a permission that requires user authorization. Static Properties Property Description Camera Used when requesting permission or checking if permission has been granted to use the camera. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_508a3f00e646
unity_docs
editor
Show me a Unity C# example demonstrating `SceneManagement.EditorSceneManager.CloseScene`.
ceneManagement.Scene scene , bool removeScene ); Parameters Parameter Description scene The Scene to be closed/removed. removeScene Bool flag to indicate if the Scene should be removed after closing. Returns bool Returns true if the Scene is closed/removed. Description Close the Scene. If removeScen...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_57fae7558bbb
unity_docs
xr
In Unity's 'Create an XR project', what is 'Create a new XR project' and how does it work?
To create an XR project using a template: Open the Unity Hub. In the Hub, click the New Project button. Select the desired template: Mixed Reality , VR , or AR Mobile . If necessary, click Download template . Set a project name and save location. Click Create project . Refer to the Unity Hub documentation for more info...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_1b52b40215e9
unity_docs
rendering
Explain 'Example of a Surface Shader that supports GPU Instancing in the Built-In Render Pipeline' in Unity.
The following example demonstrates how to create an instanced Surface Shader with different color values for each instance. ```csharp Shader "Custom/InstancedColorSurfaceShader" { Properties { _Color ("Color", Color) = (1,1,1,1) _MainTex ("Albedo (RGB)", 2D) = "white" {} _Glossiness ("Smoothness", Range(0,1)) = 0....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ace0fcca62ab
unity_docs
ui
What is `EditorWindow.saveChangesMessage` in Unity? Explain its purpose and usage.
EditorWindow.saveChangesMessage public string saveChangesMessage ; Description The message that displays to the user if they are prompted to save Set saveChangesMessage in a derived class to prevent users from accidentally losing unsaved work. For saveChangesMessage to work, you must use it with EditorWindow.h...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_2afca912d33c
github
scripting
Write a Unity C# ScriptableObject for Settings
```csharp using UnityEngine; namespace BehaviourInject.Internal { [CreateAssetMenu(fileName = "BInjectSettings", menuName = "BInject/Create Settings")] public class Settings : ScriptableObject { public const string SETTINGS_PATH = "BInjectSettings"; private static Settings _instance; [Tooltip("List of con...
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_bb26ae1dfbf4
unity_docs
scripting
Show me a Unity C# example demonstrating `RenderingLayerMask.GetMask`.
params string[] renderingLayerNames ); Parameters Parameter Description renderingLayerNames List of layer names to convert to a rendering layer mask. Returns uint The rendering layer mask created from the renderingLayerNames . Description Given a set of rendering layer names as defined in the Tags and...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_05bbdf8fec2f
unity_docs
math
What is `AndroidJNIHelper.ConvertToJNIArray` in Unity? Explain its purpose and usage.
AndroidJNIHelper.ConvertToJNIArray Declaration public static IntPtr ConvertToJNIArray (Array array ); Parameters Parameter Description array Managed array to be converted into a Java array object. Description Creates a Java array from a managed array. Additional resources: AndroidJNIHelper.ConvertFromJNI...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_87549e11197b
unity_docs
scripting
In Unity's 'PSO tracing and warming example', what is 'Sample script reference' and how does it work?
The following table outlines the key PSO tracing and warming scripts used in this sample and their function: Script Description Assets/SharedAssets/Scripts/Runtime/GraphicsStateCollectionManager.cs Performs PSO tracing and warmup at runtime. Holds a list of recorded collections. Assets/SharedAssets/Scripts/Editor/Graph...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_99c6ee00c815
unity_docs
animation
What is `Animations.AimConstraint.GetSource` in Unity? Explain its purpose and usage.
AimConstraint.GetSource Declaration public Animations.ConstraintSource GetSource (int index ); Parameters Parameter Description index The index of the source. Returns ConstraintSource The source object and its weight. Description Gets a constraint source by index. Throws ArgumentOutOfRangeExceptio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_76cbc26e9cf0
unity_docs
math
What is `Mesh.MeshData.GetUVs` in Unity? Explain its purpose and usage.
Mesh.MeshData.GetUVs Declaration public void GetUVs (int channel , NativeArray<Vector2> outUVs ); Declaration public void GetUVs (int channel , NativeArray<Vector3> outUVs ); Declaration public void GetUVs (int channel , NativeArray<Vector4> outUVs ); Parameters Parameter Description channel Th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d75c6a2db8c6
unity_docs
rendering
What is `ParticleSystem.ShapeModule.position` in Unity? Explain its purpose and usage.
ParticleSystem.ShapeModule.position public Vector3 position ; Description Apply an offset to the position from which the system emits particles. Additional resources: ParticleSystem.ShapeModule.shapeType .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5b55060d2d05
unity_docs
rendering
What is `Rendering.BatchDrawCommandIndirect.batchID` in Unity? Explain its purpose and usage.
BatchDrawCommandIndirect.batchID public Rendering.BatchID batchID ; Description The batch ID that this draw command uses. Determines the metadata values that are available to a shader. This determines the metadata values that are available to a shader and which Graphics buffer to bind as the unity_DOTSInstan...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6619958a2802
unity_docs
rendering
Show me a Unity C# example demonstrating `Texture2D.GetPixels32`.
at the texture uses into Color32 . To get pixel data more quickly, use GetPixelData instead. A single call to GetPixels32 is usually faster than multiple calls to GetPixel , especially for large textures. If GetPixels32 fails, Unity throws an exception. GetPixels32 might fail if the array contains too much da...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2fe6c5d43fc3
unity_docs
editor
Show me a Unity C# example demonstrating `Selection.transforms`.
Selection.transforms public static Transform[] transforms ; Description Returns the top level selection, excluding Prefabs. This is the most common selection type when working with Scene objects. ```csharp using UnityEngine; using UnityEditor;class LookAtMainCamera : ScriptableObject { [MenuItem("Example/Sele...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_116d5fa6c16d
unity_docs
rendering
What is `TerrainTools.PaintContext.GatherNormals` in Unity? Explain its purpose and usage.
PaintContext.GatherNormals Declaration public void GatherNormals (); Description Gathers the normal information into sourceRenderTexture . This function collects the terrain mesh normalmap data from all Terrain tiles in the PaintContext into sourceRenderTexture . This function is called internally by Terra...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_1e846c5bf6c5
unity_docs
rendering
Explain 'Vertex-Lit' in Unity.
Note. Unity 5 introduced the Standard Shader which replaces this shader . ## Vertex-Lit Properties Note. Unity 5 introduced the Standard Shader which replaces this shader. This shader is Vertex-Lit , which is one of the simplest shaders. All lights shining on it are rendered in a single pass and calculated at vertice...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_33248c13ffbc
unity_docs
scripting
What is `HashUtilities.AppendHash` in Unity? Explain its purpose and usage.
HashUtilities.AppendHash Declaration public static void AppendHash (ref Hash128 inHash , ref Hash128 outHash ); Parameters Parameter Description inHash Hash to append. outHash Hash that will be updated. Description Append inHash in outHash.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0c37372b5a7c
unity_docs
scripting
What is `U2D.PixelPerfectRendering.pixelSnapSpacing` in Unity? Explain its purpose and usage.
PixelPerfectRendering.pixelSnapSpacing public static float pixelSnapSpacing ; Description To achieve a pixel perfect render, Sprites must be displaced to discrete positions at render time. This value defines the minimum distance between these positions. This doesn’t affect the GameObject's transform position. B...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ddf8c4e3365e
unity_docs
physics
What are the parameters of `Rigidbody.SweepTest` in Unity?
Returns bool True when the rigidbody sweep intersects any collider, otherwise false. Description Tests if a rigidbody would collide with anything, if it was moved through the Scene. Tests if a rigidbody would collide with anything, if it was moved through the Scene. This is similar to doing a Physics.Raycast for all po...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_aadb4181c232
unity_docs
editor
Explain 'Create a drag-and-drop UI inside a custom Editor window' in Unity.
Version : 2021.3+ Drag-and-drop is a common feature in UI design. You can use UI Toolkit to create a drag-and-drop UI inside a custom Editor window or inside an application built by Unity. This example demonstrates how to create a drag-and-drop UI inside a custom Editor window. ## Example overview The example adds se...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_247ea1e744d1
unity_docs
scripting
Show me a Unity C# example demonstrating `ParticleSystem.ForceOverLifetimeModule.z`.
ParticleSystem.ForceOverLifetimeModule.z public ParticleSystem.MinMaxCurve z ; Description The curve defining particle forces in the z-axis. Additional resources: MinMaxCurve . ```csharp using UnityEngine; using System.Collections;[RequireComponent(typeof(ParticleSystem))] public class ExampleClass : MonoB...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_69afc459e810
unity_docs
rendering
What is `LightTransport.PostProcessing.ReferenceProbePostProcessor` in Unity? Explain its purpose and usage.
ReferenceProbePostProcessor class in UnityEngine.LightTransport.PostProcessing Implements interfaces: IProbePostProcessor Description ReferenceProbePostProcessor is a post processor for light probes. The ReferenceProbePostProcessor implements the IProbePostProcessor interface. The implementation favors correct...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_489fe1ad04db
unity_docs
scripting
In Unity's 'Video playback in Web', what is 'Video player' and how does it work?
You can use the Video Player component to control how to time video playback relative to other interactive behaviors in Web. For more information, refer to the Clock management with the Video Player component . The only exceptions are: Web doesn’t support frame accuracy. The VideoPlayer component doesn’t support synchr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_ee2a469fc4eb
unity_docs
editor
Explain 'Create a 2D texture array in a script' in Unity.
To create a 2D texture array in a script, use the Texture2DArray API. For example: ``` // Set the 2D texture array parameters int width = 32; int height = 32; int slices = 8; TextureFormat format = TextureFormat.RGBA32; bool mipChain = false; // Create a 2D texture array with a width and height of 32 pixels, and 8 sli...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_58310d873da5
unity_docs
scripting
What is `AI.NavMeshBuildSettings.maxJumpAcrossDistance` in Unity? Explain its purpose and usage.
NavMeshBuildSettings.maxJumpAcrossDistance public float maxJumpAcrossDistance ; Description Maximum agent jump distance. Jump-Across link generation is controlled by the Jump Distance parameter. The parameter controls what is the furthest distance that will be connected. Setting the value to 0 will disable the ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_63228aecf06f
unity_docs
scripting
What are the parameters of `Animator.GetCurrentAnimatorClipInfo` in Unity?
Returns AnimatorClipInfo[] An array of all the AnimatorClipInfo in the current state. Description Returns an array of all the AnimatorClipInfo in the current state of the given layer. ```csharp //This script outputs the name and length of the Animation clip played at start-up.using UnityEngine;public class GetCurrentAn...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_431c82e19e78
unity_docs
rendering
In Unity's 'Lighting Data Assets', what is 'Default Lighting Data Assets' and how does it work?
When you add a new scene, Unity uses a default Lighting Data Asset. The asset references a hidden ambient probe and a hidden Reflection Probe that capture environment lighting from Unity’s built-in Default Skybox . The asset doesn’t appear in the Project window . The data in the hidden probes is fixed. For example, if ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3f14681aaa26
unity_docs
networking
Explain 'Introduction to Unity Accelerator' in Unity.
Unity Accelerator is a caching proxy agent that keeps copies of a team’s imported assets to help reduce development iteration time. Unity Accelerator uses the Asset Import Pipeline to coordinate asset sharing when your team is working on the same local network so that you don’t need to reimport portions of your project...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_13f8b8bfad03
unity_docs
scripting
What is `Pool.LinkedPool_1` in Unity? Explain its purpose and usage.
LinkedPool<T0> class in UnityEngine.Pool / Implemented in: UnityEngine.CoreModule Implements interfaces: IObjectPool<T0> Description A linked list version of IObjectPool<T0> . Object Pooling is a way to optimize your projects and lower the burden that is placed on the CPU when having to rapidly create and des...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_810d7d5130d4
unity_docs
scripting
What are the parameters of `Color32.ToString` in Unity?
Description Returns a formatted string for this color. ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { Color32 color = Color.white; print(color.ToString("x")); } } ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c0caca354304
unity_docs
editor
What is `Build.IProcessSceneWithReport.OnProcessScene` in Unity? Explain its purpose and usage.
IProcessSceneWithReport.OnProcessScene Declaration public void OnProcessScene ( SceneManagement.Scene scene , Build.Reporting.BuildReport report ); Parameters Parameter Description scene The current scene being processed. report A report containing information about the current build. When this callbac...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9488dd523215
unity_docs
physics
Show me a Unity C# example demonstrating `JointSpring`.
JointSpring struct in UnityEngine / Implemented in: UnityEngine.PhysicsModule Description JointSpring is used add a spring force to HingeJoint and PhysicsMaterial . ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { HingeJoint hinge = GetComponent<HingeJoint>(); // Make the ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_59e64d10d9e2
unity_docs
editor
What is `SceneManagement.StageHandle` in Unity? Explain its purpose and usage.
StageHandle struct in UnityEditor.SceneManagement Description Struct that represents a stage handle. A stage is an editing context which includes a collection of Scenes. The main stage contains all the currently open regular Scenes, while a Prefab stage contains a preview Scene used solely for editing the Prefab ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_51ff9a324b0c
unity_docs
scripting
What is `UIElements.UxmlSerializedDataUtility` in Unity? Explain its purpose and usage.
UxmlSerializedDataUtility class in UnityEngine.UIElements / Implemented in: UnityEngine.UIElementsModule Description This is used by the code generator when a custom control is using the UxmlElementAttribute . Static Methods Method Description CopySerialized This is used by the code generator when a cu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_df5ca094a4a2
unity_docs
xr
What is `MPE.EventService.IsRequestPending` in Unity? Explain its purpose and usage.
EventService.IsRequestPending Declaration public static bool IsRequestPending (string eventType ); Parameters Parameter Description eventType Event type name. Returns bool True if there is a pending request for this event. False otherwise. Description Checks whether a request is pending on a specific...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_44f95274436c
unity_docs
ui
Show me a Unity C# example demonstrating `EditorWindow.ShowUtility`.
of the new active window. This means the EditorWindow.ShowUtility window is never hidden by the Unity editor. It is, however, not dockable to the editor. Utility windows will always be in front of normal Unity windows. It will be hidden when the user switches from Unity to another application. Note: You do not need ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3b6d890cd71b
unity_docs
math
Show me a Unity code example for 'Use P/Invoke'.
ink library (DLL) name to P/Invoke into specific system libraries. If you try to P/Invoke into any DLL that exists outside of the project, it will result in a DllNotFoundException at runtime. Therefore, it’s possible to use the __Internal keyword in place of the DLL name, which will use the C++ linker to resolve the fu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3eef43a3b85b
unity_docs
physics
Explain 'Use components' in Unity.
You can use different components to change or add functions to your GameObjects . You can use the Inspector window to change the properties of any component, or you can use scripts . For more information on how to use your components with scripts, see the components script reference page. ## Add components You can ad...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ac4b3bf6dab4
unity_docs
rendering
What is `Rendering.RenderPipelineManager.beginCameraRendering` in Unity? Explain its purpose and usage.
RenderPipelineManager.beginCameraRendering Description Delegate that you can use to invoke custom code before Unity renders an individual Camera. When Unity calls RenderPipeline.BeginCameraRendering , it executes the methods in this delegate's invocation list. In the Universal Render Pipeline (URP) and the High De...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_84404e2daed0
unity_docs
scripting
What is `TerrainData.SetTreeInstance` in Unity? Explain its purpose and usage.
TerrainData.SetTreeInstance Declaration public void SetTreeInstance (int index , TreeInstance instance ); Parameters Parameter Description index The index of the tree instance. instance The new TreeInstance value. Description Sets the tree instance with new parameters at the specified index. However, ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a13b3113149d
unity_docs
editor
What are the parameters of `EditorGUILayout.Foldout` in Unity?
Returns bool The foldout state selected by the user. If true, you should render sub-objects. Description Make a label with a foldout arrow to the left of it. This is useful for creating tree or folder like structures where child objects are only shown if the parent is folded out. Foldout in an Editor Window. ```csharp ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6722f58259f4
unity_docs
audio
What is `AudioSpeakerMode.Surround` in Unity? Explain its purpose and usage.
AudioSpeakerMode.Surround Description The Surround 5.0 speaker setup which contains five channels. The Surround 5.0 speaker mode contains 5 channels: Front left Front center Front right Surround left Surround right (no subwoofer). If not supported, Unity picks a supported mode (often AudioSpeakerMode.Stereo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_249691f4532b
unity_docs
scripting
What is `Caching.AddCache` in Unity? Explain its purpose and usage.
Caching.AddCache Declaration public static Cache AddCache (string cachePath ); Parameters Parameter Description cachePath Path to the cache folder. Description Add a cache with the given path. This allows you to add a new cache to the cache list. A reference to a Cache will be returned. ```csharp using...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_fb933b055f95
unity_docs
scripting
In Unity's 'Supporting presets for custom types', what is 'Example: Preset settings in a custom Editor window' and how does it work?
The following series of examples demonstrate how to add preset settings to a simple EditorWindow . When creating a custom EditorWindow class with settings that can be saved to presets: Use a ScriptableObject to store a copy of your settings. Optionally, add a CustomEditor attribute. The preset system handles this objec...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1ac0f5791e53
unity_docs
scripting
Give me an overview of the `LensFlare` class in Unity.
LensFlare class in UnityEngine / Inherits from: Behaviour / Implemented in: UnityEngine.CoreModule Description Script interface for a Lens flare component . This allows you to change the brightness and color of lens flares at runtime. Properties Property Description brightness The strength of the flare....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_39979e1f5df3
unity_docs
scripting
Show me a Unity C# example demonstrating `SystemLanguage.Unknown`.
SystemLanguage.Unknown Description Unknown. ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { //This checks if your computer's operating system is in an unknown language if (Application.systemLanguage == SystemLanguage.Unknown) { //Outputs into console that the system language ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4cd8bfb27513
unity_docs
rendering
What are the parameters of `Mesh.GetBlendShapeBufferRange` in Unity?
Returns BlendShapeBufferRange A struct that describes the start and end index of the data for the given blend shape. Description Get the location of blend shape vertex data for a given blend shape. When you call Mesh.GetBlendShapeBuffer with BlendShapeBufferLayout.PerShape , Unity returns a GraphicsBuffer that contains...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b66b4df35b24
unity_docs
scripting
What is `Video.VideoPlayer.time` in Unity? Explain its purpose and usage.
VideoPlayer.time public double time ; Description The presentation time of the currently available frame in VideoPlayer.texture in seconds. Use VideoPlayer.time to achieve the following actions: Start the video at a certain time. Search through a video. Synchronize a part of your clip with another eleme...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_12fbb116f2be
unity_docs
editor
In Unity's 'Debug C# code in Unity', what is 'Breakpoints' and how does it work?
Breakpoints allow you to specify points in your code where you want to pause its execution. In your external code editor, you can set a breakpoint on a line of code where you want the debugger to stop. While the code editor is at a breakpoint, you can view the contents of variables step by step. If you have attached yo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e54a6762d185
unity_docs
rendering
In Unity's 'Add built-in keyword sets', what is 'Shader directive shortcuts' and how does it work?
Shortcut Shader keywords Unity adds Unity adds a shader variant with all the keywords off Shader pass that uses the shader variants multi_compile_fog FOG_LINEAR , FOG_EXP , FOG_EXP2 Yes Fog multi_compile_fwdadd POINT DIRECTIONAL SPOT POINT_COOKIE DIRECTIONAL_COOKIE No PassType.ForwardAdd multi_compile_fwdadd_fullshadow...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c2be99df1d0c
unity_docs
math
What is `TestTools.Coverage.GetStatsForAllCoveredMethods` in Unity? Explain its purpose and usage.
Coverage.GetStatsForAllCoveredMethods Declaration public static CoveredMethodStats[] GetStatsForAllCoveredMethods (); Returns CoveredMethodStats[] Array of coverage summaries. Description Returns the coverage summary for all methods that have been called since either the Unity process was started or Covera...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_70fd0fda1d23
unity_docs
rendering
What is `Texture2D.streamingMipmaps` in Unity? Explain its purpose and usage.
Texture2D.streamingMipmaps public bool streamingMipmaps ; Description Determines whether mipmap streaming is enabled for this Texture. Mipmap streaming can only be enabled using the TextureImporter and cannot be changed at run time.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_38cef8509d48
unity_docs
animation
What is `Animations.AnimationHumanStream.SetHintPosition` in Unity? Explain its purpose and usage.
AnimationHumanStream.SetHintPosition Declaration public void SetHintPosition ( AvatarIKHint index , Vector3 pos ); Parameters Parameter Description index The AvatarIKHint that is queried. pos The position of this IK hint. Description Sets the position of this IK hint in world space. Additional resou...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b77df4f30d2b
unity_docs
rendering
What is `Material.GetColorArray` in Unity? Explain its purpose and usage.
Material.GetColorArray Declaration public Color[] GetColorArray (string name ); Declaration public Color[] GetColorArray (int nameID ); Parameters Parameter Description nameID The name ID of the property retrieved by Shader.PropertyToID . name The name of the property. Description Get a named colo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_27df92850088
unity_docs
ui
Explain 'Dispatch events' in Unity.
The event system listens for events that come from the operating system or scripts , then uses the EventDispatcher to dispatch those events to visual elements . The event dispatcher determines an appropriate dispatching strategy for each event it sends. Once determined, the dispatcher executes the strategy. Visual elem...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_175839b3b551
github
scripting
Write a Unity Editor script for Joint Rotation Config List Editor
```csharp /* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * Licensed under the Oculus SDK License Agreement (the "License"); * you may not use the Oculus SDK except in compliance with the License, * which is provided at the time of installation or download, or which * otherwise a...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_12e7ad56400f
unity_docs
scripting
What is `Quaternion.Equals` in Unity? Explain its purpose and usage.
Quaternion.Equals Declaration public bool Equals (object other ); Declaration public bool Equals ( Quaternion other ); Parameters Parameter Description other The quaternion to compare with. Returns bool true if the quaternion components (x, y, z, w) are exactly equal. Description Performs exac...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8ff50e226eb1
unity_docs
scripting
Explain 'Introduction to SerializedObject data binding' in Unity.
You can use the SerializedObject data binding system to bind to serialized properties . This means you can bind visual elements to the following objects that are compatible with the Serialization system : User-defined ScriptableObject classes User-defined MonoBehaviour classes Native Unity component types Native Unity ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6463dc469efb
unity_docs
ui
What is `UIElements.UQueryState_1.RebuildOn` in Unity? Explain its purpose and usage.
UQueryState<T0>.RebuildOn Declaration public UQueryState<T> RebuildOn ( UIElements.VisualElement element ); Parameters Parameter Description element The element on which to apply the selection rules. Returns UQueryState<T> A new QueryState with the same selection rules, applied on this element. Descr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_13155afc558d
unity_docs
editor
What is `EditorGUILayout.SelectableLabel` in Unity? Explain its purpose and usage.
EditorGUILayout.SelectableLabel Declaration public static void SelectableLabel (string text , params GUILayoutOption[] options ); Declaration public static void SelectableLabel (string text , GUIStyle style , params GUILayoutOption[] options ); Parameters Parameter Description text The text to show...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b1cafe28a4ab
unity_docs
scripting
Show me a Unity C# example demonstrating `ParticleSystem.MainModule.cullingMode`.
ParticleSystem.MainModule.cullingMode public ParticleSystemCullingMode cullingMode ; Description Configure whether the Particle System will still be simulated each frame, when it is offscreen. ```csharp using UnityEngine; using System.Collections;[RequireComponent(typeof(ParticleSystem))] public class Exampl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8ad39546a695
unity_docs
math
What is `EditorUserBuildSettings.explicitArrayBoundsChecks` in Unity? Explain its purpose and usage.
EditorUserBuildSettings.explicitArrayBoundsChecks public static bool explicitArrayBoundsChecks ; Description Are array bounds actively validated? Access to data outside array bounds will trigger a runtime exception.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_9906d693ec39
unity_docs
rendering
In Unity's 'Splash Image Player settings', what is 'Splash Screen' and how does it work?
Settings for displaying the splash screen. Setting Description Show Splash Screen Enable or disable the splash screen. Preview Load a preview of the splash screen in the Game view. The preview reflects the resolution and aspect ratio of the Game view. Splash Style Choose the color style of the Unity logo. Light on Dark...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2ac1e17f7b39
unity_docs
editor
What is `Profiling.IProfilerFrameTimeViewSampleSelectionController.SetSelection` in Unity? Explain its purpose and usage.
IProfilerFrameTimeViewSampleSelectionController.SetSelection Declaration public bool SetSelection ( Profiling.ProfilerTimeSampleSelection selection ); Parameters Parameter Description selection A fully described selection created via a the ProfilerTimeSampleSelection constructor or previously retrieved vi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f2fcb2329534
unity_docs
scripting
Show me a Unity code example for 'GradientField'.
ontrol that lets users set a color gradient from a Gradient Editor. Note : To align an element with other fields in an Inspector window, simply apply the.unity-base-field__aligned USS class to it. For more information, refer to BaseField . ## Create a GradientField You can create a GradientField with UI Builder, UXML...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f0c30822ac3c
unity_docs
animation
What is `Animations.AnimationScriptPlayable.GetProcessInputs` in Unity? Explain its purpose and usage.
AnimationScriptPlayable.GetProcessInputs Declaration public bool GetProcessInputs (); Returns bool true if the inputs will be processed; false otherwise. Description Returns whether the playable inputs will be processed or not. Additional resources: AnimationScriptPlayable.SetProcessInputs .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_20830fe3aaea
unity_docs
rendering
In Unity's 'Control material properties in the Inspector window', what is 'Create a custom editor class for a shader asset' and how does it work?
To define a custom editor for shader assets that represent a given Shader object , you create a script that inherits from the ShaderGUI class. Place your script in a folder named Editor , in your Assets folder. The script should follow this format: ```csharp using UnityEditor; public class ExampleShaderGUI : ShaderGUI...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9d5443f6441b
unity_docs
scripting
What is `UIElements.Experimental.PointerOutLinkTagEvent.ctor` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. PointerOutLinkTagEvent Constructor Declaration public PointerOutLinkTagEvent (); Description Constructor.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f43290b0f864
unity_docs
rendering
Show me a Unity C# example demonstrating `LineRenderer.SetPosition`.
etPosition (int index , Vector3 position ); Parameters Parameter Description index Which position to set. position The new position. Description Set the position of a vertex in the line. Consider using SetPositions instead, if setting multiple positions, as it is much faster than making individual fun...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e76b5460fc11
unity_docs
rendering
In Unity's 'Linear textures', what is 'Linear authored Textures' and how does it work?
It is also important that lookup Textures, masks, and other textures with RGB values that mean something specific and have no gamma correction applied to them bypass sRGB sampling. This prevents values from the sampled Texture having non-existent gamma correction removed before they are used in the Shader, with calcula...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.