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_9c1146fd8eff
unity_docs
math
What is `GeometryUtility.CalculateFrustumPlanes` in Unity? Explain its purpose and usage.
GeometryUtility.CalculateFrustumPlanes Declaration public static Plane[] CalculateFrustumPlanes ( Camera camera ); Parameters Parameter Description camera The camera with the view frustum that you want to calculate planes from. Returns Plane[] The planes that form the camera's view frustum. Descripti...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_cdca207204d4
unity_docs
audio
In Unity's 'Audio Profiler module reference', what is 'Simple view' and how does it work?
The Simple view contains the following information about the audio data for the frame you selected. Data Description Total Audio Sources Total number of audio sources in the scene. Playing Audio Sources Total number of audio sources playing in the scene Paused Audio Sources The total number of paused audio sources in t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1903749d33de
unity_docs
scripting
What is `Search.StringView.LastIndexOf` in Unity? Explain its purpose and usage.
StringView.LastIndexOf Declaration public int LastIndexOf (stringView other , stringComparison sc ); Parameters Parameter Description other A StringView . sc A string comparision option. Returns int The last index where the StringView is found, otherwise -1. Description Returns the index of the...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_92e1a48cafcd
unity_docs
editor
Show me a Unity C# example demonstrating `MouseCursor.ResizeHorizontal`.
MouseCursor.ResizeHorizontal Description Horizontal resize arrows. ```csharp //Create a folder and name it “Editor” if this doesn’t already exist //Put this script in the folder//This script creates a new menu (“Examples”) and a menu item (“Mouse Cursor”). Click on this option. This displays a small window that has...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5bdd053be42a
unity_docs
rendering
What are the parameters of `Cubemap.GetPixel` in Unity?
Returns Color The pixel color. Description Gets the pixel color at coordinates ( x , y ). This method gets pixel data from the texture in CPU memory. Texture.isReadable must be true . The lower left corner of a face is (0, 0). If the pixel coordinate is outside the texture's dimensions, Unity clamps or repeats it, depe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d042affd7297
unity_docs
rendering
In Unity's 'Validate and correct materials in the Built-In Render Pipeline', what is 'Validate pure metals' and how does it work?
Unity defines physically-based shading materials with a specular color greater than 155 sRGB as metallic. For Unity to define a metallic Material as a pure metal If a non-metallic surface has a specular color value that is too high, but has a non-zero albedo value, this is often due to an authoring error. The Material ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a94edb77ab0a
unity_docs
animation
What is `UnityEngine.AnimationModule` in Unity? Explain its purpose and usage.
UnityEngine.AnimationModule Description The Animation module implements Unity's animation system. Classes Class Description AimConstraint Constrains the orientation of an object relative to the position of one or more source objects, such that the object is facing the average position of the sources. Animation ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_0c8b1fb8deec
unity_docs
editor
Explain 'Contents of the Asset Database' in Unity.
Unity’s Asset Database keeps track of assets in your project to ensure the original asset source file and its imported counterpart remain in sync. ## Source assets and artifacts On import, Unity converts most asset types from their original format to one optimized for use at runtime. The original file is referred to ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7a1b554b27f8
unity_docs
scripting
What is `AndroidJNI.GetDirectBufferAddress` in Unity? Explain its purpose and usage.
AndroidJNI.GetDirectBufferAddress Declaration public static sbyte* GetDirectBufferAddress (IntPtr buffer ); Description Fetches and returns the starting address of the memory region referenced by the given direct java.nio.Buffer. Additional resources: Java Native Interface Specification (Oracle)
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5b2ce9a3be6b
unity_docs
physics
What is `ContactFilter2D.IsFilteringTrigger` in Unity? Explain its purpose and usage.
ContactFilter2D.IsFilteringTrigger Declaration public bool IsFilteringTrigger ( Collider2D collider ); Parameters Parameter Description collider The Collider2D used to check for a trigger. Returns bool Returns true when collider is excluded by the filter and false if otherwise. Description Check...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0923fdd1a949
unity_docs
rendering
Show me a Unity C# example demonstrating `AssetDatabase.CreateFolder`.
already exist. For example, when specifying "Assets/ParentFolder1/Parentfolder2/", the new folder will be created in "ParentFolder2" only if ParentFolder1 and ParentFolder2 already exist. Note: When Unity attempts to create a folder, if a folder with the same name exists at the same path, Unity adds a sequential numbe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b43980dd6c62
unity_docs
editor
Show me a Unity C# example demonstrating `iOS.Xcode.PBXProject.AddRemotePackageReferenceWithVersionRange`.
l , string minVersion , string maxVersion ); Parameters Parameter Description url The URL of the repository. minVersion The minimum version to allow updates from. maxVersion The maximum version to allow updates to. Returns string Returns the GUID of the remote package reference. Description Adds a ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_015f5a86056f
unity_docs
rendering
What is `Light.boundingSphereOverride` in Unity? Explain its purpose and usage.
Light.boundingSphereOverride public Vector4 boundingSphereOverride ; Description Bounding sphere used to override the regular light bounding sphere during culling. Additional resources: Light.useBoundingSphereOverride .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_a4cca641dec9
unity_docs
scripting
Explain 'Select a GameObject that overlaps with other GameObjects' in Unity.
Use the selection piercing menu to select a specific GameObject from a location that has multiple GameObjects. Large, complex scenes can have many GameObjects that occupy the same position with each other or GameObjects with meshes or geometry that overlap. The selection piercing menu lists all GameObjects that share t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_36e329bf31e6
unity_docs
rendering
What is `TerrainTools.PaintContext.pixelRect` in Unity? Explain its purpose and usage.
PaintContext.pixelRect public RectInt pixelRect ; Description (Read Only) The pixel rectangle that this PaintContext represents. The pixel rectangle coordinates refer to pixels in the targetTexture on the PaintContext.originTerrain .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f4a748d53182
unity_docs
rendering
Explain 'Text effects' in Unity.
You can apply text effects to enhance the visual appearance of the text. However, these effects are only supported for font assets with SDF rendering mode and not for bitmap. The range of the text effects is limited by the padding defined for the font asset. Therefore, to increase the size of the effect, you must incre...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_c2caabbff87e
unity_docs
xr
Explain 'Game state hinting' in Unity.
Android’s game state feature indicates to the operating system whether your application is in a loading state and also whether Android can interrupt the application. Depending on the state of the application, Android can perform certain optimizations. For example, if the application is in a loading state, the operating...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_32a11752f4c6
unity_docs
performance
What is `Profiling.ProfilerTimeSampleSelection.markerNamePath` in Unity? Explain its purpose and usage.
ProfilerTimeSampleSelection.markerNamePath public ReadOnlyCollection<string> markerNamePath ; Description A list of the names of all ProfilerMarkers that make up the Sample Stack of this selection. Unity populates this list on a selection object if it was passed to IProfilerFrameTimeViewSampleSelectionControl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_733a0e766e85
unity_docs
physics
Explain 'Wheel collider component reference' in Unity.
The Wheel collider is a collider for ground vehicles. It has built-in collision detection, wheel physics, and a slip-based tire friction model. For guidance on using the Wheel collider , see the Unity Wheel collider tutorial . Property Description Mass Set the mass of the Wheel collider (in kilograms). The default valu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_89c5f9aa4c0f
github
scripting
Write a Unity C# MonoBehaviour script called U Async
```csharp using System; using System.Collections; using UnityEngine; namespace UAsync { public static partial class Extensions { public static IEnumerator Async(this MonoBehaviour mb, Func<float, bool> conditionRun) { float elapsedTime = 0f; while (conditionRun(elapsed...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_da268fc3b50c
unity_docs
math
What are the parameters of `Animator.MatchTarget` in Unity?
Description Automatically adjust the GameObject position and rotation. Adjust the GameObject position and rotation so that the AvatarTarget reaches the matchPosition when the current state is at the specified progress. Target matching only works on the base layer (index 0). You can only queue one match target at a time...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_195cb4cc4e5e
unity_docs
editor
What is `SceneManagement.EditorSceneManager.MarkSceneDirty` in Unity? Explain its purpose and usage.
EditorSceneManager.MarkSceneDirty Declaration public static bool MarkSceneDirty ( SceneManagement.Scene scene ); Parameters Parameter Description scene The Scene to be marked as modified. Returns bool Whether the Scene was successfully marked as dirty. Description Mark the specified Scene as modifie...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_ee1672ecce20
unity_docs
ui
In Unity's 'Introduction to USS', what is 'Supported selector types' and how does it work?
USS supports several types of simple and complex selectors that match elements based on different criteria, such as the following: Element C# type name An assigned name property A list of USS classes The element’s position in the visual tree and its relationship to other elements USS also supports pseudo classes that y...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9442ad7c016e
unity_docs
xr
What is `Physics.defaultPhysicsScene` in Unity? Explain its purpose and usage.
Physics.defaultPhysicsScene public static PhysicsScene defaultPhysicsScene ; Description The PhysicsScene automatically created when Unity starts. A default PhysicsScene is automatically created when Unity starts. It is used by any Scene that does not request a local 3D physics Scene.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b614acc743b1
unity_docs
rendering
What is `ShadowmaskMode` in Unity? Explain its purpose and usage.
ShadowmaskMode enumeration Description The rendering mode of Shadowmask. Set whether static shadow casters should be rendered into real-time shadow maps. Additional resources: QualitySettings.shadowmaskMode , QualitySettings.shadowDistance . Properties Property Description Shadowmask Static shadow casters w...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_dca6a99a90b1
unity_docs
networking
Explain 'Licensing overview' in Unity.
Unity provides a range of plans for all levels. Some plans are free, while others have a subscription fee. Check out all the plans at https://unity.com/pricing . Depending on your plan and type, your license will be governed by one of the following models: Named user licensing. Serial-based licensing. Floating licensin...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_28d8e0b12b50
unity_docs
performance
What is `Unity.Profiling.LowLevel.Unsafe.ProfilerUnsafeUtility.BeginSample` in Unity? Explain its purpose and usage.
ProfilerUnsafeUtility.BeginSample Declaration public static void BeginSample (IntPtr markerPtr ); Parameters Parameter Description markerPtr Profiler marker handle. Description Starts profiling a piece of code marked with a custom name that the markerPtr handle has defined. Code marked with BeginSample...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f5586798ec7d
unity_docs
physics
Show me a Unity code example for 'Get started with runtime binding'.
tes in this GitHub repository . ## Create a data source asset Create a data source asset that contains the properties you want to bind to. In this example, you create a ScriptableObject asset named ExampleObject that contains a string property. Create a project in Unity with any template. In the Assets folder of your...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9abb42a237ad
unity_docs
scripting
What is `Unity.Properties.TypeUtility.Instantiate` in Unity? Explain its purpose and usage.
TypeUtility.Instantiate Declaration public static T Instantiate (); Returns T A new instance of the T. Description Creates a new instance of the specified T. Declaration public static T Instantiate (Type derivedType ); Parameters Parameter Description derivedType The type we want to create a n...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0b3cde47275d
unity_docs
editor
Show me a Unity C# example demonstrating `PlayerSettings.defaultWebScreenWidth`.
PlayerSettings.defaultWebScreenWidth public static int defaultWebScreenWidth ; Description Default horizontal dimension of web player window. Custom player settings. ```csharp using UnityEngine; using UnityEditor; // Simple Script that saves and loads custom // Stand-alone/Web player screen settings among // ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4a5049585741
unity_docs
animation
Show me a Unity C# example demonstrating `AnimationState.speed`.
AnimationState.speed public float speed ; Description The playback speed of the animation. 1 is normal playback speed. A negative playback speed will play the animation backwards. Additional resources: AnimationState.time , AnimationState.wrapMode properties and WrapMode enum. ```csharp using UnityEngine;...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_fb1215471963
unity_docs
physics
Explain 'Cast a ray from a camera' in Unity.
The most common use of a Ray from the camera is to perform a raycast out into the scene . A raycast sends an imaginary “laser beam” along the ray from its origin until it hits a collider in the scene. Information is then returned about the object and the point that was hit in a RaycastHit object. This is a very useful ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7484712573a8
unity_docs
scripting
Show me a Unity C# example demonstrating `MonoBehaviour.OnAnimatorMove`.
MonoBehaviour.OnAnimatorMove() Description Callback for processing animation movements for modifying root motion. This callback will be invoked at each frame after the state machines and the animations have been evaluated, but before OnAnimatorIK . Additional resources: Root motion . ```csharp // Attach this sc...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_26fbdc39595b
unity_docs
scripting
What is `AI.NavMeshObstacle.center` in Unity? Explain its purpose and usage.
NavMeshObstacle.center public Vector3 center ; Description The center of the obstacle, measured in the object's local space. Note: When a NavMeshObstacle is created the center is set to zero. ```csharp // Default center is (0, 0, 0) using UnityEngine; using UnityEngine.AI;public class ExampleScript : ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ad246c0d1ac8
unity_docs
animation
What is `AnimationUtility.SetAdditiveReferencePose` in Unity? Explain its purpose and usage.
AnimationUtility.SetAdditiveReferencePose Declaration public static void SetAdditiveReferencePose ( AnimationClip clip , AnimationClip referenceClip , float time ); Parameters Parameter Description clip The animation clip to use. referenceClip The animation clip containing the reference pose. time T...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_9aea8f54e5ce
github
scripting
Write a Unity C# script called Queen
```csharp using System.Collections; using System.Collections.Generic; using UnityEngine; public class Queen : Piece { public override bool[,] PossibleMoves() { bool[,] ret = new bool[8,8]; bool[,] bish = BishopMoves(); bool[,] rok = RookMoves(); for (int i = 0; i < 8; ++i) ...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_0b9b56ecd5e1
unity_docs
rendering
Show me a Unity C# example demonstrating `Shader.DisableKeyword`.
. The version of this function that takes a string as a parameter is slower than the version that takes a GlobalKeyword . If you call this function more than once, it is best practice to create a GlobalKeyword struct, cache it, and use that. The following example creates a GlobalKeyword struct with the name EXAMP...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bff61e92b40b
unity_docs
rendering
What is `Light.commandBufferCount` in Unity? Explain its purpose and usage.
Light.commandBufferCount public int commandBufferCount ; Description Number of command buffers set up on this light (Read Only). Additional resources: CommandBuffer , AddCommandBuffer , RemoveCommandBuffer , GetCommandBuffers .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d9623fef81ee
unity_docs
editor
What are the parameters of `MonoImporter.GetExecutionOrder` in Unity?
Returns int Returns the execution order for the given MonoScript . Description Gets the execution order for a MonoScript . This is the same execution order that the Script Execution Order Settings window displays. The default execution order for scripts is 0. Additional resources: MonoImporter.SetExecutionOrder . ```cs...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_aa10a3a6ea05
unity_docs
math
What is `Rendering.RayTracingGeometryInstanceConfig.accelerationStructureBuildFlags` in Unity? Explain its purpose and usage.
RayTracingGeometryInstanceConfig.accelerationStructureBuildFlags public Rendering.RayTracingAccelerationStructureBuildFlags accelerationStructureBuildFlags ; Description The flags Unity uses when it builds the acceleration structure for the geometry referenced by this ray tracing instance configuration. If yo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_061fded26ad7
unity_docs
performance
In Unity's 'Memory in Unity introduction', what is 'Native memory' and how does it work?
The Unity engine’s internal C/C++ core has its own memory management system, called native memory. In most situations, you can’t directly access or modify this memory type. Unity stores the scenes in your project, assets, graphics APIs, graphics drivers, subsystems, plug-in buffers, and allocations inside native memory...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_b370f342c0e1
unity_docs
rendering
In Unity's 'Rendering Statistics window reference', what is 'Statistics' and how does it work?
The Graphics section of the Statistics window contains the following information: Statistic Description FPS The current number of frames Unity is able to draw per second. CPU Main : The total amount of time taken to process one frame. This number includes the time Unity takes to process the frame update of your applica...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_dce6e465bf5c
unity_docs
editor
What is `MouseCursor.ResizeHorizontal` in Unity? Explain its purpose and usage.
MouseCursor.ResizeHorizontal Description Horizontal resize arrows. ```csharp //Create a folder and name it “Editor” if this doesn’t already exist //Put this script in the folder//This script creates a new menu (“Examples”) and a menu item (“Mouse Cursor”). Click on this option. This displays a small window that has...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f6cc58b56d55
unity_docs
animation
What is `Animations.AnimationLayerMixerPlayable.SetLayerMaskFromAvatarMask` in Unity? Explain its purpose and usage.
AnimationLayerMixerPlayable.SetLayerMaskFromAvatarMask Declaration public void SetLayerMaskFromAvatarMask (uint layerIndex , AvatarMask mask ); Parameters Parameter Description layerIndex The layer index. mask The AvatarMask used to create the new LayerMask. Description Sets the mask for the current l...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fc5318243f38
unity_docs
math
What is `ArrayUtility.IndexOf` in Unity? Explain its purpose and usage.
ArrayUtility.IndexOf Declaration public static int IndexOf (T[] array , T value ); Returns int The zero-based index of the element, if found; otherwise -1. Description Index of first element with value value .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_30f9ef0f20e8
unity_docs
scripting
What is `Search.SearchExpressionKeyword` in Unity? Explain its purpose and usage.
SearchExpressionKeyword enumeration Description Enum contaning all keywords used as configuration parameter in builtin evaluator of SearchExpression . Properties Property Description None Unrecognized keyword. Asc Asc (contraction of Ascending). Used in sor{} to define the sorting order. Desc Desc (contracti...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_732a1783c2ed
unity_docs
scripting
Show me a Unity C# example demonstrating `MeshFilter.mesh`.
u can modify the mesh for a single object only. The other objects that used the same mesh will not be modified. It is your responsibility to destroy the automatically instantiated mesh when the game object is being destroyed. Resources.UnloadUnusedAssets also destroys the mesh but it is usually only called when loadi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6dd60e36525e
unity_docs
scripting
Show me a Unity C# example demonstrating `Screen.height`.
it reflects the current resolution. Note : When accessed from the Editor events, such as ContextMenu methods, inspector enable/disable actions, or custom Editor scripts, Screen.width and Screen.height return the current Game view window resolution in the Unity Editor. These properties do not reflect the resolutio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f3ac1f9cac7d
unity_docs
scripting
Show me a Unity C# example demonstrating `Rendering.PIX.EndGPUCapture`.
PIX.EndGPUCapture Declaration public static void EndGPUCapture (); Description Ends the current GPU frame capture in PIX. If not running via PIX, or as a development build, then it has no effect. ```csharp using UnityEngine; using UnityEngine.Rendering;public class PixControl : MonoBehaviour { public int frame...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_558e73e8796a
unity_docs
scripting
What is `Search.SearchViewState.HasFlag` in Unity? Explain its purpose and usage.
SearchViewState.HasFlag Declaration public bool HasFlag ( Search.SearchViewFlags flags ); Parameters Parameter Description f Search view flags to be checked. Returns bool Returns true if the search view flags are defined in the current search view state. Description Checks if the search view was def...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_fc4beb9e357e
github
scripting
Write a Unity C# MonoBehaviour script called Example Spline
```csharp using UnityEngine; using System.Collections; using DentedPixel; public class ExampleSpline : MonoBehaviour { public Transform[] trans; LTSpline spline; private GameObject ltLogo; private GameObject ltLogo2; void Start () { spline = new LTSpline( new Vector3[] {trans[0].position, trans[1].position, ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8b2572c6b980
unity_docs
rendering
Explain 'Particle System component reference' in Unity.
A Particle System component simulates fluid entities such as liquids, clouds and flames by generating and animating large numbers of small 2D images in the scene . For a full introduction to particle systems and their uses, see further documentation on Particle Systems . Property Function Simulate Layers Allows you to ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_d41b8abf03ba
unity_docs
rendering
Explain 'Make shader behavior conditional on keywords' in Unity.
To mark parts of your shader code conditional based on whether you enable or disable a shader keyword, use an HLSL if statement . For example: ``` #pragma multi_compile QUALITY_LOW QUALITY_MED QUALITY_HIGH if (QUALITY_LOW) { // code for low quality setting } else if (QUALITY_MED) { // code for medium quality setting...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_481d3b8e9ccd
unity_docs
editor
Explain 'Analytics' in Unity.
com.unity.services.analytics ## Description The Unity Analytics package automatically collects core events and user properties when someone uses your game or application, and enables you to track specific in-game actions your user performs by defining custom events. The data collected from this package is surfaced in...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fd3d68344e29
unity_docs
scripting
What is `UIElements.MultiColumnController.ctor` in Unity? Explain its purpose and usage.
MultiColumnController Constructor Declaration public MultiColumnController ( UIElements.Columns columns , UIElements.SortColumnDescriptions sortDescriptions , List<SortColumnDescription> sortedColumns ); Parameters Parameter Description columns The columns data used to initialize the header. sortDescri...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d2c9bcfdfc87
unity_docs
rendering
Give me an overview of the `ScaleMode` class in Unity.
ScaleMode enumeration Description Scaling mode to draw textures with. Properties Property Description StretchToFill Stretches the texture to fill the complete rectangle passed in to GUI.DrawTexture. ScaleAndCrop Scales the texture, maintaining aspect ratio, so it completely covers the position rectangle passed...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1bc5e0492333
unity_docs
scripting
What is `Application.dataPath` in Unity? Explain its purpose and usage.
Application.dataPath public static string dataPath ; Description Contains the path to the game data folder on the target device (Read Only). The value depends on which platform you are running on: Unity Editor: < path to project folder >/Assets Mac player: < path to player app bundle >/Contents iOS player: <...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_415c06539acb
unity_docs
physics
Show me a Unity C# example demonstrating `RaycastHit2D.collider`.
ollider2D detected by the physics query. When the RaycastHit2D result is returned from a physics query, the collider refers to the specific Collider2D that was detected. NOTE : This field will be NULL if nothing was detected however when checking if the result is valid, you should use the less verbose method sh...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_387a9c424aca
unity_docs
editor
Show me a Unity C# example demonstrating `ExpressionEvaluator.Evaluate`.
ated support: arithmetic operators a+b , a-b , a*b , a/b , power ( a^b ) and modulo ( a%b ) operators, parentheses, math functions sqrt(a) , floor(a) , ceil(a) , round(a) , trigonometic functions cos(a) , sin(a) , tan(a) (argument expressed in radians), and a constant pi . If the expression can not b...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_be05e3e4a03b
unity_docs
rendering
What are the parameters of `Texture2D.GetPixelData` in Unity?
Returns NativeArray<T> A native array that points directly to the texture's data buffer in CPU memory. Description Gets the raw data from a texture. This method returns a NativeArray<T0> that points directly to the texture's data on the CPU and has the size of the mipmap level. The array doesn't contain a copy of the d...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cf958e35746d
unity_docs
scripting
What is `Unity.Android.Gradle.BaseBlock` in Unity? Explain its purpose and usage.
BaseBlock class in Unity.Android.Gradle / Inherits from: Unity.Android.Gradle.BaseElement Description Abstract base class for all existing block elements. Empty blocks don't appear in the resulting file. A block is empty if it has no children and has no raw value set. Constructors Constructor Description Ba...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9f0a1fcc2d4c
unity_docs
ui
Show me a Unity C# example demonstrating `GUI.BeginScrollView`.
. If false or left out, it is only shown when viewRect is taller than position . Returns Vector2 The modified scrollPosition. Feed this back into the variable you pass in, as shown in the example. Description Begin a scrolling view inside your GUI. ScrollViews let you make a smaller area on-screen look 'int...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_e95a37b0ed70
github
scripting
Write a Unity Editor script for Interface With Serializable Content Drawer
```csharp using Attributes; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using UnityEditor; using UnityEngine; namespace EditorExtensions { /* * use [SerializeReference,SelectableImpl] on filed definition to use the drawer, like this: * [SerializeRefere...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_4eed644c42cf
unity_docs
rendering
Show me a Unity C# example demonstrating `Camera.allCameras`.
Camera.allCameras public static Camera[] allCameras ; Description Returns all enabled cameras in the Scene. All cameras in the scene can be enabled or disabled. The allCameras value tells how many cameras are still enabled. If all the cameras are disabled then a value of zero will be returned. ```csharp u...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fbd1c0acebc6
unity_docs
scripting
What is `WSA.Tile.GetTemplate` in Unity? Explain its purpose and usage.
Tile.GetTemplate Declaration public static string GetTemplate ( WSA.TileTemplate templ ); Parameters Parameter Description templ A template identifier. Returns string String, which is an empty XML document to be filled and used for tile notification. Description Get template XML for tile notificatio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e0214f7fb889
unity_docs
physics
Show me a Unity C# example demonstrating `AssetImporters.ScriptedImporterAttribute.version`.
ScriptedImporterAttribute.version public int version ; Description Importer version number that is used by the import layer to detect new version of the importer and trigger re-imports when such events occur, to apply latest changes made to the scripted imrpoter. ```csharp using UnityEngine; using UnityEditor.A...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2c09c0f6c166
unity_docs
editor
What are the parameters of `iOS.Xcode.PBXProject.GetPBXProjectPath` in Unity?
Returns string The path to the PBX project file. This path can be opened later using the ReadFromFile function. Description Returns the path to PBX project in the given Unity build path. This function can only be used for Unity-generated projects. Note: On VisionOS and macOS platforms this will return BUILDPATH/Unity-i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_04f24ddf780e
unity_docs
scripting
What is `SystemLanguage.Spanish` in Unity? Explain its purpose and usage.
SystemLanguage.Spanish Description Spanish. ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { //This checks if your computer's operating system is in the Spanish language if (Application.systemLanguage == SystemLanguage.Spanish) { //Outputs into console that the system is Spani...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b0be1bd77835
unity_docs
xr
Give me an overview of the `CachedAssetBundle` class in Unity.
CachedAssetBundle struct in UnityEngine / Implemented in: UnityEngine.CoreModule Description Data structure for downloading AssetBundles to a customized cache path. Additional resources: UnityWebRequestAssetBundle.GetAssetBundle for more information. Properties Property Description hash Hash128 which is use...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_842c9d067b33
unity_docs
scripting
What is `TextMesh.tabSize` in Unity? Explain its purpose and usage.
TextMesh.tabSize public float tabSize ; Description How much space will be inserted for a tab '\t' character. This is a multiplum of the 'spacebar' character offset. ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { GetComponent<TextMesh>().tabSize = 5; } } ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1c5b61bb9970
unity_docs
xr
What are the parameters of `Android.Permission.RequestUserPermission` in Unity?
Description Request the user to grant access to a device resource or information that requires authorization. The RequestUserPermission method doesn't wait for the user response and returns immediately. If the system permission dialog is displayed, the application suspends. You can use HasUserAuthorizedPermission metho...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1c8a614020cb
unity_docs
rendering
What is `CubemapArray.SetPixels` in Unity? Explain its purpose and usage.
CubemapArray.SetPixels Declaration public void SetPixels (Color[] colors , CubemapFace face , int arrayElement , int miplevel ); Declaration public void SetPixels (Color[] colors , CubemapFace face , int arrayElement ); Parameters Parameter Description colors The array of pixel colours to use....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_686bd3a0b6c9
unity_docs
scripting
Give me an overview of the `CullingGroupEvent` class in Unity.
CullingGroupEvent struct in UnityEngine / Implemented in: UnityEngine.CoreModule Description Provides information about the current and previous states of one sphere in a CullingGroup. Additional resources: CullingGroup.onStateChanged . Properties Property Description currentDistance The current distance b...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_9f24e40ba6ae
unity_docs
scripting
In Unity's 'FAQ for input and event systems with UI Toolkit', what is 'Method 1: Use Event System' and how does it work?
UI Toolkit elements, such as Button or Label, are not GameObjects, so they don’t cast or assign a VisualElement to a GameObject variable. Use the Event System to find the panel, then use UI Toolkit APIs to find the visual element under the pointer. Add an Event System component in your scene the same way as you create ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f42a981b38d9
unity_docs
performance
What is `Profiling.ProfilerTimeSampleSelection.rawSampleIndices` in Unity? Explain its purpose and usage.
ProfilerTimeSampleSelection.rawSampleIndices public ReadOnlyCollection<int> rawSampleIndices ; Description A sample selected in Hierarchy view might correspond to multiple samples in RawFrameDataView . This is a list of all of these sample indices. Note: When HierarchyFrameDataView uses HierarchyFrameDataVie...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_71e78e598f57
unity_docs
rendering
What are the parameters of `Shader.SetKeyword` in Unity?
Description Sets the state of 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 . When value is true , this function calls EnableKeyword . ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ae5c12f08180
unity_docs
scripting
What is `RenderTargetSetup.colorStore` in Unity? Explain its purpose and usage.
RenderTargetSetup.colorStore public RenderBufferStoreAction[] colorStore ; Description Store Actions for Color Buffers. It will override any actions set on RenderBuffers themselves. Please note that not all platforms have load/store actions, so this setting might be ignored at runtime. Generally mobile-oriented...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_430a121c2c13
unity_docs
animation
What is `Animator.GetBehaviours` in Unity? Explain its purpose and usage.
Animator.GetBehaviours Declaration public T[] GetBehaviours (); Description Returns all StateMachineBehaviour that match type T or are derived from T . Returns null if none are found. ```csharp using UnityEngine; using System.Collections;// An example StateMachineBehaviour. public class BreathBehaviour : ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bb762fc24968
unity_docs
performance
Show me a Unity C# example demonstrating `Profiling.Profiler.GetTotalFragmentationInfo`.
and the next, specifically [ (2^n) .. (2^(n+1) - 1) ]. e.g. blocks of sizes [1], [2..3], [4..7], [8..15], [16..31], [32..63], [64..127], [128..256] ... bytes. This design gives quick and constant time allocator performance for all allocations regardless of allocation size or heap capacity. You can use Profiler.GetTot...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b998b72532d6
unity_docs
physics
What are the parameters of `GameObject.CompareTag` in Unity?
Returns bool true if the GameObject has the given tag, false otherwise. Description Checks if the specified tag is attached to the GameObject. The example below calls CompareTag on a Collider to check if it has the Player tag. ```csharp // Immediate death trigger. // Destroys any colliders that enter the trigger, if th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_26b601a45bc5
unity_docs
physics
In Unity's 'Physics Profiler module', what is 'Module details pane' and how does it work?
When you click on the Physics Profiler module, the module details pane displays further information about the physics in your project’s scene. Statistic Description Physics Used Memory The total amount of memory that the physics module has used. Dynamic Bodies The number of Rigidbody components and ArticulationBody com...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_773eb1e89488
unity_docs
networking
Explain 'Sentis' in Unity.
com.unity.ai.inference ## Description Sentis is a neural network inference library. It enables you to import trained neural network models, connect the network inputs and outputs to your game code, and then run them locally in your end-user app. Use cases include capabilities like natural language processing, object ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_54f280624f3e
unity_docs
scripting
Give me an overview of the `FilterMode` class in Unity.
FilterMode enumeration Description Filtering mode for textures. Corresponds to the settings in a texture inspector . Additional resources: Texture.filterMode , texture assets . ```csharp //This script changes the filter mode of your Texture you attach when you press the space key in Play Mode. It switches betw...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d4ba003490bb
unity_docs
animation
What is `Animations.AnimatorControllerPlayable.IsParameterControlledByCurve` in Unity? Explain its purpose and usage.
AnimatorControllerPlayable.IsParameterControlledByCurve Declaration public bool IsParameterControlledByCurve (string name ); Declaration public bool IsParameterControlledByCurve (int id ); Parameters Parameter Description name The parameter name. id The parameter ID. Returns bool True if the param...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_34691ac8b0ef
github
scripting
Write a Unity C# XR/VR script for Teleport Volume Anchor Affordance State Link
```csharp using System; using UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.State; using UnityEngine.XR.Interaction.Toolkit.Interactables; using UnityEngine.XR.Interaction.Toolkit.Locomotion.Teleportation; namespace UnityEngine.XR.Interaction.Toolkit.Samples.StarterAssets { /// <summary> /// Helper compo...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
gh_7fe5a06be3f4_doc_1
github
scripting
What does `HasInstance` do in this Unity script? Explain its purpose and signature.
Is there an existing instance of type ?If there is no set instance, this will try to find them. If more than one instanceis found, the extra instances are deleted. Signature: ```csharp public static bool HasInstance => CheckForInstanceAndDeleteExtras(); ```
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_man_8eab2bcbad5e
unity_docs
scripting
Explain 'Bonjour browser sample' in Unity.
For a simple example of how to use a native plug-in , download the Bonjour Browser Sample . This example demonstrates how you can invoke Objective-C code from a Unity iOS application. This application implements a simple Bonjour client and consists of: A Unity iOS Project where Plugins\Bonjour.cs is the C# interface to...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cb86e91f3c94
unity_docs
rendering
Give me an overview of the `Highlighter` class in Unity.
Highlighter class in UnityEditor Description Use this class to highlight elements in the editor for use in in-editor tutorials and similar. Static Properties Property Description active Is there currently an active highlight? activeRect The rect in screenspace of the current active highlight. activeText The ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_dd4bb9329bd0
unity_docs
physics
What is `CustomRenderTextureManager.updateTriggered` in Unity? Explain its purpose and usage.
CustomRenderTextureManager.updateTriggered Description Unity raises this event when CustomRenderTexture.Update is called. Use this event to keep track of CustomRenderTexture updates. This is useful if you are writing your own CustomRenderTexture update loop. Additional resources: Rendering.GraphicsSettings.disabl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7782ad28137d
unity_docs
scripting
What is `Compilation.CompilerMessageType` in Unity? Explain its purpose and usage.
CompilerMessageType enumeration Description Compiler message type. Additional resources: CompilerMessage.type . Properties Property Description Error Error message. Warning Warning message. Info Info message.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e5afb24a3d0c
unity_docs
scripting
Show me a Unity C# example demonstrating `ParticleSystem.NoiseModule.strengthY`.
ParticleSystem.NoiseModule.strengthY public ParticleSystem.MinMaxCurve strengthY ; Description Define the strength of the effect on the y-axis, when using the ParticleSystem.NoiseModule.separateAxes option. Additional resources: MinMaxCurve . ```csharp using UnityEngine; using System.Collections;[Require...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_700fbfe033e7
unity_docs
rendering
What is `SceneView.rotation` in Unity? Explain its purpose and usage.
SceneView.rotation public Quaternion rotation ; Description The direction of the camera to the pivot of the SceneView . Changes the Scene view direction. Use with pivot , size , and CameraSettings.fieldOfView to calculate camera transformation. Use the camera LookAt to animate the transition.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_b0083c266da9
unity_docs
audio
In Unity's 'Audio in Web', what is 'Supported classes' and how does it work?
Unity Web supports the following API classes: Class WebGL Support status AudioSource WebGL supports some APIs. Refer to AudioSource for specific support details. AudioListener All APIs supported. AudioClip WebGL supports some APIs. Refer to AudioClip for specific support details. AudioMixer WebGL supports some APIs. Re...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_296f5e3d1c9c
unity_docs
rendering
Show me a Unity code example for 'Toon shading Surface Shader example in the Built-In Render Pipeline'.
The following example shows a “Ramp” lighting model that uses a Texture ramp to define how surfaces respond to the angles between the light and the normal. This can be used for a variety of effects, and is especially effective when used with Toon lighting. ```csharp ...ShaderLab code... CGPROGRAM #pragma surface surf...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_92ad213274ee
unity_docs
rendering
Give me an overview of the `CameraProjectionCache` class in Unity.
CameraProjectionCache struct in UnityEditor Description Project points from world to screen space. Projection from world to screen space depends on internal camera matrices that Unity must recalculate whenever they are accessed. When accessed in a loop where the camera state does not change, these calculations ar...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2c82f41d40b2
unity_docs
rendering
What is `Experimental.Playables.TexturePlayableBinding.Create` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. TexturePlayableBinding.Create Declaration public static Playables.PlayableBinding Create (string name , Object key ); Parameters Parameter Description key A reference to a UnityEngine.Object that acts as a key for th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4c1283e63da4
unity_docs
rendering
What is `TextureImporter.crunchedCompression` in Unity? Explain its purpose and usage.
TextureImporter.crunchedCompression public bool crunchedCompression ; Description Use crunched compression when available. This will only affect the default platfrom setting. Additional resources: TextureImporterPlatformSettings , TextureImporter.SetPlatformTextureSettings .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9b8070666a25
unity_docs
physics
What is `Physics2D.CapsuleCast` in Unity? Explain its purpose and usage.
Physics2D.CapsuleCast Declaration public static RaycastHit2D CapsuleCast ( Vector2 origin , Vector2 size , CapsuleDirection2D capsuleDirection , float angle , Vector2 direction , float distance = Mathf.Infinity, int layerMask = DefaultRaycastLayers, float minDepth = -Mathf.Infinity, float maxDep...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1d2290b6452b
unity_docs
math
What is `Experimental.GraphView.RectangleSelector.ComputeAxisAlignedBound` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. RectangleSelector.ComputeAxisAlignedBound Declaration public Rect ComputeAxisAlignedBound ( Rect position , Matrix4x4 transform ); Parameters Parameter Description position Rectangle to bound. transform Transform....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_38a1071e82e8_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Behavior with an API for spawning objects from a given set of prefabs. Signature: ```csharp public class ObjectSpawner : MonoBehaviour ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.