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_2925e42dab78
unity_docs
performance
Show me a Unity C# example demonstrating `Unity.Collections.LowLevel.Unsafe.NativeDisableContainerSafetyRestrictionAttribute`.
times you might need to use job and data access that doesn't fit into the safety system. This attribute lets you explicitly disable the safety system for a specific NativeContainer and gives you full control. However, if for example you call Dispose on a NativeArray while a job is running, the safety system can't g...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4b20c05c85da
unity_docs
scripting
What is `Actions.ContextMenuUtility` in Unity? Explain its purpose and usage.
ContextMenuUtility class in UnityEditor.Actions Description Provides methods to add menu items to the Scene view context menu. ```csharp using UnityEditor; using UnityEditor.Actions; using UnityEngine; // Add a menu item to the Scene View context menu that creates a cube where-ever the mouse clicks. public class...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_006719f60cfc
unity_docs
rendering
In Unity's 'Configure multiple cameras', what is 'Swap camera views' and how does it work?
By default, a camera renders its view to cover the whole screen and so only one camera view can be seen at a time (the visible camera is the one that has the highest value for its depth property). By disabling one camera and enabling another from a script, you can “cut” from one camera to another to give different view...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d8903eeb5226
unity_docs
rendering
In Unity's 'Make a material transparent', what is 'Use a texture to control transparency' and how does it work?
If you use a texture for Albedo instead of a color, by default the alpha channel of the texture controls the transparency of the material. A value of 0 in the alpha channel means fully transparent, and a value of 1 means fully opaque. You can use different values to make different areas more or less transparent. Unity ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_95c621d3d158_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Adapter-only renderer that converts terrain/factory simulation layers into a PNG image.Each cell becomes one pixel. Terrain is drawn first, then factory is alpha-blended on top. Signature: ```csharp public sealed class LayerPngRenderTarget : MonoBehaviour ```
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_cf7bccc71928
unity_docs
physics
Show me a Unity C# example demonstrating `Joint2D.OnJointBreak2D`.
rque of the joint, the joint will break. When the joint breaks, Joint2D.OnJointBreak2D will be called and the specific Joint2D that broke will be passed in. After Joint2D.OnJointBreak2D is called, the joint action depends on the option selected in Joint2D.breakAction . Additional resources: Joint2D.breakForce ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b60dab24b2ea
unity_docs
scripting
Show me a Unity C# example demonstrating `Input.GetButton`.
o Input . Think auto fire - this will return true as long as the button is held down. Use this only when implementing events that trigger an action, eg, shooting a weapon. The buttonName argument will normally be one of the names in InputManager such as Jump or Fire1. GetButton will return to false when it ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_7d0acfca357b
unity_docs
rendering
Explain 'Capturing frame rate' in Unity.
A special case of time management is where you want to record gameplay as a video. Since the task of saving screen images takes considerable time, the game’s normal frame rate is reduced, and the video doesn’t reflect the game’s true performance. To improve the video’s appearance, use the Time.captureFramerate property...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4e9056361346
unity_docs
networking
What is `Android.AndroidConfiguration.screenHeightDp` in Unity? Explain its purpose and usage.
AndroidConfiguration.screenHeightDp public int screenHeightDp ; Description Mirrors the Android property screenHeightDp . For information about this property, refer to the Android developer documentation on screenHeightDp .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_15db7e8ad470
unity_docs
scripting
What is `Rendering.RenderPipelineGlobalSettings.Remove` in Unity? Explain its purpose and usage.
RenderPipelineGlobalSettings.Remove Declaration protected bool Remove ( Rendering.IRenderPipelineGraphicsSettings settings ); Parameters Parameter Description setting The IRenderPipelineGraphicsSettings interface to remove. Returns bool Returns false if the element could not be removed. Description...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ff5de123d794
unity_docs
scripting
Show me a Unity C# example demonstrating `AudioSource.spread`.
AudioSource.spread public float spread ; Description Sets the spread angle (in degrees) of a 3d stereo or multichannel sound in speaker space. 0 = all sound channels are located at the same speaker location and is 'mono'. 360 = all subchannels are located at the opposite speaker location to the speaker locatio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_00baf7a84ae2
unity_docs
editor
In Unity's 'Create a 3D texture via script', what is 'Example' and how does it work?
The following example creates an instance of the Texture3D class, populates it with color data, then saves it to your project as a serialized asset file. ```csharp using UnityEditor; using UnityEngine; public class ExampleEditorScript : MonoBehaviour { [MenuItem("CreateExamples/3DTexture")] static void CreateTexture...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6490eddc1f26
unity_docs
scripting
What is `RenderingLayerMask.GetLastDefinedRenderingLayerIndex` in Unity? Explain its purpose and usage.
RenderingLayerMask.GetLastDefinedRenderingLayerIndex Declaration public static int GetLastDefinedRenderingLayerIndex (); Returns int Index of the last defined Rendering Layer. Description Returns an index of the last defined Rendering Layer in the Tags and Layers manager .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_643fc818fb10
unity_docs
rendering
What is `LineRenderer.numCornerVertices` in Unity? Explain its purpose and usage.
LineRenderer.numCornerVertices public int numCornerVertices ; Description Set this to a value greater than 0, to get rounded corners between each segment of the line. The value controls how many vertices are added to each joint, where a higher value will give a smoother result. ```csharp using UnityEngine; us...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d6745543e23d
unity_docs
performance
What is `Unity.Jobs.IJobParallelFor` in Unity? Explain its purpose and usage.
IJobParallelFor interface in Unity.Jobs Description Interface that represents a job that performs the same independent operation for each element of a native container or for a fixed number of iterations. When you schedule an IJobParallelFor job, its Execute(int index) method is invoked on multiple worker thr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_cfd1f430c16a
unity_docs
rendering
Explain 'Core packages' in Unity.
Core packages are similar to other released Unity packages, but have the following differences: Core packages are distributed alongside each version of the Unity Editor. You can’t pick different versions of core packages for your version of the Unity Editor by using the Package Manager window or API. Click on any of th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7832a7fdd995
unity_docs
input
Show me a Unity C# example demonstrating `MouseCursor.CustomCursor`.
MouseCursor.CustomCursor Description The current user defined cursor. Many custom cursors are available on the internet. Additional resources: Cursor.SetCustomCursor . ``` no example available in C# ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_688f2c112c5e
unity_docs
rendering
Explain 'Camera output' in Unity.
Techniques for outputting depth, depth-normal and motion vector information from a camera . Page Description Introduction to camera output Learn about using the DepthTextureMode API to output a depth or motion texture from a camera. Output a depth texture from a camera Output a texture with data about the object depth ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_ef81fac2d22a_doc_15
github
scripting
What does `OnContextClickItem` do in this Unity script? Explain its purpose and signature.
Occurs allowing a list item to respond to a context click.Zero-based index of the list item. Signature: ```csharp protected virtual void OnContextClickItem(int index) ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e2cb1f1be530
unity_docs
scripting
What is `Scripting.GarbageCollector.CollectIncremental` in Unity? Explain its purpose and usage.
GarbageCollector.CollectIncremental Declaration public static bool CollectIncremental (ulong nanoseconds ); Parameters Parameter Description nanoseconds The maximum duration in nanoseconds for the garbage collection operation. When set to 0 (the default), no garbage collection is performed. Returns bool ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_351d5f31fb14
unity_docs
scripting
What is `SendMessageOptions` in Unity? Explain its purpose and usage.
SendMessageOptions enumeration Description Options for how to send a message. This is used by SendMessage & BroadcastMessage in GameObject & Component . Properties Property Description RequireReceiver A receiver is required for SendMessage. DontRequireReceiver No receiver is required for SendMessage.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9591dcf95e15
unity_docs
scripting
What is `GameObject.GetComponents` in Unity? Explain its purpose and usage.
GameObject.GetComponents Declaration public T[] GetComponents (); Returns T[] An array containing all matching components of type T . Description Retrieves references to all components of type T on the specified GameObject. The typical usage for this method is to call it on a reference to a different Ga...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9f33078ea453
unity_docs
performance
What is `Profiling.FrameDataView.GetSessionMetaDataCount` in Unity? Explain its purpose and usage.
FrameDataView.GetSessionMetaDataCount Declaration public int GetSessionMetaDataCount (Guid id , int tag ); Parameters Parameter Description id Unique identifier associated with the data. tag Data stream index. Returns int Returns count of metadata chunks. Description Gets the total number of metad...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e2da6e7b9adb
unity_docs
scripting
What is `Light.range` in Unity? Explain its purpose and usage.
Light.range public float range ; Description The range of each point of the light. Since area lights have a light emitting surface instead of a single point, the cumulative range of the light is larger than this property. This larger range can be read from the Light.dilatedRange property. For non-area light...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cfd88367b65f
unity_docs
rendering
What is `Rendering.RayTracingGeometryInstanceConfig.materialProperties` in Unity? Explain its purpose and usage.
RayTracingGeometryInstanceConfig.materialProperties public MaterialPropertyBlock materialProperties ; Description Additional Material properties to apply onto Material. Additional resources: RayTracingAccelerationStructure.UpdateInstancePropertyBlock .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9ae1ef0e4b50
unity_docs
scripting
What is `Animator.SetIKRotationWeight` in Unity? Explain its purpose and usage.
Animator.SetIKRotationWeight Declaration public void SetIKRotationWeight ( AvatarIKGoal goal , float value ); Parameters Parameter Description goal The AvatarIKGoal that is set. value The rotational weight. Description Sets the rotational weight of an IK goal (0 = rotation before IK, 1 = rotation at t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1640b2103e6e
unity_docs
audio
What is `Collision2D.relativeVelocity` in Unity? Explain its purpose and usage.
Collision2D.relativeVelocity public Vector2 relativeVelocity ; Description The relative linear velocity of the two colliding objects (Read Only). ```csharp // Play a sound when we hit an object with a big velocity using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { AudioSo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8b3fa089b9a5
unity_docs
editor
What is `IHasCustomMenu.AddItemsToMenu` in Unity? Explain its purpose and usage.
IHasCustomMenu.AddItemsToMenu Declaration public void AddItemsToMenu ( GenericMenu menu ); Description Adds your custom menu items to an Editor Window. The following example shows how you can implement this method in a class that derives from EditorWindow and implements IHasCustomMenu. ```csharp using Unit...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bef65fd870f6
unity_docs
scripting
What is `EditorCurveBinding.SerializeReferenceCurve` in Unity? Explain its purpose and usage.
EditorCurveBinding.SerializeReferenceCurve(string,Type,string) Parameters Parameter Description inPath The transform path to the object to animate. inType The type of the MonoBehaviour managing the SerializeReference instance to animate. refID The reference id of the SerializeReference instance to animate. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e1fa09c1f47b
unity_docs
scripting
What is `Experimental.GraphView.Dragger.CalculatePosition` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. Dragger.CalculatePosition Declaration protected Rect CalculatePosition (float x , float y , float width , float height ); Parameters Parameter Description x New x position. y New y position. width Element width. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0a107381ed42
unity_docs
scripting
What is `PlayerSettings.stripEngineCode` in Unity? Explain its purpose and usage.
PlayerSettings.stripEngineCode public static bool stripEngineCode ; Description Remove unused Engine code from your build (IL2CPP-only). If this is enabled, unused modules and classes of the Unity Engine codebase will be removed in IL2CPP builds. This will result in smaller binary size. It is recommended to us...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5b6af5126dda
unity_docs
rendering
In Unity's 'Create a Profiler module', what is 'Create a Profiler module with the Profiler Module Editor' and how does it work?
You can use Unity’s built-in Profiler Module Editor to create your own Profiler module. To collect data in your Profiler module, you must add at least one counter for the module to track. You can add both built-in Unity counters, or use the ProfilerCounter API to create your own counters to add to the module. The list ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7e0347a8f08a
unity_docs
rendering
Show me a Unity C# example demonstrating `Rendering.RenderPipeline.BeginContextRendering`.
Pipeline.BeginFrameRendering . It does everything that method does, and in addition it calls the RenderPipelineManager.beginContextRendering delegate. If you are writing a custom Scriptable Render Pipeline, use this method instead of RenderPipeline.BeginFrameRendering . The following code example demonstrates where ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_76c9aedfd93b
unity_docs
scripting
In Unity's 'Deploy a Web application', what is 'Web server configuration' and how does it work?
You might need to adjust your server configuration to match your specific build setup. In particular, there might be issues if you already have another server-side configuration to compress hosted files, which could interfere with this setup. To make the browser perform decompression natively while it downloads your ap...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9e1317b4c596
unity_docs
editor
What is `Tilemaps.Tilemap.GetEditorPreviewTile` in Unity? Explain its purpose and usage.
Tilemap.GetEditorPreviewTile Declaration public Tilemaps.TileBase GetEditorPreviewTile ( Vector3Int position ); Parameters Parameter Description position Position of the editor preview Tile on the Tilemap . Returns TileBase The editor preview Tile placed at the cell. Description Gets the edit...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_a431e5038f5d_doc_10
github
scripting
What does `GetAutoGraphicsApi` do in this Unity script? Explain its purpose and signature.
Gets the current value of the Graphics API setting for the given Build Target Signature: ```csharp public static bool GetAutoGraphicsApi(BuildTarget buildTarget) ```
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_682e6632b2bd
unity_docs
editor
Show me a Unity C# example demonstrating `iOS.Xcode.PBXProject.ContainsFileByRealPath`.
path of the file. sourceTree The source tree path the file is relative to. The PBXSourceTree.Group tree is not supported. Returns bool Returns true if the project contains the file, false otherwise. Description Checks if the project contains a file with the given physical path. The version without source t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_616bf551bd36
unity_docs
animation
Explain 'USS properties reference' in Unity.
The following table lists the USS properties in UI Toolkit. The table indicates which properties are inherited and their animatability . For an inherited property, the element gets the value from its parent element if you don’t specify a value for it. The following example uses an inherited property to set the font for...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_72c576b05d3d
unity_docs
rendering
What is `Experimental.GlobalIllumination.LightDataGI.innerConeAngle` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. LightDataGI.innerConeAngle public float innerConeAngle ; Description The inner cone angle for spot lights.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5a09a34590d8
unity_docs
scripting
Show me a Unity C# example demonstrating `EditorGUILayout.InspectorTitlebar`.
bject[] targetObjs ); Parameters Parameter Description foldout The foldout state shown with the arrow. targetObj The object (for example a component) or objects that the titlebar is for. Returns bool The foldout state selected by the user. Description Make an inspector-window-like titlebar. Create a ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_bdb7047cb824
unity_docs
rendering
Explain 'Other methods to warm up shaders' in Unity.
Warm up shaders if your build targets the DirectX 11, OpenGL, OpenGLES, or WebGL graphics APIs. If your project uses the DirectX 11, OpenGL, OpenGLES, or WebGL graphics APIs, Unity provides multiple methods to warm up shaders in your project. ## Other methods to warm up shaders On DirectX 11, OpenGL, OpenGLES, or Web...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f55e6a0d9857
unity_docs
rendering
Explain 'Dedicated Server Player settings' in Unity.
The Player settings for the Dedicated Server Player are a subset of the Desktop target Player settings. For a description of the general Player settings, refer to Player Settings . Due to the headless and server application nature of the Dedicated Server, only the options in the Other Settings section are applicable. T...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_857d5e3a97c1
unity_docs
editor
What is `Search.ParsedQuery_2` in Unity? Explain its purpose and usage.
ParsedQuery<T0,T1> class in UnityEditor.Search Description Provides methods to define an operation that can be used to filter a data set. <TData>: The filtered data type, <TPayload>: The payload type. Properties Property Description errors A list of QueryErrors. evaluationGraph Query evaluation graph used to...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d32096e576eb
unity_docs
editor
What is `Overlays.OverlayCanvas` in Unity? Explain its purpose and usage.
OverlayCanvas class in UnityEditor.Overlays Implements interfaces: ISerializationCallbackReceiver Description OverlayCanvas is a container for collections of Overlay s. Every EditorWindow has an OverlayCanvas , but only windows that opt-in to Overlay support will display Overlays. See ISupportsOverlays for...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7a8668b63843
unity_docs
math
What are the parameters of `AnimationCurve.ctor` in Unity?
Description Creates an animation curve from an arbitrary number of keyframes. This creates a curve from variable number of Keyframe parameters. If you want to create curve from an array of keyframes, create an empty curve and assign keys property. ```csharp using UnityEngine; using System.Collections;public class AnimC...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c891278b1132
unity_docs
editor
What is `GlobalObjectId.targetPrefabId` in Unity? Explain its purpose and usage.
GlobalObjectId.targetPrefabId public ulong targetPrefabId ; Description The ID of the prefab instance that contains the referenced object. Adding a new prefab instance to a scene creates a new instance of every object the prefab contains, including every GameObject. The GameObject inside a prefab instance doesn...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8fa42eb81d16
unity_docs
editor
What is `EditorUtility.OpenFilePanelWithFilters` in Unity? Explain its purpose and usage.
EditorUtility.OpenFilePanelWithFilters Declaration public static string OpenFilePanelWithFilters (string title , string directory , string[] filters ); Parameters Parameter Description title Title for dialog. directory Default directory. filters File extensions in form: new string[] { "Image files", "p...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e12f399ad13a
unity_docs
math
Explain 'Create a Culling Group' in Unity.
There are no components or visual tools for working with CullingGroups; they are purely accessible via script. A CullingGroup can be constructed using the ‘new’ operator: ``` CullingGroup group = new CullingGroup(); ``` To have the CullingGroup perform visibility and/or distance calculations, specify the camera it shou...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d5dc0ad6399a
unity_docs
math
What is `Rendering.BatchCullingOutputDrawCommands.indirectDrawCommandCount` in Unity? Explain its purpose and usage.
BatchCullingOutputDrawCommands.indirectDrawCommandCount public int indirectDrawCommandCount ; Description The number of elements in the BatchCullingOutputDrawCommands.indirectDrawCommands array. You must set this in the OnPerformCulling callback.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8ddd27316585
unity_docs
scripting
In Unity's 'Supported dependency versions', what is 'JDK' and how does it work?
The following table shows the JDK version that each Unity version supports: Unity version JDK version 6000.0 17 (OpenJDK version 17) 2022.3 LTS 11 (OpenJDK version 11) 2021.3 LTS 11 (OpenJDK version 11) Note : Unity versions 6 and later support CMake version 3.22.1, while earlier Unity versions don’t support CMake.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_ecac194c16fb_doc_14
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Allows accessing the PositionerAPI endpoints Signature: ```csharp public PositionerApi PositionerApi ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_0df0e77d8626
unity_docs
rendering
What is `ParticleSystem.SizeBySpeedModule.sizeMultiplier` in Unity? Explain its purpose and usage.
ParticleSystem.SizeBySpeedModule.sizeMultiplier public float sizeMultiplier ; Description A multiplier for ParticleSystem.SizeBySpeedModule.size . Changing this property is more efficient than accessing the entire curve, if you only want to change the overall size multiplier. ```csharp using UnityEngine; usi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8c07172a99b8
unity_docs
physics
Explain 'Configuring particles' in Unity.
Techniques and resources for configuring how Particle Systems emit particles, and the properties of individual particles from a Particle System . Topic Description Particle emissions and emitters Understand particle emissions, and how Unity manages them via Particle System modules. Configuring global particle propertie...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9f6ce19e5587
unity_docs
scripting
What is `SearchService.ObjectSelectorSearchContext.allowedInstanceIds` in Unity? Explain its purpose and usage.
ObjectSelectorSearchContext.allowedInstanceIds public IEnumerable<int> allowedInstanceIds ; Description IEnumerable of integers that contains the instanceIds of objects that the search can include in its results.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_571e7b52afa8
unity_docs
rendering
In Unity's 'Introduction to material properties', what is 'Serialized and Runtime Material properties' and how does it work?
Materials can contain both serialized and runtime-set property values. Serialized data is all the properties defined in shader’s Properties block. Typically these are values that need to be stored in the material, and are tweakable by the user in Material Inspector. A material can also have some properties that are use...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_225af27c1e86
unity_docs
scripting
What is `Unity.Android.Gradle.Dependencies.AddDependencyPlugin` in Unity? Explain its purpose and usage.
Dependencies.AddDependencyPlugin Declaration public Unity.Android.Gradle.GradlePlugin AddDependencyPlugin (string name , string version , bool apply ); Parameters Parameter Description name Plugin name. version Plugin version. apply Should plugin be applied. Returns GradlePlugin The added depende...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_675432489bcb
unity_docs
rendering
What is `Experimental.GlobalIllumination.SpotLightBoxShape.mode` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. SpotLightBoxShape.mode public Experimental.GlobalIllumination.LightMode mode ; Description The lightmode.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_24f134e645b5
unity_docs
performance
What is `Profiling.Profiler.usedHeapSizeLong` in Unity? Explain its purpose and usage.
Profiler.usedHeapSizeLong public static long usedHeapSizeLong ; Returns long Size of the memory allocated by Unity (or 0 if the profiler is disabled). Description Returns the number of bytes that Unity has allocated. This does not include bytes allocated by external libraries or drivers.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6d48612774a4
unity_docs
rendering
What is `Rendering.RayTracingInstanceCullingShaderTagConfig.tagId` in Unity? Explain its purpose and usage.
RayTracingInstanceCullingShaderTagConfig.tagId public Rendering.ShaderTagId tagId ; Description A shader tag id. Use ShaderTagId constructor to create one (e.g. ShaderTagId("RenderPipeline").
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8dac968f838c
unity_docs
scripting
What is `Compilation.CompilationPipeline.GetAssemblyDefinitionFilePathFromAssemblyName` in Unity? Explain its purpose and usage.
CompilationPipeline.GetAssemblyDefinitionFilePathFromAssemblyName Declaration public static string GetAssemblyDefinitionFilePathFromAssemblyName (string assemblyName ); Parameters Parameter Description assemblyName Assembly name. Returns string File path of assembly definition file. Description Retur...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e174693fd69b
unity_docs
editor
What is `AssetImporters.AssetImporterEditor.OnDisable` in Unity? Explain its purpose and usage.
AssetImporterEditor.OnDisable Declaration public void OnDisable (); Description This function is called when the editor object goes out of scope. This is also called when the editor is destroyed and can be used for any cleanup code. When scripts are reloaded after compilation has finished, OnDisable will be cal...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_4eb3077c07c2
github
scripting
Write a Unity C# physics script for Attack
```csharp using System.Collections; using System.Collections.Generic; using UnityEngine; namespace PlainSaveLoad { public class Attack : MonoBehaviour { public int damage; public int force; private void OnCollisionEnter(Collision collision) { if (collision.gameObjec...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_9e994234762a
unity_docs
scripting
What is `Animation.Stop` in Unity? Explain its purpose and usage.
Animation.Stop Declaration public void Stop (); Description Stops all playing animations that were started with this Animation. Stopping an animation also Rewinds it to the Start. ```csharp using UnityEngine;public class ExampleScript : MonoBehaviour { Animation anim; void Start() { anim = GetComponent<Ani...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cb7d7a68191b
unity_docs
editor
Show me a Unity C# example demonstrating `EditorGUI.ChangeCheckScope`.
ChangeCheckScope class in UnityEditor Description Check if any control was changed inside a block of code. When needing to check if GUI.changed is set to true inside a block of code, wrap the code inside a ChangeCheckScope like this: ```csharp using UnityEditor;class ExampleClass { void ExampleMethod() { us...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_727172fedf58
unity_docs
scripting
What is `Playables.PlayableExtensions.SetLeadTime` in Unity? Explain its purpose and usage.
PlayableExtensions.SetLeadTime Declaration public static void SetLeadTime (U playable , float value ); Parameters Parameter Description playable The Playable used by this operation. value The new lead time in seconds. Description Sets the Playable lead time in seconds. PrepareData() is called when...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_dbfb7fdb0a30
unity_docs
editor
Explain 'Import local asset packages' in Unity.
You can import locally saved asset packages (.unitypackage files) into the Unity Editor for use in your project. Note : For information about using the Package Manager window to import an asset package you purchased or downloaded from the Asset Store , refer to Download and import an asset package . To import a local a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_161f09ee7aeb
unity_docs
rendering
In Unity's 'Hierarchy window reference', what is 'GameObject icons in the Hierarchy' and how does it work?
The icons next to the GameObject name indicate whether the item is a basic GameObject or a prefab, and whether a prefab has been modified from its original values. You can identify the following types of items using the icons in the Hierarchy window. Item Icon Description GameObject The foundational building blocks of ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_e770e4ea46ee_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Sets the Magic Leap 2 SDK folder in the Preferences window Signature: ```csharp public class SetSdkFolderSetupStep : ISetupStep ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e26aa540d99a
unity_docs
animation
Explain 'Alembic' in Unity.
com.unity.formats.alembic ## Description Import and export Alembic files (.abc), record and stream animations in the Alembic format directly in Unity. NOTE: Supported build platforms: only Windows 64-bit/Arm64, macOS X, and Linux 64. The Alembic format is commonly used in animation to transfer facial, cloth, and othe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_176de4d7e843
unity_docs
editor
Show me a Unity C# example demonstrating `EditorGUI.TextArea`.
orStyles.textField); Parameters Parameter Description position Rectangle on the screen to use for the text field. text The text to edit. style Optional GUIStyle . Returns string The text entered by the user. Description Makes a text area. This works just like GUI.TextArea , but correctly responds ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2315b30b54b7
unity_docs
rendering
What are the parameters of `Shader.DisableKeyword` in Unity?
Description Disables a global shader keyword. Shader keywords determine which shader variants Unity uses. For information on working with local shader keywords and global shader keywords and how they interact, see Using shader keywords with C# scripts . If you pass a string and a GlobalKeyword with the given name does ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c3db32e1ee04
unity_docs
editor
What is `Experimental.ArtifactKey` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. ArtifactKey struct in UnityEditor.Experimental Description An ArtifactKey is used for specifying an artifact to lookup or produce. One example of producing an artifact is to run and importer on a specific asset. The importer i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_2d7d88b06b10
unity_docs
rendering
In Unity's 'Dedicated Server Player settings', what is 'Other Settings' and how does it work?
This section allows you to customize a range of options organized into the following groups: Configuration Shader Settings Shader Variant Loading Settings Script Compilation Optimization Stack Trace Legacy Capture Logs
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_db5d74100e8d
unity_docs
scripting
What is `UIElements.TypedUxmlAttributeDescription_1.GetValueFromBag` in Unity? Explain its purpose and usage.
TypedUxmlAttributeDescription<T0>.GetValueFromBag Declaration public T GetValueFromBag ( UIElements.IUxmlAttributes bag , UIElements.CreationContext cc ); Parameters Parameter Description bag The bag of attributes where to get the actual value. cc The creation context. Returns T The value of type T...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_c5564a9cc8a9_doc_0
github
scripting
What does `HookGetInstanceProcAddr` do in this Unity script? Explain its purpose and signature.
Used to intercept the function XrEndFrame to change the flag Unpremultiplied Alpha.xrGetInstanceProcAddr native function pointerFunction pointer to hook OpenXR native functions like XrEndFrame. Signature: ```csharp protected override IntPtr HookGetInstanceProcAddr(IntPtr func) ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_689e60bb663a
unity_docs
rendering
What is `ShaderUtil.GetComputeShaderMessageCount` in Unity? Explain its purpose and usage.
ShaderUtil.GetComputeShaderMessageCount Declaration public static int GetComputeShaderMessageCount ( ComputeShader s ); Parameters Parameter Description s The ComputeShader instance to check for messages. Returns int The number of errors and warnings generated by the Unity Shader Compiler. Descript...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_1d10234e5a94
unity_docs
editor
In Unity's 'Build a macOS application', what is 'Target architecture' and how does it work?
Before you build an application for macOS, be aware of the chipset differences between Apple devices. Some Apple devices use Intel chipsets and others use Apple silicon. You can use Unity to create both architecture-specific builds and builds that target both Intel and Apple silicon. The available target architectures ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_f3d90b097b1b_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Sample monobehaviour without specific inspector Signature: ```csharp public class SampleDefaultMonoBehaviour : MonoBehaviour ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_5e5aea5ce504
unity_docs
editor
What is `EditorGUI.DelayedDoubleField` in Unity? Explain its purpose and usage.
EditorGUI.DelayedDoubleField Declaration public static double DelayedDoubleField ( Rect position , double value , GUIStyle style = EditorStyles.numberField); Declaration public static double DelayedDoubleField ( Rect position , string label , double value , GUIStyle style = EditorStyles.numberFiel...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fef21315483a
unity_docs
math
What is `AndroidJNI.CallStaticFloatMethod` in Unity? Explain its purpose and usage.
AndroidJNI.CallStaticFloatMethod Declaration public static float CallStaticFloatMethod (IntPtr clazz , IntPtr methodID , jvalue[] args ); Description Invokes the specified methodID static method on a Java object, optionally passing in an array of arguments ( args ). Additional resources: Java Native Inter...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_333340a3452a
unity_docs
rendering
In Unity's 'Text effects', what is 'Apply text shadows' and how does it work?
To apply shadows to the text, set the text-shadow property in a USS file, inline in UXML, or a C# script. text-shadow is a shorthand property that sets the following properties: text-shadow-offset-x : Horizontal shadow displacement. Positive values move the shadow to the right, while negative values move it to the left...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_36813b775d92
unity_docs
xr
What is `PackageManager.Client.ClearCache` in Unity? Explain its purpose and usage.
Client.ClearCache Declaration public static PackageManager.Requests.ClearCacheRequest ClearCache (); Returns ClearCacheRequest A ClearCacheRequest instance, which you can use to get the StatusCode to know if the operation completed successfully. Description Empties the package cache. Empties the g...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fbf3c519695e
unity_docs
scripting
What is `Profiling.HierarchyFrameDataView.GetItemColumnData` in Unity? Explain its purpose and usage.
HierarchyFrameDataView.GetItemColumnData Declaration public string GetItemColumnData (int id , int column ); Parameters Parameter Description id Hierarchy item identifier. column Column identifier. Returns string Value of the correspnding column as string. Description Returns string representation...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a398d7b3cd21
unity_docs
scripting
What is `ILogger.LogWarning` in Unity? Explain its purpose and usage.
ILogger.LogWarning Declaration public void LogWarning (string tag , object message ); Declaration public void LogWarning (string tag , object message , Object context ); Description A variant of Logger.Log that logs an warning message. Additional resources: Logger.LogWarning .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_668f4442b8b5
unity_docs
scripting
What is `Unity.IO.LowLevel.Unsafe.VirtualFileSystem.GetLocalFileSystemName` in Unity? Explain its purpose and usage.
VirtualFileSystem.GetLocalFileSystemName Declaration public static bool GetLocalFileSystemName (string vfsFileName , out string localFileName , out ulong localFileOffset , out ulong localFileSize ); Parameters Parameter Description vfsFileName Virtual file entry to find. localFileName Out parameter cont...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3df4de781f54
unity_docs
scripting
In Unity's 'Enter Play mode with domain reload disabled', what is 'Resetting state on exiting Play mode' and how does it work?
It’s often most efficient to reset state on exiting Play mode rather than on entering. You can use the EditorApplication.playModeStateChanged event and its ExitingPlayMode enum value to catch the Play mode exit event and reset state at that point. In the following example the event handler for Play mode exit is used to...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d94205d5da1c
unity_docs
scripting
What is `Search.SearchSelectorAttribute.cacheable` in Unity? Explain its purpose and usage.
SearchSelectorAttribute.cacheable public bool cacheable ; Description Set the cacheable property if you do not want the search backend to pull cached values from the property database. This is particularly useful if you know that the selected value changes often.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5f29f4b195d4
unity_docs
scripting
Give me an overview of the `VideoDeinterlaceMode` class in Unity.
VideoDeinterlaceMode enumeration Description Describes how the fields in the image, if any, should be interpreted. Properties Property Description Off Clip is not interlaced. Even First field is in the even lines. Odd First field is in the odd lines.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e640afcf2830
unity_docs
rendering
What is `AssetImporters.ScriptedImporter.OnImportAsset` in Unity? Explain its purpose and usage.
ScriptedImporter.OnImportAsset Declaration public void OnImportAsset ( AssetImporters.AssetImportContext ctx ); Parameters Parameter Description ctx This argument contains all the contextual information needed to process the import event and is also used by the custom importer to store the resulting Unity A...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4abffaf2de81
unity_docs
scripting
What is `GlobalObjectId.Equals` in Unity? Explain its purpose and usage.
GlobalObjectId.Equals Declaration public bool Equals ( GlobalObjectId other ); Parameters Parameter Description other The other GlobalObjectId to compare with this instance. Returns bool Returns true if the two instances of GlobalObjectId are value equivalent. Otherwise, returns false . Descriptio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_62dce804016c
unity_docs
scripting
What is `Experimental.GraphView.GraphView.FrameAll` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphView.FrameAll Declaration public Experimental.GraphView.EventPropagation FrameAll (); Returns EventPropagation Should always be Stop. Description Focus view all elements in the graph.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ed757c99049b
unity_docs
xr
What is `FrameTimingManager.GetLatestTimings` in Unity? Explain its purpose and usage.
FrameTimingManager.GetLatestTimings Declaration public static uint GetLatestTimings (uint numFrames , FrameTiming[] timings ); Parameters Parameter Description numFrames User supplies a desired number of frames they would like FrameTimings for. This should be equal to or less than the maximum FrameTimings t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_575bf3be6874
unity_docs
rendering
What is `Renderer.staticShadowCaster` in Unity? Explain its purpose and usage.
Renderer.staticShadowCaster public bool staticShadowCaster ; Description Is this renderer a static shadow caster? When enabled, Unity considers this renderer as being static for the sake of shadow rendering. If the SRP implements cached shadow maps, this field indicates to the render pipeline what renderers are...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3aaa60e72e52
unity_docs
rendering
What is `Rendering.LocalKeyword.operator_eq` in Unity? Explain its purpose and usage.
LocalKeyword.operator == public static bool operator == ( Rendering.LocalKeyword lhs , Rendering.LocalKeyword rhs ); Description Returns true if the shader keywords are the same. Otherwise, returns false.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fd3ffef97859
unity_docs
animation
What is `UIElements.IExperimentalFeatures.animation` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. IExperimentalFeatures.animation public UIElements.Experimental.ITransitionAnimations animation ; Description Returns the animation experimental interface.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9aab0575d2c9
unity_docs
editor
What is `Search.SearchQueryError` in Unity? Explain its purpose and usage.
SearchQueryError class in UnityEditor.Search Description Represents a query parsing error. This class is only used in the context of SearchProviders , when performing a search. It allows a SearchProvider to report error during the parsing of the search query. Here is an example of a SearchProvider that uses ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d3288ad795a3
unity_docs
editor
What is `iOS.Xcode.PBXProject.ReadFromFile` in Unity? Explain its purpose and usage.
PBXProject.ReadFromFile Declaration public void ReadFromFile (string path ); Parameters Parameter Description path Path of the file. Description Reads the project from a file identified by the given path. Current contents of the project are discarded. ```csharp using UnityEditor; using System.IO; using U...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0b3b269d5973
unity_docs
scripting
Show me a Unity C# example demonstrating `EditorUtility.CollectDeepHierarchy`.
tion Collect all objects in the hierarchy rooted at each of the given objects. This is most useful for linearizing entire GameObject hierarchies including all their components. Note that the traversal will not include assets referenced from within the hierarchy. For example, having a MeshFilter component in the hier...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6f11324ae2c8
unity_docs
editor
What is `Build.IFilterBuildAssemblies.OnFilterAssemblies` in Unity? Explain its purpose and usage.
IFilterBuildAssemblies.OnFilterAssemblies Declaration public string[] OnFilterAssemblies ( BuildOptions buildOptions , string[] assemblies ); Parameters Parameter Description buildOptions The current build options. assemblies The list of assemblies that will be included. Returns string[] Returns the ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_51a3150cf359
unity_docs
animation
What is `Animations.AnimatorControllerPlayable.SetFloat` in Unity? Explain its purpose and usage.
AnimatorControllerPlayable.SetFloat Declaration public void SetFloat (string name , float value ); Declaration public void SetFloat (int id , float value ); Parameters Parameter Description name The parameter name. id The parameter ID. value The new parameter value. dampTime The damper total tim...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.