id
stringlengths
15
22
source
stringclasses
2 values
category
stringclasses
12 values
instruction
stringlengths
22
180
response
stringlengths
100
46.1k
system
stringclasses
5 values
gh_59f1b0932bd7
github
scripting
Write a Unity Editor script for Draw Locks List View Item
```csharp using System; using UnityEngine; using Codice.CM.Common; using PlasticGui.WorkspaceWindow.Locks; using Unity.PlasticSCM.Editor.UI.Avatar; using Unity.PlasticSCM.Editor.UI.Tree; namespace Unity.PlasticSCM.Editor.Views.Locks { internal static class DrawLocksListViewItem { internal static void...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_c36798be69ab
unity_docs
scripting
What is `Cloth.randomAcceleration` in Unity? Explain its purpose and usage.
Cloth.randomAcceleration public Vector3 randomAcceleration ; Description A random, external acceleration applied to the cloth. Use this to simulate randomly changing forces on the cloth, such as wind turbulences waving a flag. Additional resources: Cloth.externalAcceleration . ```csharp using UnityEngine;p...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c0889499b5e9
unity_docs
input
What is `VersionControl.Asset.IsState` in Unity? Explain its purpose and usage.
Asset.IsState Declaration public bool IsState ( VersionControl.Asset.States state ); Parameters Parameter Description state State to check for. Description Returns true if the version control state of the asset exactly matches the input state.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c71927ad40a2
unity_docs
editor
What is `IMGUI.Controls.TreeView.HasFocus` in Unity? Explain its purpose and usage.
TreeView.HasFocus Declaration public bool HasFocus (); Description Returns true if the TreeView and its EditorWindow have keyboard focus. Additional resources: GUIUtility.keyboardControl , EditorWindow.focusedWindow .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e9f9a140906d
unity_docs
physics
What is `PhysicsScene2D.Linecast` in Unity? Explain its purpose and usage.
PhysicsScene2D.Linecast Declaration public RaycastHit2D Linecast ( Vector2 start , Vector2 end , int layerMask = Physics2D.DefaultRaycastLayers); Declaration public RaycastHit2D Linecast ( Vector2 start , Vector2 end , ContactFilter2D contactFilter ); Parameters Parameter Description sta...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f972987a290b
unity_docs
rendering
Explain 'Choose a render pipeline' in Unity.
It’s important to choose the right Unity render pipeline for your project when you’re early in development. Different render pipelines have different capabilities and perform differently, so they work best for different games, applications, and platforms. It can be very time-consuming to switch a project from one rende...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0c58c2a0f557
unity_docs
editor
What is `Compilation.ScriptCompilerOptions` in Unity? Explain its purpose and usage.
ScriptCompilerOptions class in UnityEditor.Compilation Description Compiler options passed to the script compiler. Properties Property Description AdditionalCompilerArguments Additional compiler arguments. AllowUnsafeCode Allow 'unsafe' code when compiling scripts. AnalyzerConfigPath Stores the path to the R...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_111a6fe8bf34
unity_docs
editor
Show me a Unity C# example demonstrating `Networking.PlayerConnection.PlayerConnectionGUIUtility.GetConnectionState`.
g back on to the connection to the Editor. Instead, it only responds to a user actively choosing a target, and waits until that connection has been established. If the connection type is one that is shared across Editor windows, it will also be fired when the user chooses it in a different EditorWindow . The returned ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_dc95ef1e7c49
unity_docs
rendering
Explain 'Surface Shader output structures in the Built-In Render Pipeline' in Unity.
Standard output structure of surface shaders is this: ``` struct SurfaceOutput { fixed3 Albedo; // diffuse color fixed3 Normal; // tangent space normal, if written fixed3 Emission; half Specular; // specular power in 0..1 range fixed Gloss; // specular intensity fixed Alpha; // alpha for transparencies }; ``` In ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e19ae2af893d
unity_docs
scripting
Show me a Unity C# example demonstrating `Handles.Slider`.
position value passed into the function. Description Make a 3D slider that moves along one axis. This method will draw a 3D-draggable handle on the screen. The handle is constrained to sliding along a direction vector in 3D space. Slider handle in the Scene View. Add the following script to your Assets folder as...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8d74d7e6b8d4
unity_docs
scripting
What is `UIElements.TwoPaneSplitView.CollapseChild` in Unity? Explain its purpose and usage.
TwoPaneSplitView.CollapseChild Declaration public void CollapseChild (int index ); Parameters Parameter Description index Index of child to collapse. Description Collapse one of the panes of the split view. This will hide the resizer and make the other child take up all available space.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_157aea74de02
unity_docs
scripting
What is `Skybox` in Unity? Explain its purpose and usage.
Skybox class in UnityEngine / Inherits from: Behaviour / Implemented in: UnityEngine.CoreModule Description A script interface for the skybox component . The skybox class has only the material property. Additional resources: skybox component . Properties Property Description material The material used...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_57d77b7444a8
unity_docs
math
What is `GUIStyle.GetCursorStringIndex` in Unity? Explain its purpose and usage.
GUIStyle.GetCursorStringIndex Declaration public int GetCursorStringIndex ( Rect position , GUIContent content , Vector2 cursorPixelPosition ); Description Get the cursor position (indexing into contents.text) when the user clicked at cursorPixelPosition. This does not respect any images inside content...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d7b396da7a81
unity_docs
scripting
What is `UIElements.Experimental.StyleValues.paddingTop` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. StyleValues.paddingTop public float paddingTop ; Description Space reserved for the top edge of the padding during the layout phase.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9dcf7f381375
unity_docs
scripting
What is `Build.Content.WriteCommand.serializeObjects` in Unity? Explain its purpose and usage.
WriteCommand.serializeObjects public List<SerializationInfo> serializeObjects ; Description List of objects and their order contained inside a serialized file. Internal use only. See WriteCommand .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9ffaa040d284
unity_docs
editor
Show me a Unity C# example demonstrating `AssetImporters.CollectImportedDependenciesAttribute`.
cies declared in methods with this attribute before importing the dependent assets. This also re-imports the dependent asset whenever the dependency asset changes. Use this declared dependency to safely load dependancies in AssetPostprocessor callbacks. This example shows how you can declare a dependency between two ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6388f9c865fe
unity_docs
rendering
What is `Experimental.Rendering.ShaderWarmupSetup` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. ShaderWarmupSetup struct in UnityEngine.Experimental.Rendering / Implemented in: UnityEngine.CoreModule Description The rendering configuration to use when prewarming shader variants. For information on shader loading and pr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_062930f8c1a7
unity_docs
scripting
What is `HandleUtility.UnregisterRenderPickingCallback` in Unity? Explain its purpose and usage.
HandleUtility.UnregisterRenderPickingCallback Declaration public static bool UnregisterRenderPickingCallback ( HandleUtility.RenderPickingCallback renderPickingCallback ); Parameters Parameter Description renderPickingCallback The delegate object to unregister from the callback. Returns bool True if the...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_dfb07a61a8b0
unity_docs
xr
Explain 'Asset Loading Profiler module reference' in Unity.
The Asset Loading Profiler module displays information about how your application loads assets, including a breakdown of read operations by area. The details pane provides an insight into each of the asset loading markers captured during the profile. You can use this information to find out how efficiently your applica...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6c932a9b1d93
unity_docs
scripting
What is `Android.AndroidApplication.InvokeOnUIThread` in Unity? Explain its purpose and usage.
AndroidApplication.InvokeOnUIThread Declaration public static void InvokeOnUIThread ( Unity.Android.Gradle.Manifest.Action action ); Description Invokes delegate on Android application's UI thread. Note: Certain Android Java functions, such as those related to the user interface can only be called on the UI ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9123019d35bf
unity_docs
scripting
What is `Rendering.StencilState.passOperationBack` in Unity? Explain its purpose and usage.
StencilState.passOperationBack public Rendering.StencilOp passOperationBack ; Description What to do with the contents of the buffer if the stencil test (and the depth test) passes for back-facing geometry.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_951e0080df42
unity_docs
physics
What is `Rigidbody.GetAccumulatedForce` in Unity? Explain its purpose and usage.
Rigidbody.GetAccumulatedForce Declaration public Vector3 GetAccumulatedForce (float step = Time.fixedDeltaTime); Parameters Parameter Description step The timestep of the next physics simulation. Returns Vector3 Accumulated force expressed in ForceMode.Force . Description Returns the force that ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_63b9f7b83a63
unity_docs
xr
In Unity's 'visionOS', what is 'Windowed apps' and how does it work?
Unity describes applications that live within Windows as Windowed apps. By default, your Unity content is built as a Windowed app on the visionOS platform if you don’t install and enable the visionOS XR provider plug-in in the XR Plug-in Management section of your Project Settings . Refer to Choose XR provider plug-ins...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_816e12e09605
unity_docs
editor
What is `IMGUI.Controls.PrimitiveBoundsHandle` in Unity? Explain its purpose and usage.
PrimitiveBoundsHandle class in UnityEditor.IMGUI.Controls Description Base class for a compound handle to edit a bounding volume in the Scene view. This class allows you to display a shape with up to six control handles for simultaneously editing the size and center of a bounding volume. Dragging on any one contr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b3e4378cf382
unity_docs
rendering
What is `ModelImporter.ExtractTextures` in Unity? Explain its purpose and usage.
ModelImporter.ExtractTextures Declaration public bool ExtractTextures (string folderPath ); Parameters Parameter Description folderPath The directory where the textures will be extracted. Returns bool Returns true if the textures are extracted successfully, otherwise false. Description Extracts the e...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_066f96ca391e
unity_docs
physics
What is `CapsuleCollider2D` in Unity? Explain its purpose and usage.
CapsuleCollider2D class in UnityEngine / Inherits from: Collider2D / Implemented in: UnityEngine.Physics2DModule Description A capsule-shaped primitive collider. Capsules are boxes with a semi-circle at each end. Properties Property Description direction The direction that the capsule sides can extend. s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_88eaa17e22c5
unity_docs
scripting
Show me a Unity C# example demonstrating `ScriptableObject.OnDestroy`.
ScriptableObject.OnDestroy() Description This function is called when the scriptable object will be destroyed. An example is given below. This example has two scripts. The first shown is the ScriptableObject script. This implements code which is separate from MonoBehaviour . The second is a small MonoBehaviour...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_de8393885260
unity_docs
editor
What is `UIElements.DropdownMenu.AppendSeparator` in Unity? Explain its purpose and usage.
DropdownMenu.AppendSeparator Declaration public void AppendSeparator (string subMenuPath ); Parameters Parameter Description subMenuPath The submenu path to add the separator to. Path components are delimited by forward slashes ('/'). Description Adds a separator line in the menu. The separator is add...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_aa10c44d3d0c
unity_docs
scripting
Show me a Unity C# example demonstrating `ParticleSystem.MainModule.simulationSpeed`.
ParticleSystem.MainModule.simulationSpeed public float simulationSpeed ; Description Override the default playback speed of the Particle System. Useful for speeding up or slowing down the entire simulation. ```csharp using UnityEngine; using System.Collections;[RequireComponent(typeof(ParticleSystem))] public...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c17f5322f526
unity_docs
scripting
What is `ParticleSystem.externalForces` in Unity? Explain its purpose and usage.
ParticleSystem.externalForces public ParticleSystem.ExternalForcesModule externalForces ; Description Script interface for the ExternalForcesModule of a Particle System. This module enables ParticleSystemForceField and WindZone components to affect the Particle System. Particle System modules do not need...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a4de0bbfd018
unity_docs
performance
What is `Jobs.IJobParallelForTransformExtensions.Schedule` in Unity? Explain its purpose and usage.
IJobParallelForTransformExtensions.Schedule Declaration public static Unity.Jobs.JobHandle Schedule (T jobData , Jobs.TransformAccessArray transforms , Unity.Jobs.JobHandle dependsOn ); Parameters Parameter Description jobData The job to schedule. transforms The TransformAccessArray to run the jo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bb6b74c8bf98
unity_docs
input
What is `UIElements.UIToolkitInputBackendOption` in Unity? Explain its purpose and usage.
UIToolkitInputBackendOption enumeration Description Input backend options for UI Toolkit events at runtime. Properties Property Description Default The initial configuration on UI Toolkit start up. This is equal to InputSystemCompatibleBackend. This option will use the Input System package is available, ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_87c8c9925203
unity_docs
math
What is `Matrix4x4.determinant` in Unity? Explain its purpose and usage.
Matrix4x4.determinant public float determinant ; Description The determinant of the matrix. (Read Only) You can not invert matrices with a determinant of zero. ```csharp using UnityEngine;public class ExampleScript : MonoBehaviour { void Update() { // create a transformation matrix with scale, zero position...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_f522b91ce703_doc_2
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Represents an object which can receive three arguments as part of its initialization process.-derived classes that implement this interface can be instantiated with their dependency using the function.-derived classes that implement this interface can be added to a with their dependency using the function.If the class...
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_23b49725f741
unity_docs
rendering
What is `TransparencySortMode` in Unity? Explain its purpose and usage.
TransparencySortMode enumeration Description Transparent object sorting mode of a Camera . By default, perspective cameras sort objects based on distance from camera position to the object center; and orthographic cameras sort based on distance along the view direction. If you're making a 2D game with a perspecti...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f17d2285d1bf
unity_docs
rendering
Show me a Unity C# example demonstrating `Search.SearchAction.execute`.
SearchAction.execute public Action<SearchItem[]> execute ; Description Executes an action on a set of items. ``` new SearchAction("scene", "toggle_cast_shadows", new GUIContent("Toggle Cast Shadows", null, "Toggle Cast Shadows on a Mesh")) { // Only enable this action if any of the selected items are actually ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_552eb19f2be6
unity_docs
scripting
What is `Animations.GameObjectRecorder.BindComponent` in Unity? Explain its purpose and usage.
GameObjectRecorder.BindComponent Declaration public void BindComponent ( Component component ); Parameters Parameter Description component The component to bind. Description Adds bindings for all the properties of component . ```csharp using UnityEngine; using UnityEditor; using UnityEditor.Animations;p...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c4eb8ca2ff6f
unity_docs
xr
What is `Android.AndroidAssetPackUseMobileDataRequestResult` in Unity? Explain its purpose and usage.
AndroidAssetPackUseMobileDataRequestResult class in UnityEngine.Android / Implemented in: UnityEngine.AndroidJNIModule Description Represents the choice of an end user that indicates if your application can use mobile data to download Android asset packs. The value is received from a callback after AndroidAsset...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_a21d0460770c
unity_docs
scripting
Show me a Unity code example for 'TagField'.
ed in the Inspector window to allow users to select a tag for a GameObject . Note : To align an element with other fields in an Inspector window, simply apply the.unity-base-field__aligned USS class to it. For more information, refer to BaseField . ## Create a TagField element You can create a TagField with UI Builde...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6bfcb8d6d3d5
unity_docs
scripting
What is `Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.IsDefaultValue` in Unity? Explain its purpose and usage.
AtomicSafetyHandle.IsDefaultValue Declaration public static bool IsDefaultValue (ref Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle ); Parameters Parameter Description handle The AtomicSafetyHandle to check. Returns bool true if the AtomicSafetyHandle hasn't been initialized and still has ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_573bfd5accfa
unity_docs
math
What is `Sprite.OverridePhysicsShape` in Unity? Explain its purpose and usage.
Sprite.OverridePhysicsShape Declaration public void OverridePhysicsShape (IList<Vector2[]> physicsShapes ); Parameters Parameter Description physicsShapes A multidimensional list of points in Sprite.rect space denoting the physics shape outlines. Description Sets up a new Sprite physics shape. The posi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d92a96886e78
unity_docs
editor
Show me a Unity C# example demonstrating `UIElements.Column.comparison`.
Column.comparison public Comparison<int> comparison ; Description The comparison to use when using ColumnSortingMode.Default . Compares two items by their index in the source. The following example creates a MultiColumnListView that can be sorted with the default algorithm: ```csharp using System; u...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_72b157c528e3
unity_docs
rendering
What is `Terrain.treeBillboardDistance` in Unity? Explain its purpose and usage.
Terrain.treeBillboardDistance public float treeBillboardDistance ; Description Distance from the camera where trees will be rendered as billboards only. Decreasing this value improves performance but makes the transition look worse because the difference between billboards and trees will be more obvious.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2dab9d2e882e
unity_docs
editor
Show me a Unity C# example demonstrating `AssetDatabase.GetImporterOverride`.
AssetDatabase.GetImporterOverride Declaration public static Type GetImporterOverride (string path ); Parameters Parameter Description path Project relative path for the asset. Returns Type Importer type. Description Returns the type of the override importer. Returns null if there isn't one. ```csha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_497fc82d74b5
unity_docs
rendering
Show me a Unity C# example demonstrating `Rendering.CommandBuffer.SetRayTracingShaderPass`.
eometry intersection code is executed. This method must be called before calling CommandBuffer.DispatchRays . The Shader Pass code can include optional closest hit or any hit shaders. For procedural ray-traced geometries, an intersection shader must be authored. The engine code will automatically enable a keywork name...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2f0e802bf116
unity_docs
math
What is `Vector3.normalized` in Unity? Explain its purpose and usage.
Vector3.normalized public Vector3 normalized ; Description The unit vector in the direction of the current vector. This property holds a normalized vector based on the current vector. The normalized vector has a magnitude of 1 and is in the same direction as the current vector. If the current vector i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a99b31614d03
unity_docs
rendering
What is `LightTransport.InputExtraction.PopulateWorld` in Unity? Explain its purpose and usage.
InputExtraction.PopulateWorld Declaration public static bool PopulateWorld ( LightTransport.InputExtraction.BakeInput bakeInput , LightTransport.BakeProgressState progress , LightTransport.IDeviceContext context , LightTransport.IWorld world ); Parameters Parameter Description bakeInput Scene data ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_62dba6d3c143
unity_docs
editor
What is `Time.unscaledTime` in Unity? Explain its purpose and usage.
Time.unscaledTime public static float unscaledTime ; Description The timeScale-independent time for this frame (Read Only). This is the time in seconds since the start of the game. When called from inside MonoBehaviour's FixedUpdate , it returns Time.fixedUnscaledTime . Unlike Time.realtimeSinceStartup , th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f736ffd6c794
unity_docs
rendering
In Unity's 'Material Validator in the Built-In Render Pipeline', what is 'Open the Material Validator' and how does it work?
To use the Material Validator, select the Scene View ’s draw mode drop-down menu, which is is usually set to Shaded by default. Navigate to the Material Validation section. The Material Validator has two modes: Validate Albedo and Validate Metal Specular .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8ab0a230c126
unity_docs
scripting
What is `SpaceAttribute.ctor` in Unity? Explain its purpose and usage.
SpaceAttribute Constructor Declaration public SpaceAttribute (float height ); Parameters Parameter Description height The spacing in pixels. Description Use this DecoratorDrawer to add some spacing in the Inspector.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_ecac194c16fb_doc_1
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Single static instance of the Api class. Is used to access other APIs and methods. Signature: ```csharp public static Api Instance = null; ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4714aec8742c
unity_docs
physics
What is `Scripting.AlwaysLinkAssemblyAttribute` in Unity? Explain its purpose and usage.
AlwaysLinkAssemblyAttribute class in UnityEngine.Scripting / Implemented in: UnityEngine.CoreModule Description Ensure an assembly is always processed during managed code stripping. Use the [assembly: UnityEngine.Scripting.AlwaysLinkAssembly] attribute to force UnityLinker to process the assembly regardless of ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b85f2238dd88
unity_docs
physics
What is `Rigidbody.inertiaTensor` in Unity? Explain its purpose and usage.
Rigidbody.inertiaTensor public Vector3 inertiaTensor ; Description The inertia tensor of this body, defined as a diagonal matrix in a reference frame positioned at this body's center of mass and rotated by Rigidbody.inertiaTensorRotation . Inertia tensor is a rotational analog of mass: the larger the inerti...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_120b06a1da3c
unity_docs
scripting
What is `Canvas` in Unity? Explain its purpose and usage.
Canvas class in UnityEngine / Inherits from: Behaviour / Implemented in: UnityEngine.UIModule Description Element that can be used for screen rendering. Elements on a canvas are rendered AFTER Scene rendering, either from an attached camera or using overlay mode. ```csharp using System.Collections; using Sys...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a3f242b238b8
unity_docs
physics
What is `RigidbodyType2D` in Unity? Explain its purpose and usage.
RigidbodyType2D enumeration Description The physical behaviour type of the Rigidbody2D . Controls the physical behaviour of a Rigidbody2D in how it should move, react to forces and interact with the rest of the physics simulation. Additional resources: Rigidbody2D.bodyType . Properties Property Description ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e9f74a950496
unity_docs
rendering
What is `Tilemaps.TilemapRenderer.Mode` in Unity? Explain its purpose and usage.
Mode enumeration Description Determines how the TilemapRenderer should batch the sprites from tiles for rendering. Properties Property Description Chunk Batches each Sprite from the Tilemap into grouped chunks to be rendered. Individual Sends each Sprite from the Tilemap to be rendered individually. SRP...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_a7e2e2f31124
github
scripting
Write a Unity C# script called Vive Underlay Passthrough Processor
```csharp namespace Tilia.CameraRigs.OpenXR.ViveOpenXRPlugin { using UnityEngine.XR.OpenXR; public class ViveUnderlayPassthroughProcessor : PassthroughProcessor { private VIVE.OpenXR.Passthrough.XrPassthroughHTC id = 0; protected override void ActivatePassthroughLogic() { ...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_man_a06717a250c9
unity_docs
rendering
Explain 'Design a tree' in Unity.
Design a tree in the Tree Editor, create its materials, and add colliders . If you want to use an imported mesh , refer to Create trees and leaves from meshes . ## Add a new tree To create a new Tree asset, from the main menu, select GameObject > 3D Object > Tree . This action adds a tree to your Scene view. It also ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_45617bd3798f
unity_docs
rendering
What is `ParticleSystemSubEmitterProperties` in Unity? Explain its purpose and usage.
ParticleSystemSubEmitterProperties enumeration Description The properties of sub-emitter particles. Properties Property Description InheritNothing When spawning new particles, do not inherit any properties from the parent particles. InheritEverything When spawning new particles, inherit all available propertie...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_53006cc226d2
unity_docs
xr
What is `Profiling.Profiler.SetTempAllocatorRequestedSize` in Unity? Explain its purpose and usage.
Profiler.SetTempAllocatorRequestedSize Declaration public static bool SetTempAllocatorRequestedSize (uint size ); Parameters Parameter Description size Size in bytes. Returns bool Returns true if requested size was successfully set. Will return false if value is disallowed (too small). Description Se...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7805374622a4
unity_docs
math
What is `UIElements.LongField.ApplyInputDeviceDelta` in Unity? Explain its purpose and usage.
LongField.ApplyInputDeviceDelta Declaration public void ApplyInputDeviceDelta ( Vector3 delta , UIElements.DeltaSpeed speed , long startValue ); Parameters Parameter Description delta A vector used to compute the value change. speed A multiplier for the value change. startValue The start value. Des...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f817542b0fb9
unity_docs
physics
Explain 'Continuous collision detection (CCD)' in Unity.
Continuous collision detection (CCD) modes use predictive algorithms to calculate collisions that happen between physics timesteps. They are more accurate, but usually require more computational resources than discrete collision detection . CCD is supported for Box, Sphere and Capsule colliders . It is intended as a sa...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_89a67d997ab8
unity_docs
ui
What is `EditorWindow.OnSelectionChange` in Unity? Explain its purpose and usage.
EditorWindow.OnSelectionChange() Description Called whenever the selection has changed. Saves the current selection and load it later with a simple click. ```csharp // Simple example that lets you save the current selection and load it. using UnityEditor; using UnityEngine.UIElements; public class OnSelectionCha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_ad3f5e3e411c
unity_docs
scripting
Explain 'C# compiler and language version reference' in Unity.
This version of the Unity Editor uses the following C# compiler and language version: C# compiler : Roslyn C# language version : C# 9.0 The Editor passes a default set of options to the C# compiler. To pass additional options in your project, refer to Conditional compilation in Unity . ## Garbage collection Unity use...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8e3e850216ca
unity_docs
scripting
What is `Search.QueryGraph.ctor` in Unity? Explain its purpose and usage.
QueryGraph Constructor Declaration public QueryGraph ( Search.IQueryNode root ); Parameters Parameter Description root Root node of the graph. Description Constructor. Creates a new query graph.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3c47b9444bc7
unity_docs
scripting
What is `VideoCodec.H265` in Unity? Explain its purpose and usage.
VideoCodec.H265 Description Encode video with the H.265 codec. The MPEG-H Part 2, or High Efficiency Video Coding (HEVC) video codec. This codec is supported by hardware on most platforms. For more information about video encoding, refer to Video encoding compatibility reference . Note : The codec is not included...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ddd772c7ac89
unity_docs
animation
What is `Animator.applyRootMotion` in Unity? Explain its purpose and usage.
Animator.applyRootMotion public bool applyRootMotion ; Description Should root motion be applied? Root motion is the effect where an object's entire mesh moves away from its starting point but that motion is created by the animation itself rather than by changing the Transform position. Note that applyRootMot...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_200efc8d0e47
unity_docs
physics
Explain 'Physics Debug window reference' in Unity.
Use the Physics Debug window to configure and generate visual representations of 3D physics activity in a scene . These visualizations appear in the Scene view . To open the Physics Debug window in the Unity Editor, go to Window > Analysis > Physics Debugger . Physics Debugger inserts a Physics debug panel in the Scene...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6ac315a95d09
unity_docs
scripting
In Unity's 'Get started with runtime UI', what is 'Create a UI Document with controls' and how does it work?
Create a UI Document with a label, a button, and a Toggle. For information on how to add UI controls with UI Builder or UXML, refer to Get started with UI Toolkit . Create a project in Unity Editor with any template. Create a UI Document named SimpleRuntimeUI.uxml with the following contents: ``` <ui:UXML xmlns:ui="Uni...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_1c91c5dbd1ef
github
scripting
Write a Unity C# script called Game Settings
```csharp using System.Collections.Generic; using TetrisEngine.TetriminosPiece; using UnityEngine; namespace TetrisEngine { //Class responsable for holding the settings of the game public class GameSettings { private const float MIN_TIME_TO_STEP = 0.01f; [SerializeField] public float timeToStep; [Seriali...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_57aaf96baac6
unity_docs
rendering
What is `EditorWindow.OnFocus` in Unity? Explain its purpose and usage.
EditorWindow.OnFocus() Description Called when the window gets keyboard focus. Additional resources: OnLostFocus . Preview your camera in orthographic mode when you select the window. ```csharp // Simple script that lets you preview your main camera in // Orthographic view when selected. using UnityEngine; usin...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5573cabf8165
unity_docs
input
What is `XR.InputTracking.trackingAcquired` in Unity? Explain its purpose and usage.
InputTracking.trackingAcquired Parameters Parameter Description nodeState Describes the node that has begun being tracked. Description Called when a tracked node begins reporting tracking information.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_da38dc4afce4
unity_docs
scripting
What is `UIElements.IntegerField.ValueToString` in Unity? Explain its purpose and usage.
IntegerField.ValueToString Declaration protected string ValueToString (int v ); Parameters Parameter Description v The integer to be converted to string. Returns string The integer as string. Description Converts the given integer to a string.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d2cfba2a653f
unity_docs
rendering
What is `ParticleSystem.Particle.startColor` in Unity? Explain its purpose and usage.
ParticleSystem.Particle.startColor public Color32 startColor ; Description The initial color of the particle. The current color of the particle is calculated procedurally based on this value and the active color modules. Alpha channel of the color is used to fade out particles.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7743cfc610ff
unity_docs
ui
What is `Experimental.GraphView.Attacher.element` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. Attacher.element public UIElements.VisualElement element ; Description The element that is attached to the target element.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_548a85376ffe
unity_docs
scripting
Show me a Unity C# example demonstrating `Search.SearchContextAttribute.flags`.
SearchContextAttribute.flags public Search.SearchViewFlags flags ; Description Search view flags used to open the Object Picker in various states. The following example will open the Object Picker window using the compact list view and include packages results. ```csharp [SearchContext("", "adb", SearchViewF...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d10d3e429a18
unity_docs
math
What is `Random.Range` in Unity? Explain its purpose and usage.
Random.Range Declaration public static float Range (float minInclusive , float maxInclusive ); Description Returns a random float within [minInclusive..maxInclusive] (range is inclusive). If minInclusive is greater than maxInclusive , then the numbers are automatically swapped. Important : Both the lo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_ae04db195b11_doc_1
github
scripting
What does `GetPerlin` do in this Unity script? Explain its purpose and signature.
Returns a Perlin noise float in the range of -1 and 1, based on a unique seed and a shared sampling point Signature: ```csharp private float GetPerlin(float seed) => (Mathf.PerlinNoise(seed, _sharedSamplingPoint) - 0.5f) * 2f; ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_e42277df4add
unity_docs
editor
What is `UnityLinker.UnityLinkerBuildPipelineData` in Unity? Explain its purpose and usage.
UnityLinkerBuildPipelineData class in UnityEditor.UnityLinker Description Contains information for various IUnityLinkerProcessor callbacks. Properties Property Description target The build target. Constructors Constructor Description UnityLinkerBuildPipelineData Creates a new instance of an UnityLinkerBuil...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b05a69d874a7
unity_docs
math
Show me a Unity C# example demonstrating `Tilemaps.TileBase.RefreshTile`.
position Position of the Tile on the Tilemap . tilemap The Tilemap the tile is present on. Description This method is called when the tile is refreshed. Implement this and call Tilemap.RefreshTile on all affected tiles on the Tilemap including the tile at the given position to refresh them. This is also ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_35c083000e4c
unity_docs
rendering
Explain 'Using Web templates' in Unity.
When you build a Web project, Unity embeds the Player in a HTML page such that a browser can open it. A Web template is a configuration setting that lets you control the appearance of this HTML page, so that you can test, demonstrate, and preview your Web application in a browser. To access Web templates: Go to Player ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f44f42017852
unity_docs
editor
What is `PluginImporter.SetIcon` in Unity? Explain its purpose and usage.
PluginImporter.SetIcon Declaration public void SetIcon (string className , Texture2D icon ); Parameters Parameter Description className The fully qualified class name of a MonoScript imported by this managed plugin. icon The custom icon to associate with the imported MonoScript . When the value is nu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_2afbb832eadf
unity_docs
rendering
In Unity's 'Trail Renderer component reference', what is 'Materials' and how does it work?
The Materials section lists all the materials that this component uses. Property Description Size The number of elements in the material list. If you decrease the number of elements, Unity deletes the elements at the end of the list. If you increase the number of elements, Unity adds new elements to the end of the list...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cd31752af87a
unity_docs
rendering
What are the parameters of `LineRenderer.SetPosition` in Unity?
Description Set the position of a vertex in the line. Consider using SetPositions instead, if setting multiple positions, as it is much faster than making individual function calls for each position. Additional resources: positionCount property. ```csharp using UnityEngine; using System.Collections;public class Example...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_959663c29501
unity_docs
scripting
What are the parameters of `Undo.RegisterChildrenOrderUndo` in Unity?
Description Stores a copy of the order of the object's children on the undo stack. If the undo is performed, the order of the object's children will be restored to the recorded state. ```csharp using UnityEngine; using UnityEditor;public class UndoExamples { [MenuItem("Undo Examples/RegisterChildrenOrderUndo")] ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6976445450e5
unity_docs
rendering
In Unity's 'Audio Spatializer SDK', what is 'The Unity Audio Spatializer SDK and example implementation' and how does it work?
To provide flexibility and support for working with audio spatialization, Unity has an open interface, the Audio Spatializer SDK, as an extension on top of the Native Audio Plugin SDK. You can replace the standard panner in Unity with a more advanced one, and give it access to important meta-data about the source and l...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_23164194235a
unity_docs
ui
In Unity's 'Find visual elements with UQuery', what is 'Query methods' and how does it work?
You can use UQuery through the following extension methods: Q Query Internally, the Q and Query methods use UQueryBuilder to construct a query. These extension methods reduce the verbosity of creating a UQueryBuilder . To use UQuery to find elements, you must load and instantiate the UXML first, and then use Query or Q...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_dceaba10e264
unity_docs
physics
In Unity's 'Debug shaders with Visual Studio', what is 'Preparing your shaders' and how does it work?
To debug shaders, you must compile them with debug symbols included. To do that, insert the #pragma enable_d3d11_debug_symbols directive into the source code of each shader that you want to debug. Warning: This pragma directive can negatively affect performance. Remove it from your shader code before you make a final b...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d3829ed554d5
unity_docs
scripting
Explain 'Install and upgrade' in Unity.
The following topics give an overview on how to install and upgrade Unity. Topic Description Install Unity Learn how to install Unity. Deploy Unity across your Enterprise How to deploy Unity across larger organizations. Licenses and activation Learn about how to activate your Unity license. Upgrade Unity Learn about ho...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_803a5333b4f7
unity_docs
scripting
What is `Time.frameCount` in Unity? Explain its purpose and usage.
Time.frameCount public static int frameCount ; Description The total number of frames since the start of the game (Read Only). This value starts at 0 and increases by 1 on each Update phase. Internally, Unity uses a 64 bit integer which it downcasts to 32 bits when this is called, and discards the most signif...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_382793da5641
unity_docs
scripting
Show me a Unity C# example demonstrating `GridLayout.CellToWorld`.
GridLayout.CellToWorld Declaration public Vector3 CellToWorld ( Vector3Int cellPosition ); Parameters Parameter Description cellPosition Cell position to convert. Returns Vector3 World position of the cell position. Description Converts a cell position to world position space. ```csharp // Snap t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_daf70ef05469
unity_docs
rendering
What is `UIElements.DynamicAtlasFilters.Readability` in Unity? Explain its purpose and usage.
DynamicAtlasFilters.Readability Description Excludes readable textures. Readable textures are textures that are readable from scripts, which means they are also writable or editable. Another way to think of this filter is as a way to exclude textures that are not read-only.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e9cfec054348
unity_docs
rendering
In Unity's 'Reflective Parallax Diffuse', what is 'Parallax Normal mapped Properties' and how does it work?
Parallax Normal mapped is the same as regular Normal mapped , but with a better simulation of “depth”. The extra depth effect is achieved through the use of a Height Map . The Height Map is contained in the alpha channel of the Normal map . In the alpha, black is zero depth and white is full depth. This is most often u...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5d75bf15851f
unity_docs
rendering
In Unity's 'Build assets into AssetBundles', what is 'Perform a clean build' and how does it work?
When you create an official AssetBundle release, perform a clean build to ensure Unity rebuilds all content during the build process. To perform a clean build, pass the BuildAssetBundleOptions.ForceRebuildAssetBundle flag as an option to BuildPipeline.BuildAssetBundles . In some projects, you can delete the Library/Sha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_60d570b1df38
unity_docs
animation
What is `Animations.TransformStreamHandle.SetLocalRotation` in Unity? Explain its purpose and usage.
TransformStreamHandle.SetLocalRotation Declaration public void SetLocalRotation ( Animations.AnimationStream stream , Quaternion rotation ); Parameters Parameter Description stream The AnimationStream that holds the animated values. rotation The rotation of the transform relative to the parent. Desc...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7b06d1d7ff14
unity_docs
scripting
What is `IMGUI.Controls.TreeView.CanStartDrag` in Unity? Explain its purpose and usage.
TreeView.CanStartDrag Declaration protected bool CanStartDrag ( IMGUI.Controls.TreeView.CanStartDragArgs args ); Description This function is called whenever a TreeViewItem is clicked and dragged. It returns false by default. Override this function so it returns true to enable drag and drop behavior for TreeV...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b88a6af147c2
unity_docs
editor
What is `EditorGUI.RenderingLayerMaskField` in Unity? Explain its purpose and usage.
EditorGUI.RenderingLayerMaskField Declaration public static void RenderingLayerMaskField ( Rect position , string label , SerializedProperty property ); Declaration public static void RenderingLayerMaskField ( Rect position , GUIContent label , SerializedProperty property ); Parameters Paramete...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6e8428527177
unity_docs
editor
What is `Search.SearchColumnCompareArgs` in Unity? Explain its purpose and usage.
SearchColumnCompareArgs struct in UnityEditor.Search Description Search column compare arguments are used by SearchColumn.comparer to sort search results. Properties Property Description lhs Left-hand side column to compare. rhs Right-hand side column to compare. sortAscending Indicates if the results shou...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_0b7aaf0f17a3
unity_docs
physics
In Unity's 'Wheel collider component reference', what is 'Forward Friction and Sideways Friction' and how does it work?
The Forward Friction and Sideways Friction properties correspond to the points in the following wheel curve diagram: These points are represented in the WheelCurve See Wheel collider Friction for more details. Property Description Extremum Slip The value of the Extremum point on the Slip axis. The default is 0.4. Extre...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c9b13e1ed91f
unity_docs
scripting
What is `ParticleSystem.MainModule.gravityModifierMultiplier` in Unity? Explain its purpose and usage.
ParticleSystem.MainModule.gravityModifierMultiplier public float gravityModifierMultiplier ; Description Change the gravity multiplier. Changing this property is more efficient than accessing the entire curve ( ParticleSystem.MainModule.gravityModifier ), if you only want to change the overall gravity multipli...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.