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_9691cc14828b
unity_docs
rendering
What is `RenderTexture.enableRandomWrite` in Unity? Explain its purpose and usage.
RenderTexture.enableRandomWrite public bool enableRandomWrite ; Description Enable random access write into this render texture on Shader Model 5.0 level shaders. Shader Model 5.0 level pixel or compute shaders can write into arbitrary locations of some textures, called "unordered access views" in UsingDX11GL...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_c1e6bcdfdc44
github
scripting
Write a Unity C# physics script for Player Controller
```csharp using UnityEngine; public class PlayerController : MonoBehaviour { private static readonly int Speed = Animator.StringToHash("speed"); private static readonly int Grounded = Animator.StringToHash("grounded"); private static readonly int Property = Animator.StringToHash("throw"); public float ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2fac5ec8b953
unity_docs
math
What is `GUIStyle.GetCursorPixelPosition` in Unity? Explain its purpose and usage.
GUIStyle.GetCursorPixelPosition Declaration public Vector2 GetCursorPixelPosition ( Rect position , GUIContent content , int cursorStringIndex ); Description Get the pixel position of a given string index.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_c80d506b7855
unity_docs
physics
In Unity's 'Introduction to 2D', what is 'Gameplay in 2D' and how does it work?
The familiar functions of the Unity Editor when you use 3D mode are still available but with helpful additions to simplify 2D development. The most noticeable feature is the 2D view mode button in the toolbar of the Scene view. When you enable 2D mode, Unity will set an orthographic (perspective-free) view. This view m...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_4ddfae5222bf
github
scripting
Write a Unity C# script called Hand Ray
```csharp // Copyright (c) Mixed Reality Toolkit Contributors // Licensed under the BSD 3-Clause using UnityEngine; namespace MixedReality.Toolkit.Input { /// <summary> /// A hand ray which is used by far pointers to direct interactions. /// </summary> /// <remarks> /// This class is managed ...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_6a13491b5dd1
unity_docs
rendering
Give me an overview of the `LineTextureMode` class in Unity.
LineTextureMode enumeration Description Choose how textures are applied to Lines and Trails. Properties Property Description Stretch Map the texture once along the entire length of the line. Tile Repeat the texture along the line, based on its length in world units. To set the tiling rate, use Material.SetText...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f838201279b6
unity_docs
editor
Explain 'Revert a prefab instance to a GameObject' in Unity.
If you want to convert a prefab instance into a regular GameObject , you can use the Unpack command. Unity then unpacks the prefab instance into GameObjects but retains the original prefab asset. To use the Unpack command to convert a prefab instance into a GameObject, perform the following steps: In the Hierarchy , ri...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_220b541b9749
unity_docs
rendering
What is `Rendering.RayTracingInstanceCullingConfig.sphereRadius` in Unity? Explain its purpose and usage.
RayTracingInstanceCullingConfig.sphereRadius public float sphereRadius ; Description The radius of the sphere used for culling ray tracing instances associated with the Renderers in a Scene. To enable sphere culling, use RayTracingInstanceCullingFlags.EnableSphereCulling flag in RayTracingInstanceCullingConf...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_687d1ff6ba4a_doc_2
github
scripting
What does `IsValid` do in this Unity script? Explain its purpose and signature.
Check if node setup is validReturns true if node is configured correctly Signature: ```csharp public virtual bool IsValid() ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_229c9873706c
unity_docs
scripting
What is `Component.CompareTag` in Unity? Explain its purpose and usage.
Component.CompareTag Declaration public bool CompareTag (string tag ); Parameters Parameter Description tag The tag to compare. Returns bool Returns true if GameObject has same tag. Returns false otherwise. Description Checks the GameObject's tag against the defined tag . ```csharp // Immediate dea...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ff0f1a6859bd
unity_docs
scripting
What is `Handles.RadiusHandle` in Unity? Explain its purpose and usage.
Handles.RadiusHandle Declaration public static float RadiusHandle ( Quaternion rotation , Vector3 position , float radius , bool handlesOnly ); Declaration public static float RadiusHandle ( Quaternion rotation , Vector3 position , float radius ); Parameters Parameter Description rotation The...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_41da8c6abd57
unity_docs
scripting
Explain 'Control behavior with events' in Unity.
UI Toolkit provides events that communicate user actions or notifications to visual elements . The UI Toolkit event system shares the same terminology and event naming as HTML events . Topic Description Dispatch events Understand the event dispatch behavior, propagation, and target. Capture the pointer with a manipulat...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_385e194dd296
unity_docs
rendering
In Unity's 'iOS Player settings', what is 'Resolution' and how does it work?
Property Description Resolution Scaling Mode Use the Resolution Scaling Mode setting to set the scaling to be equal to or below the native screen resolution. Disabled :Scaling doesn’t apply and the application renders to its native screen resolution. Fixed DPI : When you select this value, the Target DPI property appea...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c593595eb7b4
unity_docs
scripting
What is `VideoEncodingProfile.H264High` in Unity? Explain its purpose and usage.
VideoEncodingProfile.H264High Description Encode video with the high profile. This profile is the most advanced encoding profile and has features designed for high-definition videos. This profile has the best compression and quality, however it takes more processing power.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0d6e328cfa60
unity_docs
scripting
What is `ChangeGameObjectParentEventArgs.previousParentInstanceId` in Unity? Explain its purpose and usage.
ChangeGameObjectParentEventArgs.previousParentInstanceId public int previousParentInstanceId ; Description The instance ID of the GameObject that was the previous parent of the target. Note that this is not the instance ID of its Transform .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6881d03bbdf8
unity_docs
rendering
What is `Texture3D.CopyPixels` in Unity? Explain its purpose and usage.
Texture3D.CopyPixels Declaration public void CopyPixels ( Texture src ); Declaration public void CopyPixels ( Texture src , int srcElement , int srcMip , int dstElement , int dstMip ); Declaration public void CopyPixels ( Texture src , int srcElement , int srcMip , int srcX , int srcY , int s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d8f2f19409f7
unity_docs
editor
What is `SerializedObject.GetIterator` in Unity? Explain its purpose and usage.
SerializedObject.GetIterator Declaration public SerializedProperty GetIterator (); Description Get the first serialized property. You can use this to go over all properties of the target object. Typically, when the desired field name is known, it is better to use FindProperty to retrieve the associated Ser...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b33bc41c67ed
unity_docs
scripting
Show me a Unity C# example demonstrating `Transform.localRotation`.
Transform.localRotation public Quaternion localRotation ; Description The rotation of the transform relative to the transform rotation of the parent. Unity stores rotations as Quaternions internally. To rotate an object, use Transform.Rotate . Use Transform.localEulerAngles for modifying the rotation as e...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_421e5421cffb
unity_docs
scripting
What is `RenderSettings.reflectionBounces` in Unity? Explain its purpose and usage.
RenderSettings.reflectionBounces public static int reflectionBounces ; Description The number of times a reflection includes other reflections. Defines in how many passes reflections are calculated. In a given pass, the Scene is rendered into a cubemap with the reflections calculated in the previous pass applie...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f279e535c6c7
unity_docs
scripting
What is `Video.VideoPlayer.TimeEventHandler` in Unity? Explain its purpose and usage.
VideoPlayer.TimeEventHandler Declaration public delegate void TimeEventHandler ( Video.VideoPlayer source , double seconds ); Parameters Parameter Description source The VideoPlayer that is emitting the event. seconds Time position. Description Delegate type for VideoPlayer events that carry a time...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e1a98ac16d5a
unity_docs
physics
What is `TerrainHeightmapSyncControl.HeightOnly` in Unity? Explain its purpose and usage.
TerrainHeightmapSyncControl.HeightOnly Description Synchronizes only height data of the heightmap texture from the GPU back to CPU memory. This option forces the tessellation level to maximum on the modified heightmap region. Use TerrainData.SyncHeightmap afterward to rectify the tessellation.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0ac0f113bb1c
unity_docs
scripting
What is `IMGUI.Controls.TreeView.DragAndDropArgs.parentItem` in Unity? Explain its purpose and usage.
TreeView.DragAndDropArgs.parentItem public IMGUI.Controls.TreeViewItem parentItem ; Description The parent item is set if the drag is either upon this item or between two of its children. Use this value to determine if the drag is value and what happens when items are dropped. Additional resources: insertAtIn...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a83cc94a21b3
unity_docs
scripting
What are the parameters of `Unity.Collections.LowLevel.Unsafe.UnsafeUtility.MallocTracked` in Unity?
Returns void* A pointer to the allocated memory block. Manage this pointer diligently, ensuring it is freed appropriately to prevent memory leaks and accessing invalid memory. Description Allocates a block of memory with specified size, alignment, and tracking information. The MallocTracked method allocates memory whil...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_31d566042428
unity_docs
rendering
Give me an overview of the `ICameraLensData` class in Unity.
ICameraLensData interface in UnityEditor Description Implements this interface on a Viewpoint<T0> to define a camera frustum when a Viewpoint is enabled in the Cameras Overlay. These fields can be modified in the Scene view: Field of View Orthographic mode Orthographic size Properties Property Descriptio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6cd8aefb5759
unity_docs
physics
What is `RelativeJoint2D` in Unity? Explain its purpose and usage.
RelativeJoint2D class in UnityEngine / Inherits from: Joint2D / Implemented in: UnityEngine.Physics2DModule Description Keeps two Rigidbody2D at their relative orientations. Two Rigidbody2D connected together with this joint will have forces applied to them to keep them both at their relative linear and a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0b2fc8529a15
unity_docs
physics
What is `Rigidbody.automaticCenterOfMass` in Unity? Explain its purpose and usage.
Rigidbody.automaticCenterOfMass public bool automaticCenterOfMass ; Description Whether or not to calculate the center of mass automatically. If enabled, the center of mass is calculated automatically based on the settings of attached Collider s. If no colliders are present, the center of mass has a default v...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_29c758d9af64
unity_docs
editor
What is `Menu` in Unity? Explain its purpose and usage.
Menu class in UnityEditor Description Provides methods to manipulate a menu item. Constructors Constructor Description Menu Default constructor. Static Methods Method Description GetChecked Gets the check status of a menu item. GetEnabled Gets the enabled status of a menu item. SetChecked Sets the check ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4c4ca7851b79
unity_docs
networking
What is `Android.AndroidOrientation.Undefined` in Unity? Explain its purpose and usage.
AndroidOrientation.Undefined Description Mirrors the Android property value ORIENTATION_UNDEFINED . For information about the property value, refer to the Android developer documentation on ORIENTATION_UNDEFINED .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_2329a7941cc1_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
The buttons on the controller that will trigger a transition to the Teleport Controller. Signature: ```csharp public List<InputHelpers.Button> activationButtons ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_68c777dab90b
unity_docs
scripting
Show me a Unity C# example demonstrating `NetworkReachability.ReachableViaCarrierDataNetwork`.
NetworkReachability.ReachableViaCarrierDataNetwork Description Network is reachable via carrier data network. ```csharp //Attach this script to a GameObject //This script checks the device’s ability to reach the internet and outputs it to the console windowusing UnityEngine;public class Example : MonoBehaviour { s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7c5ab0eff761
unity_docs
rendering
What is `Rendering.RenderQueue.AlphaTest` in Unity? Explain its purpose and usage.
RenderQueue.AlphaTest Description Alpha tested geometry uses this queue. It’s a separate queue from Geometry one since it’s more efficient to render alpha-tested objects after all solid ones are drawn. Additional resources: Material.renderQueue , Shader.renderQueue , subshader tags .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_0fa93753e642
github
scripting
Write a Unity C# script called Improved Spawn System
```csharp using System.Collections.Generic; using TinyECS.Impls; using TinyECS.Interfaces; using TinyECSUnityIntegration.Interfaces; using UnityEngine; /// <summary> /// This class will use all the power that TinyECS provides /// </summary> public class ImprovedSpawnSystem : BaseReactiveSystem { protected IWorld...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_a5133f1bf867
unity_docs
rendering
What is `CustomRenderTexture.updatePeriod` in Unity? Explain its purpose and usage.
CustomRenderTexture.updatePeriod public float updatePeriod ; Description The period in seconds that Unity updates real-time Custom Render Textures. A value of 0.0 means Unity updates real-time Custom Render Textures every frame.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ee4bb3114b4c
unity_docs
editor
Show me a Unity C# example demonstrating `PlayerSettings.Android.defaultWindowWidth`.
PlayerSettings.Android.defaultWindowWidth public static int defaultWindowWidth ; Description The default horizontal size of the Android Player window in pixels. On Android phones and tablets that support multiple windows, this controls the width of the window when in the popup window mode. ```csharp using Uni...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d525448000c7
unity_docs
rendering
What is `LightBakingOutput` in Unity? Explain its purpose and usage.
LightBakingOutput struct in UnityEngine / Implemented in: UnityEngine.CoreModule Description Struct describing the result of a Global Illumination bake for a given light. The example below demonstrates how you can check the baked status of a light and change its active state. ```csharp using UnityEngine; using...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9b5c34692937
unity_docs
math
What are the parameters of `Tilemaps.Tilemap.SetTilesBlock` in Unity?
Description Fills bounds with array of Tile s. This is meant for a more performant way to set Tiles as a batch, when compared to calling SetTile for every single Tile. The bounds size must match the array size. For example bounds of 1x2x3 needs an array length of 6. ```csharp // Fill area on Tilemap with checkerboard p...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c0370f4d293e
unity_docs
math
What is `Vector2.Dot` in Unity? Explain its purpose and usage.
Vector2.Dot Declaration public static float Dot ( Vector2 lhs , Vector2 rhs ); Description Dot Product of two vectors. Returns lhs . rhs . For normalized vectors Dot returns 1 if they point in exactly the same direction; -1 if they point in completely opposite directions; and a number in between for o...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_65f8a774faba
unity_docs
ui
Show me a Unity code example for 'Scroller'.
A Scroller lets users scroll through content in your user interface. ## Create a Scroller You can create a Scroller with UI Builder, UXML, or C#. The following C# example creates a Scroller with a default value, low limit, and high limit, and sets the direction of the Scroller: ``` var scroller = new Scroller(); scro...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8a6063ab1152
unity_docs
rendering
Give me an overview of the `RenderTextureMemoryless` class in Unity.
RenderTextureMemoryless enumeration Description Flags enumeration of the render texture memoryless modes. Additional resources: RenderTexture.memorylessMode , RenderTexture . Properties Property Description None The render texture is not memoryless. Color Render texture color pixels are memoryless when Rend...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6ed56ca8a64d
unity_docs
scripting
Explain 'Cameras overlay' in Unity.
Use the Cameras overlay to take first-person control of cameras and manage cameras in the Scene view. To display the Cameras overlay in the Scene view , enable it from the Overlays menu . ## Select a camera The Cameras overlay lists every GameObject with a Camera or Cinemachine Camera component in the open scene in a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ebc0d546415e
unity_docs
scripting
What is `ParticleSystem.sizeOverLifetime` in Unity? Explain its purpose and usage.
ParticleSystem.sizeOverLifetime public ParticleSystem.SizeOverLifetimeModule sizeOverLifetime ; Description Script interface for the SizeOverLifetimeModule of a Particle System. This module controls the size of particles throughout their lifetime. Particle System modules do not need to be reassigned back to...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7f855db00876
unity_docs
rendering
What is `LightingSettings.filterTypeDirect` in Unity? Explain its purpose and usage.
LightingSettings.filterTypeDirect public LightingSettings.FilterType filterTypeDirect ; Description Specifies the filter kernel that the Progressive Lightmapper uses for the direct lighting. (Editor only). When this is set to None , the Progressive Lightmapper does not filter direct lighting. When this is s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_238c0531c613
github
scripting
Write a Unity C# UI script for My Mono Behaviour
```csharp using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace BuffInteritance { public class MyMonoBehaviour : MonoBehaviour { protected IEnumerator DelayedCoroutine(float delay, System.Action a) { yiel...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_64389f99d41a
unity_docs
audio
Show me a Unity C# example demonstrating `AudioEchoFilter.dryMix`.
AudioEchoFilter.dryMix public float dryMix ; Description Volume of original signal to pass to output. 0.0 to 1.0. Default = 1.0. ```csharp using UnityEngine;[RequireComponent(typeof(AudioSource))] [RequireComponent(typeof(AudioEchoFilter))] public class Example : MonoBehaviour { // Listen to only Echo (not th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8bab1bc7f6ad
unity_docs
scripting
What is `MonoBehaviour.OnTriggerEnter` in Unity? Explain its purpose and usage.
MonoBehaviour.OnTriggerEnter(Collider) Parameters Parameter Description other The other Collider involved in this collision. Description Called when a collider enters a trigger collider. OnTriggerEnter is called on whichever iteration of the physics FixedUpdate loop Unity first detects that the collider ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_b1569bcdb10c
unity_docs
rendering
In Unity's 'Choose a GPU texture format by platform', what is 'Desktop' and how does it work?
For devices with DirectX 11 or better class GPUs, where support for BC7 and BC6H formats is guaranteed to be available, the recommended choice of compression formats is: RGB textures - DXT1 at four bits/ pixel . RGBA textures - BC7 (higher quality, slower to compress) or DXT5 (faster to compress), both at eight bits/pi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7b8043778a8a
unity_docs
xr
What is `LocationService.isEnabledByUser` in Unity? Explain its purpose and usage.
LocationService.isEnabledByUser public bool isEnabledByUser ; Description Indicates whether the device allows the application to access the location service. Check this property before you start location updates to determine if the device has location services enabled and that the application has access to them...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_78d8377bbdd2
unity_docs
editor
What is `PrefabUtility.RevertRemovedGameObject` in Unity? Explain its purpose and usage.
PrefabUtility.RevertRemovedGameObject Declaration public static void RevertRemovedGameObject ( GameObject gameObjectInInstance , GameObject assetGameObject , InteractionMode action ); Parameters Parameter Description gameObjectInInstance A GameObject in the Prefab instance containing the removed GameO...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6f93c7614d48
unity_docs
scripting
What are the parameters of `SceneManagement.SceneManager.activeSceneChanged` in Unity?
Description Subscribe to this event to get notified when the active Scene has changed. This script added to activeSceneChanged takes two hidden arguments. These are the replaced Scene and the next Scene. The arguments are not visible. In the Editor this event is sent only in Play mode (not in Edit mode). If the event...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e19744f7e746
unity_docs
rendering
Explain 'Profiler modules' in Unity.
The Profiler window contains modules which display different types of data. You can select from default modules, or create your own custom modules to display data specific to your application. Topic Description Profiler modules introduction Add Profiler modules to the Profiler window to collect specific data about your...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_14983dc363c2
unity_docs
scripting
What is `UIElements.Label` in Unity? Explain its purpose and usage.
Label class in UnityEngine.UIElements / Inherits from: UIElements.TextElement / Implemented in: UnityEngine.UIElementsModule Description Provides an Element displaying text. For more information, refer to UXML element Label . Static Properties Property Description ussClassName USS class name of eleme...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5027f476cf27
unity_docs
editor
What is `Search.SearchIndexer.SaveBytes` in Unity? Explain its purpose and usage.
SearchIndexer.SaveBytes Declaration public byte[] SaveBytes (); Returns byte[] Bytes representation of the index. Description Get the bytes representation of this index. See SearchIndexer.Write . ```csharp using System.IO; using UnityEditor; using UnityEditor.Search; using UnityEngine; static class Exam...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_4a228497e0d1
unity_docs
ui
Explain 'Use bar sliders' in Unity.
A bar slider lets you allocate sections of a whole. For example, the level of detail (LOD) Group component uses a bar slider to define transitions between the levels. All levels together make up 100%. To change allocations, drag the divider between two sections left or right. This changes both sections at the same time...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_42b5b7515554
unity_docs
scripting
What are the parameters of `Unity.IO.LowLevel.Unsafe.AsyncReadManager.OpenFileAsync` in Unity?
Returns FileHandle The FileHandle of the file being opened. Use the FileHandle to check the status of the open operation, to read the file, and to close the file when done. Description Opens the file asynchronously. Note: WebGL builds do not support using AsyncReadManager to open files from a remote web server; for exa...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fcb9fe08047a
unity_docs
rendering
What is `ParticleSystemJobs.IJobParticleSystemParallelForBatch` in Unity? Explain its purpose and usage.
IJobParticleSystemParallelForBatch interface in UnityEngine.ParticleSystemJobs Description Inherit from this interface to implement a Particle System job. Additional resources: IJobParticleSystemParallelForBatch.Execute . Public Methods Method Description Execute Implement this method to access and modify pa...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_45b538dbed62
unity_docs
rendering
What is `Mesh.MeshData.vertexCount` in Unity? Explain its purpose and usage.
Mesh.MeshData.vertexCount public int vertexCount ; Description Gets the number of vertices in the MeshData . (Read Only) vertexCount determines the number of elements in all vertex attribute arrays, including positions ( GetVertices ), normals ( GetNormals ), and texture coordinates ( GetUVs ). Additional re...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a53d73a6205c
unity_docs
rendering
What is `LightingDataAsset.SetLights` in Unity? Explain its purpose and usage.
LightingDataAsset.SetLights Declaration public void SetLights (Light[] lights ); Parameters Parameter Description lights The array of Lights to overwrite the LightingDataAssets storage with. Description Overwrites the Lights referenced by a LightingDataAsset. This method can be used to change per-light da...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_059e86163d04
unity_docs
animation
What is `ModelImporter.animationPositionError` in Unity? Explain its purpose and usage.
ModelImporter.animationPositionError public float animationPositionError ; Description Allowed error of animation position compression. Allowed error is defined in distance (in percents) between compressed and original positions on a curve. This settings used only when animation keyframe reduction is enabled. A...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1a66f15ecedc
unity_docs
scripting
What is `Experimental.GraphView.IDropTarget.DragEnter` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. IDropTarget.DragEnter Declaration public bool DragEnter ( UIElements.DragEnterEvent evt , IEnumerable<ISelectable> selection , Experimental.GraphView.IDropTarget enteredTarget , Experimental.GraphView.ISelection dragSour...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_0fb057e63299
unity_docs
editor
Explain 'WebGL Publisher' in Unity.
com.unity.connect.share ## Description This tool allows you to make a WebGL build of your current project and upload it to Unity’s website, where it can be shared with others. ## Released for Unity Package version 4.2.4 is released for Unity Editor version 6000.0.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_46ee037637a4
unity_docs
rendering
Explain 'Create a shader variant collection' in Unity.
A shader variant collection is effectively a list of shader variants . Use shader variant collections to prewarm shader variants , or to ensure that shader variants that are required at runtime but not referenced in a scene are not excluded (“stripped”) from your build. ## Create a shader variant collection asset You...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5ff0befb3340
unity_docs
scripting
What is `SceneManagement.EditorSceneManager.SceneSavingCallback` in Unity? Explain its purpose and usage.
EditorSceneManager.SceneSavingCallback Declaration public delegate void SceneSavingCallback ( SceneManagement.Scene scene , string path ); Parameters Parameter Description scene The Scene to be saved. path The path to which the Scene is saved. Description Callbacks of this type which have been added to...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_95b358e85e17
unity_docs
editor
What is `Profiling.FrameDataView.MarkerInfo` in Unity? Explain its purpose and usage.
MarkerInfo struct in UnityEditor.Profiling Description Marker descriptor structure. Provides information about the marker. Additional resources: GetMarkers . Properties Property Description category Marker category. flags Marker flags. id Marker identifier. metadataInfo Metadata information. name Marker ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_ba8c0600af03
unity_docs
input
Show me a Unity code example for 'Create a slide toggle custom control'.
lass Create the slide toggle class with a C# script. Create a Unity project with the 3D template. A 3D template has a better visual effect for this example. However, you can use any template. Create a folder named slide-toggle to store your files. In the slide-toggle folder, create a C# script named SlideToggle.cs . O...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2c7855f49cec
unity_docs
input
Show me a Unity C# example demonstrating `Search.SearchExpression.GetFormatString`.
Str Extracted format string. Returns bool Returns true if the SearchExpression was succesfully converted to a format string. Description Extract a format string from a given expression. This function should be used to extract a format string from an input parameter of a SearchExpression. For example: the evalu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_236e15850e7d
unity_docs
scripting
Explain 'Transcode your video files' in Unity.
To enable transcoding for your video files, you need to change the settings in the Video Clip Importer settings. Follow these steps: ## Access and configure the transcoding settings To transcode your video files: Select your video clip asset . The Inspector window shows the Video Clip Import Settings . Enable Transco...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_9ec05ce32376
unity_docs
scripting
In Unity's 'APK expansion files in Unity', what is 'APK compatibility' and how does it work?
When you create the patch expansion file, you must include a unity_obb_guid file within it so Android recognizes the APK expansion as being compatible with the APK. To do this: Find the main APK expansion file that Unity generates. It’s a zip archive. Extract the files from the APK expansion zip archive. In the list of...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c311597f8acf
unity_docs
scripting
What is `MPE.ChannelService.UnregisterMessageHandler` in Unity? Explain its purpose and usage.
ChannelService.UnregisterMessageHandler Declaration public static void UnregisterMessageHandler (string channelName , Action<int,byte[]> handler ); Parameters Parameter Description channelName The channel to stop processing messages on. handler The handler to unregister. Description Unregisters a specif...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_438bcb27fd32
unity_docs
editor
Show me a Unity C# example demonstrating `QualitySettings.GetActiveQualityLevelsForPlatform`.
aration public static int[] GetActiveQualityLevelsForPlatform (string buildTargetGroupName ); Parameters Parameter Description buildTargetGroupName The platform target. Returns int[] The array with the Quality Level indexes that are selected for the given platform. Description [Editor Only] Obtains an ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_bdd056eb5758
unity_docs
editor
Explain 'Analyzing AssetBundles' in Unity.
Unity provides several tools to inspect the internal structure and contents of AssetBundles to help with troubleshooting. ## WebExtract and binary2text WebExtract and binary2text are low-level command-line tools included with every Unity Editor installation. WebExtract : Extracts the files embedded within an AssetBun...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0f607a447a69
unity_docs
physics
Give me an overview of the `HingeJoint` class in Unity.
HingeJoint class in UnityEngine / Inherits from: Joint / Implemented in: UnityEngine.PhysicsModule Description The HingeJoint groups together 2 rigid bodies, constraining them to move like connected by a hinge. This joint is great for, well, doors, but can also be used to model chains, etc... The HingeJoint ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_08d7e6b7d60d
unity_docs
ui
Show me a Unity code example for 'Customize the GUI for your audio plug-in'.
-ins, it searches for corresponding GUI files that match the names of the registered plug-ins. To make sure Unity links your custom GUI to your plug-in: Open your custom GUI class. Make sure your GUI class inherits from IAudioEffectPluginGUI . Override the Name property of your class so it is the same as your plug-in. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_f522b91ce703_doc_26
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Represents an object which can receive three or more arguments as part of its initialization process,with the third one being an object of type . Type of the third argument. Signature: ```csharp public interface IThirdArgument<TThirdArgument> ```
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_1c703a4c5285
unity_docs
rendering
Show me a Unity C# example demonstrating `LineRenderer.SetPositions`.
n the line. This method is preferred to SetPosition when setting all positions, as it is more efficient to set all positions using a single command than to set each position individually. Note that positionCount must be called before SetPositions . Also SetPositions ignores points with indices beyond positionC...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_dd7faf13c34d
unity_docs
rendering
Give me an overview of the `ParticleSystemGameObjectFilter` class in Unity.
ParticleSystemGameObjectFilter enumeration Description The particle GameObject filtering mode that specifies which objects are used by specific Particle System modules. Properties Property Description LayerMask Include objects based on a layer mask, where all objects that match the mask are included. List Incl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_edf17a5876c3
unity_docs
physics
What is `Unity.IntegerTime.RationalTimeExtensions.Convert` in Unity? Explain its purpose and usage.
RationalTimeExtensions.Convert Declaration public static Unity.IntegerTime.RationalTime Convert ( Unity.IntegerTime.RationalTime time , Unity.IntegerTime.RationalTime.TicksPerSecond rate ); Parameters Parameter Description t The value to convert. r The new Rate. Returns RationalTime A new instanc...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_989b0a82ed34
unity_docs
animation
What is `Tilemaps.TileAnimationFlags.SyncAnimation` in Unity? Explain its purpose and usage.
TileAnimationFlags.SyncAnimation Description When set, this will sync the start time of this Tile Animation with other Tile Animations that are the same. This will not affect Tile Animations that are changed using Tilemap.SetAnimationTime or Tilemap.SetAnimationFrame .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3988ac8af12e
unity_docs
animation
In Unity's 'Importing a model with non-humanoid (generic) animations', what is 'Creating an Avatar Mask' and how does it work?
You can apply masking to animation clips either during import time, or at runtime. Masking during import time is preferable, because it allows the discarded animation data to be omitted from your build, making the files smaller and therefore using less memory. It also makes for faster processing because there is less a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8294a14f4f19
unity_docs
animation
Give me an overview of the `AnimatorClipInfo` class in Unity.
AnimatorClipInfo struct in UnityEngine / Implemented in: UnityEngine.AnimationModule Description Information about clip being played and blended by the Animator. Additional resources: Animator.GetCurrentAnimatorClipInfo and Animator.GetNextAnimatorClipInfo . ```csharp //Create a GameObject and attach an Ani...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_dd15ddb7d43c
unity_docs
scripting
Explain 'Upgrade an asset package for the Asset Store' in Unity.
An upgrade gives customers who own one of your packages a discount on another package you own. Both packages exist on the Asset Store at the same time. You can set a specific price, or set the upgrade price to $0, to provide the target package for free. ## Upgrade types You can apply the following upgrade types: Majo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_49e7d1ba71fd
unity_docs
scripting
Show me a Unity C# example demonstrating `SystemInfo.graphicsDeviceVersion`.
n square brackets. In case of Direct3D9 API, the returned string will contain " Direct3D 9.0c " followed by driver name and version in square brackets. In case of Direct3D11 API, the returned string will contain " Direct3D 11.0 " followed by feature level in square brackets. Additional resources: SystemInfo.graphicsDe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b9ff36c3c46f
unity_docs
rendering
What are the parameters of `Search.SearchContextAttribute.ctor` in Unity?
Description Search context constructor used to add some search context to an object field. ```csharp const string assetProviders = "adb;asset"; const string objectProviders = "adb,asset,scene"; const SearchViewFlags pickerMinimalUIFlags = SearchViewFlags.Packages | SearchViewFlags.IgnoreSavedSearches | SearchVi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_420485cade9e
unity_docs
rendering
What is `ParticleSystem.RotationBySpeedModule.yMultiplier` in Unity? Explain its purpose and usage.
ParticleSystem.RotationBySpeedModule.yMultiplier public float yMultiplier ; Description Speed multiplier along the y-axis. Changing this property is more efficient than accessing the entire curve, if you only want to change the overall speed multiplier. ```csharp using UnityEngine; using System.Collections;[R...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b9f0b7e24c86
unity_docs
rendering
What is `SpeedTreeImporter.materialLocation` in Unity? Explain its purpose and usage.
SpeedTreeImporter.materialLocation public SpeedTreeImporter.MaterialLocation materialLocation ; Description Material import location options. When importing a new model, Unity imports materials as either external assets or sub-assets, based on this property. Additional resources: MaterialLocation .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f8cca4de8ef3
unity_docs
scripting
What is `PopupWindow` in Unity? Explain its purpose and usage.
PopupWindow class in UnityEditor / Inherits from: EditorWindow Description Class used to display popup windows that inherit from PopupWindowContent . Popup Windows are borderless, and not draggable or resizable. They also will automatically close when they lose focus. They are intended to show short-lived info...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5627f94e06db
unity_docs
ui
What is `EditorPrefs.SetFloat` in Unity? Explain its purpose and usage.
EditorPrefs.SetFloat Declaration public static void SetFloat (string key , float value ); Parameters Parameter Description key Name of key to write float into. value Float value to write into the storage. Description Sets the float value of the preference identified by key . ```csharp // Simple script...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d07171c8e7e4
unity_docs
scripting
Explain 'Draw order' in Unity.
The draw order of elements in the visual tree follows a depth-first search. Child visual elements appear on top of parent elements. UI Toolkit draws child elements in the order of the sibling list. The draw order is the following: The top visual element. The first child element of that visual element. The child element...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1843ffded8bd
unity_docs
scripting
What is `Experimental.GraphView.GraphView` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphView class in UnityEditor.Experimental.GraphView / Inherits from: UIElements.VisualElement Implements interfaces: ISelection Description Main GraphView class. Properties Property Description canPasteSerializedData A...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f62aeea7240b
unity_docs
rendering
Give me an overview of the `TextureImporterCompression` class in Unity.
TextureImporterCompression enumeration Description Select the kind of compression you want for your texture. Properties Property Description Uncompressed Texture will not be compressed. Compressed Texture will be compressed using a standard format depending on the platform (DXT, ASTC, ...). CompressedHQ Textu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_7c6a44f8dde1
github
scripting
Write a Unity C# script called Grabbing Rule
```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 a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_8973f3810f66
unity_docs
rendering
Show me a Unity C# example demonstrating `Search.SearchExpressionType.Selector`.
SearchExpressionType.Selector Description Denote an expression representing a selector. All selector starts with @. For example @size in expression: select{t:material, @size}. ```csharp [Description("Convert arguments to a string allowing you to format the result.")] [SearchExpressionEvaluator(SearchExpressionType....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3824c6b17846
unity_docs
rendering
What is `Rendering.CommandBuffer.SetupCameraProperties` in Unity? Explain its purpose and usage.
CommandBuffer.SetupCameraProperties Declaration public void SetupCameraProperties ( Camera camera ); Parameters Parameter Description camera Camera to setup shader variables for. Description Schedules the setup of Camera specific global Shader variables. This function sets up view, projection and clippin...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a9f6d5382b04
unity_docs
ui
Give me an overview of the `RangeAttribute` class in Unity.
RangeAttribute class in UnityEngine / Inherits from: PropertyAttribute / Implemented in: UnityEngine.CoreModule Description Attribute used to make a float or int variable in a script be restricted to a specific range. When this attribute is used, the float or int will be shown as a slider in the Inspector ins...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_88c85a6cdf2e_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
A base class for MonoBehaviours that can beinstantiatedor addedto a with an argument passed to the function of the created instance.Instances of classes inheriting from receive the argumentvia the method where it can be assigned to a member field or property. Type of the argument received in the function. Signatu...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_0875854ecf19
unity_docs
xr
What is `Android.AndroidAssetPacks.coreUnityAssetPacksDownloaded` in Unity? Explain its purpose and usage.
AndroidAssetPacks.coreUnityAssetPacksDownloaded public static bool coreUnityAssetPacksDownloaded ; Description Checks if all core Unity asset packs are downloaded. Returns true if all core Unity asset packs are downloaded. Otherwise, returns false . This also returns false if the PlayCore plugin is missing...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_70a92a88ec4e
unity_docs
scripting
Explain 'Loading assets from AssetBundles' in Unity.
To load assets from an AssetBundle, you must first load the AssetBundle itself and then load the assets from it. ## Loading AssetBundles You can use the following APIs to load AssetBundles: The static Load methods on the AssetBundle class, for example AssetBundle.LoadFromFile . This class has a range of loading metho...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1ce183010907
unity_docs
animation
What is `Animator.GetAnimatorTransitionInfo` in Unity? Explain its purpose and usage.
Animator.GetAnimatorTransitionInfo Declaration public AnimatorTransitionInfo GetAnimatorTransitionInfo (int layerIndex ); Parameters Parameter Description layerIndex The layer's index. Returns AnimatorTransitionInfo An AnimatorTransitionInfo with the informations on the current transition. Descri...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e45c2595b080
unity_docs
scripting
What is `QualitySettings.SetLODSettings` in Unity? Explain its purpose and usage.
QualitySettings.SetLODSettings Declaration public static void SetLODSettings (float lodBias , int maximumLODLevel , bool setDirty ); Parameters Parameter Description lodBias Global multiplier for the LOD's switching distance. maximumLODLevel A maximum LOD level. All LOD groups. setDirty If true, marks...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_b63447500a9a_doc_12
github
scripting
What does `InvokeDismissalAfterAnimation` do in this Unity script? Explain its purpose and signature.
Coroutine to set the animation trigger, wait for the animation to finish,and then hide the dialog and invoke the dismissal action. This coroutineis started by the base method once all listenershave been removed. Signature: ```csharp private IEnumerator InvokeDismissalAfterAnimation() ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_acb4b292f64f
unity_docs
editor
What are the parameters of `AssetModificationProcessor.CanOpenForEdit` in Unity?
Returns void Returns true if all files can be opened for editing. Description This is called by Unity when inspecting assets to determine if they can potentially be opened for editing. This is called by Unity's own systems, but you can also call it if you are implementing your own Editor tools such as a custom version ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.