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_fd4a9aa4d072
unity_docs
performance
What is `ParticleSystemJobs.ParticleSystemNativeArray3` in Unity? Explain its purpose and usage.
ParticleSystemNativeArray3 struct in UnityEngine.ParticleSystemJobs / Implemented in: UnityEngine.ParticleSystemModule Description A container to hold x, y, and z-axis data for particles. Properties Property Description x The x-axis value for each particle. y The y-axis value for each particle. z The z-axi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_eccdc2efee6b
unity_docs
scripting
What is `Search.QueryEngine_1.searchWordMatcher` in Unity? Explain its purpose and usage.
QueryEngine<T0>.searchWordMatcher public Func<string,bool,stringComparison,string,bool> searchWordMatcher ; Description The function used to match the search data against the search words. See SetSearchWordMatcher for a complete example.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_9022806d1035
unity_docs
physics
Explain 'OnTrigger events' in Unity.
Trigger colliders don’t cause collisions . Instead, they detect other colliders that pass through them, and call functions that you can use to initiate events. Example uses for triggers include: When the player reaches a specific area at the end of a corridor, activate a cinematic cutscene. When the player character wa...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_130ce8e700b4
unity_docs
physics
Give me an overview of the `OverlapCapsuleCommand` class in Unity.
OverlapCapsuleCommand struct in UnityEngine / Implemented in: UnityEngine.PhysicsModule Description Struct used to set up an overlap capsule command to be performed asynchronously during a job. When you use this struct to schedule a batch of overlap capsule commands, the commands are performed asynchronously. T...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_01e5b7294cc9
unity_docs
scripting
What is `Profiling.Profiler.BeginSample` in Unity? Explain its purpose and usage.
Profiler.BeginSample Declaration public static void BeginSample (string name ); Declaration public static void BeginSample (string name , Object targetObject ); Parameters Parameter Description name A string to identify the sample in the Profiler window. targetObject An object that provides context...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e356cd1e375d
unity_docs
rendering
What is `CustomRenderTexture.initializationColor` in Unity? Explain its purpose and usage.
CustomRenderTexture.initializationColor public Color initializationColor ; Description The color that Unity uses to initialize a Custom Render Texture. Unity ignores this parameter if an initializationMaterial is set.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a809eebc2f65
unity_docs
rendering
What is `Search.SearchItemOptions.Highlight` in Unity? Explain its purpose and usage.
SearchItemOptions.Highlight Description Highlights parts of the description that match the Search Query. ``` private static SearchItem SearchLogEntry(SearchContext context, SearchProvider provider, LogEntry logEntry) { if (!SearchUtils.MatchSearchGroups(context, logEntry.msgLowerCased, true)) return null; var l...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e1dda481db92
unity_docs
scripting
Explain 'Inspector window reference' in Unity.
The Inspector window displays the properties of the current selection of one or more GameObjects, assets, or components. You can use the Inspector window to view and edit the properties of the selected items. Topic Description Manage the Inspector window Open the Inspector window in normal or debug mode. Inspect items ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_b23457cfe475
github
scripting
Write a Unity C# MonoBehaviour script called Singleton Test Object_B
```csharp using System; using DyrdaDev.Singleton; using UnityEngine; public class SingletonTestObject_B : SingletonMonoBehaviour<SingletonTestObject_B> { private void Start() { Debug.Log("Testing the other singelton class: " + SingletonTestObject.Instance.name); } } ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_379f1914c0e0
unity_docs
scripting
Show me a Unity C# example demonstrating `CharacterController.collisionFlags`.
CharacterController.collisionFlags public CollisionFlags collisionFlags ; Description What part of the capsule collided with the environment during the last CharacterController.Move call. ```csharp using UnityEngine;public class Example : MonoBehaviour { CharacterController controller; void Start() { cont...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_26d630705216
unity_docs
scripting
In Unity's 'Gizmos introduction', what is 'Selection Outline' and how does it work?
When Selection Outline is enabled, an outline appears around selected GameObjects and their child GameObjects. By default, Unity outlines selected GameObjects in orange, and child GameObjects in blue. You can change these colors in the Unity Preferences window . When you select a GameObject, Unity outlines all its chil...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5ee9fb89ffd5
unity_docs
scripting
Give me an overview of the `PrefabUtility` class in Unity.
PrefabUtility class in UnityEditor Description Utility class for any Prefab related operations. ```csharp // This script creates a new menu item Examples>Create Prefab in the main menu. // Use it to create Prefab(s) from the selected GameObject(s). // It is placed in the root Assets folder. using System.IO; using...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ae3a69f93679
unity_docs
scripting
What is `Unity.Collections.LowLevel.Unsafe.NativeSliceUnsafeUtility.GetAtomicSafetyHandle` in Unity? Explain its purpose and usage.
NativeSliceUnsafeUtility.GetAtomicSafetyHandle Declaration public static Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle GetAtomicSafetyHandle (NativeSlice<T> slice ); Parameters Parameter Description slice The NativeSlice to check. Returns AtomicSafetyHandle The AtomicSafetyHandle of slice . ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_af772f315f70
unity_docs
editor
What are the parameters of `AssetDatabase.importPackageStarted` in Unity?
Description Callback raised whenever a package import starts. ```csharp using UnityEditor; using UnityEngine;[InitializeOnLoad] public class AssetDatabaseExamples { static AssetDatabaseExamples() { AssetDatabase.importPackageStarted += OnImportPackageStarted; AssetDatabase.importPackageCompleted...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_b1f37eaa6de4
unity_docs
physics
Explain '2D Sprite' in Unity.
com.unity.2d.sprite ## Description Use Unity Sprite Editor Window to create and edit Sprite asset properties like pivot, borders and Physics shape ## Version information Core packages are fixed to a single version matching the Editor version.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_b4eb7e0ea965
unity_docs
rendering
In Unity's 'Lightmap data format', what is 'Advantages of High Quality (BC6H) lightmaps' and how does it work?
HDR lightmaps don’t use any encoding scheme to encode lightmap values, so the supported range is only limited by the 16-bit floating point texture format that goes from 0 to 65504. BC6H format quality is superior to DXT5 + RGBM format encoding, and it doesn’t produce any of the color banding artifacts that RGBM encodin...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_393971c34b86
unity_docs
editor
Show me a Unity C# example demonstrating `EditorTools.ToolManager.SetActiveTool`.
Tool (Type type ); Declaration public static void SetActiveTool ( EditorTools.EditorTool tool ); Parameters Parameter Description type The EditorTool type to set as the active tool. tool The EditorTool instance to set as the active tool. Description Sets the active EditorTool . To set a built-in...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_8f8ed77e0973
github
scripting
Write a Unity Editor script for Base Editor Script Template
```csharp using CodeGeneration.Base; using FieldSearch.Attributes; using FieldSearch.Core.GlobalEditor; using System; using UnityEngine; namespace FieldSearch.EditorScriptGeneration.Templates { /// <summary> /// Base editor script template object. /// Base editor implementation <see cref="BaseScriptTempla...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_988710b1eb7b
unity_docs
physics
What is `Physics2D.GetIgnoreCollision` in Unity? Explain its purpose and usage.
Physics2D.GetIgnoreCollision Declaration public static bool GetIgnoreCollision ( Collider2D collider1 , Collider2D collider2 ); Parameters Parameter Description collider1 The first Collider to compare to collider2 . collider2 The second Collider to compare to collider1 . Returns bool Whether the ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8eedde7944ea
unity_docs
editor
What are the parameters of `Profiling.FrameDataView.GetCounterValueAsInt` in Unity?
Returns int Returns the counter value as int . Description Gets the last value of a counter marker in the frame as an int data type'. Use to retrieve the last data sample of a marker with MarkerFlags.Counter flag. ```csharp using UnityEditor.Profiling;class Example { static unsafe int ExtractMyCounterValue(FrameDat...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e135e574a36d
unity_docs
physics
What is `JointBreakAction2D.Disable` in Unity? Explain its purpose and usage.
JointBreakAction2D.Disable Description When the Joint2D breaks, call Joint2D.OnJointBreak2D and then disable the component. When the joint is disable, no further joint breaking can occur until the joint is enabled again.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_c373de714fb8_doc_6
github
scripting
What does `TryUpdateInstance` do in this Unity script? Explain its purpose and signature.
Delete previous instance when creating a new one Signature: ```csharp protected virtual void TryUpdateInstance() ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_man_0deb176ccb21
unity_docs
rendering
In Unity's 'Batch meshes at runtime', what is 'Batch moving GameObjects at runtime' and how does it work?
To batch moving GameObjects, enable dynamic batching . Warning: For most uses, dynamic batching is no longer recommended, because the CPU overhead can be greater than the overhead of a draw call. If you use URP or HDRP, use the Scriptable Render Pipeline (SRP) Batcher instead. For more information, refer to Choose a dr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_fac9d7f42500
unity_docs
physics
Explain 'Spring Joint component reference' in Unity.
The Spring Joint joins two Rigidbodies together but allows the distance between them to change as though they were connected by a spring. The spring acts like a piece of elastic that tries to pull the two anchor points together to the same position. ## Properties Property: Function: Connected Body The Rigidbody objec...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_41114eabb408
unity_docs
physics
Show me a Unity C# example demonstrating `Rigidbody.SweepTest`.
object would fit through a gap without colliding with anything. Note that this function only works when a primitive collider type (sphere, cube or capsule) or a convex mesh is attached to the rigidbody object - concave mesh colliders will not work, although they can be detected in the Scene by the sweep. Additional res...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_95eef3080fea
unity_docs
ui
What is `UIElements.PickingMode.Position` in Unity? Explain its purpose and usage.
PickingMode.Position Description Picking enabled. Default Value. Performs picking based on the position rectangle. In the VisualElement tree hierarchy, the picking process works using a similar logic as the rendering but in reverse order: it starts with the front-most elements and proceeds step by step towards ba...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0e333ca54664
unity_docs
rendering
What is `Rendering.CommandBuffer.SetGlobalFloatArray` in Unity? Explain its purpose and usage.
CommandBuffer.SetGlobalFloatArray Declaration public void SetGlobalFloatArray (string propertyName , float[] values ); Declaration public void SetGlobalFloatArray (int nameID , float[] values ); Declaration public void SetGlobalFloatArray (string propertyName , List<float> values ); Declaration publ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cc5420f3e78a
unity_docs
scripting
What is `Build.Reporting.CommonRoles.resourcesFile` in Unity? Explain its purpose and usage.
CommonRoles.resourcesFile public static string resourcesFile ; Description The BuildFile.role value of the file that contains the contents of the project's "Resources" folder, packed into a single file.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_dc8129945f55
unity_docs
physics
What is `PhysicsVisualizationSettings.QueryFilter.Capsule` in Unity? Explain its purpose and usage.
PhysicsVisualizationSettings.QueryFilter.Capsule Description Whether the filter includes capsule shaped queries. For example, capsule shaped queries include Physics.CapsuleCast , Physics.CheckCapsule , and Physics.OverlapCapsule .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_07b62c184bc5
unity_docs
scripting
Show me a Unity C# example demonstrating `Unity.Collections.LowLevel.Unsafe.UnsafeUtility.PinGCArrayAndGetDataAddress`.
collector from relocating it. This is crucial when interfacing with native code or conducting low-level memory operations involving managed arrays. Use this method to obtain a stable pointer to array elements for performance-critical operations. After pinning an array, release the GC handle using UnsafeUtility.Release...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_078cdf17ed22
unity_docs
scripting
Give me an overview of the `SleepTimeout` class in Unity.
SleepTimeout class in UnityEngine / Implemented in: UnityEngine.CoreModule Description Constants for special values of Screen.sleepTimeout . Use them to specify something other than a fixed amount of seconds before dimming the screen. Static Properties Property Description NeverSleep Prevent screen dimming...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_beeec50ffac4
unity_docs
math
What is `Object.InstantiateAsync` in Unity? Explain its purpose and usage.
Object.InstantiateAsync Declaration public static AsyncInstantiateOperation<T> InstantiateAsync (T original ); Declaration public static AsyncInstantiateOperation<T> InstantiateAsync (T original , InstantiateParameters parameters , CancellationToken cancellationToken ); Declaration public static AsyncI...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d99ff86d1bdc
unity_docs
editor
Explain 'UITK Text Settings assets' in Unity.
UI Toolkit stores project-wide text settings in the UITK Text Settings asset. UI Toolkit uses a default UITK Text Settings asset for your text objects. For runtime UI, you can create and assign a UITK Text Settings asset to the Panel Setting asset, and edit the text setting properties: To create a UITK Text Settings, s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_92e16eb367c7
unity_docs
rendering
What is `RenderPickingResult.resolverWithWorldPos` in Unity? Explain its purpose and usage.
RenderPickingResult.resolverWithWorldPos public HandleUtility.ResolvePickingWithWorldPositionCallback resolverWithWorldPos ; Description The callback to invoke to resolve a picking index into a GameObject reference. The callback is invoked only if one of the picking indices rendered ends up being the topmost ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f2c228fbfd6c
unity_docs
ui
What is `Experimental.GraphView.FreehandSelector.RegisterCallbacksOnTarget` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. FreehandSelector.RegisterCallbacksOnTarget Declaration protected void RegisterCallbacksOnTarget (); Description Register callbacks on target VisualElement.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d229a7f42d07
unity_docs
editor
In Unity's 'Create custom Editor Windows with IMGUI', what is 'Showing the window' and how does it work?
In order to show the window on screen, make a menu item that displays it. This is done by creating a function which is activated by the MenuItem property. The default behavior in Unity is to recycle windows, so selecting the menu item again would show existing windows. This is done by using the function EditorWindow.Ge...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f18ba396e861
unity_docs
scripting
What is `UIElements.BaseTreeView.itemsSource` in Unity? Explain its purpose and usage.
BaseTreeView.itemsSource public IList itemsSource ; Description Access to the itemsSource. For a TreeView, the source contains the items wrappers. To set the items source, use SetRootItems_1 instead, which allows fully typed items.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d992881685e2
unity_docs
rendering
In Unity's 'GPU texture formats reference', what is 'Supported texture formats, by platform' and how does it work?
The table below shows each texture format available in Unity, and the platforms that support them. Texture format Windows macOS Linux Android iOS & tvOS Web (Desktop Browsers) Web (iOS and Android browser) Alpha 8 yes yes yes yes yes yes yes R 8 yes yes yes yes yes yes yes R 16 bit yes yes yes partial (4) partial (4) y...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_636e12aad062
unity_docs
editor
Show me a Unity C# example demonstrating `Unity.Profiling.Editor.ProfilerModuleMetadataAttribute.ctor`.
ProfilerModuleMetadataAttribute Constructor Declaration public ProfilerModuleMetadataAttribute (string displayName ); Parameters Parameter Description displayName The display name of the attributed module. Description Initializes and returns an instance of ProfilerModuleMetadataAttribute . ```csharp usin...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a331df9c4c4f
unity_docs
scripting
What is `AI.NavMeshPath.status` in Unity? Explain its purpose and usage.
NavMeshPath.status public AI.NavMeshPathStatus status ; Description Status of the path. (Read Only) This reports whether the path reaches the target, reaches part of the way to the target, or is just not valid. Among other reasons, a path returns NavMeshPathStatus.PathInvalid if it can't determine the neare...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_afd2b6e3bf5d
github
scripting
Write a Unity C# MonoBehaviour script called Root Object Test1
```csharp using UnityEngine; public class RootObjectTest1 : MonoBehaviourExtended, ITest { [Root] private GameObject go; private void Start() { if (!Test()) { Debug.LogError("Test failed: " + this); } } public bool Test() { if (go != null) ...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_4f9fb4bb3caf
unity_docs
physics
What is `PhysicsVisualizationSettings.SetShowRigidbodies` in Unity? Explain its purpose and usage.
PhysicsVisualizationSettings.SetShowRigidbodies Declaration public static void SetShowRigidbodies (bool show ); Description Should any Rigidbodies be considered by the display filter. Kinematic Rigidbodies can be further filtered by SetShowKinematicBodies . Sleeping Rigidbodies can be further filtered by Set...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bd892a15f40d
unity_docs
scripting
What is `TextAsset.text` in Unity? Explain its purpose and usage.
TextAsset.text public string text ; Description The text contents of the file as a string. (Read Only) Encodings are detected and interpreted automatically. Supported encodings are: UTF-32 Big or Little Endian with a byte order mark, UTF-16 Big or Little Endian with a byte order mark, UTF-8 with a byte orde...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_6b945cbccb82_doc_2
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
The Input System action to read the Aim Flags.Typically a Value action type with an Integer control type with a binding to either:&lt;MetaAimHand&gt;{LeftHand}/aimFlags&lt;MetaAimHand&gt;{RightHand}/aimFlags Signature: ```csharp public InputActionProperty aimFlagsAction ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8c6f4974ffbe
unity_docs
rendering
Explain 'Lens flares in the Built-In Render Pipeline' in Unity.
Resources and techniques for creating lens flares lighting effects in the Built-In Render Pipeline . Page Description Create a lens flare Create a flare and apply it to a lens flare component, then configure it to be visible by cameras . Configuring Flare elements Learn how Unity manages elements on a Flare asset, and ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_4d2a53a39613
unity_docs
ui
In Unity's 'Work with elements', what is 'Add elements' and how does it work?
You need to add elements to the hierarchy to create UI. To add an element to the hierarchy in UI Builder, drag it from the Library tab into the Hierarchy window. You can also double-click on an element in the Library to append it to the Hierarchy . By default, elements aren’t named, so they appear in the Hierarchy as t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_a3ca89a674a5
unity_docs
xr
In Unity's 'Handle Android crashes', what is 'Specify how Unity handles crashes' and how does it work?
If you don’t want to use Unity’s default crash handling behavior, you can use the -androidChainedSignalHandlerBehavior command-line argument to change how Unity reacts to crashes. This argument takes one of the following values: Behavior value Description legacy When a native crash occurs, Unity wraps and throws the cr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5a4864b0652b
unity_docs
math
Give me an overview of the `TreeInstance` class in Unity.
TreeInstance struct in UnityEngine / Implemented in: UnityEngine.TerrainModule Description Contains information about a tree placed in the Terrain game object. This struct can be accessed from the TerrainData Object. Properties Property Description color Color of this instance. heightScale Height scale of ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_4abb0c1bb72e
unity_docs
physics
Explain 'Create and apply a custom Physics Material' in Unity.
You can create as many custom Physics Material assets as you need, and apply them to colliders in your scene . Several colliders can have the same Physics Material asset assigned to them, and you can set a project-wide default to apply new default settings to all colliders in the project. ## Create a custom Physics Ma...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cc242d37fba8
unity_docs
editor
Show me a Unity C# example demonstrating `PrefabUtility.ReplacePrefabAssetOfPrefabInstance`.
ther it makes sense to delete the object if it proves redundant on the new instance. This can be done from either the Hierarchy or Overrides window. For explict control over which overrides should be cleared use the PrefabReplacingSettings.prefabOverridesOptions flags found in the PrefabReplacingSettings . Additiona...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6427eb9e67fe
unity_docs
scripting
What is `Unity.Android.Gradle.PluginManagement` in Unity? Explain its purpose and usage.
PluginManagement class in Unity.Android.Gradle / Inherits from: Unity.Android.Gradle.BaseBlock Description The C# definition of the pluginManagement element in a settings.gradle file. For more information about the file, see Android's documentation: The Gradle settings file Properties Property Description...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_441d62ee8573
unity_docs
editor
What are the parameters of `AssetDatabase.importPackageCancelled` in Unity?
Description Callback raised whenever a package import is cancelled by the user. ```csharp using UnityEditor; using UnityEngine;[InitializeOnLoad] public class AssetDatabaseExamples { static AssetDatabaseExamples() { AssetDatabase.importPackageStarted += OnImportPackageStarted; AssetDatabase.impo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6ad6e5a7a192
unity_docs
ui
Show me a Unity C# example demonstrating `GUI.BringWindowToFront`.
GUI.BringWindowToFront Declaration public static void BringWindowToFront (int windowID ); Parameters Parameter Description windowID The identifier used when you created the window in the Window call. Description Bring a specific window to front of the floating windows. ```csharp // Draws 2 overlapped wi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_8f542aebd9f9_doc_2
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Transform component receives a special class to always save its data. Signature: ```csharp public TransformData tData; ```
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_man_bb66a76db0ce
unity_docs
editor
In Unity's 'Include additional files in a build', what is 'AssetBundles and the StreamingAssets folder' and how does it work?
The StreamingAssets folder is useful if you intend to distribute AssetBundles directly in the Player installation, rather than downloading them on-demand. To do this: Build the AssetBundles to an output path inside Assets/StreamingAssets . Note : The.manifest files generated alongside the AssetBundle files aren’t requi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_fef5b7e5c109
unity_docs
physics
Explain 'List panel reference' in Unity.
The Package Manager window displays the list of feature sets, packages, or Asset Store packages that meet your criteria. You set the criteria by selecting a context in the navigation panel , and by optionally setting additional filter and search criteria. For important information about the way search works, refer to S...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ca571fb5784d
unity_docs
scripting
What is `Android.AndroidGame.Automatic` in Unity? Explain its purpose and usage.
Automatic class in UnityEngine.Android / Implemented in: UnityEngine.AndroidJNIModule Description Provides methods for Automated game state hinting in Unity . Static Methods Method Description SetGameState Sets the current AndroidGameState to be used for Automated game state hinting in Unity. Requires API l...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7ffb91d46437
unity_docs
editor
What are the parameters of `Callbacks.RunAfterClassAttribute.ctor` in Unity?
Description Add this attribute to a callback method to mark that this callback must be run after any callbacks that are part of the specified class. To define dependencies for a callback, use the following attributes: RunAfterClassAttribute , RunBeforeClassAttribute RunAfterAssemblyAttribute , RunBeforeAssemblyAttribut...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b106a6918b74
unity_docs
xr
What is `Rendering.AsyncGPUReadbackRequest.GetData` in Unity? Explain its purpose and usage.
AsyncGPUReadbackRequest.GetData Declaration public NativeArray<T> GetData (int layer ); Parameters Parameter Description layer The index of the layer to retrieve. Description Fetches the data of a successful request. This method throws an InvalidOperationException if called when the request has not been f...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3d65b370ad06
unity_docs
editor
Show me a Unity C# example demonstrating `Build.Profile.BuildProfile.SetActiveBuildProfile`.
d to the next Editor update. However, in batch mode the Editor will stop after executing the designated script code, so deferring the operation isn't possible. To set a build profile that targets a non-active platform in batch mode, use the activeBuildProfile command-line argument. Additional resources: Platform pr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c1502fa0b63c
unity_docs
scripting
What is `Rendering.ReflectionProbeRefreshMode.EveryFrame` in Unity? Explain its purpose and usage.
ReflectionProbeRefreshMode.EveryFrame Description Causes Unity to update the probe's cubemap every frame. Note that updating a probe is very costly. Setting this option on too many probes could have a significant negative effect on frame rate. Use time-slicing to help improve performance. Additional resources: Refl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f1e0ae244488
unity_docs
scripting
What is `IMGUI.Controls.MultiColumnHeader.ToggleVisibility` in Unity? Explain its purpose and usage.
MultiColumnHeader.ToggleVisibility Declaration protected void ToggleVisibility (int columnIndex ); Parameters Parameter Description columnIndex Toggle visibility for this column. Description Method for toggling the visibility of a column. This is also called from the context menu of the MultiColumnHeader....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_00d3e0aa5133
unity_docs
rendering
What is `AssetDatabase.CopyAsset` in Unity? Explain its purpose and usage.
AssetDatabase.CopyAsset Declaration public static bool CopyAsset (string path , string newPath ); Parameters Parameter Description path Filesystem path of the source asset. newPath Filesystem path of the new asset to create. Returns bool Returns true if the copy operation is successful or false if par...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4514674c4153
unity_docs
rendering
What is `TerrainLayerInspector.ApplyCustomUI` in Unity? Explain its purpose and usage.
TerrainLayerInspector.ApplyCustomUI Declaration public void ApplyCustomUI ( ITerrainLayerCustomUI customUI , Terrain terrain ); Parameters Parameter Description customUI The custom UI object. terrain The Terrain object. Description Applies the custom UI for the Terrain Layer object. The custom UI ob...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_79365964224b
unity_docs
animation
What is `Animations.PropertyStreamHandle.GetReadMask` in Unity? Explain its purpose and usage.
PropertyStreamHandle.GetReadMask Declaration public bool GetReadMask ( Animations.AnimationStream stream ); Parameters Parameter Description stream The AnimationStream that holds the animated values. Returns bool Returns true if the property can be read. Description Gets the read mask of the prope...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d20ccdc093f6
unity_docs
physics
What is `AssetDatabase.MakeEditable` in Unity? Explain its purpose and usage.
AssetDatabase.MakeEditable Declaration public static bool MakeEditable (string path ); Parameters Parameter Description path Project relative path to the file. Returns bool true if Unity successfully made the file editable in the version control system. Otherwise, returns false . Description Makes a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_a937c3f773db
unity_docs
physics
In Unity's 'Create rule set files', what is 'Step 1: Set up the ruleset file' and how does it work?
Create a subfolder named “Subfolder” inside your project’s Assets folder. Inside Subfolder : Create a new .asmdef file. Save a duplicate copy of RethrowError.cs . Create a Default.ruleset file inside Assets with the following code: ``` <?xml version="1.0" encoding="utf-8"?> <RuleSet Name="New Rule Set" Description=" " ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_415ad6ecfd9e
unity_docs
rendering
In Unity's 'Check whether a GameObject is compatible with the SRP Batcher in URP', what is 'Shader compatibility' and how does it work?
All lit and unlit shaders in the the Universal Render Pipeline (URP) and the High Definition Render Pipeline (HDRP) fit this requirement (except for the particle versions of these shaders). For a custom shader to be compatible with the SRP Batcher it must meet the following requirements: The shader must declare all bui...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b9dcf10ad218
unity_docs
input
What is `Android.AndroidApplication.onConfigurationChanged` in Unity? Explain its purpose and usage.
AndroidApplication.onConfigurationChanged Description A callback to detect the device configuration changes when the application is running. Unity invokes this callback for the configuration changes related to the following aspects. Orientation Keyboard visibility Dark theme Screen layout Screen size For more...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9a0ebf08ac73
unity_docs
scripting
What is `PlayerPrefs.DeleteAll` in Unity? Explain its purpose and usage.
PlayerPrefs.DeleteAll Declaration public static void DeleteAll (); Description Removes all keys and values from the preferences. Use with caution. Call this function in a script to delete all current settings in the PlayerPrefs . The following example demonstrates creating a button that deletes all PlayerPrefs...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_7c63e9bc7f8f
unity_docs
rendering
Explain 'Fog shader example in the Built-In Render Pipeline' in Unity.
``` Shader "Custom/TextureCoordinates/Fog" { SubShader { Pass { HLSLPROGRAM #pragma vertex vert #pragma fragment frag //Needed for fog variation to be compiled. #pragma multi_compile_fog #include "UnityCG.cginc" struct vertexInput { float4 vertex : POSITION; float4 texcoord0 : TEXCOORD0; }; struct fra...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c4265e871dcd
unity_docs
ui
What is `GUIStyle.CalcSize` in Unity? Explain its purpose and usage.
GUIStyle.CalcSize Declaration public Vector2 CalcSize ( GUIContent content ); Description Calculate the size of some content if it is rendered with this style. This function does not take word wrapping into account. To do that, you need to determine the allocated width and then call CalcHeight to figure...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_127fb98ef039
unity_docs
editor
In Unity's 'Version Control', 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.collab-proxy@3.0 released 3.0.0, 3.0.1, 3.0.2 com.unity.collab-proxy@2.12 released 2.12.4
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_41506977f4e1
unity_docs
animation
Explain 'Key manipulation in Dopesheet mode' in Unity.
Use Box Selection to select multiple keys while viewing the Animation window in Dopesheet mode. Use Box Selection to select and manipulate many keys at once. Perform the following actions to select multiple keys: * Hold Shift and click to add individual keys to your selection. * Drag a rectangle with the mouse to selec...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6bd2bf73dfb2
unity_docs
performance
Show me a Unity C# example demonstrating `Profiling.CustomSampler.Begin`.
CustomSampler.Begin Declaration public void Begin (); Declaration public void Begin ( Object targetObject ); Description Begin profiling a piece of code with a custom label defined by this instance of CustomSampler . This will show up in the Profiler hierarchy. ```csharp using UnityEngine; using UnityEn...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_e3638f791235_doc_2
github
scripting
What does `DefaultFileFolder` do in this Unity script? Explain its purpose and signature.
Folder for generated files Signature: ```csharp public string DefaultFileFolder => Path.Combine(Environment.CurrentDirectory, _defaultFileFolder); ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c8eec0d515ef
unity_docs
performance
What is `AI.NavMeshBuildSettings.maxJobWorkers` in Unity? Explain its purpose and usage.
NavMeshBuildSettings.maxJobWorkers public uint maxJobWorkers ; Description The maximum number of worker threads that the build process can utilize when building a NavMesh with these settings. A value between 1 and JobsUtility.JobWorkerCount (inclusive) causes the build process to schedule all of the work with...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_5a9c05e27e0f
github
scripting
Write a Unity C# physics script for Fade Canvas On Overlap
```csharp using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; public class FadeCanvasOnOverlap : MonoBehaviour { [Tooltip("Used for the radius of overlap sphere")] public float checkDistance = 0.5f; [Tooltip("What layers trigger the overlap?")] public LayerMas...
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_f9cea2b567e5
unity_docs
scripting
What is `Experimental.Rendering.GraphicsFormatUtility.GetDepthBits` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphicsFormatUtility.GetDepthBits Declaration public static int GetDepthBits ( Experimental.Rendering.GraphicsFormat format ); Parameters Parameter Description format GraphicsFormat to use when retrieving the number of ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9378258a4001
unity_docs
animation
What is `AnimationState.time` in Unity? Explain its purpose and usage.
AnimationState.time public float time ; Description The current time of the animation. If the time is larger than length it will be wrapped according to wrapMode. The value can be larger than the animations length. In this case playback mode will remap the time before sampling. This value usually goes from 0 to...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_2df14284cabb
unity_docs
scripting
Show me a Unity code example for 'Display camera views on multiple monitors'.
u activate a display, you can’t deactivate it. The best time to activate additional displays is when your application creates a new Scene . A good way to do this is to attach a script component to the default Camera. Make sure you call Display.Activate() only once during startup. As a best practice, you might find it h...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5f1c54f38603
unity_docs
rendering
Show me a Unity C# example demonstrating `Playables.ScriptPlayableBinding.Create`.
that acts as a key for this binding. type The type of object that will be bound to the ScriptPlayableOutput . name The name of the ScriptPlayableOutput. Returns PlayableBinding Returns a PlayableBinding that contains information that is used to create a ScriptPlayableOutput . Description Creates a Play...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1ca5b6323394
unity_docs
physics
What is `Physics.reuseCollisionCallbacks` in Unity? Explain its purpose and usage.
Physics.reuseCollisionCallbacks public static bool reuseCollisionCallbacks ; Description Determines whether the garbage collector should reuse only a single instance of a Collision type for all collision callbacks. When an MonoBehaviour.OnCollisionEnter , MonoBehaviour.OnCollisionStay or MonoBehaviour.OnCol...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_9dadc22a86d9
github
scripting
Write a Unity C# script called Target Job
```csharp using Gilzoide.UpdateManager.Jobs; using Unity.Collections; using UnityEngine; using UnityEngine.Jobs; namespace Gilzoide.UpdateManager.Sample.FollowTarget { [ReadOnlyTransformAccess] public struct TargetJob : IBurstUpdateTransformJob<BurstUpdateTransformJob<TargetJob>> { [WriteOnly] publ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_357f274447ca
unity_docs
rendering
In Unity's 'Stencil command in ShaderLab reference', what is 'Parameters' and how does it work?
Parameter Value Function ref An integer. Range 0 through 255. Default is 0. The reference value. The GPU compares the current contents of the stencil buffer against this value, using the operation defined in comparisonOperation. This value is masked with readMask or writeMask, depending on whether a read or a write ope...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_a0ef10e1d980
unity_docs
physics
Explain 'Name your package' in Unity.
There are two names for a package. The first name is the official name , which is an identifier that you register the package with. The second name is the user-facing display name that appears in the Unity Editor. Keep the display name brief, yet informative enough so that users can tell what it contains. The Unity Pac...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6c534675b9c6
unity_docs
performance
What is `Unity.Profiling.ProfilerFlowEventType.ParallelNext` in Unity? Explain its purpose and usage.
ProfilerFlowEventType.ParallelNext Description Use for the parallel flow continuation point. All parallel flow instances are equivalent and connected to the same Begin or Next events that happened previously. An example of a flow start point is job scheduling. For instance, IJobParallelForExtensions.Schedule ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_17bb4d784f7b
unity_docs
editor
What is `EditorGUIUtility.CommandEvent` in Unity? Explain its purpose and usage.
EditorGUIUtility.CommandEvent Declaration public static Event CommandEvent (string commandName ); Parameters Parameter Description commandName The command to be sent. Description Creates an event that can be sent to another window. ```csharp // Sends a paste event to an EditorWindow, as if Paste // was ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cd1968a18b0e
unity_docs
scripting
Show me a Unity C# example demonstrating `Scripting.RequiredMemberAttribute`.
RequiredMemberAttribute class in UnityEngine.Scripting / Implemented in: UnityEngine.CoreModule Description When a type is marked, all of its members with [RequiredMember] are marked. ```csharp using System; using UnityEngine; using UnityEngine.Scripting;public class NewBehaviourScript : MonoBehaviour { void S...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7e60a41efc7e
unity_docs
rendering
Show me a Unity C# example demonstrating `ParticleSystem.SizeBySpeedModule.y`.
ParticleSystem.SizeBySpeedModule.y public ParticleSystem.MinMaxCurve y ; Description Size by speed curve for the y-axis. Additional resources: MinMaxCurve . ```csharp using UnityEngine; using System.Collections;[RequireComponent(typeof(ParticleSystem))] public class ExampleClass : MonoBehaviour { private ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5c38af3b84d1
unity_docs
rendering
In Unity's 'Get started with UI Builder', what is 'Create the root element' and how does it work?
Create a new project and then create a root visual element that covers the entire screen. Set your root element to have a background color and center all child elements in the middle of the screen. Create a project in Unity with any template. Select Window > UI Toolkit > UI Builder . In the UI Builder window, at the to...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b828f36c8ab4
unity_docs
scripting
Show me a Unity C# example demonstrating `Unity.IO.LowLevel.Unsafe.AsyncReadManagerSummaryMetrics`.
ng set of AsyncReadManagerRequestMetric records by calling AsyncReadManagerMetrics.GetSummaryOfMetrics . You can get these records by calling AsyncReadManagerMetrics.GetMetrics . In both cases, you can filter the data with AsyncReadManagerMetricsFilters in order to focus the summary on the particular categories ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d655bfb99824
unity_docs
scripting
Show me a Unity code example for 'Quit a Unity Android application'.
If you must programmatically close an Android application, it’s best practice to use Activity.moveTaskToBack instead of Application.Quit . Activity.moveTaskToBack pauses the application and moves it to the background, which is closer to the standard Android application lifecycle than Application.Quit . The following co...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6e765ab51446
unity_docs
math
What is `BoundsInt.ClampToBounds` in Unity? Explain its purpose and usage.
BoundsInt.ClampToBounds Declaration public void ClampToBounds ( BoundsInt bounds ); Parameters Parameter Description bounds Bounds to clamp to. Description Clamps the position and size of this bounding box to the given bounds.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d66f5ede6289
unity_docs
editor
Explain 'Toolchain Linux x64' in Unity.
com.unity.toolchain.linux-x86_64 ## Description Toolchain to build player target Linux x86_64 on host Linux x86_64 ## Released for Unity Package version 2.0.11 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_sr_91dc511c5a90
unity_docs
performance
What is `Profiling.RawFrameDataView` in Unity? Explain its purpose and usage.
RawFrameDataView class in UnityEditor.Profiling / Inherits from: Profiling.FrameDataView Description Provides access to the Profiler data for a specific frame and thread. Use RawFrameDataView to retrieve unstructured Profiler samples data for the particular frame. The order of samples is determined by the or...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5ed7a2bc0021
unity_docs
scripting
What is `SearchService.ObjectSelectorSearch.UnregisterEngine` in Unity? Explain its purpose and usage.
ObjectSelectorSearch.UnregisterEngine Declaration public static void UnregisterEngine ( SearchService.IObjectSelectorEngine engine ); Parameters Parameter Description engine The ObjectSelector search engine to unregister. Description Unregisters a dynamically registered engine.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4edec59f1176
unity_docs
scripting
What is `Rendering.StencilState.SetCompareFunction` in Unity? Explain its purpose and usage.
StencilState.SetCompareFunction Declaration public void SetCompareFunction ( Rendering.CompareFunction value ); Parameters Parameter Description value The value to set. Description The function used to compare the reference value to the current contents of the buffer. Sets compareFunctionBack and comp...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_918d60c92f38
unity_docs
rendering
What is `Rendering.RayTracingInstanceCullingTest.allowOpaqueMaterials` in Unity? Explain its purpose and usage.
RayTracingInstanceCullingTest.allowOpaqueMaterials public bool allowOpaqueMaterials ; Description Whether to allow Renderers that use opaque Materials. If this value is false and the Mesh used by a Renderer uses opaque Materials then the test fails. A Material is considered opaque if it's not alpha tested or tr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_001fcaf64152
unity_docs
scripting
Show me a Unity C# example demonstrating `Quaternion.eulerAngles`.
le demonstrates the rotation of a GameObject using eulerAngles based on the Input of the user. The example shows that we never rely on reading the Quanternion.eulerAngles to increment the rotation, instead we set it using our Vector3 currentEulerAngles. All rotational changes happen in the currentEulerAngles variable, ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.