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_b52dbe6ae01e
unity_docs
performance
What is `ParticleSystemJobs.ParticleSystemJobData.inverseStartLifetimes` in Unity? Explain its purpose and usage.
ParticleSystemJobData.inverseStartLifetimes public NativeArray<float> inverseStartLifetimes ; Description The lifetime of each particle, stored as 1.0f / lifetime. There are more cases in the native code where we wish to divide by lifetime, rather than multiply by it. Therefore, storing the reciprocal allows us...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a01c0c68958a
unity_docs
xr
What is `XR.XRNode` in Unity? Explain its purpose and usage.
XRNode enumeration Description Enumeration of XR nodes which can be updated by XR input or sent haptic data. Note: The types GameController, TrackingReference, and HardwareTracker are considered non-singleton nodes, as there can be many of each available. As a result, InputTracking.GetLocalPosition, and InputTrac...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5f978e40651f
unity_docs
xr
What is `GradientMode.Blend` in Unity? Explain its purpose and usage.
GradientMode.Blend Description Linearly interpolate between the gradient keys. This mode finds the two keys adjacent to the requested evaluation time, and interpolates between them. Note that a simple linear interpolation between color keys of very different hue can look unnatural. Using GradientMode.PerceptualBle...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_c18f78a4d9cf
unity_docs
ui
In Unity's 'Keyboard events', what is 'Unique properties' and how does it work?
keyCode : The keyCode property returns a character key that corresponds directly to a physical key on an input device, such as a keyboard or joystick. The difference between the character property and the keyCode property is that keyCode represents a physical key, while character represents the entry of a specific char...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2a0934923ffc
unity_docs
rendering
What is `SystemInfo.maxTextureSize` in Unity? Explain its purpose and usage.
SystemInfo.maxTextureSize public static int maxTextureSize ; Description Maximum texture size in pixels (Read Only). The largest texture width and height that your graphics hardware supports. Unity only supports textures up to a size of 16384, even if maxTextureSize returns a larger size. You can only creat...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8515f30d48d2
unity_docs
scripting
What is `Progress.UnregisterCancelCallback` in Unity? Explain its purpose and usage.
Progress.UnregisterCancelCallback Declaration public static void UnregisterCancelCallback (int id ); Parameters Parameter Description id The progress indicator's unique ID. Description Unregisters a previously registered progress cancellation callback. Additional resources: Progress.RegisterCancelCallbac...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2f183ed58fd1
unity_docs
math
What is `AndroidJNI.ToCharArray` in Unity? Explain its purpose and usage.
AndroidJNI.ToCharArray Declaration public static IntPtr ToCharArray (char[] array ); Description Converts a managed array of System.Char to a Java array of char . Additional resources: AndroidJNI.NewCharArray , AndroidJNI.SetCharArrayElement .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d5bad71e7abd
unity_docs
math
What are the parameters of `TestTools.Coverage.GetStatsFor` in Unity?
Returns CoveredMethodStats Coverage summary. Description Returns the coverage summary for the specified method. See CoveredMethodStats for more information about the coverage statistics returned by this method. ```csharp using UnityEngine; using UnityEngine.TestTools; using System.Reflection;public class CoverageClass ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_afae9d70c65c
unity_docs
rendering
What is `CameraProjectionCache` in Unity? Explain its purpose and usage.
CameraProjectionCache struct in UnityEditor Description Project points from world to screen space. Projection from world to screen space depends on internal camera matrices that Unity must recalculate whenever they are accessed. When accessed in a loop where the camera state does not change, these calculations ar...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fd70295d8948
unity_docs
physics
Give me an overview of the `RigidbodyInterpolation` class in Unity.
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_sr_319682f6319f
unity_docs
rendering
What is `GizmoUtility.SetGizmoEnabled` in Unity? Explain its purpose and usage.
GizmoUtility.SetGizmoEnabled Declaration public static void SetGizmoEnabled (Type type , bool enabled , bool addToRecentlyChanged ); Parameters Parameter Description type The component type to render or hide gizmos. enabled Set true to render gizmos in the Scene View, false to hide. addToRecentlyChanged...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_35f8fb3212ea_doc_2
github
scripting
What does `OnEnable` do in this Unity script? Explain its purpose and signature.
Re-subscribe to theme, sync visual state with toggle state, and restore interactable state with delay. Signature: ```csharp protected override void OnEnable() ```
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_2d73dd6a1a32
unity_docs
scripting
Give me an overview of the `WebGLCompressionFormat` class in Unity.
WebGLCompressionFormat enumeration Description An enum containing different compression types. This enum is used within the WebGL platform to define what type of compression will be used for resources. Properties Property Description Brotli WebGL resources are stored using Brotli compression. Gzip WebGL resou...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_ef001388660f
unity_docs
ui
In Unity's 'Name selectors', what is 'Example' and how does it work?
To demonstrate how simple selectors match elements, here is an example UI Document. ``` <UXML xmlns="UnityEngine.UIElements"> <VisualElement name="container1"> <VisualElement name="container2" class="yellow"> <Button name="OK" class="yellow" text="OK" /> <Button name="Cancel" text="Cancel" /> </VisualElement> </V...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6cbdf2f33e8e
unity_docs
rendering
In Unity's 'Set the render pipeline and render order for a shader', what is 'Add a tag' and how does it work?
Add a Tag block to a SubShader block or a Pass block. For example: ``` Shader "TagsExample" { SubShader { // Add a subshader tag Tags { "TagName" = "Value" } Pass { // Add a pass tag Tags { "TagName" = "Value" } ... } } } ``` For more information about tag names and values, refer to SubShader tags in Shade...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ddddb3271467
unity_docs
scripting
Give me an overview of the `Social` class in Unity.
Method group is Obsolete Social class in UnityEngine / Implemented in: UnityEngine.GameCenterModule Obsolete Social is deprecated and will be removed in a future release. Description Generic access to the Social API. Social.Active can be used to target a specific social platform implementation, but by defau...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f49688871717
unity_docs
rendering
Explain 'Shader keywords workflow' in Unity.
To control how shaders behave in different situations, use shader keywords. Each keyword acts as a toggle to change the shader’s behavior. You can use keywords to do the following: Configure different settings for a material. Make a shader work differently on different hardware. Dynamically change the behavior of a sha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8383460b3ba6
unity_docs
animation
What is `Animations.AnimatorController.CreateBlendTreeInController` in Unity? Explain its purpose and usage.
AnimatorController.CreateBlendTreeInController Declaration public Animations.AnimatorState CreateBlendTreeInController (string name , out Animations.BlendTree tree ); Declaration public Animations.AnimatorState CreateBlendTreeInController (string name , out Animations.BlendTree tree , int layerIndex...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_57757e20572a
unity_docs
scripting
What is `SpritePackerMode` in Unity? Explain its purpose and usage.
SpritePackerMode enumeration Description Sprite Packer mode for the current project. Properties Property Description Disabled Doesn't pack sprites. BuildTimeOnlyAtlas Pack all the SpriteAtlas when building player/bundles. AlwaysOnAtlas Always pack all the SpriteAtlas. SpriteAtlasV2 If enabled, will automatic...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_23f61522a7f7_doc_2
github
scripting
What does `RightHand2UnityLeftHand` do in this Unity script? Explain its purpose and signature.
runtime右手坐标系结果转换成Unity左手系结果旋转, 四元数平移 Signature: ```csharp static public void RightHand2UnityLeftHand(XRRotation rotation, XRPosition position) ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b2be4f29b49d
unity_docs
ui
Give me an overview of the `EnumButtonsAttribute` class in Unity.
EnumButtonsAttribute class in UnityEngine / Inherits from: PropertyAttribute / Implemented in: UnityEngine.CoreModule Description Attribute to enable editing an enum with a ToggleButtonGroup . ```csharp using System; using System.Collections.Generic; using UnityEngine; public enum Position { First, Second...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_739f7764a85c
unity_docs
scripting
Show me a Unity C# example demonstrating `Camera.SetStereoViewMatrix`.
nce to find out which will be used. Calling Camera.ResetStereoViewMatrices will revert the camera to using view matrices provided by the VR SDK. Note that the Camera.stereoSeparation will not be applied until you call Camera.ResetStereoViewMatrices . Additional resources: Camera.ResetStereoViewMatrices , Came...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_0ffe105be10d
unity_docs
ui
Explain 'Extending the device simulator' in Unity.
The Device Simulator supports plugins to extend its functionality and change the UI of the Control Panel in the Simulator view. ## Creating a plugin To create a Device Simulator plugin, extend the DeviceSimulatorPlugin class. To insert UI into the Device Simulator view, your plugin must: Override the title property t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_94c216cb2541_doc_14
github
scripting
What does `GetConfigCsvExportValuesList` do in this Unity script? Explain its purpose and signature.
Returns the configuration data of this config as list of objects.A list of objects of the quiz config. Signature: ```csharp public List<object> GetConfigCsvExportValuesList() => new() ```
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_e9a624c6d772
unity_docs
rendering
What is `Rendering.SupportedRenderingFeatures.overridesLightProbeSystemWarningMessage` in Unity? Explain its purpose and usage.
SupportedRenderingFeatures.overridesLightProbeSystemWarningMessage public string overridesLightProbeSystemWarningMessage ; Description The message to display in the LightProbeGroup editor if the light probe system is overridden by the renderer.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6239fc83ebe3
unity_docs
audio
Give me an overview of the `AudioRenderer` class in Unity.
AudioRenderer class in UnityEngine / Implemented in: UnityEngine.AudioModule Description Allow recording the main output of the game or specific groups in the AudioMixer. Static Methods Method Description GetSampleCountForCaptureFrame Returns the number of samples available since the last time AudioRenderer....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4d36c902ee05
unity_docs
physics
Show me a Unity C# example demonstrating `Physics.OverlapSphere`.
of colliders to include in the query. queryTriggerInteraction Specifies whether this query should hit Triggers. Returns Collider[] Returns an array with all colliders touching or inside the sphere. Description Computes and stores colliders touching or inside the sphere. Additional resources: Physics.AllLaye...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3172e1e93b14
unity_docs
ui
In Unity's 'Brushes', what is 'Brush settings' and how does it work?
Property Function Mask Texture Defines the shape and strength of the Brush. Select a Texture in your project, and the system creates a grayscale mask from the Texture. If the selected Texture has multiple color channels, the Brush uses the Red channel as its source. Remap Remaps the grayscale values of the Brush mask, ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_da707a198484
unity_docs
math
What are the parameters of `TerrainData.GetDetailLayer` in Unity?
Description Returns a 2D array of the detail object density (i.e. the number of detail objects for this layer) in the specific location. The Terrain system uses detail layer density maps. Each map is essentially a grayscale image, where each pixel value denotes the number of detail objects that will be procedurally pla...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_36b8b9ff13ba_doc_3
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Maximum bytes allowed for the preload cache (0 = unlimited). Signature: ```csharp public long PreloadBudgetBytes ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
gh_35f8fb3212ea_doc_11
github
scripting
What does `OnEndDrag` do in this Unity script? Explain its purpose and signature.
Forward drag end event to parent ScrollRect if present. Signature: ```csharp public void OnEndDrag(PointerEventData eventData) ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2bb8af484c54
unity_docs
scripting
What is `Actions.ContextMenuUtility.AddComponentEntriesTo` in Unity? Explain its purpose and usage.
ContextMenuUtility.AddComponentEntriesTo Declaration public static void AddComponentEntriesTo ( UIElements.DropdownMenu menu ); Parameters Parameter Description menu The Scene view context menu to add the component menu items of the current selection to. Description Adds the component menu items of the cu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_1ef9b7b3df05
unity_docs
input
In Unity's 'Troubleshooting common cross-platform issues', what is 'Keyboard and joypad' and how does it work?
The Input.GetAxis function is convenient on desktop platforms to consolidate keyboard and joypad input. This function isn’t suitable for mobile platforms that rely on touchscreen input. The standard desktop keyboard input is only suitable for porting typed text to mobile devices. You can add a layer of abstraction to y...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_f6c6a98abb97
github
scripting
Write a Unity C# UI script for Charts Example
```csharp using System.Collections.Generic; using System.Linq; using shadcnui.GUIComponents.Core.Base; using shadcnui.GUIComponents.Core.Styling; using shadcnui.GUIComponents.Core.Utils; using shadcnui.GUIComponents.Data; using UnityEngine; namespace shadcnui_examples.Examples { public class ChartsExample : MonoBe...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
gh_13c4367d492a
github
scripting
Write a Unity Editor script for Input Splat Data
```csharp using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; using GaussianSplatting.Runtime; using Unity.Burst; using Unity.Collections; using Unity.Collections.LowLevel.Unsafe; using Unity.Jobs; using Unity.Mathematics; using UnityEngine; using UnityEngine.Assertions; ...
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_a95bc7e36a12
unity_docs
scripting
Show me a Unity C# example demonstrating `Material.CopyPropertiesFromMaterial`.
Material.CopyPropertiesFromMaterial Declaration public void CopyPropertiesFromMaterial ( Material mat ); Description Copy properties from other material into this material. This function copies property values (both serialized and set at runtime), as well as shader keywords, render queue and global illuminat...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_94209c9248f7
unity_docs
physics
What are the parameters of `Physics2D.CircleCast` in Unity?
Returns RaycastHit2D The cast results returned. Description Casts a circle against Colliders in the Scene, returning the first Collider to contact with it. A CircleCast is conceptually like dragging a circle through the Scene in a particular direction. Any object making contact with the circle can be detected and repo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_a584bd23a45d
unity_docs
rendering
Explain 'Tab' in Unity.
A Tab element represents a single tab within a TabView . In a window or menu, you can use a tab to group related content. ## Make a Tab closable To make it so a Tab can be closed, set the closable property to true . When a Tab is closable, a close icon appears on the Tab. If a user selects the close icon, the Tab clo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_50f4043c8837
unity_docs
scripting
What is `GUIStyle.normal` in Unity? Explain its purpose and usage.
GUIStyle.normal public GUIStyleState normal ; Description Rendering settings for when the component is displayed normally. ```csharp using UnityEngine;public class Example : MonoBehaviour { // Prints the text color that button is using. void OnGUI() { Debug.Log(GUI.skin.button.normal.textColor); } } ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9b75f85d5861
unity_docs
editor
What is `Build.IPostprocessBuildWithReport.OnPostprocessBuild` in Unity? Explain its purpose and usage.
IPostprocessBuildWithReport.OnPostprocessBuild Declaration public void OnPostprocessBuild ( Build.Reporting.BuildReport report ); Parameters Parameter Description report A BuildReport containing information about the build, such as the target platform and output path. Description Implement this function t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d3d743cc1e1e
unity_docs
rendering
What is `Camera.RenderToCubemap` in Unity? Explain its purpose and usage.
Camera.RenderToCubemap Declaration public bool RenderToCubemap ( Cubemap cubemap , int faceMask ); Parameters Parameter Description cubemap The cube map to render to. faceMask A bitmask which determines which of the six faces are rendered to. Returns bool False if rendering fails, else true. Desc...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d698c7891c4f
unity_docs
scripting
Explain 'Report crash bugs for iOS' in Unity.
You can report crash bugs for iOS with Unity Bug Reporting . If your application crashes in the Xcode debugger, it’s recommended to add the Xcode console output to your bug report. Use the following steps to access the console output if your application crashes: Note : Before submitting a bug report , refer to Troubles...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_607831fec43b
unity_docs
rendering
What is `ShaderKeywordFilter.FilterAction` in Unity? Explain its purpose and usage.
FilterAction enumeration Description Whether shader keyword filter attributes include the keywords, remove the keywords or do nothing, based on the attribute condition evaluation. Properties Property Description Select Includes only the keywords in any multi_compile keyword set containing them, if the attribute...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1b1f46a841bb
unity_docs
scripting
What is `Color.ctor` in Unity? Explain its purpose and usage.
Color Constructor Declaration public Color (float r , float g , float b , float a ); Parameters Parameter Description r Red component. g Green component. b Blue component. a Alpha component. Description Constructs a new Color with given r,g,b,a components. ```csharp using UnityEngine;public class...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d4849a649cc6
unity_docs
physics
Explain 'Handling variation in time' in Unity.
For a given frame rate in frames per second (FPS), the duration of individual frames tends to vary. These variations can be minor. For example, in a game running at 60 FPS , the actual number of frames per second may vary slightly, so that each frame lasts between 0.016 and 0.018 seconds. Larger variations can occur wh...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bc47c8fa44de
unity_docs
rendering
What is `Rendering.RenderTextureSubElement.Stencil` in Unity? Explain its purpose and usage.
RenderTextureSubElement.Stencil Description The stencil element of a RenderTexture. Use this to access the stencil data of the underlying surface from a Render Texture and then bind it in a Shader. Before you create the RenderTexture, make sure to set the stencil format to one that the target platform supports. To ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e19caa4ecea1
unity_docs
rendering
What is `TextureWrapMode` in Unity? Explain its purpose and usage.
TextureWrapMode enumeration Description Wrap mode for textures. Corresponds to the settings in a texture inspector . Wrap mode determines how texture is sampled when texture coordinates are outside of the typical 0..1 range. For example, Repeat makes the texture tile, whereas Clamp makes the texture edge pixe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b8cd44e50876
unity_docs
rendering
What is `Experimental.Rendering.GraphicsStateCollection.RemoveVariant` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphicsStateCollection.RemoveVariant Declaration public bool RemoveVariant ( Shader shader , Rendering.PassIdentifier passId , LocalKeyword[] keywords ); Parameters Parameter Description shader Shader used in the va...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_73a954fb827c
unity_docs
physics
Show me a Unity C# example demonstrating `MonoBehaviour.FixedUpdate`.
mulation needs. This ensures that physics calculations remain consistent and deterministic, regardless of how fast the game renders frames. Use Application.targetFrameRate to set a target frame rate. For more information on managing frame rate variation, refer to Handling variation in time . The following example co...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f7f43abb4313
unity_docs
physics
In Unity's 'Measure performance with the built-in profiler', what is 'Rendering statistics' and how does it work?
Property Function tris # Total number of triangles sent for rendering. verts # Total number of vertices sent for rendering. Keep this number under 10000 if your application uses only static geometry. If your application uses many instances of skinned geometry, this number should be much lower. dynamic/static batching N...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7641491ef2d3
unity_docs
scripting
What is `ControllerColliderHit.transform` in Unity? Explain its purpose and usage.
ControllerColliderHit.transform public Transform transform ; Description The transform that was hit by the controller. ```csharp using UnityEngine;public class Example : MonoBehaviour { // Print the transform's name that collided with this ControllerCollider void OnControllerColliderHit(ControllerColliderHi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e2c70c0fd4f7
unity_docs
scripting
Give me an overview of the `AscentCalculationMode` class in Unity.
AscentCalculationMode enumeration Description Method used for calculating a font's ascent. The ascent is the distance from the baseline to the top of the font. Font designers define this differently within the metrics of various fonts: some fonts will use the bounding box height, some will use cap height, and othe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f5481cc92e32
unity_docs
rendering
In Unity's 'Text assets', what is 'Using text assets' and how does it work?
Text assets are useful for getting text from different text files into your application while you’re building it. For example, you can use it to add a.txt file to your project to bring the text into your application. If you’re making a text-heavy adventure game, you can put the text for each scene separate.txt files an...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_631922c40522_doc_10
github
scripting
What does `LoadAsyncTask` do in this Unity script? Explain its purpose and signature.
Load the asset asynchronously with C# async/await. Signature: ```csharp public Task<T> LoadAsyncTask() ```
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_man_6c686de8c400
unity_docs
scripting
Explain 'Yield instruction reference' in Unity.
Coroutines suspend their execution at a yield return statement. A yield return null suspends execution of the coroutine until the next frame. But the yield return can also return an instruction for the Unity Editor or runtime to, for example, wait for a specified amount of time or until a condition is met before resumi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f48be6269546
unity_docs
scripting
What is `UIElements.INavigationEvent.actionKey` in Unity? Explain its purpose and usage.
INavigationEvent.actionKey public bool actionKey ; Description Gets a boolean value that indicates whether the platform-specific action key is pressed. True means the action key is pressed. False means it isn't. The platform-specific action key is Cmd on macOS, and Ctrl on all other platforms.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bfc946e2f34c
unity_docs
rendering
Show me a Unity C# example demonstrating `UserAuthorization`.
UserAuthorization enumeration Description Use this enum to request permission from the user’s device for access to system features. To request permission, pass this as a parameter to Application.RequestUserAuthorization . Note : The Microphone API is not available for the Web platform. ```csharp // This script ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d0aa17ecf45b
unity_docs
editor
What is `SceneManagement.EditorSceneManager.MoveSceneBefore` in Unity? Explain its purpose and usage.
EditorSceneManager.MoveSceneBefore Declaration public static void MoveSceneBefore ( SceneManagement.Scene src , SceneManagement.Scene dst ); Parameters Parameter Description src The Scene to move. dst The Scene which should come directly after the source Scene in the hierarchy. Description Allows you...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_afd67c041c2e
unity_docs
scripting
What are the parameters of `Graphics.CopyTexture` in Unity?
Description Copies pixel data from one texture to another. This method copies pixel data from one texture to another on the GPU. If Texture.isReadable is true for both src and dst , the method also attempts to copy pixel data on the CPU by running a CopyPixels method such as Texture2D.CopyPixels . If Texture.isReadable...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_743842473591
unity_docs
scripting
Explain 'Unity Search' in Unity.
Use Search to find items in the Unity Editor and perform actions on the results. For example, you can: Find assets and drag them to a GameObject ’s component. Edit properties for multiple assets and GameObjects. Find and install Unity packages. Run main menu commands. Section Description Launch and use the Search windo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_34bf0ce60af2
unity_docs
physics
Explain 'Introduction to collision' in Unity.
In Unity, a collision happens when two GameObjects that are configured for collision occupy the same physical space. Collision is a foundational part of most games, and many interactive applications and simulators. To handle collision between GameObjects, Unity uses colliders . A collider is a Unity component that defi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cc7015f6d3dc
unity_docs
physics
What is `Collider.OnCollisionEnter` in Unity? Explain its purpose and usage.
Collider.OnCollisionEnter(Collision) Parameters Parameter Description other The Collision data associated with this collision event. Description OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider. In contrast to OnTriggerEnter , OnCollisionEnter is passed t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_dcd643557b68
unity_docs
scripting
What is `Unity.IntegerTime.DiscreteTime.operator_eq` in Unity? Explain its purpose and usage.
DiscreteTime.operator == public static bool operator == ( Unity.IntegerTime.DiscreteTime lhs , Unity.IntegerTime.DiscreteTime rhs ); Parameters Parameter Description lhs The left hand side. rhs The right hand side. Description Returns true if the time is equal to a given time, false otherwise.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_26de49c35211
unity_docs
scripting
In Unity's 'Supported data types for Java/Kotlin and C# code', what is 'Example 1: Transfer basic data types' and how does it work?
The following C# script uses AndroidJavaClass to call the Java functions to transfer variable data. ```csharp using UnityEngine; public class TransferTypes : MonoBehaviour { void Start() { using (AndroidJavaClass pluginClass = new AndroidJavaClass("com.unity3d.player.JavaTransferTypesExample")) { //Receive data f...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_c7895cb23c7f
unity_docs
scripting
Explain 'Enable optional features for QNX' in Unity.
You can enable the following optional features to improve the performance of your applications. ## Command line arguments You can launch the Unity QNX Player from the command line and pass arguments to change how the Player executes. Note : All command line arguments have precedence over the settings configured in th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f1904b5c3fc0
unity_docs
scripting
What is `SceneManagement.EditorSceneManager.SceneSavedCallback` in Unity? Explain its purpose and usage.
EditorSceneManager.SceneSavedCallback Declaration public delegate void SceneSavedCallback ( SceneManagement.Scene scene ); Parameters Parameter Description scene The Scene that was saved. Description Callbacks of this type which have been added to the sceneSaved event are called after a Scene has been s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_66158ebffe7f
unity_docs
rendering
Show me a Unity C# example demonstrating `ImageConversion.EncodeArrayToEXR`.
her formats (and the data is converted on the fly). The default output format is uncompressed 16-bit float EXR and can be controlled using the passed in flags. The encoded EXR data will only contain an alpha channel when the passed-in format has one. For single-channel red textures ( R8 , R16 , RFloat and RHalf ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1e6967010d03
unity_docs
scripting
Show me a Unity C# example demonstrating `Rendering.ReflectionProbeClearFlags.SolidColor`.
ReflectionProbeClearFlags.SolidColor Description Clear with a background color. Additional resources: ReflectionProbe.clearFlags property. ```csharp using UnityEngine; using System.Collections; public class ExampleScript : MonoBehaviour { void Start() { ReflectionProbe probe = GetComponent<ReflectionProbe>();...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_877f361c5b21
unity_docs
scripting
What is `Unity.Collections.LowLevel.Unsafe.UnsafeUtility.CheckForLeaks` in Unity? Explain its purpose and usage.
UnsafeUtility.CheckForLeaks Declaration public static int CheckForLeaks (); Returns int The number of leaks found. Description Gets a list of memory leaks. Any memory allocated before this call that hasn't already been freed, is assumed to have leaked.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c7b80571dbf6
unity_docs
scripting
What are the parameters of `ParticleSystem.CustomDataModule.SetVector` in Unity?
Description Set a MinMaxCurve , in order to generate custom data. Additional resources: ParticleSystem.CustomDataModule.GetVector , ParticleSystem.GetCustomParticleData . ```csharp using UnityEngine; using System.Collections;[RequireComponent(typeof(ParticleSystem))] public class ExampleClass : MonoBehaviour { void...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_85423c454484
unity_docs
scripting
What is `Experimental.GraphView.ContentZoomer.UnregisterCallbacksFromTarget` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. ContentZoomer.UnregisterCallbacksFromTarget Declaration protected void UnregisterCallbacksFromTarget (); Description Called to unregister event callbacks from the target element.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f803e83f82f6
unity_docs
scripting
Show me a Unity code example for 'Import an Android Library plug-in'.
re an Android Library plug-in to depend on unityLibrary instead. To do this, use the following steps: In the Project window, select the.androidlib plug-in to access the Inspector window. In the Select dependent module section, select None . Android Library plug-in Inspector with the Select dependent module setting sele...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_addcb921fd7c
unity_docs
rendering
In Unity's 'Optimize Web platform for mobile', what is 'Optimize for size' and how does it work?
A smaller build size is better for mobile because there’s less data to download, which usually makes load times shorter and uses less storage on the user’s device. To make your build as small as possible, disable development build settings and optimize your build for disk size: Go to File > Build Profiles . Select Web ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e89b94e6f503
unity_docs
networking
In Unity's 'Sentis', what is 'Compatible with Unity' and how does it work?
These package versions are available in Unity version 6000.0: Documentation location: State Versions available: com.unity.ai.inference@2.6 released 2.6.0, 2.6.1 com.unity.ai.inference@2.5 released 2.5.0
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_21b0a08391a1
unity_docs
editor
Show me a Unity code example for 'Package layout'.
This is the package layout recommended for custom packages: ``` <package-root> ├── package.json ├── README.md ├── CHANGELOG.md ├── LICENSE.md ├── Third Party Notices.md ├── Editor │ ├── <company-name>.<package-name>.Editor.asmdef │ └── EditorExample.cs ├── Runtime │ ├── <company-name>.<package-name>.asmdef │...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c519879a0994
unity_docs
math
What is `TerrainTools.TerrainPaintUtility.CalculateBrushTransform` in Unity? Explain its purpose and usage.
TerrainPaintUtility.CalculateBrushTransform Declaration public static TerrainTools.BrushTransform CalculateBrushTransform ( Terrain terrain , Vector2 brushCenterTerrainUV , float brushSize , float brushRotationDegrees ); Parameters Parameter Description terrain Reference terrain, defines terrain UV a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ff3ffd3c203b
unity_docs
physics
What is `PhysicsVisualizationSettings.QueryFilter.Cast` in Unity? Explain its purpose and usage.
PhysicsVisualizationSettings.QueryFilter.Cast Description Whether the filter includes cast type queries. For example, cast type queries include Physics.BoxCast , Physics.CapsuleCastAll , and Physics.SphereCastNonAlloc .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cecdb5922eac
unity_docs
editor
Show me a Unity C# example demonstrating `AssetPostprocessor.OnPostprocessAllAssets`.
ing attributes: RunAfterClassAttribute , RunBeforeClassAttribute RunAfterAssemblyAttribute , RunBeforeAssemblyAttribute RunAfterPackageAttribute , RunBeforePackageAttribute Note: A version of this callback without the didDomainReload parameter is also available ( OnPostprocessAllAssets(string[] importedAssets,...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_139b923eed78
unity_docs
rendering
Explain 'Embedded Linux build settings reference' in Unity.
Use the Embedded Linux build settings to configure and build your application for the Embedded Linux platform. The Embedded Linux build settings are part of the Platform Settings section of the Build Profiles window . Property Description Architecture Choose the CPU architecture to build for the Embedded Linux platform...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_af5708f309af
unity_docs
rendering
Give me an overview of the `TerrainHeightmapSyncControl` class in Unity.
TerrainHeightmapSyncControl enumeration Description Controls what Terrain heightmap data to synchronize when there are changes to the heightmap texture. Additional resources: TerrainData.CopyActiveRenderTextureToHeightmap , TerrainData.DirtyHeightmapRegion , TerrainData.SyncHeightmap . Properties Property De...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d54c4cabbff7
unity_docs
rendering
Show me a Unity C# example demonstrating `GUI.Toggle`.
Rectangle on the screen to use for the button. value Is this button on or off? text Text to display on the button. image Texture to display on the button. content Text, image and tooltip for this button. style The style to use. If left out, the toggle style from the current GUISkin is used. Returns boo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4c25b4ff1512
unity_docs
physics
What is `ContactPoint2D.enabled` in Unity? Explain its purpose and usage.
ContactPoint2D.enabled public bool enabled ; Description Indicates whether the collision response or reaction is enabled or disabled. Certain features can disable collision responses which means you still get the collision callback but no response or reaction happens. For example, two boxes going through each o...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b5a89caf0477
unity_docs
scripting
What is `Debug.RetrieveStartupLogs` in Unity? Explain its purpose and usage.
Debug.RetrieveStartupLogs Declaration public static StartupLog[] RetrieveStartupLogs (); Description Returns any captured startup logs If startup logs are being captured, all captured logs will be returned. Capturing will also be disabled.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_99718cf211ee
unity_docs
rendering
What is `Rendering.RenderQueueRange.upperBound` in Unity? Explain its purpose and usage.
RenderQueueRange.upperBound public int upperBound ; Description Inclusive upper bound for the range. Objects that have material render queue smaller or equal to this are included in the range. Additional resources: lowerBound , FilteringSettings.renderQueueRange .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_20740282e8a9
unity_docs
scripting
Show me a Unity code example for 'Create a bindable custom control'.
g or an integer. You can find the completed files that this example creates in this GitHub repository . ## Create the custom control class Create a C# class to define the custom control. Create a Unity project with any template. Create a folder named ExampleField to store your files. In the ExampleField folder, creat...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fc15c43b758b
unity_docs
rendering
What is `iOSStatusBarStyle` in Unity? Explain its purpose and usage.
iOSStatusBarStyle enumeration Description iOS status bar style. Properties Property Description Default Default. LightContent A light status bar, intended for use on dark backgrounds. DarkContent A dark status bar, intended for use on light backgrounds.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_4b67205c6fc3_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
XR-enabled button with hover and click interactionsWorks with XR raycasting and pointer events Signature: ```csharp public class XRButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler ```
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_man_2ba067f8b1ee
unity_docs
ui
Explain 'Name selectors' in Unity.
USS name selectors match elements based on the name of an element. USS Name selectors are analogous to CSS ID selectors that match elements with a specific id attribute. To set the name of an element: In C# script, use VisualElement.name . In UXML, use the name attribute. For example: <VisualElement name="my-nameName">...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1bc5394c5485
unity_docs
rendering
What is `Rendering.ThreadedBatchContext.AddBatch` in Unity? Explain its purpose and usage.
ThreadedBatchContext.AddBatch Declaration public Rendering.BatchID AddBatch (NativeArray<MetadataValue> batchMetadata , GraphicsBufferHandle buffer ); Declaration public Rendering.BatchID AddBatch (NativeArray<MetadataValue> batchMetadata , GraphicsBufferHandle buffer , uint bufferOffset , uint win...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9b1cf0f5689e
unity_docs
editor
What is `Editor.Repaint` in Unity? Explain its purpose and usage.
Editor.Repaint Declaration public void Repaint (); Description Redraw any inspectors that shows this editor. Use this method when you want to ensure that the inspector updates to show changes made in OnSceneGUI .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_57c5fd7d8089_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
A custom reticle for a that displays its progress towards evaluatinga destination anchor and an indicator pointing in the direction of the destination anchor. Signature: ```csharp public class MultiAnchorTeleportReticle : MonoBehaviour, IXRInteractableCustomReticle ```
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_man_7aed94aad194
unity_docs
rendering
Explain 'Create a 3D texture' in Unity.
A 3D texture is a bitmap image that contains information in three dimensions rather than the standard two. 3D textures are commonly used to simulate volumetric effects such as fog or smoke, to approximate a volumetric 3D mesh , or to store animated textures and blend between them. To create a 3D texture, import a 2D te...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b965c2a30280
unity_docs
rendering
What are the parameters of `DynamicGI.SetEnvironmentData` in Unity?
Description Allows overriding the distant environment lighting for Enlighten Realtime Global Illumination, without changing the Skybox Material. The input array represents a cube with each face being 8 x 8 texels and each texel being 4 floats (for the RGBA values of the texel's color), so the size of the array is 8*8*6...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_a5a92a587eea
unity_docs
scripting
Explain 'Create a native plug-in for Android' in Unity.
To compile a C++ plug-in for Android, use the Android NDK and familiarize yourself with the steps required to build a shared library or a static library. If you use C++ to implement the plug-in, you must declare with C linkage to avoid name mangling issues . By default, only C source files that have a .c file extension...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_66c455d2004f
unity_docs
editor
What is `EditorUtility.OpenFilePanel` in Unity? Explain its purpose and usage.
EditorUtility.OpenFilePanel Declaration public static string OpenFilePanel (string title , string directory , string extension ); Parameters Parameter Description title The text to display in the toolbar of the dialog window. directory The default file directory that this dialog opens. This parameter is...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a2ae66da78c0
unity_docs
physics
What is `MonoBehaviour.OnCollisionStay` in Unity? Explain its purpose and usage.
MonoBehaviour.OnCollisionStay(Collision) Parameters Parameter Description other The Collision data associated with this collision. Description OnCollisionStay is called once per frame for every Collider or Rigidbody that touches another Collider or Rigidbody. In contrast to OnTriggerStay, OnCollisionStay is p...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_0e1ef4996a0d
unity_docs
networking
Show me a Unity code example for 'Use Unity Accelerator on the command line'.
t, configure, and make use of one or more cache servers. For ease of use, it’s best practice to add the location of the unity-accelerator executable to your PATH . The executable was installed in the path you chose when running the installer, for example C:\Program Files\Unity\accelerator . The CLI tool has an extensiv...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_544ee11291f0
unity_docs
rendering
What is `WebCamKind.UltraWideAngle` in Unity? Explain its purpose and usage.
WebCamKind.UltraWideAngle Description Ultra wide angle camera. These devices have a shorter focal length than a wide-angle camera. On iOS devices, this value is reported directly by the hardware. On Android devices, this value is reported for cameras with a calculated Equivalent Focal Length of less than 20mm. Addi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_445358e69697
unity_docs
scripting
Show me a Unity C# example demonstrating `ParticleSystem.MainModule.startColor`.
ParticleSystem.MainModule.startColor public ParticleSystem.MinMaxGradient startColor ; Description The initial color of particles when the Particle System first spawns them. Additional resources: MinMaxGradient . ```csharp using UnityEngine; using System.Collections;[RequireComponent(typeof(ParticleSystem)...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9d9c1573299f
unity_docs
scripting
What is `Experimental.GraphView.GraphElement.IsSelectable` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphElement.IsSelectable Declaration public bool IsSelectable (); Returns bool Returns true if the GraphElement is selectable. Returns false otherwise. Description The GraphElement is selectable.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.