id
stringlengths
15
22
source
stringclasses
2 values
category
stringclasses
12 values
instruction
stringlengths
22
180
response
stringlengths
100
46.1k
system
stringclasses
5 values
gh_ef10608562d4_doc_1
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
The Text component this behavior uses to display the incremented value. Signature: ```csharp public Text text ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_f7818637a4cc
unity_docs
scripting
Give me an overview of the `PhysicsMaterial` class in Unity.
PhysicsMaterial class in UnityEngine / Inherits from: Object / Implemented in: UnityEngine.PhysicsModule Description Physics material describes how to handle colliding objects (friction, bounciness). Additional resources: Collider . Properties Property Description bounceCombine Determines how the bounci...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2563e1c3b5c5
unity_docs
editor
What is `VersionControl.Provider.ChangeSets` in Unity? Explain its purpose and usage.
Provider.ChangeSets Declaration public static VersionControl.Task ChangeSets (); Description Gets a list of pending changesets owned by the current user. ```csharp using System.Collections.Generic; using UnityEditor; using UnityEditor.VersionControl; using UnityEngine;public class EditorScript : MonoBehaviour...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1fec26fded74
unity_docs
physics
What is `Physics2D.queriesHitTriggers` in Unity? Explain its purpose and usage.
Physics2D.queriesHitTriggers public static bool queriesHitTriggers ; Description Do raycasts detect Colliders configured as triggers? A Collider can be set up to act as a trigger which will detect other Colliders entering its volume but won't physically collide with them. Often, it is desirable to avoid detec...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_aa3ee5601aa7
unity_docs
ui
Show me a Unity C# example demonstrating `GUIStyle.fixedHeight`.
GUIStyle.fixedHeight public float fixedHeight ; Description If non-0, any GUI elements rendered with this style will have the height specified here. ```csharp using UnityEngine;public class Example : MonoBehaviour { // Prints the value of fixedHeight. void OnGUI() { Debug.Log(GUI.skin.button.fixedHeight); ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_a520efb4895c
unity_docs
input
In Unity's 'UnsignedIntegerField', what is 'Customize the input text selection' and how does it work?
Input text is selectable by default. You can customize the selection behaviors such as selectAllOnMouseUP and selectAllOnFocus . In C#, set them through textSelection : ``` myElement.textSelection.selectAllOnMouseUp = false; myElement.textSelection.selectAllOnFocus = false; ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_1a910c7c83a2_doc_2
github
scripting
What does `CloneWizard` do in this Unity script? Explain its purpose and signature.
Creates a new PopulateRuleOverideTileWizard and copies the settings from an existing PopulateRuleOverideTileWizardThe wizard to copy settings from Signature: ```csharp public static void CloneWizard(PopulateRuleOverideTileWizard oldWizard) ```
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_fe37cd58b062
unity_docs
physics
Show me a Unity C# example demonstrating `Rigidbody2D.AddForce`.
specify a ForceMode2D the default will be used. The default in this case is ForceMode2D.Force which adds force over time, using mass. To use the example scripts below, drag and drop your chosen script onto a Sprite in the Hierarchy. Make sure that the Sprite has a Rigidbody2D component. Additional resources: AddForce...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_94c216cb2541_doc_2
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
The mode of the quiz. Either SingleChoice or MultipleChoice. Signature: ```csharp public QuizMode quizMode = QuizMode.SingleChoice; ```
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_bbe703e8cf00
unity_docs
rendering
Give me an overview of the `EditorSelectedRenderState` class in Unity.
EditorSelectedRenderState enumeration Description The editor selected render mode for Scene View selection. Properties Property Description Hidden The Renderer has no selection highlight or wireframe in the Editor. Wireframe The Renderer has wireframe but not selection highlight in the Editor. Highlight The R...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_1fd926147387_doc_0
github
scripting
What does `ContainsMLRegistry` do in this Unity script? Explain its purpose and signature.
Returns true if the given Manifest contains the ML registry Signature: ```csharp static bool ContainsMLRegistry(Manifest manifest) => manifest.scopedRegistries.ToList().Any(d => d.name == ML_REGISTRY.name); ```
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_6efe478236ec
unity_docs
scripting
What is `Overlays.Overlay.layout` in Unity? Explain its purpose and usage.
Overlay.layout public Overlays.Layout layout ; Description The preferred layout for the Overlay . All overlays support Panel, while some overlays can also be configured as horizontal or vertical toolbars.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_2a4b843a84fb
unity_docs
rendering
In Unity's 'Reflective Bumped Specular', what is 'Reflective Properties' and how does it work?
Note. Unity 5 introduced the Standard Shader which replaces this shader. This shader will simulate reflective surfaces such as cars, metal objects etc. It requires an environment Cubemap which will define what exactly is reflected. The main texture’s alpha channel defines the strength of reflection on the object’s surf...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cffc90146810
unity_docs
input
What is `UIElements.MouseCaptureController.HasMouseCapture` in Unity? Explain its purpose and usage.
MouseCaptureController.HasMouseCapture Declaration public static bool HasMouseCapture ( UIElements.IEventHandler handler ); Parameters Parameter Description handler Event handler to check. Returns bool True if the handler captures the mouse. Description Checks if the event handler is capturing the ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8666f882b65a
unity_docs
editor
What are the parameters of `Networking.PlayerConnection.PlayerConnectionGUILayout.ConnectionTargetSelectionDropdown` in Unity?
Description Display a drop-down button and menu for the user to choose and establish a connection to a Player. This is the same control that is used in the toolbars of the Profiler Window , Frame Debugger or Console Window . The drop-down will list all available Players and Editors that your Editor can connect to and t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_41ce0399443c
unity_docs
rendering
Explain 'Writing HLSL shader programs' in Unity.
Write High-Level Shader Language (HLSL) vertex and fragment shader programs inside a Pass block in a custom ShaderLab shader. Page Description Introduction to HLSL shader programs Learn about writing shader programs in HLSL in Unity, and vertex and fragment shaders. Add an HLSL shader program Use the HLSLPROGRAM direct...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c688c02549d1
unity_docs
scripting
What is `Experimental.Rendering.GraphicsFormat.RGB_PVRTC_4Bpp_UNorm` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphicsFormat.RGB_PVRTC_4Bpp_UNorm Description A three-component, PVRTC compressed format where each 64-bit compressed texel block encodes a 4×4 rectangle of unsigned normalized RGB texel data. This format has no alpha and is co...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f52ecaa45d6d
unity_docs
scripting
What are the parameters of `Caching.AddCache` in Unity?
Description Add a cache with the given path. This allows you to add a new cache to the cache list. A reference to a Cache will be returned. ```csharp using System.IO; using UnityEngine;public class Example : MonoBehaviour { void AddCacheAtPath(string path) { if (!Directory.Exists(path)) Dire...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_852715275888
unity_docs
physics
Give me an overview of the `Hash128` class in Unity.
Hash128 struct in UnityEngine / Implemented in: UnityEngine.CoreModule Description Represents a 128-bit hash value. Use Hash128 to uniquely identify a piece of data. A 128-bit hash value has an extremely low probability of hash collisions, so you can assume that if the hash values of two pieces of data are id...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_0ff08bf811d0
unity_docs
rendering
Explain 'Introduction to high dynamic range (HDR)' in Unity.
High dynamic range (HDR) is a technique that produces images with a greater dynamic range of luminosity than standard dynamic range (SDR) images, allowing for realistic depictions of color and brightness. ## How HDR works In standard rendering, the red, green, and blue values of a pixel are stored using an 8-bit valu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3b2ecc33b7e6
unity_docs
rendering
What is `Shader.WarmupAllShaders` in Unity? Explain its purpose and usage.
Shader.WarmupAllShaders Declaration public static void WarmupAllShaders (); Description Prewarms all shader variants of all Shaders currently in memory. For information on shader loading and prewarming, including a list of different prewarming techniques, see Shader loading . While this method can be convenie...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c9068d234232
unity_docs
scripting
What is `WindZone.windMain` in Unity? Explain its purpose and usage.
WindZone.windMain public float windMain ; Description The primary wind force. It produces a softly changing wind Pressure. ```csharp // Creates a wind zone with the effect of a helicopter passing by // Just place this into an empty game object and move it over a tree using UnityEngine;public class ExampleScri...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b731cc53caa4
unity_docs
scripting
What is `ScriptableObject.Awake` in Unity? Explain its purpose and usage.
ScriptableObject.Awake() Description Called when an instance of ScriptableObject is created. Awake is called when a new instance of a ScriptableObject is created, which happens in the following scenarios: At Editor startup, for all ScriptableObjects referenced in open scenes. On creation of a new Scriptable...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0cd12413dcdf
unity_docs
rendering
What is `Transform.hierarchyCapacity` in Unity? Explain its purpose and usage.
Transform.hierarchyCapacity public int hierarchyCapacity ; Description The transform capacity of the transform's hierarchy data structure. Unity internally represents each transform hierarchy, i.e. a root and all it's deep children, with its own packed data structure. This data structure is resized when the nu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_02b3f6f193b6
unity_docs
physics
What is `PolygonCollider2D` in Unity? Explain its purpose and usage.
PolygonCollider2D class in UnityEngine / Inherits from: Collider2D / Implemented in: UnityEngine.Physics2DModule Description Collider for 2D physics representing an arbitrary polygon defined by its vertices. Additional resources: BoxCollider2D , CircleCollider2D , EdgeCollider2D . Properties Property De...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_0208712036dc
unity_docs
rendering
Explain 'SpeedTree model import' in Unity.
SpeedTree provides prebuilt tree Assets and modeling software focused specifically on trees. Unity recognizes and imports SpeedTree Assets in the same way that it handles other Assets. If you’re using SpeedTree Modeler 7, make sure to resave your .spm files using the Unity version of the Modeler. If you’re using SpeedT...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_47de01489f1e
unity_docs
scripting
What is `SystemLanguage.Portuguese` in Unity? Explain its purpose and usage.
SystemLanguage.Portuguese Description Portuguese. ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { //This checks if your computer's operating system is in the Portuguese language if (Application.systemLanguage == SystemLanguage.Portuguese) { //Outputs into console that the sys...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4ef28b3e1531
unity_docs
physics
What is `EditorApplication` in Unity? Explain its purpose and usage.
EditorApplication class in UnityEditor Description Main Application class. Static Properties Property Description applicationContentsPath Path to the Unity editor contents folder. (Read Only) applicationPath Gets the path to the Unity Editor application. (Read Only) contextualPropertyMenu Callback raised whe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ff5f19d81d96
unity_docs
editor
What is `Menu.GetChecked` in Unity? Explain its purpose and usage.
Menu.GetChecked Declaration public static bool GetChecked (string menuPath ); Description Gets the check status of a menu item. ```csharp using UnityEditor; using UnityEngine; public class CheckMenuTest: MonoBehaviour { // Add a menu item named "MenuTest" to MyMenu in the main menu. [MenuItem("MyMenu/Menu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_06b564d7dfbf
unity_docs
rendering
Explain 'Rendering to a texture' in Unity.
Resources for updating textures at runtime via Render Textures and Movie Textures. Page Description Render a camera view to a Render Texture Create a texture that displays what a camera sees, for example to create a live arena camera in your game. Drawing to textures with shaders via Custom Render Textures Resources fo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9c957521b021
unity_docs
editor
Give me an overview of the `FileUtil` class in Unity.
FileUtil class in UnityEditor Description Lets you do move , copy , delete operations over files or directories. Static Methods Method Description CopyFileOrDirectory Copies a file or a directory. CopyFileOrDirectoryFollowSymlinks Copies the file or directory. DeleteFileOrDirectory Deletes a file or a di...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cc570192e09c
unity_docs
rendering
What is `TextureWrapMode.Repeat` in Unity? Explain its purpose and usage.
TextureWrapMode.Repeat Description Tiles the texture, creating a repeating pattern. When UVs are outside of the 0...1 range, the integer part will be ignored, thus creating a repeating pattern. Additional resources: Texture.wrapMode , texture assets .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f9b41f63ca0b
unity_docs
rendering
Explain '3D textures' in Unity.
Resources for creating and using a bitmap image that contains information in three dimensions, for example to create volumetric effects, 3D meshes, or animated textures. Page Description Introduction to 3D textures Learn how 3D textures are used to simulate volumetric effects, approximate a volumetric 3D mesh , or stor...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_eb67b506d03a
unity_docs
ui
Show me a Unity C# example demonstrating `QualitySettings.SetQualityLevel`.
id SetQualityLevel (int index , bool applyExpensiveChanges = true); Parameters Parameter Description index Quality index to set. applyExpensiveChanges Should expensive changes be applied (Anti-aliasing etc). Description Sets a new graphics quality level. The list of quality levels can be found by going ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_09a50849f117
unity_docs
scripting
What is `AI.NavMeshAgent.obstacleAvoidanceType` in Unity? Explain its purpose and usage.
NavMeshAgent.obstacleAvoidanceType public AI.ObstacleAvoidanceType obstacleAvoidanceType ; Description The level of quality of avoidance. This property lets you trade off the precision of obstacle avoidance againt the processor load required to achieve it. The exact quality/performance values will depend heav...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_886dc5a02ed4
unity_docs
xr
Show me a Unity code example for 'Foveated rendering'.
, fixed foveated rendering is always at full strength when enabled. ## Control foveated rendering Control foveated rendering by setting the foveatedRenderingLevel property of the XRDisplaySubsystem to a value between zero and one. You must enable foveated runtime in your project’s provider plug-in settings or the run...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_859082efa490
unity_docs
scripting
What is `IMGUI.Controls.MultiColumnHeader.IsSortedAscending` in Unity? Explain its purpose and usage.
MultiColumnHeader.IsSortedAscending Declaration public bool IsSortedAscending (int columnIndex ); Parameters Parameter Description columnIndex Column index. Returns bool True if sorted ascending. Description Check the sorting order state for a column. This function checks and returns the sorting ord...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1274d4f679f7
unity_docs
editor
What are the parameters of `iOS.Xcode.PBXProject.SetBuildPropertyForConfig` in Unity?
Description Sets a build property to the given value in the specified build configuration(s). Duplicate build properties are ignored. Values for names LIBRARY_SEARCH_PATHS and FRAMEWORK_SEARCH_PATHS are quoted if they contain spaces. ```csharp using UnityEditor; using System.IO; using UnityEditor.Callbacks; using Unity...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_41a59cc5a352
unity_docs
scripting
Show me a Unity C# example demonstrating `Cloth.useGravity`.
Cloth.useGravity public bool useGravity ; Description Should gravity affect the cloth simulation? ```csharp using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { void Example() { // Dont use gravity on this cloth regardless if is Interactive or Skinned. transform.GetCompon...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c8e44d1ea022
unity_docs
editor
What is `Actions.EditorAction.OnSceneGUI` in Unity? Explain its purpose and usage.
EditorAction.OnSceneGUI Declaration public void OnSceneGUI ( SceneView sceneView ); Parameters Parameter Description sceneView The Scene view that Actions.EditorAction.OnSceneGUI is called in. Description Callback raised when the Scene view calls OnGUI. Use this method to implement any handles or inter...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_9a0669ccc969
unity_docs
input
Explain 'Create a slide toggle custom control' in Unity.
Version : 2023.2+ This example demonstrates how to create a “switch-like” variation of a toggle. ## Example overview The example creates a custom control: a toggle that users can flip with the mouse, the keyboard, a gamepad, and other devices. It comes with a label that can describe what the toggle represents. You ca...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7355998a3efe
unity_docs
scripting
What is `ModelImporter.normalSmoothingSource` in Unity? Explain its purpose and usage.
ModelImporter.normalSmoothingSource public ModelImporterNormalSmoothingSource normalSmoothingSource ; Description Source of smoothing information for calculation of normals. Additional resources: ModelImporterNormalSmoothingSource , importNormals , importBlendShapeNormals .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_429bae794111
unity_docs
rendering
What is `Lightmapping.GetLightingDataAssetForScene` in Unity? Explain its purpose and usage.
Lightmapping.GetLightingDataAssetForScene Declaration public static LightingDataAsset GetLightingDataAssetForScene ( SceneManagement.Scene scene ); Parameters Parameter Description scene The scene to get the LightingDataAsset for. Returns LightingDataAsset The LightingDataAsset associated with the sce...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_500cfc5f9551
unity_docs
editor
What is `EditorGUI.Toggle` in Unity? Explain its purpose and usage.
EditorGUI.Toggle Declaration public static bool Toggle ( Rect position , bool value ); Declaration public static bool Toggle ( Rect position , string label , bool value ); Declaration public static bool Toggle ( Rect position , bool value , GUIStyle style ); Declaration public static bool To...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f8c048878b33
unity_docs
rendering
Explain 'Set a shader to require a package' in Unity.
To set a shader to only compile if a specific package is installed, add a PackageRequirements block in the SubShader block or Pass block. When Unity imports the shader, it checks if the specified package is installed in the project, and if the package version meets the requirements. If the requirements aren’t met, Unit...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c74974b025a0
unity_docs
scripting
What is `GameObject.activeInHierarchy` in Unity? Explain its purpose and usage.
GameObject.activeInHierarchy public bool activeInHierarchy ; Description The active state of the GameObject in the Scene hierarchy. True if active, false if inactive. (Read Only) A GameObject is active in the scene hierarchy if GameObject.activeSelf is true for the object and all parent objects. A GameObje...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_58276d996b5f
unity_docs
rendering
What is `Material.ApplyPropertyOverride` in Unity? Explain its purpose and usage.
Material.ApplyPropertyOverride Declaration public void ApplyPropertyOverride ( Material destination , string name , bool recordUndo ); Declaration public void ApplyPropertyOverride ( Material destination , int nameID , bool recordUndo ); Parameters Parameter Description destination The Material t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_740b35d435fb
unity_docs
scripting
What is `Accessibility.AccessibilitySettings.closedCaptioningStatusChanged` in Unity? Explain its purpose and usage.
AccessibilitySettings.closedCaptioningStatusChanged Description Event that is invoked on the main thread when the user changes the closed captioning setting in the system settings. For all the supported platforms, refer to AccessibilitySettings .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7f83dcaf7d00
unity_docs
math
What is `Cloth.normals` in Unity? Explain its purpose and usage.
Cloth.normals public Vector3[] normals ; Description The current normals of the cloth object. This gives you read access to the normals of the cloth object, so you can analyse it's current simulation state. Note that the normal indices may not necessarily correspond to the indices of the source mesh - especial...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e2bc4470b31c
unity_docs
editor
What is `ObjectPreview.OnPreviewGUI` in Unity? Explain its purpose and usage.
ObjectPreview.OnPreviewGUI Declaration public void OnPreviewGUI ( Rect r , GUIStyle background ); Parameters Parameter Description r Rectangle in which to draw the preview. background Background image. Description Implement to create your own custom preview for the preview area of the inspector, prim...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ef4d5b42f88a
unity_docs
math
What is `ContactPoint.normal` in Unity? Explain its purpose and usage.
ContactPoint.normal public Vector3 normal ; Description Normal of the contact point. The following example will draw a line to represent every normal from a collision. Each line will be drawn in the Scene view. ```csharp using UnityEngine;public class Example : MonoBehaviour { void OnCollisionEnter(Collisio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_603e8ab3f3e8
unity_docs
editor
Show me a Unity C# example demonstrating `SerializedProperty.arraySize`.
a larger size increases the array size by appending new elements at the end. The values of those new elements are undefined until explicitly assigned some desired content, as demonstrated in the second example below. Additional resources: isArray , minArraySize , GetArrayElementAtIndex , InsertArrayElementAtIndex ,...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_67a168966b2f
unity_docs
rendering
What is `Material.GetTextureOffset` in Unity? Explain its purpose and usage.
Material.GetTextureOffset Declaration public Vector2 GetTextureOffset (string name ); Declaration public Vector2 GetTextureOffset (int nameID ); Parameters Parameter Description nameID The name ID of the property retrieved by Shader.PropertyToID . name The name of the property. Description Get...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c8b856b527b8
unity_docs
scripting
What are the parameters of `Object.DontDestroyOnLoad` in Unity?
Description Do not destroy the target Object when loading a new Scene . The load of a new Scene destroys all current Scene objects. Call Object.DontDestroyOnLoad to preserve an Object during scene loading. If the target Object is a component or GameObject , Unity also preserves all of the Transform ’s children. Object....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_374406e18194
unity_docs
scripting
What is `Device.Application.HasProLicense` in Unity? Explain its purpose and usage.
Application.HasProLicense Declaration public static bool HasProLicense (); Description This has the same functionality as Application.HasProLicense . At the moment, the Device Simulator doesn't support simulation of this method.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a0ab1d24aee4
unity_docs
scripting
Show me a Unity C# example demonstrating `Handles.Slider2D`.
passed into the function. Description Make a 3D slider that moves along a plane defined by two axes. This method will draw a 3D-draggable handle on the screen. The handle is constrained to sliding along a plane in 3D space. 2D slider handle in the Scene View. Add the following script to your Assets folder as Sli...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_280be083ffc4
unity_docs
editor
What is `Device.SystemInfo.GetCompatibleFormat` in Unity? Explain its purpose and usage.
SystemInfo.GetCompatibleFormat Declaration public static Experimental.Rendering.GraphicsFormat GetCompatibleFormat ( Experimental.Rendering.GraphicsFormat format , Experimental.Rendering.GraphicsFormatUsage usage ); Description This has the same functionality as SystemInfo.GetCompatibleFormat and also m...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_775eb131996e
unity_docs
ui
What is `UIElements.FontDefinition` in Unity? Explain its purpose and usage.
FontDefinition struct in UnityEngine.UIElements / Implemented in: UnityEngine.UIElementsModule Description Describes a VisualElement font. Properties Property Description font Font to use to display text. You cannot set this and FontDefinition.fontAsset at the same time. fontAsset SDF font to use...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8ab73b62988b
unity_docs
rendering
What is `Rendering.CameraProperties.SetShadowCullingPlane` in Unity? Explain its purpose and usage.
CameraProperties.SetShadowCullingPlane Declaration public void SetShadowCullingPlane (int index , Plane plane ); Parameters Parameter Description index Plane index (up to 5). plane Shadow culling plane. Description Set a shadow culling plane. Additional resources: GetShadowCullingPlane .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_aa79c844b650
unity_docs
scripting
In Unity's 'Best practices for managing elements', what is 'Different approaches to hiding an element' and how does it work?
When you use VisualElement.RemoveFromHierarchy() to remove an element from the hierarchy and eliminate references to it, the element is garbage collected. This reduces the CPU and GPU cost to zero and frees a significant amount of memory. However, it’s a slow and costly operation to recreate elements and reload them in...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5f1e508356ef
unity_docs
scripting
What is `Unity.Hierarchy.HierarchyFlattenedNode` in Unity? Explain its purpose and usage.
HierarchyFlattenedNode struct in Unity.Hierarchy / Implemented in: UnityEngine.HierarchyCoreModule Description Represents a flattened hierarchy node. Static Properties Property Description Null Represents a flattened hierarchy node that is null or invalid. Properties Property Description ChildrenC...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_aca80146d230
unity_docs
physics
What are the parameters of `PhysicsScene2D.Raycast` in Unity?
Returns RaycastHit2D The cast results returned. Description Casts a ray against colliders in the PhysicsScene2D, returning the first intersection only. A raycast is conceptually like a laser beam that is fired from a point in space along a particular direction. Any object making contact with the beam can be detected an...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5cf5177b041a
unity_docs
scripting
What is `Rendering.SupportedRenderingFeatures.ReflectionProbeModes` in Unity? Explain its purpose and usage.
ReflectionProbeModes enumeration Description Supported modes for ReflectionProbes. Properties Property Description None Default reflection probe support. Rotation Rotated reflection probes are supported.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fe028477b4f2
unity_docs
scripting
What is `Accessibility.AccessibilityNode.frameGetter` in Unity? Explain its purpose and usage.
AccessibilityNode.frameGetter public Func<Rect> frameGetter ; Description Optional delegate that can be set to calculate the frame for the node instead of setting a flat value. If the frame of the node may change over time, this delegate should be set instead of giving a one time value for the frame. If A...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b8ec355707b2
unity_docs
scripting
What are the parameters of `Handles.SphereHandleCap` in Unity?
Description Draw a sphere handle. Pass this into handle functions. On EventType.Layout event, calculates handle distance to mouse and calls HandleUtility.AddControl accordingly. On EventType.Repaint event, draws the handle shape. Sphere Handle Cap in the Scene View. Add the following script to your Assets folder as Sph...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_85c030e61ef1
unity_docs
scripting
Show me a Unity C# example demonstrating `ParticleSystem.CollisionModule.AddPlane`.
ParticleSystem.CollisionModule.AddPlane Declaration public void AddPlane ( Transform transform ); Parameters Parameter Description transform The plane to add. Description Adds a collision plane to use with this Particle System. ```csharp using UnityEngine; using System.Collections;[RequireComponent(type...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c166e3021b8d
unity_docs
editor
What is `SerializedProperty.GetEndProperty` in Unity? Explain its purpose and usage.
SerializedProperty.GetEndProperty Declaration public SerializedProperty GetEndProperty (); Declaration public SerializedProperty GetEndProperty (bool includeInvisible ); Description Retrieves the SerializedProperty that defines the end range of this property. It's the first property that's not a child ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_dbe8ec10487f
unity_docs
scripting
What is `UIElements.IBindingExtensions` in Unity? Explain its purpose and usage.
IBindingExtensions class in UnityEngine.UIElements / Implemented in: UnityEngine.UIElementsModule Description Extensions methods to provide additional IBindable functionality. Static Methods Method Description IsBound Checks if a IBindable is bound to a property.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7f7f69024700
unity_docs
scripting
What is `AudioType.MOD` in Unity? Explain its purpose and usage.
AudioType.MOD Description The audio file you want to stream has the Protracker / Fasttracker MOD audio file format. Use this enumeration value to ensure the format type of the audio file has the MOD audio file format. Use this audio type for files with the extension .mod . If the audio file has a different format, ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_863e0d1ebb31
unity_docs
input
In Unity's 'Create a custom activity', what is 'Example activity' and how does it work?
The following code sample shows an example activity that overrides multiple functions. ```csharp package com.company.product; import com.unity3d.player.UnityPlayerActivity; import android.os.Bundle; import android.util.Log; public class OverrideExample extends UnityPlayerActivity { protected void onCreate(Bundle save...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5d81bb77af94
unity_docs
rendering
Show me a Unity C# example demonstrating `AndroidBlitType`.
Texture.sRGB ), otherwise the generated image typically appears too dark. Therefore AndroidBlitType.Never is not recommended when linear rendering is used. If you want to use linear rendering with AndroidBlitType.Never despite this information, you have to setup your own sRGB render target and handle the blit to th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_94c216cb2541_doc_3
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
The ordering of the questions. Either Ordered (order of in `questions`) or Randomize. Signature: ```csharp public QuestionOrdering questionOrdering = QuestionOrdering.Randomize; ```
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_7e4705fcb1a9
unity_docs
animation
What is `AnimationUtility.SetAnimationClips` in Unity? Explain its purpose and usage.
AnimationUtility.SetAnimationClips Declaration public static void SetAnimationClips ( Animation animation , AnimationClip[] clips ); Description Sets the array of animation clips to be referenced in the Animation component.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7c78ff1570b4
unity_docs
input
What is `Input.compensateSensors` in Unity? Explain its purpose and usage.
Input.compensateSensors public static bool compensateSensors ; Description This property controls if input sensors should be compensated for screen orientation. Compensated sensors are accelerometer, compass, gyroscope. Note : This API is part of the legacy Input Manager. The recommended best practice is that y...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8b6b449258fc
unity_docs
scripting
Show me a Unity C# example demonstrating `Windows.Speech.DictationRecognizer`.
egister and listen for hypothesis and phrase completed events. Start() and Stop() methods respectively enable and disable dictation recognition. Once done with the recognizer, it must be disposed using Dispose() method to release the resources it uses. It will release these resources automatically during garbage collec...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_bf47066f6329
unity_docs
rendering
In Unity's 'New in Unity 2023.1', what is 'Release Notes' and how does it work?
To find out more about the new features, changes, and improvements to this Unity version, refer to the 2023.1 Release Notes . To find the release notes for other releases, refer to the Unity download archive .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_4ff2de3a61dd
unity_docs
editor
In Unity's 'Save your work', what is 'Automatic saves' and how does it work?
Unity automatically saves the following changes to your disk: New assets : Unity automatically saves new assets when you create them but you need to save later changes. Asset Import Settings : For the changes to take effect with most assets, you need to select Apply in the Inspector window. Unity saves the changes when...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e54f8cc7f30f
unity_docs
math
What is `MaterialPropertyBlock.SetVectorArray` in Unity? Explain its purpose and usage.
MaterialPropertyBlock.SetVectorArray Declaration public void SetVectorArray (string name , Vector4[] values ); Declaration public void SetVectorArray (int nameID , Vector4[] values ); Declaration public void SetVectorArray (string name , List<Vector4> values ); Declaration public void SetVectorArra...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_53aecbb1713c
unity_docs
editor
What is `VersionControl.Provider.GetAssetListFromSelection` in Unity? Explain its purpose and usage.
Provider.GetAssetListFromSelection Declaration public static VersionControl.AssetList GetAssetListFromSelection (); Description Returns the version control information about the currently selected Assets. This method effectively adds all of the currently selected Assets to a AssetList which can be used for ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f3edb331c6e5
unity_docs
scripting
What is `ParticleSystem.CollisionModule.lifetimeLossMultiplier` in Unity? Explain its purpose and usage.
ParticleSystem.CollisionModule.lifetimeLossMultiplier public float lifetimeLossMultiplier ; Description Change the lifetime loss multiplier. Changing this property is more efficient than accessing the entire curve, if you only want to change the overall lifetime loss multiplier. ```csharp using UnityEngine; u...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a1bafa6619ed
unity_docs
editor
Show me a Unity C# example demonstrating `Search.SearchContextAttribute.providerIds`.
SearchContextAttribute.providerIds public string[] providerIds ; Description A list of Search Provider IDs that will be used to create the search context. ```csharp const string assetProviders = "adb;asset";[SearchContext("t:prefab", "expression;asset;scene", SearchViewFlags.GridView)] public GameObject prefab;...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_de8c2d1a7fee
unity_docs
scripting
What is `EditorApplication.projectWindowItemOnGUI` in Unity? Explain its purpose and usage.
EditorApplication.projectWindowItemOnGUI public static EditorApplication.ProjectWindowItemCallback projectWindowItemOnGUI ; Description Delegate for OnGUI events for every visible list item in the ProjectWindow. Additional resources: ProjectWindowItemCallback , ProjectWindowItemInstanceCallback , EditorApp...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f35c037b2593
unity_docs
xr
What is `XR.XRDisplaySubsystem.zFar` in Unity? Explain its purpose and usage.
XRDisplaySubsystem.zFar public float zFar ; Description Set DisplaySubsystem to use zFar for rendering. zFar is the far plane in meters from the main camera. ZFar and ZNear are used for explicit XR depth buffer sharing.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d11240490c2d
unity_docs
scripting
What is `UIElements.SelectionType` in Unity? Explain its purpose and usage.
SelectionType enumeration Description Controls how many items can be selected at once. Used by BaseVerticalCollectionView and its inheritors including ListView , TreeView , MultiColumnListView and MultiColumnTreeView . Set the view's selectionType property as one of these values to control how many ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_a326a9e5b629_doc_2
github
scripting
What does `YieldAction` do in this Unity script? Explain its purpose and signature.
A block of code (see ) that returnsa value which is yielded in a coroutine. For more informationabout what to return from a coroutine, see the documentation. Signature: ```csharp public delegate object YieldAction(); ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_b4f4af79fd07
unity_docs
xr
Explain 'XR input options' in Unity.
The main options to handle input in an XR game or application include: The XR Interaction Toolkit OpenXR interaction profiles “Traditional” input through the Input System or Input Manager The XR.InputDevice and XR.Node APIs Third-party input libraries In some cases, you might use more than one of these options at the s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3302ec5a53b0
unity_docs
rendering
What is `Shader.FindSubshaderTagValue` in Unity? Explain its purpose and usage.
Shader.FindSubshaderTagValue Declaration public Rendering.ShaderTagId FindSubshaderTagValue (int subshaderIndex , Rendering.ShaderTagId tagName ); Parameters Parameter Description subshaderIndex The index of the SubShader. tagName The name of the tag. Description Searches for the tag specified by ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_42ec43f986f2
unity_docs
rendering
Explain 'Sample a 2D texture array in a shader' in Unity.
To sample a texture array in a custom shader , follow these steps: To create a texture array material property, add a 2DArray material property declaration. For example: ``` Properties { _MainTex ("Texture array", 2DArray) = "" {} } ``` To set the texture array as a shader input, add a UNITY_DECLARE_TEX2DARRAY macro. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5dfc50f791cf
unity_docs
scripting
What is `Camera` in Unity? Explain its purpose and usage.
Camera class in UnityEngine / Inherits from: Behaviour / Implemented in: UnityEngine.CoreModule Description A Camera is a device through which the player views the world. A screen space point is defined in pixels. The bottom-left of the screen is (0,0); the right-top is ( pixelWidth , pixelHeight ). The z po...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b11e18aaedae
unity_docs
scripting
Show me a Unity C# example demonstrating `ArticulationBody.AddForce`.
ng applied. For more information on how ForceMode affects velocity, see Rigidbody.AddForce . By default the ArticulationBody's state is set to awake when a force is applied, unless the force is Vector3.zero . Unit of measurement - N (newtons). Additional resources: AddForceAtPosition , AddRelativeForce , AddTorqu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5577c6095b67
unity_docs
rendering
In Unity's 'Set a shader to require a package', what is 'Require a package version' and how does it work?
Inside the PackageRequirements block, use the following syntax: "com.my.package": "MAJOR.MINOR" to require package version MAJOR.MINOR or later. "unity": "6000.MINOR" to require Unity version 6000.MINOR or later. The PackageRequirements block must be the first block in the SubShader block or Pass block.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_03dcd40f4b5b
unity_docs
scripting
Show me a Unity C# example demonstrating `SystemLanguage.Catalan`.
SystemLanguage.Catalan Description Catalan. ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { //This checks if your computer's operating system is in the Catalan language if (Application.systemLanguage == SystemLanguage.Catalan) { //Outputs into console that the system is Catal...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_7fdeb7c12e6b
github
scripting
Write a Unity C# script called King
```csharp using System.Collections; using System.Collections.Generic; using UnityEngine; public class King : Piece { public override bool[,] PossibleMoves() { bool[,] ret = new bool[8, 8]; Piece p; int i, j; bool[,] attacked = _BoardManager.AttackedSquares(!isWhite, false); ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_319f8e37aba4
unity_docs
scripting
What is `iOS.Xcode.XcScheme.ReadFromString` in Unity? Explain its purpose and usage.
XcScheme.ReadFromString Declaration public void ReadFromString (string text ); Parameters Parameter Description text A string containing a properly formatted XcScheme plist document. Description Reads the scheme from the given string. The existing values of this XcScheme instance are discarded and replace...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d7f8814c804e
unity_docs
rendering
What is `ShaderPrecisionModel` in Unity? Explain its purpose and usage.
ShaderPrecisionModel enumeration Description Options for the shader precision model. This enumeration allows you to change two things: the default sampler precision and the definition of half . The default sampler precision is only relevant to samplers that don't explicitly declare a precision. For example, sa...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_21d0a20a6ce5
unity_docs
scripting
In Unity's 'Loading assets from AssetBundles', what is 'Loading AssetBundle manifests' and how does it work?
You can load an AssetBundle manifest into an instance of the AssetBundleManifest class to get information including dependency data, hash data, and variant data for built AssetBundles. This is especially useful when managing dependencies between AssetBundles. The manifest object makes dynamically finding and loading de...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_baa9f715e20d
unity_docs
scripting
What is `UIElements.UxmlSerializedDataUtility.CopySerialized` in Unity? Explain its purpose and usage.
UxmlSerializedDataUtility.CopySerialized Declaration public static object CopySerialized (object value ); Description This is used by the code generator when a custom control is using the UxmlElementAttribute .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_062b54a2fd9d
unity_docs
scripting
What is `RectOffset.ToString` in Unity? Explain its purpose and usage.
RectOffset.ToString Declaration public string ToString (); Declaration public string ToString (string format ); Declaration public string ToString (string format , IFormatProvider formatProvider ); Parameters Parameter Description format A numeric format string. formatProvider An object that spec...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_53726eaae2d4
unity_docs
scripting
What is `PlayerSettings.iOS.showActivityIndicatorOnLoading` in Unity? Explain its purpose and usage.
PlayerSettings.iOS.showActivityIndicatorOnLoading public static iOSShowActivityIndicatorOnLoading showActivityIndicatorOnLoading ; Description Application should show ActivityIndicator when loading.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9e7dec98c041
unity_docs
editor
Show me a Unity C# example demonstrating `SceneManagement.SceneManager.GetSceneAt`.
he scene to get. Index must be greater than or equal to 0 and less than SceneManager.sceneCount . Returns Scene A reference to the Scene at the index specified. Description Gets the scene at the specified index in the SceneManager's scene list. This includes scenes that are currently loading or unloading. Add...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.