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
gh_d2784b5a56c4
github
scripting
Write a Unity C# XR/VR script for Finger Raw Pinch Injector
```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_c1789c596cc3
unity_docs
scripting
What is `AndroidJNI.SetStaticBooleanField` in Unity? Explain its purpose and usage.
AndroidJNI.SetStaticBooleanField Declaration public static void SetStaticBooleanField (IntPtr clazz , IntPtr fieldID , bool val ); Description Sets the value of a static field in the specified object. Additional resources: Java Native Interface Specification (Oracle)
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_329533337dae
unity_docs
math
Show me a Unity C# example demonstrating `EditorPrefs.SetBool`.
EditorPrefs.SetBool Declaration public static void SetBool (string key , bool value ); Description Sets the value of the preference identified by key . Round rotations/positions and remember the active option. ```csharp using UnityEngine; using UnityEditor;public class EditorPrefsBoolExample : EditorWindow ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9e2955f33f88
unity_docs
animation
What are the parameters of `AnimatorOverrideController.ApplyOverrides` in Unity?
Description Applies the list of overrides on this Animator Override Controller. This function should be used as soon as you need to override more than two Animation Clips in the same frame. The function will notify the Animator to update all the internal bindings after processing the whole list. ```csharp using UnityEn...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_dd30b056469f
unity_docs
scripting
Give me an overview of the `WaitUntil` class in Unity.
WaitUntil class in UnityEngine / Inherits from: CustomYieldInstruction / Implemented in: UnityEngine.CoreModule Description Suspends the coroutine execution until the supplied delegate evaluates to true . WaitUntil can only be used with a yield statement in coroutines. The supplied delegate is executed ea...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_29ed0c0e6dcf
unity_docs
rendering
In Unity's 'Reflective Specular', what is 'Reflective Properties' and how does it work?
Note. Unity 5 introduced the Standard Shader which replaces this shader. This shader will simulate reflective surfaces such as cars, metal objects etc. It requires an environment Cubemap which will define what exactly is reflected. The main texture’s alpha channel defines the strength of reflection on the object’s surf...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0cb18fd27b1f
unity_docs
scripting
What is `ParticleSystem.MainModule.startSpeed` in Unity? Explain its purpose and usage.
ParticleSystem.MainModule.startSpeed public ParticleSystem.MinMaxCurve startSpeed ; Description The initial speed of particles when the Particle System first spawns them. Additional resources: MinMaxCurve . ```csharp using UnityEngine; using System.Collections;[RequireComponent(typeof(ParticleSystem))] pub...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_61e8cb49711e
unity_docs
editor
Explain 'Use the Advanced Object Picker' in Unity.
The Advanced Object Picker window is similar to the Search window in the following ways: It supports visual queries. It lists results in four tabs: All, Project, Resources, and Hierarchy. To learn more, refer to Search Providers . It has three views: grid, list, and table. It can display an Inspector panel for an item,...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_268323a8ef45
unity_docs
physics
What is `ConfigurableJoint.swapBodies` in Unity? Explain its purpose and usage.
ConfigurableJoint.swapBodies public bool swapBodies ; Description Enable this property to swap the order in which the physics engine processes the Rigidbodies involved in the joint. This results in different joint motion but has no impact on Rigidbodies and anchors. Prior to Unity 3.4, this was wrongfully appl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f40ca36a4f7b
unity_docs
scripting
What is `Search.PropertyDatabase.filePath` in Unity? Explain its purpose and usage.
PropertyDatabase.filePath public string filePath ; Description The file on which this PropertyDatabase is opened. Multiple PropertyDatabase s can be opened on different files, but only a single PropertyDatabase can be opened on a single file. You can do concurrent operations on a single instance of a Prop...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d50ab037ecff
unity_docs
editor
What is `Device.SystemInfo.graphicsDeviceID` in Unity? Explain its purpose and usage.
SystemInfo.graphicsDeviceID public static int graphicsDeviceID ; Description This has the same functionality as SystemInfo.graphicsDeviceID and also mimics platform-specific behavior in the Unity Editor.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_251916979d0d
unity_docs
physics
What is `ConfigurableJoint.slerpDrive` in Unity? Explain its purpose and usage.
ConfigurableJoint.slerpDrive public JointDrive slerpDrive ; Description Definition of how the joint's rotation will behave around all local axes. Only used if Rotation Drive Mode is Slerp Only.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c7a3e3ab79a8
unity_docs
editor
What is `Device.SystemInfo.maxGraphicsBufferSize` in Unity? Explain its purpose and usage.
SystemInfo.maxGraphicsBufferSize public static long maxGraphicsBufferSize ; Description The maximum size of a graphics buffer ( GraphicsBuffer , ComputeBuffer , vertex/index buffer, etc.) in bytes (Read Only). This property has the same functionality as SystemInfo.maxGraphicsBufferSize , and also mimics platf...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_0ba8d13bbb59
github
scripting
Write a Unity C# script called Sprite Animation System
```csharp using System.Collections; using System.Collections.Generic; using UnityEngine; public class SpriteAnimationSystem { [System.Serializable] public struct Animation { public Sprite sprites; public float length; } } ```
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_man_610fc69139d3
unity_docs
scripting
Explain 'Web templates' in Unity.
Use Web templates to control the appearance of the HTML page that hosts your Web Player. Important: To use the templates feature in the Web platform, you need prior knowledge of JavaScript concepts and terminology. Topic Description Using Web templates Find and use built-in and custom Web templates. Add a custom Web te...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_791fee9f7ea7
unity_docs
rendering
What is `Rendering.RenderPipelineAsset.defaultLineMaterial` in Unity? Explain its purpose and usage.
RenderPipelineAsset.defaultLineMaterial public Material defaultLineMaterial ; Returns Material Default material. Description Return the default Line Material for this pipeline. This is used whenever a LineRenderer is created in the Editor.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ac4cc60d0869
unity_docs
scripting
Show me a Unity C# example demonstrating `Networking.UploadHandlerRaw`.
UploadHandlerRaw class in UnityEngine.Networking / Inherits from: Networking.UploadHandler / Implemented in: UnityEngine.UnityWebRequestModule Description A general-purpose UploadHandler subclass, using a native-code memory buffer. This subclass copies input data into a native-code memory buffer at construc...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9e8a8de740ef
unity_docs
animation
What is `Animations.AnimatorStateMachine.AddEntryTransition` in Unity? Explain its purpose and usage.
AnimatorStateMachine.AddEntryTransition Declaration public Animations.AnimatorTransition AddEntryTransition ( Animations.AnimatorState destinationState ); Declaration public Animations.AnimatorTransition AddEntryTransition ( Animations.AnimatorStateMachine destinationStateMachine ); Parameters Parame...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_32260ac5c5bf
unity_docs
editor
Explain 'SerializedObject data binding' in Unity.
SerializedObject data binding binds the properties of a SerializedObject to the properties of a UI control. You can use this type of data binding only in the Editor UI. Topic Description Introduction to SerializedObject data binding Get started with SerializedObject data binding. Bindable elements Learn how to create b...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6a9927fe6284
unity_docs
editor
What is `Callbacks.RunBeforeClassAttribute` in Unity? Explain its purpose and usage.
RunBeforeClassAttribute class in UnityEditor.Callbacks Description Add this attribute to a callback method to mark that this callback must be run before any callbacks that are part of the specified class. To define dependencies for a callback, use the following attributes: RunAfterClassAttribute , RunBeforeClas...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0b0ff3c8c2b9
unity_docs
rendering
What is `Search.SearchProposition.ctor` in Unity? Explain its purpose and usage.
SearchProposition Constructor Declaration public SearchProposition (string label , string replacement , string help , int priority , Texture2D icon , object data , Color color ); Declaration public SearchProposition (string category , string label , string replacement , string help , int priority...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8622456e9a7c
unity_docs
rendering
Explain 'Mathematics' in Unity.
com.unity.mathematics ## Description Unity’s C# SIMD math library providing vector types and math functions with a shader like syntax. ## Released for Unity Package version 1.3.3 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_531ffa470bdd
unity_docs
rendering
In Unity's 'Apply GPU instancing for a Particle System in the Built-In Render Pipeline', what is 'Custom shader examples' and how does it work?
You can also write custom shaders that make use of GPU Instancing. See the following sections for more information: Particle system GPU Instancing in a Surface Shader Particle system GPU Instancing in a Custom Shader Customising instance data used by the Particle System (to work alongside Custom Vertex Streams)
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_3619a2f53add_doc_3
github
scripting
What does `Refresh` do in this Unity script? Explain its purpose and signature.
Refreshes the color of a position on a GridGrid to refresh colorPosition of the Grid to refresh color Signature: ```csharp public void Refresh(Grid grid, Vector3Int position) ```
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_man_60e0b342273f
unity_docs
editor
Explain 'Unity Editor analytics' in Unity.
The Unity Editor collects data about how the product gets used. Unity uses this data to make informed decisions on how to improve features in the Editor. Unity uses its own custom software to collect these analytics . ## Examples of analytics The following are examples of some of the analytics that Unity collects: Me...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_991498589ee8
unity_docs
input
What is `Input.stylusTouchSupported` in Unity? Explain its purpose and usage.
Input.stylusTouchSupported public static bool stylusTouchSupported ; Description Returns true when Stylus Touch is supported by a device or platform. Note : This API is part of the legacy Input Manager. The recommended best practice is that you don't use this API in new projects. For new projects, use the Input...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_6ab178b5fbe5_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Quick start helper - attach to any GameObject to test basic functionality Signature: ```csharp public class QuickStart : MonoBehaviour ```
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_e518952ad696
unity_docs
xr
What is `Networking.UnityWebRequest.downloadProgress` in Unity? Explain its purpose and usage.
UnityWebRequest.downloadProgress public float downloadProgress ; Description Returns a floating-point value between 0.0 and 1.0, indicating the progress of downloading body data from the server. (Read Only) Note: This property only works if the server’s response contains a Content-Length header and the UnityW...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d1654c42725d
unity_docs
scripting
What is `SceneManagement.SceneManager.MergeScenes` in Unity? Explain its purpose and usage.
SceneManager.MergeScenes Declaration public static void MergeScenes ( SceneManagement.Scene sourceScene , SceneManagement.Scene destinationScene ); Parameters Parameter Description sourceScene The Scene that will be merged into the destination Scene. destinationScene Existing Scene to merge the source ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c8c4b185d80d
unity_docs
scripting
What is `Unity.IO.Archive.ArchiveStatus` in Unity? Explain its purpose and usage.
ArchiveStatus enumeration Description Options for tracking the status of the archive operation. Properties Property Description InProgress Operation is currently in progress. Complete Operation finished successfully. Failed Operation failed.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6dca4559e095
unity_docs
rendering
Explain 'Texture and mesh loading' in Unity.
Unity can load texture and mesh data from disk and upload it to the GPU in two different ways: synchronously or asynchronously. These two processes are called the synchronous upload pipeline and the asynchronous upload pipeline. When Unity uses the synchronous upload pipeline, it cannot perform other tasks while it loa...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6362507590e6
unity_docs
performance
What is `BuildOptions.Development` in Unity? Explain its purpose and usage.
BuildOptions.Development Description Build a development version of the Player. A development build includes debug symbols and enables the Profiler . Additional resources: BuildPipeline.BuildPlayer .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6aa9f31e888a
unity_docs
networking
In Unity's 'Set up your Node.js server configuration for Web builds', what is 'Set up your index.js file' and how does it work?
To prepare your index.js file for use with Unity Web: Create a file in a text editor or IDE. Name the file index.js . Save your file in your Node.js project directory. Paste the following code into the file: ``` #!/usr/bin/env node const path = require('path'); const express = require('express'); // Create express app...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c63c91faecc4
unity_docs
math
Show me a Unity C# example demonstrating `Mathf.Atan2`.
Mathf.Atan2 Declaration public static float Atan2 (float y , float x ); Description Returns the angle in radians whose Tan is y/x . Return value is the angle between the x-axis and a 2D vector starting at zero and terminating at (x,y). Note: This function takes account of the cases where x is zero and re...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b9af7b6070ee
unity_docs
animation
What is `UIElements.IVisualElementScheduler` in Unity? Explain its purpose and usage.
IVisualElementScheduler interface in UnityEngine.UIElements Description A scheduler provides the functionality to queue actions to run at a specific time or duration. You can use the scheduler to create animations, update the UI, or create tasks that require a delay or repeated action. To schedule an act...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c2a06c54e6b2
unity_docs
xr
What is `GUIUtility.ExitGUI` in Unity? Explain its purpose and usage.
GUIUtility.ExitGUI Declaration public static void ExitGUI (); Description Puts the GUI in a state that will prevent all subsequent immediate mode GUI functions from evaluating for the remainder of the GUI loop by throwing an ExitGUIException . In Unity's immediate mode GUI system, the GUI loop procedes by call...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cf5c47158735
unity_docs
ui
What is `Experimental.GraphView.ISelectable.Unselect` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. ISelectable.Unselect Declaration public void Unselect ( UIElements.VisualElement selectionContainer ); Parameters Parameter Description selectionContainer Container in which selection is tracked. Description Deselect e...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_20574a54ece8
unity_docs
scripting
What is `Events.UnityEventTools.AddVoidPersistentListener` in Unity? Explain its purpose and usage.
UnityEventTools.AddVoidPersistentListener Declaration public static void AddVoidPersistentListener ( Events.UnityEventBase unityEvent , Events.UnityAction call ); Parameters Parameter Description unityEvent Event to modify. call Function to call. Description Adds a persistent, preset call to the list...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_dc8b14027d01
unity_docs
scripting
What is `Networking.UnityWebRequestAsyncOperation` in Unity? Explain its purpose and usage.
UnityWebRequestAsyncOperation class in UnityEngine.Networking / Inherits from: AsyncOperation / Implemented in: UnityEngine.UnityWebRequestModule Description Asynchronous operation object returned from UnityWebRequest.SendWebRequest (). You can yield until it continues, register an event handler with AsyncOp...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_23b2b64be931
unity_docs
scripting
In Unity's 'Package Manager troubleshooting', what is 'System-wide issues' and how does it work?
Network connection issues Error messages appear in the status bar when the Package Manager has detected an issue that isn’t related to a specific package. For example, if the Package Manager can’t access the package registry server , it displays this message in the status bar: Network error message Error refreshing ass...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7956dcd964dc
unity_docs
scripting
What is `ParticleSystem.MainModule.startSizeXMultiplier` in Unity? Explain its purpose and usage.
ParticleSystem.MainModule.startSizeXMultiplier public float startSizeXMultiplier ; Description A multiplier for ParticleSystem.MainModule.startSizeX . Changing this property is more efficient than accessing the entire curve, if you only want to change the overall size multiplier. ```csharp using UnityEngine;...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_d3f279891c5d
github
scripting
Write a Unity C# script called Image Fill
```csharp using GI.UnityToolkit.Utilities; using GI.UnityToolkit.Variables; using UnityEngine; using UnityEngine.UI; namespace GI.UnityToolkit.Components.UI.Variables { [RequireComponent(typeof(Image))] public class ImageFill : ImageComponent { [SerializeField] private FloatVariable floatVariable; ...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
gh_982c85173185_doc_9
github
scripting
What does `CancelCamera` do in this Unity script? Explain its purpose and signature.
Cancels camera movement for the current motion. Resets to use camera at the end of the touch motion. Signature: ```csharp public void CancelCamera() ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_a0a901dae6f8
unity_docs
scripting
Explain 'Managed memory introduction' in Unity.
Unity’s managed memory system is part of the C# scripting environment provided by either the Mono or IL2CPP Virtual Machines (VM) . The benefit of the managed memory system is that it manages the release of memory, so you don’t need to manually request the release of memory through your code. This virtual memory offers...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_38a1071e82e8
github
scripting
Write a Unity C# XR/VR script for Object Spawner
```csharp using System; using System.Collections.Generic; using UnityEngine.XR.Interaction.Toolkit.Utilities; namespace UnityEngine.XR.Interaction.Toolkit.Samples.StarterAssets { /// <summary> /// Behavior with an API for spawning objects from a given set of prefabs. /// </summary> public class ObjectS...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_f659c2ec7ffe
unity_docs
scripting
What is `GradientMode` in Unity? Explain its purpose and usage.
GradientMode enumeration Description Color interpolation mode used by Gradient . Additional resources: Gradient.mode , Gradient.Evaluate . Properties Property Description Blend Linearly interpolate between the gradient keys. Fixed Use a constant color between the keys. PerceptualBlend Linearly interpolate...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_45975c08dbad
unity_docs
rendering
What is `Rendering.BatchRendererGroup.RegisterMaterial` in Unity? Explain its purpose and usage.
BatchRendererGroup.RegisterMaterial Declaration public Rendering.BatchMaterialID RegisterMaterial ( Material material ); Parameters Parameter Description material Unity Material. Returns BatchMaterialID BatchRendererGroup Material ID. Description Registers a Material in BatchRendererGroup and re...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6dc2dd4467bb
unity_docs
physics
Explain 'Garbage collection modes' in Unity.
Unity’s garbage collector has the following modes: Incremental garbage collection : Enabled by default. This mode spreads out the process of garbage collection over multiple frames. Non-incremental garbage collection mode : If you disable the Incremental GC Player Setting ( Project Settings > Player > Configuration ), ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_19672be947a6
unity_docs
ui
In Unity's 'UPM package Asset Store publishing workflow', what is 'UPM package namespaces' and how does it work?
UPM packages require consistent namespaces. The following table shows each of the namespaces you need to set for the different stages of the UPM publishing workflow: UPM workflow step Namespace action Description Sign up to the UPM workflow Set a publisher namespace. Establish and claim a namespace for your packages du...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a860df44f6d5
unity_docs
rendering
Show me a Unity C# example demonstrating `GUI.Box`.
e. If left out, the box style from the current GUISkin is used. Description Create a Box on the GUI Layer. A Box can contain text, an image, or a combination of these along with an optional tooltip, through using a GUIContent parameter. You may also use a GUIStyle to adjust the layout of items in a box, t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ec7dcbefb9f8
unity_docs
physics
What is `RigidbodyInterpolation` in Unity? Explain its purpose and usage.
RigidbodyInterpolation enumeration Description Rigidbody interpolation mode. Interpolation calculates the pose of a Rigidbody in frames that fall between physics timestep updates, to reduce the appearance of visible jitter. It is particularly useful for player character GameObjects, and any other GameObject that ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_ce1d2e6481c4
unity_docs
rendering
Explain 'Get started with text' in Unity.
UI Toolkit uses TextCore to render text, a technology based on TextMesh Pro . TextCore allows advanced styling capabilities and can render text clearly at various point sizes and resolutions. It takes advantage of Signed Distance Field (SDF) font rendering, which can generate font assets that look crisp even when trans...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e4caba9329c0
unity_docs
audio
Explain 'Audio' in Unity.
The Audio settings (main menu: Edit > Project Settings , then select the Audio category) allows you to tweak the maximum volume of all sounds playing in the scene. Property Function Global Volume Set the volume for all sounds during playback. Volume Rolloff Scale Set the global attenuation rolloff factor for Logarithmi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c2c2d4738197
unity_docs
scripting
What is `WebCamTexture` in Unity? Explain its purpose and usage.
WebCamTexture class in UnityEngine / Inherits from: Texture / Implemented in: UnityEngine.AudioModule Description WebCam Textures are textures onto which the live video input is rendered. On Android, iOS, and WebGL platforms, WebCamTexture requires the camera permission. On Android, you can request it at ru...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5bcf216f5cad
unity_docs
rendering
What is `Rendering.GraphicsTextureDescriptor.format` in Unity? Explain its purpose and usage.
GraphicsTextureDescriptor.format public Experimental.Rendering.GraphicsFormat format ; Description The pixel format for the GraphicsTexture expressed as a GraphicsFormat . Not all graphics cards support all uses across formats. Before enabling GraphicsTextureDescriptorFlags.RenderTarget on a GraphicsTex...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0678288c3033
unity_docs
rendering
What is `LightingDataAsset.GetDefaultReflectionCubemap` in Unity? Explain its purpose and usage.
LightingDataAsset.GetDefaultReflectionCubemap Declaration public Texture GetDefaultReflectionCubemap (); Returns Texture The default reflection cubemap. Description Gets the default reflection cubemap stored in a LightingDataAsset.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ac9f613c0718
unity_docs
rendering
What are the parameters of `Experimental.GlobalIllumination.LightmapperUtils.Extract` in Unity?
Returns LightMode Returns the light's light mode. Description Extracts informations from Lights. Declaration public static void Extract ( Light l , ref Experimental.GlobalIllumination.DirectionalLight dir ); Declaration public static void Extract ( Light l , ref Experimental.GlobalIllumination.PointLight point ); Decla...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9b20541fe550
unity_docs
scripting
Show me a Unity C# example demonstrating `Events.UnityEvent.AddListener`.
UnityEvent.AddListener Declaration public void AddListener ( Events.UnityAction call ); Parameters Parameter Description call Callback function. Description Adds a non-persistent listener to the UnityEvent. Adds a runtime callback. You can add many different listeners. If you add identical listeners mult...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_eca4355703f4
unity_docs
performance
Show me a Unity C# example demonstrating `Unity.Jobs.IJobParallelFor`.
best practice to use a small batch size, for example a batch size of 1. IJobParallelFor uses atomic operations to perform work stealing. Batch sizes can be small but they are not for free. You can use the returned JobHandle to make sure that the job has completed, or you can pass it to other jobs as a dependency to ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_9463be878df8
unity_docs
rendering
In Unity's 'Stereo rendering', what is 'Single-pass instanced render mode support' and how does it work?
Single-pass instanced render mode is supported on the following platforms and devices: Android devices that support the Multiview extension HoloLens PlayStation VR PC devices (tethered): For DirectX on desktop, the GPU must support Direct3D 11 and the VPAndRTArrayIndexFromAnyShaderFeedingRasterizer extension. For OpenG...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_730bc2fa26db
unity_docs
rendering
What is `AndroidDisplayOptions.DetectPresentationDisplay` in Unity? Explain its purpose and usage.
AndroidDisplayOptions.DetectPresentationDisplay Description The Unity Player automatically renders the camera output on a secondary screen. Automatic rendering is supported only on screens that the Android system identifies as a presentation display and when the Target Display for the camera is set to 2 in th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_afd890055a8b
unity_docs
rendering
Give me an overview of the `ShaderUtil` class in Unity.
ShaderUtil class in UnityEditor Description Utility functions to assist with working with shaders from the editor. Static Properties Property Description allowAsyncCompilation When true, asynchronous Shader compilation is allowed at the current call site. anythingCompiling When true, the Editor is compiling s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_95d07e1a8880
unity_docs
ui
In Unity's 'Capture events', what is 'Mouse capture' and how does it work?
Mouse capture events refer to events on a physical mouse, or a virtual mouse emulating a physical mouse. Capturing a mouse will also result in a PointerCaptureEvent for the mouse pointer. When an element releases a mouse capture, the corresponding MouseCaptureOutEvent triggers, with the target being the element that re...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_11441c90816a
unity_docs
scripting
What is `ModelImporter.optimizeMeshPolygons` in Unity? Explain its purpose and usage.
ModelImporter.optimizeMeshPolygons public bool optimizeMeshPolygons ; Description Optimize the order of polygons in the mesh to make better use of the GPUs internal caches to improve rendering performance.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_289e9fdf0bdd
unity_docs
scripting
In Unity's 'Auto Layout', what is 'Understanding Layout Controllers' and how does it work?
Layout controllers are components that control the sizes and possibly positions of one or more layout elements, meaning Game Objects with Rect Transforms on. A layout controller may control its own layout element (the same Game Object it is on itself) or it may control child layout elements . A component that functions...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b668a5aeabbb
unity_docs
scripting
What is `WSA.Toast.GetTemplate` in Unity? Explain its purpose and usage.
Toast.GetTemplate Declaration public static string GetTemplate ( WSA.ToastTemplate templ ); Parameters Parameter Description templ A template identifier. Returns string string, which is an empty XML document to be filled and used for toast notification. Description Get template XML for toast notific...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_15b76364ee67
unity_docs
performance
What is `Unity.Profiling.LowLevel.Unsafe.ProfilerUnsafeUtility.SingleSampleWithMetadata` in Unity? Explain its purpose and usage.
ProfilerUnsafeUtility.SingleSampleWithMetadata Declaration public static void SingleSampleWithMetadata (IntPtr markerPtr , int metadataCount , void* metadata ); Parameters Parameter Description markerPtr Profiler marker handle. metadataCount Metadata parameters count. metadata Unsafe pointer to the Pro...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8fb594c15e08
unity_docs
physics
In Unity's 'Create a ragdoll', what is 'Create the character' and how does it work?
Ragdolls make use of Skinned Meshes , that is a character mesh rigged up with bones in the 3D modeling application. For this reason, you must build ragdoll characters in a 3D package like Autodesk® Maya®. When you’ve created your character and rigged it, save the asset normally in your Project Folder . When you switch ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d5be0c329135
unity_docs
audio
What is `Experimental.Audio.AudioSampleProvider.ClearSampleFramesOverflowNativeHandler` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. AudioSampleProvider.ClearSampleFramesOverflowNativeHandler Declaration public void ClearSampleFramesOverflowNativeHandler (); Description Clear the native handler set with AudioSampleProvider.SetSampleFramesOverflowNativeHan...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2b12dbea2015
unity_docs
editor
Show me a Unity C# example demonstrating `Search.SearchIndexer.Start`.
SearchIndexer.Start Declaration public void Start (bool clear ); Parameters Parameter Description clear True if the the current index should be cleared. Description Starts indexing entries. ```csharp using System.Linq; using UnityEditor; using UnityEditor.Search; using UnityEngine; /// <summary> /// Sear...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_db3f0d652a64
unity_docs
networking
What is `Networking.DownloadHandler.data` in Unity? Explain its purpose and usage.
DownloadHandler.data public byte[] data ; Description Returns the raw bytes downloaded from the remote server, or null . (Read Only) This property returns the raw bytes downloaded from the remote server. If no data has yet been received, this property returns null . Note: Note: The precise memory allocation ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_2db5c90148ae
unity_docs
rendering
Explain 'Materials tab' in Unity.
Use the Materials tab to change how Unity deals with materials for an imported SpeedTree model. If the model has materials, Unity imports them as sub-assets. To change other import settings for the SpeedTree model, see the Model tab . The Materials tab has these sections: (A) The Location and Materials properties allow...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_02f915916e49
unity_docs
audio
What is `Video.VideoPlayer.EnableAudioTrack` in Unity? Explain its purpose and usage.
VideoPlayer.EnableAudioTrack Declaration public void EnableAudioTrack (ushort trackIndex , bool enabled ); Parameters Parameter Description trackIndex Index of the audio track to enable/disable. enabled True for enabling the track. False for disabling the track. Description Enable/disable audio track...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_9860ddf62821
unity_docs
rendering
In Unity's 'Metallic and specular workflows', what is 'Specular workflow' and how does it work?
In the specular workflow, a specular color value directly controls the intensity and color of reflections on the surface. This makes it possible to have a specular reflection that’s a different color to diffuse reflection. A black specular color means no reflections, while a white specular color means full reflection. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_48a57e458c85
unity_docs
editor
What is `iOS.Xcode.PlistDocument` in Unity? Explain its purpose and usage.
PlistDocument class in UnityEditor.iOS.Xcode Description Represents an Apple property list document. For more information on property lists, refer to Apple's documentation . ```csharp using System; using UnityEditor; using UnityEditor.Callbacks; using UnityEditor.iOS.Xcode;public class PlistDocumentExample { [P...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_907578c17e88
unity_docs
rendering
What is `LineAlignment` in Unity? Explain its purpose and usage.
LineAlignment enumeration Description Control the direction lines face, when using the LineRenderer or TrailRenderer . Properties Property Description View Lines face the camera. TransformZ Lines face the Z axis of the Transform Component.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_a7c7b278b2bf
github
scripting
Write a Unity C# UI script for Button Attribute Editor
```csharp using System.Collections.Generic; using UnityEditor; using UnityEngine; using System.Linq; using System.Reflection; using System; [CustomEditor(typeof(MonoBehaviour),true)] public class ButtonAttributeEditor : Editor { public List<InspectButtonAttribute> buttonAttributes; private static readonly Dic...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_54b46791e783
unity_docs
rendering
What is `ParticleSystemShapeTextureChannel` in Unity? Explain its purpose and usage.
ParticleSystemShapeTextureChannel enumeration Description The texture channel. Properties Property Description Red The red channel. Green The green channel. Blue The blue channel. Alpha The alpha channel.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_1568367f1824
unity_docs
ui
Show me a Unity code example for 'UIE-transition-event-example'.
itory . ## Create the example Create a project in Unity with any template. From the menu, select Assets > Create > UI Toolkit > Editor Window . In the UI Toolkit Editor Window Creator window, enter TransitionExample . Save your changes. This creates three files as TransitionExample.cs , TransitionExample.uss , and Tr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_93b844eaabc9
unity_docs
rendering
What is `ShaderData.Subshader.FindTagValue` in Unity? Explain its purpose and usage.
ShaderData.Subshader.FindTagValue Declaration public Rendering.ShaderTagId FindTagValue ( Rendering.ShaderTagId tag ); Parameters Parameter Description tagName The name of the tag. Description Searches for the tag specified by tagName on this SubShader and returns the value of the tag.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_caa933894bd6
unity_docs
rendering
Show me a Unity C# example demonstrating `AssetPostprocessor.OnPostprocessCubemap`.
Description Add this function to a subclass to get a notification just before a cubemap texture has completed importing. Note that you should avoid modifying the TextureImporter settings in this manner as it would have no effect on the texture that is currently being imported but would apply the next time the textur...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_295ab41a18d7
unity_docs
rendering
Show me a Unity C# example demonstrating `Search.SearchPropositionFlags.QueryBuilder`.
SearchPropositionFlags.QueryBuilder Description Indicates that the search propositions are fetched for the query block selector. ``` static IEnumerable<SearchProposition> EnumerateDecalPropositions(SearchContext context, SearchPropositionOptions options) { if (!options.flags.HasAny(SearchPropositionFlags.QueryBuil...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d3f309522d8d
unity_docs
editor
Show me a Unity C# example demonstrating `AssetDatabase.MoveAsset`.
meter Description oldPath The path where the asset currently resides. newPath The path which the asset should be moved to. Returns string An empty string if the asset has been successfully moved, otherwise an error message. Description Move an asset file (or folder) from one folder to another. All paths a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_214c67d1a5e6
unity_docs
ui
What is `UIElements.VisualElement.styleSheets` in Unity? Explain its purpose and usage.
VisualElement.styleSheets public UIElements.VisualElementStyleSheetSet styleSheets ; Description Returns a VisualElementStyleSheetSet that manipulates style sheets attached to this element.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ede60bfbab8d
unity_docs
scripting
Show me a Unity C# example demonstrating `PlayerPrefs.SetInt`.
o a function called SetInt . The function uses the KeyName variable in PlayerPrefs.SetInt as an identifier, and Value as the contents to store. For example, you could use PlayerPrefs.SetInt to store the user’s currency, like this: /PlayerPrefs.SetInt(“CharacterMoney”, 123)/. The GetInt function then uses the s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_1f5db9d03e6e
unity_docs
math
Explain 'Load SSH keys automatically on Windows (PuTTY)' in Unity.
Follow these steps if you use PuTTY and its authentication agent (Pageant) instead of Windows’ built-in OpenSSH client. For example, if you use SourceTree as your Git client, it comes with PuTTY (and Pageant) to use instead of OpenSSH. ## Before you begin Make sure you’ve installed the PuTTY suite, which includes Pag...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_aa74d29879c4
unity_docs
editor
What is `EditorGUILayout.IntPopup` in Unity? Explain its purpose and usage.
EditorGUILayout.IntPopup Declaration public static int IntPopup (int selectedValue , string[] displayedOptions , int[] optionValues , params GUILayoutOption[] options ); Declaration public static int IntPopup (int selectedValue , string[] displayedOptions , int[] optionValues , GUIStyle style , params ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cf15d67d98e1
unity_docs
editor
What is `AssetImporter.SetAssetBundleNameAndVariant` in Unity? Explain its purpose and usage.
AssetImporter.SetAssetBundleNameAndVariant Declaration public void SetAssetBundleNameAndVariant (string assetBundleName , string assetBundleVariant ); Parameters Parameter Description assetBundleName AssetBundle name. assetBundleVariant AssetBundle variant. Description Set the AssetBundle name and varia...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a015c03c6601
unity_docs
scripting
What is `SystemInfo.supportsParallelPSOCreation` in Unity? Explain its purpose and usage.
SystemInfo.supportsParallelPSOCreation public static bool supportsParallelPSOCreation ; Description Returns true if parallel PSO creation is available for this device and false otherwise. See GraphicsStateCollection .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f823b4b89c39
unity_docs
editor
What is `EditorTools.ToolManager.activeToolChanging` in Unity? Explain its purpose and usage.
ToolManager.activeToolChanging Parameters Parameter Description value An event issued before the active tool changes. Description Defines an event handler for when the active tool changes. Use this event along with IsActiveTool to be notified when an EditorTool is deactivated.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4c53874c85d9
unity_docs
scripting
What is `Profiling.HierarchyFrameDataView.columnSelfPercent` in Unity? Explain its purpose and usage.
HierarchyFrameDataView.columnSelfPercent public static int columnSelfPercent ; Description The percentage of the CPU time Unity spends in a sample itself, excluding the time from child samples. The percentage is calculated from the columnSelfTime value of the sample divided by the CPU frame time.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_cbd9464db94f
unity_docs
editor
In Unity's 'Modify the Gradle project files for a Unity application', what is 'Gradle template files' and how does it work?
Unity uses templates to produce the final Gradle project files. You can override these templates to control how Unity produces the final files. Gradle merges the manifests from your Android libraries into a final main manifest and makes sure that the final configuration is correct. Important : If you use custom Gradle ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1a6607a89ee6
unity_docs
rendering
Show me a Unity C# example demonstrating `ParticleSystemJobs.IJobParticleSystemParallelForBatch.Execute`.
int count ); Parameters Parameter Description jobData Contains the particle properties. startIndex The first particle index that this job should process. count The number of particles that this job should process. Description Implement this method to access and modify particle properties. Below is an exa...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6f6312987838
unity_docs
rendering
What is `TextureImporterPlatformSettings.allowsAlphaSplitting` in Unity? Explain its purpose and usage.
TextureImporterPlatformSettings.allowsAlphaSplitting public bool allowsAlphaSplitting ; Description Allows Alpha splitting on the imported texture when needed (for example ETC1 compression for textures with transparency).
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_66d1b59b4a2c_doc_2
github
scripting
What does `OnDisable` do in this Unity script? Explain its purpose and signature.
Tries disconnecting to signals of the timer. Signature: ```csharp protected virtual void OnDisable() ```
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_a3ed91f7f302
unity_docs
scripting
What is `Unity.Android.Gradle.BaseElement.ResolveConflict` in Unity? Explain its purpose and usage.
BaseElement.ResolveConflict Declaration public void ResolveConflict (); Description Resolve a conflict if another script has already modified the element. If you call this method and the element was not modified, the build will fail. This is to make sure that you call this method explicitly to resolve an existi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5c6f958cbc96
unity_docs
math
What is `Unity.Android.Gradle.Manifest.BaseAttributesContainer.ToolsSelector` in Unity? Explain its purpose and usage.
BaseAttributesContainer.ToolsSelector public Unity.Android.Gradle.Manifest.AttributeStringArray ToolsSelector ; Description The C# definition of the tools:selector Android Manifest attribute.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_15eae46979cf
unity_docs
scripting
What is `HideFlags` in Unity? Explain its purpose and usage.
HideFlags enumeration Description Bit mask that controls object destruction, saving and visibility in inspectors. Additional resources: Object.hideFlags . ```csharp using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { // Creates a material that is explicitly created & destroye...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a1dda7025d6b
unity_docs
scripting
What is `VideoEncodeAspectRatio` in Unity? Explain its purpose and usage.
VideoEncodeAspectRatio enumeration Description Methods to compensate for aspect ratio discrepancies between the source resolution and the wanted encoding size. Properties Property Description NoScaling Perform no operation. Stretch Stretch the source to fill the target resolution without preserving the aspect ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_aa4618856f57
unity_docs
scripting
What is `Experimental.Rendering.GraphicsFormat.R8G8B8A8_SNorm` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphicsFormat.R8G8B8A8_SNorm Description A four-component, 32-bit signed normalized format that has an 8-bit R component in byte 0, an 8-bit G component in byte 1, an 8-bit B component in byte 2, and an 8-bit A component in byte...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.