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_man_5d6503481d95
unity_docs
scripting
In Unity's 'Create USS variables', what is 'Specify default values for USS variables' and how does it work?
The var() function accepts an optional default value. The UI system uses the default value when it cannot resolve the variable. For example, if you remove a variable from a style sheet but forget to remove a reference to it. To specify a default value for a variable, add it after the variable value, separated by a comm...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5855583683f5
unity_docs
scripting
Give me an overview of the `Awaitable_1` class in Unity.
Awaitable<T0> class in UnityEngine / Implemented in: UnityEngine.CoreModule Description Custom Unity type that can be awaited and used as an async return type in the C# asynchronous programming model. Public Methods Method Description Cancel Cancel the awaitable. If the awaitable is being awaited, the awaite...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_6138533f60d4
github
scripting
Write a Unity C# script called Transform Access Array Extensions
```csharp using UnityEngine.Jobs; namespace Gilzoide.UpdateManager.Extensions { public static class TransformAccessArrayExtensions { public static void DisposeIfCreated(this ref TransformAccessArray transformArray) { if (transformArray.isCreated) { transf...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_696e3a84b143
unity_docs
ui
What is `UIElements.UxmlElementAttribute` in Unity? Explain its purpose and usage.
UxmlElementAttribute class in UnityEngine.UIElements / Implemented in: UnityEngine.UIElementsModule Description Declares a custom control. To create a custom control, you must add the UxmlElement attribute to the custom control class definition. You must declare the custom control class as a partial class ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ecad7194d68f
unity_docs
rendering
What is `Sprites.Packer.GetAlphaTexturesForAtlas` in Unity? Explain its purpose and usage.
Packer.GetAlphaTexturesForAtlas Declaration public static Texture2D[] GetAlphaTexturesForAtlas (string atlasName ); Parameters Parameter Description atlasName Name of the atlas. Description Returns all alpha atlas textures generated for the specified atlas. Alpha splits are generated when the textures wit...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5bad5a46a4a8
unity_docs
scripting
Show me a Unity C# example demonstrating `WindZone.windPulseMagnitude`.
WindZone.windPulseMagnitude public float windPulseMagnitude ; Description Defines how much the wind changes over time. ```csharp // Creates a wind zone with the effect of a helicopter passing by // Place this into an empty GameObject and move it over a tree using UnityEngine;public class ExampleScript : MonoBe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_fafe2c2e7120
github
scripting
Write a Unity C# UI script for Endless Mode Toggle UI Script
```csharp using System.Collections; using System.Collections.Generic; using UnityEngine; public class EndlessModeToggleUIScript : MonoBehaviour { [SerializeField] [Tooltip("Drag and drop the scarier scares buttons here!")] GameObject EndlessModeOFF, EndlessModeON; // Start is called before the first fr...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_af30ce42fb09
unity_docs
scripting
What is `UIElements.BaseVerticalCollectionView.SetSelection` in Unity? Explain its purpose and usage.
BaseVerticalCollectionView.SetSelection Declaration public void SetSelection (int index ); Parameters Parameter Description index The item index. Description Sets the currently selected item. Declaration public void SetSelection (IEnumerable<int> indices ); Parameters Parameter Description indi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d30a8fc1c5ea
unity_docs
editor
What is `EditorGUI.PropertyScope` in Unity? Explain its purpose and usage.
PropertyScope class in UnityEditor Description Create a Property wrapper, useful for making regular GUI controls work with SerializedProperty . Most EditorGUI and EditorGUILayout GUI controls already have overloads that work with SerializedProperty. However, for GUI controls that don't handle SerializedPrope...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_20e343b7a964
unity_docs
scripting
What is `SessionState.GetString` in Unity? Explain its purpose and usage.
SessionState.GetString Declaration public static string GetString (string key , string defaultValue ); Description Retrieve a String value. Due to the behavior of Unity's serialization system, SessionState.GetString returns an empty string instead of null when no string value is stored for the key, even i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_6dc95f197b88
github
scripting
Write a Unity C# XR/VR script for Transform Sync
```csharp using System; using UnityEngine.XR.Interaction.Toolkit.Utilities.Tweenables.Primitives; namespace UnityEngine.XR.Interaction.Toolkit.Samples.Hands { /// <summary> /// Class used to sync the transform of a target game object with this one. /// </summary> public class TransformSync : MonoBehavi...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_dcebeafc38c8
unity_docs
scripting
Show me a Unity C# example demonstrating `Quaternion.Dot`.
Quaternion.Dot Declaration public static float Dot ( Quaternion a , Quaternion b ); Description The dot product between two rotations. ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { print(Quaternion.Dot(transform.rotation, Quaternion.identity)); } } ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fcbd0fbd758f
unity_docs
math
What is `BoundsInt.xMax` in Unity? Explain its purpose and usage.
BoundsInt.xMax public int xMax ; Description The maximal x point of the box. Only points with an x component less than this value are contained in the box. Sets the maximum value of BoundsInt 's x point. If you enter a maximum value that is less than the current minimum value, then the entered value becomes t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_9f4917548802_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Destroys the child GameObject and creates a new child GameObject with the given TComponent component.IHierarchyBehaviour's will be initialized.The child Component to destroy.The type of Component to be created.The new TComponent Signature: ```csharp public static TComponent ReplaceChild<TComponent>(this GameObject par...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_08d031958b5e
unity_docs
scripting
What is `CustomGridBrushAttribute` in Unity? Explain its purpose and usage.
CustomGridBrushAttribute class in UnityEngine / Implemented in: UnityEngine.TilemapModule Description Attribute to define the class as a grid brush and to make it available in the palette window. Properties Property Description defaultBrush If set to true, brush will replace Unity built-in brush as the defau...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a569a1dc4c49
unity_docs
animation
What is `Animations.ParentConstraint.SetRotationOffset` in Unity? Explain its purpose and usage.
ParentConstraint.SetRotationOffset Declaration public void SetRotationOffset (int index , Vector3 value ); Parameters Parameter Description index The index of the constraint source. value The new rotation offset. Description Sets the rotation offset associated with a source by index. Throws InvalidOp...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_373fab9e6da4
unity_docs
scripting
What is `Experimental.GraphView.StickyNoteFontSize` in Unity? Explain its purpose and usage.
StickyNoteFontSize enumeration Description Enum used to describe the font size used by the [StickyNote]. Properties Property Description Small Small font size. Medium Medium font size. Large Large font size. Huge Huge font size.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fb8932957ee5
unity_docs
scripting
What is `SphereCollider.radius` in Unity? Explain its purpose and usage.
SphereCollider.radius public float radius ; Description The radius of the sphere measured in the object's local space. The sphere radius will be scaled by the transform's scale. ```csharp using UnityEngine;//Always attach a SphereCollider component to your GameObject public class Example : MonoBehaviour { //...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_132cfdd60d17
unity_docs
scripting
What is `Display.renderingWidth` in Unity? Explain its purpose and usage.
Display.renderingWidth public int renderingWidth ; Description Horizontal resolution that the display is rendering at in the viewport. Rendering resolution can be different from a platform's original display resolution (see Display.systemWidth ). Additional resources: renderingHeight , SetRenderingResolution...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_64195186128f
unity_docs
physics
Give me an overview of the `CustomCollider2D` class in Unity.
CustomCollider2D class in UnityEngine / Inherits from: Collider2D / Implemented in: UnityEngine.Physics2DModule Description Represents a Collider2D that is configured by assigning PhysicsShape2D geometry to it via a PhysicsShapeGroup2D . Unlike all other Collider2D which are defined indirectly by contr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1e51ac3d6074
unity_docs
rendering
What is `ShaderGUI.OnClosed` in Unity? Explain its purpose and usage.
ShaderGUI.OnClosed Declaration public void OnClosed ( Material material ); Description This method is called when the ShaderGUI is being closed. A common reason for this is when a new shader is assigned to a material. The callback is called immediately before the new shader is assigned.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_23801ff61afc
unity_docs
performance
What is `Profiling.RawFrameDataView.GetSampleFlowEvents` in Unity? Explain its purpose and usage.
RawFrameDataView.GetSampleFlowEvents Declaration public void GetSampleFlowEvents (int sampleIndex , List<FlowEvent> outFlowEvents ); Parameters Parameter Description sampleIndex Index of the Profiler sample. outFlowEvents Returns the list of profiler flow events for the sample in the current frame and thr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8c31ce2f886d
unity_docs
editor
What is `Build.Content.SceneLoadInfo` in Unity? Explain its purpose and usage.
SceneLoadInfo class in UnityEditor.Build.Content Description Container for holding preload information for a given serialized Scene in an AssetBundle. Note: this class and its members exist to provide low-level support for the Scriptable Build Pipeline package. This is intended for internal use only; use the S...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_add33c075c9d
unity_docs
scripting
What is `Build.Content.SceneDependencyInfo.referencedObjects` in Unity? Explain its purpose and usage.
SceneDependencyInfo.referencedObjects public ReadOnlyCollection<ObjectIdentifier> referencedObjects ; Description List of objects referenced by the Scene. Internal use only. See SceneDependencyInfo .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_644e5f264e66
unity_docs
rendering
What is `ShadowmaskMode.DistanceShadowmask` in Unity? Explain its purpose and usage.
ShadowmaskMode.DistanceShadowmask Description Static shadow casters will be rendered into real-time shadow maps. Shadowmasks and occlusion from Light Probes will only be used past the real-time shadow distance. Additional resources: QualitySettings.shadowmaskMode , QualitySettings.shadowDistance .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_553278e50a3d
unity_docs
audio
What is `AudioSource.bypassListenerEffects` in Unity? Explain its purpose and usage.
AudioSource.bypassListenerEffects public bool bypassListenerEffects ; Description When set, global effects on the AudioListener doesn't apply to the audio signal generated by the AudioSource. It also does'nt apply, if the AudioSource is playing into a mixer group.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a4bbabdfbe68
unity_docs
editor
What are the parameters of `iOS.Xcode.PBXProject.ReadFromStream` in Unity?
Description Reads the project from the given text reader. Current contents of the project are discarded. ```csharp using UnityEditor; using System.IO; using UnityEditor.Callbacks; using UnityEditor.iOS.Xcode;public class Sample_ReadFromStream { [PostProcessBuild] public static void OnPostprocessBuild(BuildTar...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_29fc036931a4
unity_docs
editor
Show me a Unity C# example demonstrating `Search.SearchExpression.TryConvertToDouble`.
r ); Parameters Parameter Description item SearchItem to extract the value from. value Resulting value. selector Selector use to access an item value. If null, we will use the internal item value. Returns bool Returns true if we were able to select the value and convert it to a double. Description Re...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5d39d6fb2c2b
unity_docs
audio
Explain 'Tracker Modules' in Unity.
Tracker Modules are essentially just packages of audio samples that have been modeled, arranged and sequenced programatically. The concept was introduced in the 1980’s (mainly in conjunction with the Amiga computer) and has been popular since the early days of game development and demo culture. Tracker Module files are...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_11b663c7ee53
unity_docs
scripting
What is `PlayerSettings.SetIl2CppStacktraceInformation` in Unity? Explain its purpose and usage.
PlayerSettings.SetIl2CppStacktraceInformation Declaration public static void SetIl2CppStacktraceInformation ( Build.NamedBuildTarget buildTarget , Il2CppStacktraceInformation option ); Parameters Parameter Description buildTarget The NamedBuildTarget . option Stack trace information option. Descript...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4a1b806ec4a6
unity_docs
editor
What is `Device.SystemInfo.supportsSetConstantBuffer` in Unity? Explain its purpose and usage.
SystemInfo.supportsSetConstantBuffer public static bool supportsSetConstantBuffer ; Description This has the same functionality as SystemInfo.supportsSetConstantBuffer and also mimics platform-specific behavior in the Unity Editor.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_058b27bdf9fb
unity_docs
rendering
In Unity's '2D images for low level of detail (LOD)', what is 'Render pipeline information' and how does it work?
How you work with billboards depends on the render pipeline you use. Feature name Universal Render Pipeline (URP) High Definition Render Pipeline (HDRP) Built-in Render Pipeline Billboard Renderer component Yes. Yes. Only with VFX Graph. Yes.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8b5f542e069e
unity_docs
scripting
What is `Search.PropertyDatabase.Invalidate` in Unity? Explain its purpose and usage.
PropertyDatabase.Invalidate Declaration public void Invalidate (ref Search.PropertyDatabaseRecordKey recordKey ); Parameters Parameter Description recordKey A record key. Description Invalidates a single property record so it is no longer retrievable. ``` // Store a property. var propertyRecordKey = Pro...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_db4425e934ec
unity_docs
scripting
Explain 'Work with blend shapes' in Unity.
## Prepare the artwork Once you have set up blend shapes in your 3D modeling application, do the following: In your 3D modeling application, enable these export settings: Enable exporting animation. Enable exporting blend shapes for deformed models. Export your selection to an .fbx file. Import your FBX file into Unit...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5f43ddd800e8
unity_docs
rendering
What are the parameters of `ModelImporter.SearchAndRemapMaterials` in Unity?
Returns bool Returns false if the source file is empty or invalid. Returns true otherwise. Description Search the project for matching materials and use them instead of the internal materials. Unity uses the naming convention specified by nameOption to find and match Material assets in your project and maps them to the...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f5f86e155f55
unity_docs
rendering
What is `Camera.allowDynamicResolution` in Unity? Explain its purpose and usage.
Camera.allowDynamicResolution public bool allowDynamicResolution ; Description Dynamic Resolution Scaling. True if the camera is using Dynamic Resolution rendering and false if it is not. Even if this property is true, Dynamic Resolution is only used if also supported by the current Graphics Device. Note: Dyn...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ab1b7dfbefd5
unity_docs
scripting
What is `ParticleSystem.NoiseModule.remapXMultiplier` in Unity? Explain its purpose and usage.
ParticleSystem.NoiseModule.remapXMultiplier public float remapXMultiplier ; Description x-axis remap multiplier. Changing this property is more efficient than accessing the entire curve, if you only want to change the overall remap multiplier. Additional resources: ParticleSystem.NoiseModule.remapX . ```csha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_16a74db3a6c4
unity_docs
scripting
What are the parameters of `Component.CompareTag` in Unity?
Returns bool Returns true if GameObject has same tag. Returns false otherwise. Description Checks the GameObject's tag against the defined tag . ```csharp // Immediate death trigger. // Destroys any colliders that enter the trigger, if they are tagged player.using UnityEngine; using System.Collections;public class Exam...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e0561b8023c5
unity_docs
scripting
What is `ShortcutManagement.IShortcutManager.activeProfileChanged` in Unity? Explain its purpose and usage.
IShortcutManager.activeProfileChanged Parameters Parameter Description value Active profile changed event handler. Description Raised when the ID of the active profile is changed. This event is raised when the active profile is changed, e.g. when activeProfileId changes. It is not raised when the shortcut ov...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0df615163368
unity_docs
scripting
What is `Experimental.GraphView.StackNode.CanAcceptDrop` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. StackNode.CanAcceptDrop Declaration public bool CanAcceptDrop (List<ISelectable> selection ); Parameters Parameter Description selection "The selected GraphElements to be checked. Returns bool Returns true if this Sta...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_05ec84776b1c
unity_docs
scripting
What is `UIElements.Experimental.PointerOutLinkTagEvent.GetPooled` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. PointerOutLinkTagEvent.GetPooled Declaration public static UIElements.Experimental.PointerOutLinkTagEvent GetPooled ( UIElements.IPointerEvent evt , string linkID ); Returns PointerOutLinkTagEvent An initialized event....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4356fe1f702c
unity_docs
scripting
What is `AI.NavMesh.SetLinkOwner` in Unity? Explain its purpose and usage.
NavMesh.SetLinkOwner Declaration public static void SetLinkOwner ( AI.NavMeshLinkInstance handle , Object owner ); Parameters Parameter Description handle The identifier of the link instance for which you assign an owner. owner An object that carries useful information in relation to the instance of th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_14d6b47d5008
unity_docs
rendering
What is `VideoEncodingProfile.H264Baseline` in Unity? Explain its purpose and usage.
VideoEncodingProfile.H264Baseline Description Encode video with the baseline profile. This is the most basic level of the encoder profiles. The decoding process for this profile is less complex, which is suitable for devices with lightweight processing. This profile doesn’t include advanced features, such as B-fram...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d06326b7e9cf
unity_docs
scripting
What are the parameters of `Unity.Collections.LowLevel.Unsafe.UnsafeUtility.As` in Unity?
Returns T A reference to the object interpreted as the target type. Description Performs an unsafe cast of a specified object to a different type. The As method converts a reference of one type to another type. Use this method for direct type conversions, such as during low-level memory operations or when you interact ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6a75519dfa7f
unity_docs
scripting
In Unity's 'ToolbarBreadcrumbs', what is 'Create a ToolbarBreadcrumbs' and how does it work?
You can create a ToolbarBreadcrumbs with UI Builder, UXML, or C#. The following C# example creates a ToolbarBreadcrumbs with three items: ```csharp using UnityEditor.UIElements; ... var toolbarBreadcrumbs = new ToolbarBreadcrumbs(); // Use the PushItem() method to add an item to the breadcrumbs. The method takes a str...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_470188aa5376
unity_docs
scripting
What is `IMGUI.Controls.MultiColumnHeaderState.Column.autoResize` in Unity? Explain its purpose and usage.
MultiColumnHeaderState.Column.autoResize public bool autoResize ; Description Option to allow the column to resize automatically when resizing the entire MultiColumnHeader. The default value is true which means that the column will resize automatically if the rect of the MultiColumHeader is changed. If false th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_96dd38ced091
unity_docs
math
What is `Vector2Int.magnitude` in Unity? Explain its purpose and usage.
Vector2Int.magnitude public float magnitude ; Description Returns the length of this vector (Read Only). The length of the vector is square root of (x*x+y*y) . If you only need to compare magnitudes of some vectors, you can compare squared magnitudes of them using sqrMagnitude (computing squared magnitudes i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_87c6a0104357
unity_docs
ui
What is `Editor.CreatePreview` in Unity? Explain its purpose and usage.
Editor.CreatePreview Declaration public UIElements.VisualElement CreatePreview ( UIElements.VisualElement inspectorPreviewWindow ); Description Implement this method to make a custom UIElements inspector preview. Inside this method, you can create your own custom UIElements inspector preview for a specific ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_df23fe66d956
unity_docs
input
Show me a Unity C# example demonstrating `GUI.tooltip`.
string to display. When the mouse is over a control with a tooltip, it sets the global GUI.tooltip value to the tooltip you pass in. If the mouse is not hovering over any control, the value is set to the control which has keyboard focus. At the end of the OnGUI code, you can make a label showing the value of GUI.too...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a882b82ede5b
unity_docs
performance
What is `Profiling.RawFrameDataView.GetSampleCallstack` in Unity? Explain its purpose and usage.
RawFrameDataView.GetSampleCallstack Declaration public void GetSampleCallstack (int sampleIndex , List<ulong> outCallstack ); Parameters Parameter Description sampleIndex Index of the Profiler sample. outCallstack List filled with callstack pointers as a result of a method call. Description Gets the cal...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f7f772888b36
unity_docs
scripting
Show me a Unity C# example demonstrating `SystemLanguage.Norwegian`.
SystemLanguage.Norwegian Description Norwegian. ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { //This checks if your computer's operating system is in the Norwegian language if (Application.systemLanguage == SystemLanguage.Norwegian) { //Outputs into console that the system ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_dc0e67f0e8cd
unity_docs
scripting
What is `ParticleSystem.NoiseModule.remapX` in Unity? Explain its purpose and usage.
ParticleSystem.NoiseModule.remapX public ParticleSystem.MinMaxCurve remapX ; Description Define how the noise values are remapped on the x-axis, when using the ParticleSystem.NoiseModule.separateAxes option. Additional resources: MinMaxCurve . ```csharp using UnityEngine; using System.Collections;[Requir...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_1557a2064b88
github
scripting
Write a Unity Editor script for Addressable Prefab Preview
```csharp using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using UnityEditor; using UnityEngine; using UnityEngine.AddressableAssets; using Object = UnityEngine.Object; namespace PassivePicasso.SimplyAddress { public static class AddressablePrefabPreview { ...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_521af9a60a2d
unity_docs
editor
What is `Search.SearchExpressionEvaluatorAttribute` in Unity? Explain its purpose and usage.
SearchExpressionEvaluatorAttribute class in UnityEditor.Search Description Attribute used to register new SearchExpressionEvaluator. This will allow to use new function in SearchExpression . As a side note all builtin evaluators (count{}, select{}, ...) are defined using this attribute. ```csharp using System; u...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d20b1252e67e
unity_docs
rendering
What is `Material.SetConstantBuffer` in Unity? Explain its purpose and usage.
Material.SetConstantBuffer Declaration public void SetConstantBuffer (string name , ComputeBuffer value , int offset , int size ); Declaration public void SetConstantBuffer (int nameID , ComputeBuffer value , int offset , int size ); Declaration public void SetConstantBuffer (string name , Gra...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_792571d4586a
unity_docs
rendering
What is `ComputeBufferType.Default` in Unity? Explain its purpose and usage.
ComputeBufferType.Default Description Default ComputeBuffer type (structured buffer). In HLSL shaders, this maps to StructuredBuffer<T> or RWStructuredBuffer<T> . When you construct a ComputeBuffer of this type, the value of stride must match the stride of the corresponding StructuredBuffer struct type in ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d6e44fd8e28d
unity_docs
input
What is `UIElements.IKeyboardEvent` in Unity? Explain its purpose and usage.
IKeyboardEvent interface in UnityEngine.UIElements Description This interface describes the data used by keyboard events. Properties Property Description actionKey Gets a boolean value that indicates whether the platform-specific action key is pressed. True means the action key is pressed. False means it...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_e88aa342a4c2_doc_2
github
scripting
What does `GetInstance` do in this Unity script? Explain its purpose and signature.
Singleton instance of VoiceSystemManager. Signature: ```csharp public static VoiceSystemManager GetInstance => _INSTANCE ??= new VoiceSystemManager(); ```
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_52b64226b2a2
unity_docs
scripting
What is `SerializeField` in Unity? Explain its purpose and usage.
SerializeField class in UnityEngine / Implemented in: UnityEngine.CoreModule Description Force Unity to serialize a private field. Unity only serializes public fields by default. To serialize private fields, add the [SerializeField] attribute to them. Unity serializes all your script components, reloads the n...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_a924b181a4f8
github
scripting
Write a Unity C# animation script for Shader Prop Animator
```csharp using UnityEngine; using System.Collections; namespace TMPro.Examples { public class ShaderPropAnimator : MonoBehaviour { private Renderer m_Renderer; private Material m_Material; public AnimationCurve GlowCurve; public float m_frame; void Awake() ...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_0b34d2c89f69
unity_docs
rendering
What is `Mesh.SetTriangles` in Unity? Explain its purpose and usage.
Mesh.SetTriangles Declaration public void SetTriangles (int[] triangles , int submesh , bool calculateBounds = true, int baseVertex = 0); Declaration public void SetTriangles (List<int> triangles , int submesh , bool calculateBounds = true, int baseVertex = 0); Declaration public void SetTriangl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_89aa84ea8b65
unity_docs
physics
In Unity's '2D game creation workflow', what is 'Scripting' and how does it work?
All 2D games need scripts . Scripts respond to input from the player and arrange for events in the gameplay to happen when they should. For details on how to use scripts in Unity see Scripting Overview . Also see the Unity Learn Beginner Scripting course. Scripts are attached to GameObjects, and any script you create i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_81a056d8bfb3
unity_docs
scripting
What is `MonoBehaviour.OnEnable` in Unity? Explain its purpose and usage.
MonoBehaviour.OnEnable() Description Called when a component of an active GameObject is first enabled. OnEnable is called in the following scenarios: When entering Play mode, if the GameObject is active ( GameObject.activeInHierarchy == true ) and the script component is enabled ( Behaviour.enabled == true )...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1c8f0f5bfb29
unity_docs
rendering
What is `Shader.GetPropertyType` in Unity? Explain its purpose and usage.
Shader.GetPropertyType Declaration public Rendering.ShaderPropertyType GetPropertyType (int propertyIndex ); Parameters Parameter Description propertyIndex The index of the shader property. Description Returns the ShaderPropertyType of the property at the specified index. If Unity cannot find a prope...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9e1098909059
unity_docs
physics
What is `RaycastHit.textureCoord` in Unity? Explain its purpose and usage.
RaycastHit.textureCoord public Vector2 textureCoord ; Description The uv texture coordinate at the collision location. A ray is fired into the Scene. The textureCoord is the location where the ray has hit a collider. RaycastHit._textureCoord is a texture coordinate when a hit occurs. A Vector2 zero is...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3e6a923a3f39
unity_docs
xr
In Unity's 'Mesh data for deformable meshes', what is 'Bind poses' and how does it work?
In a skinned mesh, the bind pose of a bone describes its position when the skeleton is in its default position (also called its bind pose or rest pose). In the Mesh class, you can get and set this data with Mesh.bindposes . Each element contains data for the bone with the same index. This data is required for skinned m...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_96da8996412a
unity_docs
editor
What are the parameters of `GenericMenu.AddDisabledItem` in Unity?
Description Add a disabled item to the menu. The example below shows a context menu with a disabled menu item that can be toggled on and off. Additional resources: GenericMenu.AddItem , GenericMenu.AddSeparator . ```csharp // This example shows how to create a context menu inside a custom EditorWindow, // where the fir...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2e11595e67a6
unity_docs
rendering
What is `WebCamDevice.depthCameraName` in Unity? Explain its purpose and usage.
WebCamDevice.depthCameraName public string depthCameraName ; Description A string identifier used to create a depth data based WebCamTexture. This string is null for webcam devices that do not support depth data. For webcams with depth data support (those of kind WebCamKind.ColorAndDepth ) this string is not e...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7d2560326665
unity_docs
rendering
What is `Renderer.GetSharedMaterials` in Unity? Explain its purpose and usage.
Renderer.GetSharedMaterials Declaration public void GetSharedMaterials (List<Material> m ); Parameters Parameter Description m A list of materials to populate. Description Returns all the shared materials of this object. Use this method instead of sharedMaterials if you control the life cycle of the lis...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_16991a8c3551
github
scripting
Write a Unity C# MonoBehaviour script called Min Y Destroy
```csharp using UnityEngine; using System.Collections; public class MinYDestroy : MonoBehaviour { // Set the minimum Y for the transform. This is useful for things you // wouldn't want to go below sea level, etc. float minY = 0f; void Update () { if (transform.position.y <= minY) { Destroy(gameOb...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_ec87bc37b09b
unity_docs
editor
What are the parameters of `iOS.Xcode.PBXProject.GetResourcesBuildPhaseByTarget` in Unity?
Returns string Returns the GUID of the existing phase or null if it does not exist. Description Returns the GUID of resources build phase for the given target. ```csharp using UnityEngine; using UnityEditor; using System.IO; using UnityEditor.Callbacks; using UnityEditor.iOS.Xcode;public class Sample_GetResourcesBuildP...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_865f31be1432
unity_docs
editor
What is `FilePathAttribute` in Unity? Explain its purpose and usage.
FilePathAttribute class in UnityEditor Description An attribute that specifies a file location relative to the Project folder or Unity's preferences folder. Additional resources: Location . Additional resources: ScriptableSingleton<T0> .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_4f328c795281
unity_docs
rendering
In Unity's 'Properties block reference in ShaderLab', what is 'Syntax' and how does it work?
Signature Function Properties { <Material property declaration> <Material property declaration> } Saves the given properties as part of the material asset, and uses the values stored in the material asset during rendering. A Properties block can contain any number of material property declarations.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4640a9161da9
unity_docs
scripting
Show me a Unity C# example demonstrating `Vector3.down`.
Vector3.down public static Vector3 down ; Description Shorthand for writing Vector3(0, -1, 0) . ```csharp using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { void Example() { transform.position += Vector3.down * Time.deltaTime; } } ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d547318f2095
unity_docs
scripting
Show me a Unity C# example demonstrating `Search.QueryEngine_1.SetGlobalStringComparisonOptions`.
ublic void SetGlobalStringComparisonOptions (stringComparison stringComparison ); Parameters Parameter Description stringComparison String comparison options. Description Sets global string comparison options. Used for word matching and filter handling (unless overridden by filter). Calling this function wi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ea3eb61d1303
unity_docs
math
What is `CombineInstance.transform` in Unity? Explain its purpose and usage.
CombineInstance.transform public Matrix4x4 transform ; Description Matrix to transform the Mesh with before combining. Refer to Mesh.CombineMeshes for an example. Additional resources: Mesh.CombineMeshes , mesh , subMeshIndex .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_70c9307d8c2e
unity_docs
physics
Explain 'Introduction to collider types' in Unity.
A collider ’s type defines how it interacts with other colliders, based on the configuration of its GameObject ’s collider and physics body components. The Unity documentation refers to the following collider types: Static colliders: The GameObject has a collider but no physics body (Rigidbody or ArticulationBody). Phy...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3fd8c4609ef7
unity_docs
rendering
What is `ShaderUtil.CreateShaderAsset` in Unity? Explain its purpose and usage.
ShaderUtil.CreateShaderAsset Declaration public static Shader CreateShaderAsset ( AssetImporters.AssetImportContext context , string source , bool compileInitialShaderVariants ); Declaration public static Shader CreateShaderAsset (string source , bool compileInitialShaderVariants ); Declaration publ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c69d573ebc01
unity_docs
physics
Show me a Unity C# example demonstrating `Rigidbody2D.MovePosition`.
s only. It is important to understand that the actual position change will only occur during the next physics update therefore calling this method repeatedly without waiting for the next physics update will result in the last call being used. For this reason, it is recommended that it is called during the FixedUpdate c...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_81bd714936ae
unity_docs
editor
What is `Application.exitCancellationToken` in Unity? Explain its purpose and usage.
Application.exitCancellationToken public static CancellationToken exitCancellationToken ; Description Cancellation token raised on exiting Play mode (Editor) or on quitting the application (Read Only).
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_113e7de33580
unity_docs
animation
What is `Playables.AnimationPlayableUtilities` in Unity? Explain its purpose and usage.
AnimationPlayableUtilities class in UnityEngine.Playables / Implemented in: UnityEngine.AnimationModule Description Implements high-level utility methods to simplify use of the Playable API with Animations. Static Methods Method Description PlayAnimatorController Creates a PlayableGraph to be played on the...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e043d75f5d37
unity_docs
physics
Explain 'Prepare a Mesh for Mesh colliders' in Unity.
Mesh colliders require a GameObject ’s Mesh to be properly configured so that collisions are accurate. ## Allow read and write access to a Mesh There are particular configurations and optimizations that require a Mesh to be read/write enabled. For details on what “read/write” means in this context, refer to documenta...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fa2b9c25c681
unity_docs
scripting
What is `SceneManagement.LoadSceneMode.Additive` in Unity? Explain its purpose and usage.
LoadSceneMode.Additive Description Adds the Scene to the current loaded Scenes. LoadSceneMode.Additive loads a Scene without unloading currently loaded Scenes. The additively loaded Scene appears in the Hierarchy window while another is active. To unload one of the currently loaded Scenes, see SceneManager.Unload...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_63f06dc11867
unity_docs
scripting
Show me a Unity C# example demonstrating `Video.VideoClip.GetAudioLanguage`.
ence of the user. The audio language is normally a 2 or 3 letter language code following the ISO 639-2/T or 639-2/B standards. For example, the code for English is normally “en” or “eng”. Check your audio files to see what codes they have. Some audio tracks don't have language information, in which case this function r...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_beba7be3b0bb
unity_docs
rendering
Show me a Unity C# example demonstrating `Search.SearchItemOptions.Highlight`.
SearchItemOptions.Highlight Description Highlights parts of the description that match the Search Query. ``` private static SearchItem SearchLogEntry(SearchContext context, SearchProvider provider, LogEntry logEntry) { if (!SearchUtils.MatchSearchGroups(context, logEntry.msgLowerCased, true)) return null; var l...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_50e77b9ae413
unity_docs
rendering
Explain 'Examples of GPU instancing shaders in the Built-In Render Pipeline' in Unity.
Examples of an HLSL shader and a Surface Shader that support GPU instancing. Page Description Example of an HLSL shader that supports GPU Instancing An example of an instanced vertex and fragment shader with different color values for each instance. Example of a Surface Shader that supports GPU Instancing An example of...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_15fa459cb2f3
unity_docs
scripting
What is `ParticleSystem.NoiseModule.remapYMultiplier` in Unity? Explain its purpose and usage.
ParticleSystem.NoiseModule.remapYMultiplier public float remapYMultiplier ; Description y-axis remap multiplier. Changing this property is more efficient than accessing the entire curve, if you only want to change the overall remap multiplier. Additional resources: ParticleSystem.NoiseModule.remapY . ```csha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9213012bf575
unity_docs
ui
Show me a Unity C# example demonstrating `GUISkin.verticalSliderThumb`.
GUISkin.verticalSliderThumb public GUIStyle verticalSliderThumb ; Description Style used by default for the thumb that is dragged in GUI.VerticalSlider controls. The padding property is used to determine the size of the thumb. ```csharp using UnityEngine;public class Example : MonoBehaviour { // Modifies...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_6ebaa8bbb896
github
scripting
Write a Unity C# MonoBehaviour script called List Item
```csharp using UnityEngine; namespace SimpleFileBrowser { [RequireComponent( typeof( RectTransform ) )] public class ListItem : MonoBehaviour { public object Tag { get; set; } public int Position { get; set; } private IListViewAdapter adapter; internal void SetAdapter( IListViewAdapter listView ) { ...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_969a6bc42090
unity_docs
rendering
What is `Rendering.RayTracingAccelerationStructure.AddVFXInstances` in Unity? Explain its purpose and usage.
RayTracingAccelerationStructure.AddVFXInstances Declaration public void AddVFXInstances ( Renderer targetRenderer , uint[] vfxSystemMasks ); Parameters Parameter Description targetRenderer The Renderer to add to the RayTracingAccelerationStructure. vfxSystemMasks An array of 8-bit masks you can use to se...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0d9ada0eaec0
unity_docs
xr
What is `Unity.CodeEditor.CodeEditor.OSOpenFile` in Unity? Explain its purpose and usage.
CodeEditor.OSOpenFile Declaration public static bool OSOpenFile (string appPath , string arguments ); Parameters Parameter Description appPath The absolute path of the application to open. arguments The arguments to be passed to the application. You must make sure any paths are quoted correctly for the cu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4206c96ef737
unity_docs
rendering
What is `Rendering.BatchDrawRange` in Unity? Explain its purpose and usage.
BatchDrawRange struct in UnityEngine.Rendering / Implemented in: UnityEngine.CoreModule Description Specifies a draw range of draw commands . For more information, see BatchRendererGroup . Properties Property Description drawCommandsBegin The index of the first draw command inside the BatchCullingOutput.d...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_64f7618dd482
unity_docs
rendering
What is `Shader.DisableKeyword` in Unity? Explain its purpose and usage.
Shader.DisableKeyword Declaration public static void DisableKeyword (ref Rendering.GlobalKeyword keyword ); Declaration public static void DisableKeyword (string keyword ); Parameters Parameter Description keyword The GlobalKeyword to disable. keyword The name of the GlobalKeyword to disable. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_179b2e61c21b
unity_docs
physics
What is `CompositeCollider2D.useDelaunayMesh` in Unity? Explain its purpose and usage.
CompositeCollider2D.useDelaunayMesh public bool useDelaunayMesh ; Description When the value is true, the Collider uses an additional Delaunay triangulation step to produce the Collider mesh. When the value is false, this additional step does not occur. Using Delaunay triangulation can reduce the number of shap...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_945517b5c12d
unity_docs
scripting
What is `UIElements.BaseVerticalCollectionView.onItemsChosen` in Unity? Explain its purpose and usage.
BaseVerticalCollectionView.onItemsChosen Description Obsolete. Use BaseVerticalCollectionView.itemsChosen instead. This callback receives an enumerable that contains the item or items chosen.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6d6f153f8b63
unity_docs
editor
Explain 'ScriptableObject' in Unity.
ScriptableObject is a serializable Unity type derived from UnityEngine.Object . As with MonoBehaviour , you don’t instantiate the ScriptableObject class directly but create your own custom C# classes that derive from it, and then create instances of those custom classes, usually through the Assets menu in the Unity Edi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d050b7691efa
unity_docs
editor
What are the parameters of `iOS.Xcode.PBXProject.ContainsFileByRealPath` in Unity?
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 tree argument searches across all absolute trees. Use this overload with care. ```csharp using UnityEngine; using UnityEditor; using Sys...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bd327304d2b0
unity_docs
xr
What is `XR.XRDevice.fovZoomFactor` in Unity? Explain its purpose and usage.
XRDevice.fovZoomFactor public static float fovZoomFactor ; Description Zooms the XR projection. Set this to zoom the XR projection matrix by scaling the viewing frustum. The value is clamped so that it will never fall below 1.0f. For asymmetric XR projections, setting the FoV doesn't make sense, so use this pro...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_43b1126d5d3e
unity_docs
xr
What is `XR.XRDisplaySubsystem.SetPreferredMirrorBlitMode` in Unity? Explain its purpose and usage.
XRDisplaySubsystem.SetPreferredMirrorBlitMode Declaration public void SetPreferredMirrorBlitMode (int blitMode ); Parameters Parameter Description blitMode XRMirrorViewBlitMode to set. Description Override the XR display's preferred mirror blit mode from the script.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_51f6532e657f
unity_docs
math
What is `Rendering.CommandBuffer.SetRayTracingVectorArrayParam` in Unity? Explain its purpose and usage.
CommandBuffer.SetRayTracingVectorArrayParam Declaration public void SetRayTracingVectorArrayParam ( Rendering.RayTracingShader rayTracingShader , string name , params Vector4[] values ); Declaration public void SetRayTracingVectorArrayParam ( Rendering.RayTracingShader rayTracingShader , int nameID , para...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.