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_31bfbb88d655
unity_docs
math
In Unity's 'Create a scriptable tile', what is 'Use a script to create a scriptable tile' and how does it work?
To create the PipelineExampleTile scriptable tile and have it as an available option in the UnityEditor’s Asset menu: Create a blank MonoBehaviour script by going to Assets > Create > MonoBehaviour Script . Name the file to PipelineExampleTile.cs . Open the file in a text editor. Replace the existing code with the foll...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_0261caa94f2f
unity_docs
rendering
In Unity's 'Package versioning', what is 'Automatic referencing' and how does it work?
One of the properties you can set for your assembly definitions is the Auto Referenced property, which controls whether Unity automatically references the file during compilation. When this property is enabled, some changes that would normally require only a MINOR or PATCH version increase now become breaking changes. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_152281030e1d
github
scripting
Write a Unity C# UI script for Singleton Mono
```csharp using UnityEngine; using TriInspector; abstract public class SingletonMono<T> : MonoBehaviour where T : MonoBehaviour { private static T _instance = null; public static bool HasInstance => _instance; public static T Instance { private set { if (_insta...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_man_2a54ad8e632d
unity_docs
scripting
Explain 'Vector2IntField' in Unity.
A Vector2IntField lets users enter a Vector2Int value. Note : To align a Vector2IntField with other fields in an Inspector window, simply apply the.unity-base-field__aligned USS class to it. For more information, refer to BaseField . ## Create a Vector2IntField You can create a Vector2IntField with UI Builder, UXML, ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8bce7c4cc880
unity_docs
math
What are the parameters of `Vector2.SmoothDamp` in Unity?
Description Gradually changes a vector towards a desired goal over time. The vector is smoothed by some spring-damper like function, which will never overshoot. ```csharp // Smooth towards the targetusing UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { public Transform target; ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_373bea59dc89
github
scripting
Write a Unity C# MonoBehaviour script called Path Spline2d
```csharp using UnityEngine; using System.Collections; using DentedPixel; public class PathSpline2d : MonoBehaviour { public Transform[] cubes; public GameObject dude1; public GameObject dude2; private LTSpline visualizePath; void Start () { Vector3[] path = new Vector3[] { cubes[0].position, cubes[1]...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ec58c2b782b1
unity_docs
scripting
What is `Transform.childCount` in Unity? Explain its purpose and usage.
Transform.childCount public int childCount ; Description The number of children the parent Transform has. Note: The parent is not included in the count. Note: Inactive GameObjects get included in the count. ```csharp using UnityEngine;public class ExampleClass : MonoBehaviour { // generate a group of conn...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fe6e3326fa91
unity_docs
math
What is `Vector3Int.Distance` in Unity? Explain its purpose and usage.
Vector3Int.Distance Declaration public static float Distance ( Vector3Int a , Vector3Int b ); Description Returns the distance between a and b . Vector3.Distance(a,b) is the same as (a-b).magnitude .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5ea7f7d04113
unity_docs
editor
Explain 'Create custom packages' in Unity.
Packages can contain the following: C# scripts Assemblies Native plug-ins Models, Textures, animation and audio clips , and other assets. Note : Package Manager doesn’t support streaming assets in packages. Use the Addressables package instead. Each package also contains a Package manifest file that includes informatio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a31025305037
unity_docs
math
Show me a Unity C# example demonstrating `HumanTrait.GetMuscleDefaultMax`.
HumanTrait.GetMuscleDefaultMax Declaration public static float GetMuscleDefaultMax (int i ); Parameters Parameter Description i Muscle index. Description Get the default maximum value of rotation for a muscle in degrees. The default maximum applies to all three axes of rotation for the muscle. The indexin...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c421186ae01d
unity_docs
scripting
What is `SerializedProperty.managedReferenceFullTypename` in Unity? Explain its purpose and usage.
SerializedProperty.managedReferenceFullTypename public string managedReferenceFullTypename ; Description String corresponding to the value of the managed reference object (dynamic) full type string. Contains a valid value when propertyType is SerializedPropertyType.ManagedReference . This property is Read O...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_88c85a6cdf2e_doc_3
github
scripting
What does `InitInternal` do in this Unity script? Explain its purpose and signature.
Identical to , but non-virtual, so slightly faster. Signature: ```csharp internal void InitInternal(TArgument argument) ```
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_4c9ca5192f1f
unity_docs
scripting
What is `UIElements.UxmlUnsignedIntAttributeDescription.GetValueFromBag` in Unity? Explain its purpose and usage.
UxmlUnsignedIntAttributeDescription.GetValueFromBag Declaration public uint GetValueFromBag ( UIElements.IUxmlAttributes bag , UIElements.CreationContext cc ); Parameters Parameter Description bag The bag of attributes. cc The context in which the values are retrieved. Returns uint The value of the...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5175df3ac6ca
unity_docs
rendering
What is `EditorUtility.SetSelectedRenderState` in Unity? Explain its purpose and usage.
EditorUtility.SetSelectedRenderState Declaration public static void SetSelectedRenderState ( Renderer renderer , EditorSelectedRenderState renderState ); Description Set the Scene View selected display mode for this Renderer.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_40238582dc23
unity_docs
scripting
What is `ShortcutManagement.ReserveModifiersAttribute.ctor` in Unity? Explain its purpose and usage.
ReserveModifiersAttribute Constructor Declaration public ReserveModifiersAttribute ( ShortcutManagement.ShortcutModifiers modifiers ); Parameters Parameter Description modifiers One or more modifiers to reserve. Description Creates an attribute that reserves a modifier for a single shortcut. ```csharp us...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a9a75ed5a9bf
unity_docs
scripting
What is `BuildPlayerWindow.DefaultBuildMethods.GetBuildPlayerOptions` in Unity? Explain its purpose and usage.
BuildPlayerWindow.DefaultBuildMethods.GetBuildPlayerOptions Declaration public static BuildPlayerOptions GetBuildPlayerOptions ( BuildPlayerOptions defaultBuildPlayerOptions ); Parameters Parameter Description defaultBuildPlayerOptions Default options. Returns BuildPlayerOptions The calculated BuildP...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e89d1ff01680
unity_docs
scripting
Show me a Unity C# example demonstrating `Handles.RadiusHandle`.
and only draw the point handles. Returns float The new value modified by the user's interaction with the handle. If the user has not moved the handle, it will return the same value as you passed into the function. Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-sized handles. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_648e68ef5f14
unity_docs
scripting
In Unity's 'LayerField', what is 'Create a LayerField' and how does it work?
You can create a LayerField with UI Builder, UXML, and C#. The following C# example creates a LayerField with the default value: ``` LayerField myElement = new LayerField("Label text"); // Sets the default value to 2. myElement.value = 2; ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5922c46f5b42
unity_docs
scripting
In Unity's 'Box', what is 'Create a Box' and how does it work?
You can create a Box with UXML or C#. The following C# example creates a Box with a label and a text field: ``` var box = new Box(); box.Add(new Label("Name:")); box.Add(new TextField()); ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_689e5dd4130d
unity_docs
rendering
What is `SpriteRenderer.UnregisterSpriteChangeCallback` in Unity? Explain its purpose and usage.
SpriteRenderer.UnregisterSpriteChangeCallback Declaration public void UnregisterSpriteChangeCallback (UnityAction<SpriteRenderer> callback ); Parameters Parameter Description callback The callback to be removed. Description Removes a callback (that receives a notification when the Sprite reference changes)...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_032271fd2bbe
unity_docs
physics
Give me an overview of the `ContactPairHeader` class in Unity.
ContactPairHeader struct in UnityEngine / Implemented in: UnityEngine.PhysicsModule Description A header struct which contains colliding bodies. This struct contains an array of ContactPair s that can be retrieved with the GetContactPair method. Properties Property Description body The first Rigidbody or...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_2c3fd157a84f
unity_docs
editor
Explain 'Textual query references' in Unity.
You can use textual queries rather than the visual query builder to search for items in the Unity Editor. This section provides reference pages for textual search queries. Topic Description Search expressions Use search expressions to filter search results. Search query operators Use query operators to refine search re...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_89c3347b784b
unity_docs
editor
Show me a Unity C# example demonstrating `CacheServerConnectionChangedParameters`.
CacheServerConnectionChangedParameters struct in UnityEditor Description Struct used for AssetDatabase.cacheServerConnectionChanged . ```csharp using UnityEngine; using UnityEditor;public class CacheServerConnectionChangedExample { [MenuItem("AssetDatabase/Correct connection to the Cache Server")] static void ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6c27df179106
unity_docs
editor
Show me a Unity C# example demonstrating `SettingsProvider.OnActivate`.
u add to this root, the SettingsProvider uses UIElements instead of calling SettingsProvider.OnGUI to build the UI. If you do not add to this VisualElement, then you must use the IMGUI to build the UI. Description Use this function to implement a handler for when the user clicks on the Settings in the Settings wind...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_633881ad380e
unity_docs
scripting
Explain 'Configure runtime UI' in Unity.
To render UI and react to input from the users in the Game view, create a Panel Settings asset and a UI Document component. The Panel Settings asset defines a panel in the Scene where the UI is rendered. The UI Document component connects the UI to the panel. Topic Description Create a panel Create a Panel Settings ass...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4f48e6808aa5
unity_docs
scripting
Show me a Unity C# example demonstrating `MonoBehaviour.useGUILayout`.
MonoBehaviour.useGUILayout public bool useGUILayout ; Description Disabling this lets you skip the GUI layout phase. It can only be used if you do not use GUI.Window and GUILayout inside of this OnGUI call. ```csharp using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { pu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d2e9434398a6
unity_docs
rendering
What is `Renderer.reflectionProbeUsage` in Unity? Explain its purpose and usage.
Renderer.reflectionProbeUsage public Rendering.ReflectionProbeUsage reflectionProbeUsage ; Description Should reflection probes be used for this Renderer? If enabled and reflection probes are present in the Scene, a reflection texture will be picked for this object and set as a built-in shader uniform variabl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a684e4c17edf
unity_docs
rendering
Show me a Unity C# example demonstrating `AssetPostprocessor.OnPreprocessMaterialDescription`.
r. Unity only calls this function if you set ModelImporter.materialImportMode to ModelImporterMaterialImportMode.ImportViaMaterialDescription. This function gives you control over material properties and animations during the model import process. The MaterialDescription structure contains all the material data from t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_90597f2fd37f
unity_docs
physics
What is `HingeJoint` in Unity? Explain its purpose and usage.
HingeJoint class in UnityEngine / Inherits from: Joint / Implemented in: UnityEngine.PhysicsModule Description The HingeJoint groups together 2 rigid bodies, constraining them to move like connected by a hinge. This joint is great for, well, doors, but can also be used to model chains, etc... The HingeJoint ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e1cd6427caf1
unity_docs
scripting
Show me a Unity code example for 'The Debug class'.
Debug class and its common uses when scripting with it. For an exhaustive reference of every member of the Debug class, refer to the Debug script reference . ## Logging errors, warnings and messages Unity sometimes logs errors, warnings, and messages to the Console window. The Debug class provides you with the abilit...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b308a4dcece1
unity_docs
editor
Show me a Unity C# example demonstrating `Application.isEditor`.
Application.isEditor public static bool isEditor ; Description Whether the game is running inside the Unity Editor (Read Only). Returns true if the game is being run from the Unity Editor; false if run from any deployment target. ```csharp using UnityEngine;class Example : MonoBehaviour { void Start() { if ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_35bbbd61a926
unity_docs
performance
In Unity's 'Set up your JavaScript plug-in', what is 'Include JavaScript libraries with the .jspre file type' and how does it work?
Use the .jspre plug-in file type to include existing JavaScript libraries in your JavaScript code. You can’t use Unity code to interact with the .jspre files, but you can use them in the .jslib code. The .jspre file type uses the --pre-js Emscripten option. For more information, refer to the Emscripten documentation ab...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_14fed8f2dc2f
unity_docs
math
What is `GUIUtility.GUIToScreenPoint` in Unity? Explain its purpose and usage.
GUIUtility.GUIToScreenPoint Declaration public static Vector2 GUIToScreenPoint ( Vector2 guiPoint ); Description Convert a point from GUI position to screen space. Note: In Unity the screen space y coordinate varies from zero at the top edge of the window to a maximum at the bottom edge of the window. Th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_177e6e8adcf2
unity_docs
editor
In Unity's 'Configure your debugging tool to debug Unity in Windows', what is 'Set up Windows Debugger (WinDbg) to debug Unity' and how does it work?
Follow these instructions to configure Windows Debugger (WinDbg) to automatically download and resolve Unity store symbols. When WinDbg has access to these symbols, you can use it to debug your application or the Editor. Open WinDbg as administrator. Go to File > Attach to process . A list of applications shows in the ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5577d18f6b7f
unity_docs
editor
Show me a Unity C# example demonstrating `iOS.Xcode.PBXProject.AddRemotePackageReferenceAtVersionUpToNextMajor`.
ration public string AddRemotePackageReferenceAtVersionUpToNextMajor (string url , string version ); Parameters Parameter Description url The URL of the repository. version The version to use. Returns string Returns the GUID of the remote package reference. Description Adds a reference to the remote...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e13b9cd2207b
unity_docs
scripting
What is `Unity.Android.Gradle.Repositories` in Unity? Explain its purpose and usage.
Repositories class in Unity.Android.Gradle / Inherits from: Unity.Android.Gradle.BaseBlock Description The C# definition of the repositories element in a gradle file. Configures the repositories for this project. For more information about the file, see Android's documentation: Remote repositories Static Pr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_49ae71559a15
unity_docs
scripting
Show me a Unity C# example demonstrating `Video.VideoPlayer.isPlaying`.
e content. This variable returns false if the video is paused. If you call VideoPlayer.Play , it might not always set isPlaying to true . The VideoPlayer must successfully prepare the content before it starts to play. To prepare the content before you use VideoPlayer.Play , use VideoPlayer.Prepare . Addition...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7ae7b28cf54c
unity_docs
editor
Show me a Unity C# example demonstrating `iOS.Xcode.PBXProject.ReadFromString`.
PBXProject.ReadFromString Declaration public void ReadFromString (string src ); Parameters Parameter Description src The project contents. Description Reads the project from the given string. Current contents of the project are discarded. ```csharp using UnityEditor; using System.IO; using UnityEditor.Ca...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_64c85acd263b
unity_docs
rendering
What is `Canvas.updateRectTransformForStandalone` in Unity? Explain its purpose and usage.
Canvas.updateRectTransformForStandalone public StandaloneRenderResize updateRectTransformForStandalone ; Description Should the Canvas size be updated based on the render target when a manual Camera.Render call is performed.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_a431e5038f5d_doc_13
github
scripting
What does `HasGraphicsDeviceType` do in this Unity script? Explain its purpose and signature.
Checks the given build target if a graphic device type is available Signature: ```csharp public static bool HasGraphicsDeviceType(BuildTarget buildTarget, GraphicsDeviceType graphicsDeviceType) ```
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_man_fdbcfc77fd16
unity_docs
scripting
Explain 'Vector3IntField' in Unity.
A Vector3IntField lets users enter a Vector3Int value. Note : To align a Vector3IntField with other fields in an Inspector window, simply apply the.unity-base-field__aligned USS class to it. For more information, refer to BaseField . ## Create a Vector3IntField You can create a Vector3IntField with UI Builder, UXML, ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_48a69320555c
unity_docs
xr
What is `Cubemap.IsRequestedMipmapLevelLoaded` in Unity? Explain its purpose and usage.
Cubemap.IsRequestedMipmapLevelLoaded Declaration public bool IsRequestedMipmapLevelLoaded (); Returns bool True if the mipmap level requested by requestedMipmapLevel has finished loading. Description Checks to see whether the mipmap level set by requestedMipmapLevel has finished loading.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_643a94fdacfb
unity_docs
math
What is `Vector2Int.ToString` in Unity? Explain its purpose and usage.
Vector2Int.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_c0ffc433f8b0
unity_docs
rendering
What is `TextureImporter.GetSourceTextureWidthAndHeight` in Unity? Explain its purpose and usage.
TextureImporter.GetSourceTextureWidthAndHeight Declaration public void GetSourceTextureWidthAndHeight (out int width , out int height ); Parameters Parameter Description width The source texture's width. height The source texture's height. Description Gets the source texture's width and height. Textur...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0deb83e6d51e
unity_docs
scripting
What are the parameters of `ParticleSystem.ExternalForcesModule.RemoveInfluence` in Unity?
Description Removes the Force Field from the influencers list at the given index. When influenceFilter is set to ParticleSystemGameObjectFilter.List then only Force Fields in the influencers list affect the Particle System. ```csharp using UnityEngine;public class Example : MonoBehaviour { ParticleSystem.ExternalFo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cd9e3ca4cb41
unity_docs
scripting
What is `RectInt.ToString` in Unity? Explain its purpose and usage.
RectInt.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 specifi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_46d676a5fa33
unity_docs
scripting
Explain 'Java and Kotlin source plug-ins' in Unity.
Unity can interpret individual Java and Kotlin source files as individual plug-ins . Unity supports Java and Kotlin code written in source files with.java and.kt extensions. To do this, Unity interprets each source file as an individual plug-in and compiles them when it builds the Player. This type of plug-in is useful...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c2585d0d589b
unity_docs
scripting
Show me a Unity C# example demonstrating `GridLayout.LocalToCell`.
GridLayout.LocalToCell Declaration public Vector3Int LocalToCell ( Vector3 localPosition ); Parameters Parameter Description localPosition Local Position to convert. Returns Vector3Int Cell position of the local position. Description Converts a local position to cell position. ```csharp // Snap t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_f82cb51563a0_doc_8
github
scripting
What does `Dispose` do in this Unity script? Explain its purpose and signature.
Disposes of the locator, clearing all items. Signature: ```csharp public override void Dispose() ```
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_e407a30caffb
unity_docs
editor
Show me a Unity C# example demonstrating `ProfilerWindow.GetFrameTimeViewSampleSelectionController`.
eViewSampleSelectionController object with which you can use to control the selection of the specified Profiler module. Description Retrieves an IProfilerFrameTimeViewSampleSelectionController object that you can use to control the selection in Profiler modules that are displaying timing information of Profile...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9034b3be7e2e
unity_docs
math
What is `Rect.min` in Unity? Explain its purpose and usage.
Rect.min public Vector2 min ; Description The position of the minimum corner of the rectangle. Setting this value will resize the rectangle, changing position and size to preserve max .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7bf06df1b795
unity_docs
rendering
What is `Sprite.associatedAlphaSplitTexture` in Unity? Explain its purpose and usage.
Sprite.associatedAlphaSplitTexture public Texture2D associatedAlphaSplitTexture ; Description Returns the Texture that contains the alpha channel from the source Texture. Unity generates this Texture under the hood for Sprites that have alpha in the source, and need to be compressed using techniques like ETC1...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_024df8d81102_doc_5
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Creates a child GameObject from resources.IHierarchyBehaviour's will be initialized.The path to the resourced asset.Will the instantiated GameObject stay in its world position or be set to local origin.The type of Component to be added to the new GameObject.The new TComponent Signature: ```csharp public static TCompon...
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_sr_c1ba8b7bd26c
unity_docs
input
What is `TouchType` in Unity? Explain its purpose and usage.
TouchType enumeration Description Describes whether a touch is direct, indirect (or remote), or from a stylus. Properties Property Description Direct A direct touch on a device. Indirect An Indirect, or remote, touch on a device. Stylus A touch from a stylus on a device.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_1951404dcfb7
unity_docs
rendering
Explain 'Render pipelines' in Unity.
A render pipeline performs a series of operations that take the contents of a scene , and displays them on a screen. Page Description Introduction to render pipelines Understand render pipelines and rendering paths . Scriptable Render Pipeline fundamentals Understand how Unity’s Scriptable Render Pipeline (SRP) works, ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ba347a27f4af
unity_docs
rendering
Show me a Unity C# example demonstrating `Cubemap.GetPixelData`.
it might not point to the correct memory location if the texture has been modified or updated. If you use a small type for T such as byte , GetPixelData may fail because the NativeArray would exceed the maximum length ( Int32.MaxValue ). To avoid this, use a larger type or struct. GetPixelData throws an excepti...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_a439ac8de523_doc_0
github
scripting
What does `InterfaceSelectorDrawer` do in this Unity script? Explain its purpose and signature.
Initializes a new instance of the class. Signature: ```csharp public InterfaceSelectorDrawer() ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_3306caf3ef53
unity_docs
rendering
What is `MaterialPropertyBlock.HasInt` in Unity? Explain its purpose and usage.
MaterialPropertyBlock.HasInt Declaration public bool HasInt (string name ); Declaration public bool HasInt (int nameID ); Parameters Parameter Description name The name of the property. nameID The name ID of the property. Use Shader.PropertyToID to get this ID. Returns bool Returns true if Mate...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9dce70fa5b7c
unity_docs
ui
What is `UIElements.VisualElementStyleSheetSet.Equals` in Unity? Explain its purpose and usage.
VisualElementStyleSheetSet.Equals Declaration public bool Equals ( UIElements.VisualElementStyleSheetSet other ); Parameters Parameter Description other The structure to compare with. Returns bool Returns true if the two instances refer to the same element, false otherwise. Description Compares ins...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b2ce6346fa30
unity_docs
ui
What is `GUI.skin` in Unity? Explain its purpose and usage.
GUI.skin public static GUISkin skin ; Description The global skin to use. You can set this at any point to change the look of your GUI. If you set it to null, the skin will revert to the default Unity skin. ```csharp // Press space to change between added GUI skins.using UnityEngine; using System.Collections...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_7c5ca653f251
github
scripting
Write a Unity C# script called Multi State Enabled Canvas Generic
```csharp #if !UNITY_2019 using GI.UnityToolkit.State; using GI.UnityToolkit.State.Components; using UnityEngine; #endif namespace GI.UnityToolkit.Components.UI { #if !UNITY_2019 [RequireComponent(typeof(Canvas))] public abstract class MultiStateEnabledCanvasGeneric<TState> : MultiStateEnabledComponent<TState>...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_8c13e2cd9af7
unity_docs
editor
What is `IMGUI.Controls.ArcHandle.wireframeColor` in Unity? Explain its purpose and usage.
ArcHandle.wireframeColor public Color wireframeColor ; Description Returns or specifies the color of the curved line along the outside of the arc. This value is multiplied with the value of Handles.color at the time DrawHandle is called. Additional resources: SetColorWithoutRadiusHandle , SetColorWithR...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_02e486680815
unity_docs
input
What is `Event.pointerType` in Unity? Explain its purpose and usage.
Event.pointerType public PointerType pointerType ; Description The type of pointer that created this event (for example, mouse, touch screen, pen). When a user uses a pen, some mouse events are often mixed with pen events in the event stream, and you can't distinguish them by type because mouse and pen events...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ef4adeb06c4f
unity_docs
scripting
What is `Overlays.OverlayToolbar` in Unity? Explain its purpose and usage.
OverlayToolbar class in UnityEditor.Overlays / Inherits from: UIElements.VisualElement Description Base class for toolbar elements intended to be drawn in an Overlay . Use this class with ICreateHorizontalToolbar and ICreateVerticalToolbar to build Overlays that are dockable in toolbars. ```csharp using S...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bf9cadba34d9
unity_docs
rendering
What is `ParticleSystem.SubEmittersModule.GetSubEmitterProperties` in Unity? Explain its purpose and usage.
ParticleSystem.SubEmittersModule.GetSubEmitterProperties Declaration public ParticleSystemSubEmitterProperties GetSubEmitterProperties (int index ); Parameters Parameter Description index The index of the sub-emitter. Returns ParticleSystemSubEmitterProperties The properties of the sub-emitter at the ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_b633a6600b82
unity_docs
scripting
In Unity's 'Set up an Audio Source component', what is 'Create an audio source' and how does it work?
There are multiple ways to create an audio source. Use one of the following methods: Create an audio source from an audio file . Create an audio source from an existing GameObject . Create an audio source from the menu .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e739f0aee63d
unity_docs
physics
What is `PlatformEffector2D` in Unity? Explain its purpose and usage.
PlatformEffector2D class in UnityEngine / Inherits from: Effector2D / Implemented in: UnityEngine.Physics2DModule Description Applies "platform" behaviour such as one-way collisions etc. When the source Collider2D is a trigger, the effector will apply forces whenever the target Collider2D overlaps the sou...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e99c2acf742e
unity_docs
scripting
What is `AvatarMask.GetTransformActive` in Unity? Explain its purpose and usage.
AvatarMask.GetTransformActive Declaration public bool GetTransformActive (int index ); Parameters Parameter Description index The index of the transform. Description Returns true if the transform at the given index is active.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_15093baa0cb8
unity_docs
physics
Give me an overview of the `Collision2D` class in Unity.
Collision2D class in UnityEngine / Implemented in: UnityEngine.Physics2DModule Description Collision details returned by 2D physics callback functions. The collisions details are returned by MonoBehaviour.OnCollisionEnter2D , MonoBehaviour.OnCollisionStay2D and MonoBehaviour.OnCollisionExit2D callbacks. It...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6c19da2f2628
unity_docs
editor
What is `AssetSettingsProvider.CreateProviderFromAssetPath` in Unity? Explain its purpose and usage.
AssetSettingsProvider.CreateProviderFromAssetPath Declaration public static AssetSettingsProvider CreateProviderFromAssetPath (string settingsWindowPath , string assetPath , IEnumerable<string> keywords ); Parameters Parameter Description settingsWindowPath Path of the settings in the Settings window. Us...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_438bad98ff62
unity_docs
rendering
Explain 'Cursor texture Import Settings window reference' in Unity.
The Cursor texture type formats the texture asset so that it can be used as a custom mouse cursor. Unity locks Texture Shape to 2D for this texture type. For more information, refer to Texture Shape . Property Description Alpha Source Specifies how Unity generates the alpha value for the texture asset from the texture ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_2dd321103141
unity_docs
rendering
In Unity's 'ZClip command in ShaderLab reference', what is 'Parameters' and how does it work?
Parameter Value Function enabled True Sets the depth clip mode to clip. This is the default setting. False Sets the depth clip mode to clamp. Fragments closer than the near plane are at the near plane exactly, and fragments further away than the far plane are at the far plane exactly.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f4e3b2d701e7
unity_docs
scripting
What is `Unity.IntegerTime.RationalTimeExtensions.IsValid` in Unity? Explain its purpose and usage.
RationalTimeExtensions.IsValid Declaration public static bool IsValid ( Unity.IntegerTime.RationalTime value ); Returns bool True if the TicksPerSecond is valid and false otherwise. Description Validity check.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_dcfa8aff621d
unity_docs
animation
Explain 'Creating models outside of Unity' in Unity.
This section contains information on creating models in external applications, and preparing them for import into Unity. Page Description Model file formats Supported and recommended file formats for 3D models. Support for proprietary model file formats Detailed information on Unity’s support for proprietary model file...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b7559e23233e
unity_docs
performance
What is `ParticleSystemJobs.ParticleSystemJobData.positions` in Unity? Explain its purpose and usage.
ParticleSystemJobData.positions public ParticleSystemJobs.ParticleSystemNativeArray3 positions ; Description The position of each particle. This array is stored in the Simulation Space of the Particle System, therefore it may contain data in either World or Local space.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e0e06901ed57
unity_docs
scripting
What is `Rendering.BatchDrawCommandProceduralIndirect.visibleOffset` in Unity? Explain its purpose and usage.
BatchDrawCommandProceduralIndirect.visibleOffset public uint visibleOffset ; Description The index of the element in BatchCullingOutputDrawCommands.visibleInstances that matches the first instance in this draw command.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d28df6b61f29
unity_docs
scripting
Show me a Unity C# example demonstrating `SystemInfo.unsupportedIdentifier`.
SystemInfo.unsupportedIdentifier public static string unsupportedIdentifier ; Description Value returned by SystemInfo string properties which are not supported on the current platform. ```csharp using UnityEngine; using System.Collections;public class NewBehaviourScript : MonoBehaviour { void Start() { if (...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ad818fbc3f98
unity_docs
rendering
What is `Tilemaps.TilemapRenderer.SortOrder` in Unity? Explain its purpose and usage.
SortOrder enumeration Description Sort order for all tiles rendered by the TilemapRenderer . Properties Property Description BottomLeft Sorts tiles for rendering starting from the tile with the lowest X and the lowest Y cell positions. BottomRight Sorts tiles for rendering starting from the tile with the high...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8beb726a1659
unity_docs
xr
In Unity's 'Google ARCore XR Plugin', what is 'Compatible with Unity' and how does it work?
These package versions are available in Unity version 6000.0: Documentation location: State Versions available: com.unity.xr.arcore@6.5 released 6.5.0-pre.1, 6.5.0-pre.2, 6.5.0-pre.3, 6.5.0 com.unity.xr.arcore@6.4 released 6.4.0-pre.1, 6.4.0, 6.4.1, 6.4.2 com.unity.xr.arcore@6.3 released 6.3.0-pre.1, 6.3.0-pre.2, 6.3.0...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c8f00558847a
unity_docs
scripting
What is `UIElements.BindingResult.ctor` in Unity? Explain its purpose and usage.
BindingResult Constructor Declaration public BindingResult ( UIElements.BindingStatus status , string message ); Parameters Parameter Description status The status of the binding. message The message linked to the status. Description Constructs a binding result. The message is ignored when status ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_619ac188c337
unity_docs
scripting
What is `Audio.AudioResource` in Unity? Explain its purpose and usage.
AudioResource class in UnityEngine.Audio / Inherits from: Object / Implemented in: UnityEngine.AudioModule Description Represents an audio resource asset that you can play through an AudioSource . Note : Audio resources don’t provide direct access to properties like length . However, if your audio resource ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_63dbe68b7bbe
unity_docs
ui
What is `Experimental.GraphView.IconBadge.AttachTo` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. IconBadge.AttachTo Declaration public void AttachTo ( UIElements.VisualElement target , SpriteAlignment align ); Parameters Parameter Description target The target element to attach this badge to. align Relative ali...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9b12a2b3a5d1
unity_docs
xr
What is `XR.XRDisplaySubsystem.TryGetMotionToPhoton` in Unity? Explain its purpose and usage.
XRDisplaySubsystem.TryGetMotionToPhoton Declaration public bool TryGetMotionToPhoton (out float motionToPhoton ); Parameters Parameter Description motionToPhoton Outputs the motion-to-photon value. Returns bool Returns true if the motion-to-photon value is available. Returns false otherwise. Descripti...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_0fa93753e642_doc_1
github
scripting
What does `Filter` do in this Unity script? Explain its purpose and signature.
This method filters entities that were updated by someone. If method returns truethe entity has passed the test, otherwise it's failed and will be skipped Signature: ```csharp public override bool Filter(IEntity entity) ```
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_87b7fc6b3890
unity_docs
animation
What is `Animations.AnimatorControllerPlayable.GetCurrentAnimatorClipInfoCount` in Unity? Explain its purpose and usage.
AnimatorControllerPlayable.GetCurrentAnimatorClipInfoCount Declaration public int GetCurrentAnimatorClipInfoCount (int layerIndex ); Parameters Parameter Description layerIndex The layer index. Returns int The number of AnimatorClipInfo in the current state. Description Returns the number of Anima...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_963ee43127e7
unity_docs
scripting
Show me a Unity C# example demonstrating `GL.TRIANGLES`.
3 vertices, one triangle is drawn, where each vertex becomes one corner of the triangle. If you pass 6 vertices, 2 triangles will be drawn. To set up the screen for drawing in 2D, use GL.LoadOrtho or GL.LoadPixelMatrix . To set up the screen for drawing in 3D, use GL.LoadIdentity followed by GL.MultMatrix with t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_4fbd596b793a
github
scripting
Write a Unity C# script called Register Delegate
```csharp // /*=============================================================================== // Copyright (C) 2020 PhantomsXR Ltd. All Rights Reserved. // // This file is part of the XR-MOD SDK. // // The XR-MOD SDK cannot be copied, distributed, or made available to // third-parties for commercial purposes without...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_man_7ee31c7dbdce
unity_docs
math
Explain 'Programming with the Quaternion class' in Unity.
Unity uses the Quaternion class to store the three dimensional orientation of GameObjects , as well as using them to describe a relative rotation from one orientation to another. This page provides an overview of the Quaternion class and its common uses when scripting with it. For an exhaustive reference of every membe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3c6bce3bc398
unity_docs
rendering
What is `Rendering.RenderPipelineAsset.defaultUIETC1SupportedMaterial` in Unity? Explain its purpose and usage.
RenderPipelineAsset.defaultUIETC1SupportedMaterial public Material defaultUIETC1SupportedMaterial ; Returns Material Default material. Description Return the default UI ETC1 Material for this pipeline. This is used whenever a UI object is created in the Editor.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_04a4853a154f
unity_docs
xr
What is `Networking.DownloadHandlerBuffer.GetContent` in Unity? Explain its purpose and usage.
DownloadHandlerBuffer.GetContent Declaration public static string GetContent ( Networking.UnityWebRequest www ); Parameters Parameter Description www A finished UnityWebRequest object with DownloadHandlerBuffer attached. Returns string The same as DownloadHandlerBuffer.text Description Returns a c...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5d90b6ec1a83
unity_docs
animation
What is `AnimationUtility.GetAnimationClips` in Unity? Explain its purpose and usage.
AnimationUtility.GetAnimationClips Obsolete GetAnimationClips(Animation) is deprecated. Use GetAnimationClips(GameObject) instead. Declaration public static AnimationClip[] GetAnimationClips ( Animation component ); Declaration public static AnimationClip[] GetAnimationClips ( GameObject gameObject ); ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_da050f1f5aa3
unity_docs
scripting
What is `SettingsProvider.keywords` in Unity? Explain its purpose and usage.
SettingsProvider.keywords public IEnumerable<string> keywords ; Description Gets or sets the list of keywords to compare against what the user is searching for. When the user enters values in the search box on the Settings window, SettingsProvider.HasSearchInterest tries to match those keywords to this list.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d3066aee95d8
unity_docs
rendering
Show me a Unity C# example demonstrating `GUILayout.BeginVertical`.
nal resources: GUILayout.Width , GUILayout.Height , GUILayout.MinWidth , GUILayout.MaxWidth , GUILayout.MinHeight , GUILayout.MaxHeight , GUILayout.ExpandWidth , GUILayout.ExpandHeight . Description Begin a vertical control group. All controls rendered inside this element will be placed vertically below each...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e1e46d71fc15
unity_docs
rendering
In Unity's 'Editing scene templates', what is 'Details' and how does it work?
Use the Details section to specify which scene to use for a template, and control how the template appears in the New Scene dialog . Property: Description: Template Scene Specifies the scene to use as a template. This can be any scene in the Project. Title The template name. The name you enter here appears in the New S...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_813b773ce10e
unity_docs
physics
What is `Search.SearchViewState.trackingHandler` in Unity? Explain its purpose and usage.
SearchViewState.trackingHandler public Action<SearchItem> trackingHandler ; Description External handler triggered each time the user clicks on an item in the search view. In example, this handler can be used to ping a corresponding object in the project browser.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_bb9c45441e45
unity_docs
rendering
In Unity's 'Add a shader pass in a custom shader', what is 'Name a shader pass' and how does it work?
A Pass can have a name. You need to reference a Pass by name in the UsePass command, and in some C# APIs. The name of a Pass is visible in the Frame Debugger tool. To assign a name to a Pass in ShaderLab, you place a Name block inside a Pass block. Internally, Unity converts the name to uppercase. When you reference th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_a18cb552517d
github
scripting
Write a Unity C# UI script for Sprite Shadows
```csharp using UnityEngine; using UnityEngine.Rendering; namespace VFX.Sprite_Shadows { [ExecuteAlways, RequireComponent(typeof(SpriteRenderer))] public class SpriteShadows : MonoBehaviour { public ShadowCastingMode shadowCastingMode = ShadowCastingMode.On; public MotionVectorGen...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_man_aeb7f7a0612b
unity_docs
rendering
Explain 'Access properties in combined meshes' in Unity.
In the Built-in Render Pipeline , you can use a MaterialPropertyBlock to change material properties without breaking draw call batching. The CPU still needs to make some render-state changes, but using a MaterialPropertyBlock is faster than using multiple materials. If your project uses a Scriptable Render Pipeline, do...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5d2f80c34777
unity_docs
audio
What is `Video.VideoPlayer.SetDirectAudioVolume` in Unity? Explain its purpose and usage.
VideoPlayer.SetDirectAudioVolume Declaration public void SetDirectAudioVolume (ushort trackIndex , float volume ); Parameters Parameter Description trackIndex Track index for which the volume is set. volume New volume, between 0 and 1. Description Set the direct-output audio volume for the specified tra...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_58a7dbf64113
unity_docs
scripting
What is `Unity.Properties.TypeUtility.TryInstantiate` in Unity? Explain its purpose and usage.
TypeUtility.TryInstantiate Declaration public static bool TryInstantiate (out T instance ); Parameters Parameter Description instance When this method returns, contains the created instance, if type instantiation succeeded; otherwise, the default value for <typeparamref name="T" />. Returns bool true if ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.