id
stringlengths
15
22
source
stringclasses
2 values
category
stringclasses
12 values
instruction
stringlengths
22
180
response
stringlengths
100
46.1k
system
stringclasses
5 values
local_sr_5148fed371e5
unity_docs
scripting
What is `Rigidbody.angularDamping` in Unity? Explain its purpose and usage.
Rigidbody.angularDamping public float angularDamping ; Description The angular damping of the object. Angular damping can be used to slow down the rotation of an object. The higher the damping the more the rotation slows down. ```csharp using UnityEngine; using System.Collections;public class ExampleClass : M...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7822d7cc668c
unity_docs
input
What is `Undo.FlushUndoRecordObjects` in Unity? Explain its purpose and usage.
Undo.FlushUndoRecordObjects Declaration public static void FlushUndoRecordObjects (); Description Ensure objects recorded using RecordObject or RecordObjects are registered as an undoable action. In most cases there is no reason to invoke FlushUndoRecordObjects since it's automatically done right after mou...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_68e92ac6d7ce
unity_docs
scripting
What is `ChangeGameObjectStructureEventArgs.ctor` in Unity? Explain its purpose and usage.
ChangeGameObjectStructureEventArgs Constructor Declaration public ChangeGameObjectStructureEventArgs (int instanceId , SceneManagement.Scene scene ); Parameters Parameter Description instanceId The instance ID of the GameObject that has been changed. scene The Scene containing the GameObject that ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3780e70c580b
unity_docs
editor
What is `AssetDatabase.GetImplicitAssetBundleVariantName` in Unity? Explain its purpose and usage.
AssetDatabase.GetImplicitAssetBundleVariantName Declaration public static string GetImplicitAssetBundleVariantName (string assetPath ); Parameters Parameter Description assetPath The asset's path. Returns string Returns the name of the AssetBundle Variant that a given asset belongs to. See the method des...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_22d592b33210
unity_docs
editor
Show me a Unity C# example demonstrating `MouseCursor.Pan`.
MouseCursor.Pan Description Cursor with a dragging hand for pan. ```csharp //Create a folder and name it “Editor” if this doesn’t already exist //Put this script in the folder//This script creates a new menu (“Examples”) and a menu item (“Mouse Cursor”). Click on this option. This displays a small window that has a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_3c4aa32fe12d
github
scripting
Write a Unity C# script called File Browser Quick Link
```csharp using UnityEngine; namespace SimpleFileBrowser { public class FileBrowserQuickLink : FileBrowserItem { #region Properties private string m_targetPath; public string TargetPath { get { return m_targetPath; } } #endregion #region Initialization Functions public void SetQuickLink( Sprite icon, s...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_man_256732c10dc5
unity_docs
scripting
In Unity's 'Custom serialization', what is 'Example 2: Custom serialization avoids performance issues' and how does it work?
In this case, you tell Unity not to serialize the tree directly, and you make a separate field to store the tree in a serialized format, suited to Unity’s serializer: ```csharp using System.Collections.Generic; using System; public class BehaviourWithTree : MonoBehaviour, ISerializationCallbackReceiver { // Node clas...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_46733e97eab2
unity_docs
scripting
What is `Transform.forward` in Unity? Explain its purpose and usage.
Transform.forward public Vector3 forward ; Description Returns a normalized vector representing the blue axis of the transform in world space. The example below shows how to manipulate a GameObject’s position on the Z axis (blue axis) of the transform in world space. Unlike Vector3.forward , Transform.forw...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f633831059d7
unity_docs
physics
What is `ParticleSystem.CollisionModule.multiplyColliderForceByCollisionAngle` in Unity? Explain its purpose and usage.
ParticleSystem.CollisionModule.multiplyColliderForceByCollisionAngle public bool multiplyColliderForceByCollisionAngle ; Description Specifies whether the physics system considers the collision angle when it applies forces from particles to Colliders. Additional resources: ParticleSystem.CollisionModule.colli...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7778256f4339
unity_docs
ui
What is `GUIStyle.stretchHeight` in Unity? Explain its purpose and usage.
GUIStyle.stretchHeight public bool stretchHeight ; Description Can GUI elements of this style be stretched vertically for better layout? ```csharp using UnityEngine;public class Example : MonoBehaviour { void OnGUI() { GUI.skin.button.stretchHeight = true; } } ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2fa37a156c3d
unity_docs
scripting
What is `SystemLanguage.Greek` in Unity? Explain its purpose and usage.
SystemLanguage.Greek Description Greek. ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { //This checks if your computer's operating system is in the Greek language if (Application.systemLanguage == SystemLanguage.Greek) { //Outputs into console that the system is Greek Debug....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b6ddddd7acfc
unity_docs
audio
Show me a Unity C# example demonstrating `AudioSource.playOnAwake`.
he GameObject isn't active or if the AudioSource component is disabled, the audio won't play until they become active. While this property is enabled, if you disable then enable the GameObject or the audio source, the audio will stop and then play again from the start. If you set this property to false , the audio doe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_693f5cfa861b
unity_docs
scripting
What is `UIElements.BindingActivationContext` in Unity? Explain its purpose and usage.
BindingActivationContext struct in UnityEngine.UIElements / Implemented in: UnityEngine.UIElementsModule Description Contains information passed to binding instances during registration and deregistration. Properties Property Description bindingId The binding id being activated/deactivated. targetEle...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_67c0b7a17308
unity_docs
editor
What is `Handles.Disc` in Unity? Explain its purpose and usage.
Handles.Disc Declaration public static Quaternion Disc (int id , Quaternion rotation , Vector3 position , Vector3 axis , float size , bool cutoffPlane , float snap ); Declaration public static Quaternion Disc ( Quaternion rotation , Vector3 position , Vector3 axis , float size , bool c...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_159a37c32966
unity_docs
rendering
What is `Experimental.GlobalIllumination.LightDataGI.color` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. LightDataGI.color public Experimental.GlobalIllumination.LinearColor color ; Description The color of the light.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_51e7b6f94b72
unity_docs
math
What are the parameters of `RectTransform.GetLocalCorners` in Unity?
Description Get the corners of the calculated rectangle in the local space of its Transform. Each corner provides its local space value. The returned array of 4 vertices is clockwise. It starts bottom left and rotates to top left, then top right, and finally bottom right. Note...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fa009e2636ba
unity_docs
animation
What is `Animator.GetNextAnimatorClipInfo` in Unity? Explain its purpose and usage.
Animator.GetNextAnimatorClipInfo Declaration public AnimatorClipInfo[] GetNextAnimatorClipInfo (int layerIndex ); Parameters Parameter Description layerIndex The layer index. Returns AnimatorClipInfo[] An array of all the AnimatorClipInfo in the next state. Description Returns an array of all the ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6a207a7773f2
unity_docs
ui
In Unity's 'Migrate from uGUI to UI Toolkit', what is 'Canvas versus UIDocument' and how does it work?
The Canvas component in uGUI is similar to the UIDocument component in UI Toolkit. Both are MonoBehaviours that attach to GameObjects. In uGUI, a Canvas component sits at the root of the UI tree. It works with the Canvas Scaler component to determine the sort order, rendering, and scaling mode of the UI underneath. In ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bd957bf433e9
unity_docs
math
What is `Tilemaps.Tilemap.GetColor` in Unity? Explain its purpose and usage.
Tilemap.GetColor Declaration public Color GetColor ( Vector3Int position ); Parameters Parameter Description position Position of the Tile on the Tilemap . Returns Color Color of the Tile at the XYZ coordinate. Description Gets the Color of a Tile given the XYZ coordinates of a cell in the T...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d57ba48bfb03
unity_docs
input
What is `UIElements.UnsignedLongField` in Unity? Explain its purpose and usage.
UnsignedLongField class in UnityEngine.UIElements / Inherits from: UIElements.TextValueField_1 / Implemented in: UnityEngine.UIElementsModule Description Makes a text field for entering unsigned long integers. For more information, refer to UXML element UnsignedLongField . Static Properties Property Des...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_91cde905c48e
unity_docs
rendering
What is `Rendering.RasterState.offsetFactor` in Unity? Explain its purpose and usage.
RasterState.offsetFactor public float offsetFactor ; Description Scales the maximum Z slope in the GPU's depth bias setting. Corresponds to the Offset command in ShaderLab. For more information, see ShaderLab command: Offset .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_058d1670e736
unity_docs
rendering
Show me a Unity code example for 'Example of Particle System GPU instancing with custom vertex streams in the Built-In Render Pipeline'.
xample, the shader is designed to display a special effect, which makes faster particles appear brighter, and slower particles dimmer. There is some extra code that brightens particles according to their speed, using the Speed Vertex Stream. Also, because this shader assumes the effect will not be using texture sheet a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_820bef7466c3
unity_docs
physics
In Unity's 'Use build callbacks', what is 'Build callbacks during incremental builds' and how does it work?
The following build callbacks happen during the content step of a Player build: Scene callbacks : IProcessSceneWithReport.OnProcessScene Shader callbacks : IPreprocessShaders.OnProcessShader , IPreprocessComputeShaders.OnProcessComputeShader When Unity reuses content from a previous build, it doesn’t trigger these call...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4cf61bdbe98c
unity_docs
math
What is `UIElements.PointerEventBase_1.radiusVariance` in Unity? Explain its purpose and usage.
PointerEventBase<T0>.radiusVariance public Vector2 radiusVariance ; Description Gets the accuracy of the touch radius. Add this value to the radius to get the maximum touch radius, subtract it to get the minimum touch radius.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_952c80ea184c
unity_docs
editor
In Unity's 'Create looping transitions', what is 'Example overview' and how does it work?
This example demonstrates two looping animations: Yo-yo: The loop starts from state A to state B with transition, and then return back to state A with transition. A-to-B: The loop starts from state A to state B with transition, and then return back to state A without transition. You can find the completed files that th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b5a36bb2c3ab
unity_docs
scripting
What is `UIElements.TransitionRunEvent` in Unity? Explain its purpose and usage.
TransitionRunEvent class in UnityEngine.UIElements / Inherits from: UIElements.TransitionEventBase_1 / Implemented in: UnityEngine.UIElementsModule Description Event sent when a transition is created (i.e. added to the set of running transitions). Inherited Members Properties Property Description bubbles...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fb61c6a1e758
unity_docs
math
What is `XR.CommonUsages.primary2DAxisClick` in Unity? Explain its purpose and usage.
CommonUsages.primary2DAxisClick public static InputFeatureUsage<bool> primary2DAxisClick ; Description Represents the primary 2D axis being clicked or otherwise depressed. The primary 2D axis is the Vector2 input feature tagged with CommonUsages.primary2DAxis .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_efa7571f6233
unity_docs
scripting
What is `Unity.Android.Gradle.BaseElement` in Unity? Explain its purpose and usage.
BaseElement class in Unity.Android.Gradle / Implemented in: Unity.Android.Gradle Description Abstract base class for all existing gradle file elements. Public Methods Method Description AddElementDependencies Adds a list of dependencies by ID to this element. AddElementDependency Adds a dependency to this e...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_baba4d5ed20e
unity_docs
scripting
What is `Experimental.GraphView.EdgeConnector_1.OnPointerDown` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. EdgeConnector<T0>.OnPointerDown Declaration protected void OnPointerDown ( UIElements.PointerDownEvent e ); Parameters Parameter Description e The pointer down event. Description Called when a pointer down event occurs...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_1e13f1ad6b47
unity_docs
rendering
In Unity's 'Pass information to shader compilers in HLSL', what is 'Add a #pragma directive' and how does it work?
Use a #pragma directive to do the following: Pass Unity-specific directives, for example to add shader keywords or target specific graphics APIs. For more information, refer to HLSL pragma directives reference . Pass standard HLSL directives. For more information, refer to [#pragma directive] (https://learn.microsoft.c...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_90b4cef25cb6
unity_docs
xr
In Unity's 'Scoped registry authentication', what is '1) Fetch the npm authentication token' and how does it work?
The process of creating and accessing an npm authentication token is different for each registry provider. For example, JFrog’s Artifactory repository manager uses a different procedure to generate the authentication token from npm. This is an example of a typical procedure, but you need to follow the process recommend...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_ec66bdfa8369
unity_docs
editor
In Unity's 'Thread Local Storage stack allocator example', what is 'TLS stack allocator usage reports' and how does it work?
If a thread’s stack allocator is full, allocations fall back to the threadsafe linear allocator . A few overflow allocations are fine: 1 to 10 in a frame, or a few hundred during load. However, if the numbers grow every frame, you can increase the block sizes. To increase the block size, set the value in the Editor, or...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_428202ad8535
unity_docs
editor
Show me a Unity code example for 'ScriptableObject'.
eAssetMenu attribute to create instances of this class, each of which becomes an asset in your project. ## Example: Instantiate prefabs with a ScriptableObject The following example uses a ScriptableObject to store data defined at authoring time that is later used to determine where to instantiate prefabs at runtime....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8e1127ffbfc6
unity_docs
ui
What is `UIElements.VisualElement.TryGetLastBindingToUIResult` in Unity? Explain its purpose and usage.
VisualElement.TryGetLastBindingToUIResult Declaration public bool TryGetLastBindingToUIResult (ref UIElements.BindingId bindingId , out UIElements.BindingResult result ); Parameters Parameter Description bindingId The ID of the binding object. result The result of the last binding operation to the UI....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2765cae4b154
unity_docs
editor
What is `ShortcutManagement.ShortcutManager.RegisterContext` in Unity? Explain its purpose and usage.
ShortcutManager.RegisterContext Declaration public static void RegisterContext ( ShortcutManagement.IShortcutContext context ); Parameters Parameter Description context The custom context to add to the shortcut context list. Description Registers a IShortcutContext as a custom context used to filter sho...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9eb5c4ecf344
unity_docs
networking
What is `Networking.PlayerConnection.PlayerConnectionGUIUtility` in Unity? Explain its purpose and usage.
PlayerConnectionGUIUtility class in UnityEditor.Networking.PlayerConnection Description Miscellaneous helper methods for PlayerConnectionGUI . Static Methods Method Description GetConnectionState This method generates a state tracking object for establishing and displaying an Editor to Player Connection.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_516de18e01e8
unity_docs
scripting
What is `AndroidJNI.AllocObject` in Unity? Explain its purpose and usage.
AndroidJNI.AllocObject Declaration public static IntPtr AllocObject (IntPtr clazz ); Description Allocates a new Java object without invoking any of the constructors for the object. Additional resources: Java Native Interface Specification (Oracle)
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b4a72f08278e
unity_docs
scripting
What is `GizmoInfo.name` in Unity? Explain its purpose and usage.
GizmoInfo.name public string name ; Description The display name for the type represented by this GizmoInfo. User-defined types are accessible through the script property, but built-in types (e.g., Transform) are not. Use name to identify built-in gizmo types.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_96093f080b29
unity_docs
ui
Show me a Unity code example for 'Bind without the binding path'.
ield. Find the name property of a GameObject and bind to the property directly with the BindProperty() method. In your Project window , create a folder named bind-without-binding-path to store your file. In the bind-without-binding-path folder, create a folder named Editor . In the Editor folder, create a C# script nam...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2f8720cffbde
unity_docs
editor
What is `PlayModeWindow` in Unity? Explain its purpose and usage.
PlayModeWindow class in UnityEditor Description Class containing methods to interact with the selected Unity PlayModeView (GameView, Simulator). Static Methods Method Description GetPlayModeFocused Returns the enter play mode behavior for the selected PlayModeView. GetRenderingResolution Retrieves the current...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_4808ef61d149
unity_docs
networking
In Unity's 'Introduction to Unity Accelerator', what is 'Installing Unity Accelerator' and how does it work?
To install Unity Accelerator, you can either install it with the installer or with Docker Hub . Make sure that the system you install it on meets the minimum requirements . After installation, you can verify the Unity Accelerator version and configure Unity Accelerator in the Editor .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7b61bb10a551
unity_docs
rendering
What are the parameters of `Unity.Profiling.LowLevel.Unsafe.ProfilerUnsafeUtility.FlowEvent` in Unity?
Description Add flow event to a Profiler sample. Use Profiler flow events to highlight the dependencies between task execution on different threads. Flow event works in conjunction with ProfilerMarker . ```csharp using System; using System.Threading; using Unity.Profiling; using Unity.Profiling.LowLevel; using Unity.Pr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_57d84782caa0
unity_docs
ui
What is `UIElements.ListView.makeItem` in Unity? Explain its purpose and usage.
ListView.makeItem public Func<VisualElement> makeItem ; Description Callback for constructing the VisualElement that is the template for each recycled and re-bound element in the list. This callback needs to call a function that constructs a blank VisualElement that is bound to an element from the list. ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_19cd75463366
unity_docs
scripting
In Unity's 'Use Mesh API to create a radial progress indicator', what is 'Create the radial progress indicator and its custom mesh' and how does it work?
Create a C# script to define the RadialProgress class, and expose the control to UXML and UI Builder. Create a Unity project with any template. Create a folder named radial-progress to store your files. In the radial-progress folder, create a C# scrip named RadialProgress.cs with the following content: ```csharp using ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_96c77afcd337
unity_docs
input
Explain 'Create a custom activity' in Unity.
To extend the default Unity activity, you create your own custom activity and set it as the application’s entry point. The process to do this is as follows: Create a new activity that extends the UnityPlayerActivity class. Note : If you’re creating a new activity with GameActivity application entry point, you need to e...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_78aec494938c
unity_docs
scripting
What is `UIElements.Background.FromSprite` in Unity? Explain its purpose and usage.
Background.FromSprite Declaration public static UIElements.Background FromSprite ( Sprite s ); Parameters Parameter Description s The sprite to use as a background. Returns Background A new background object. Description Creates a background from a Sprite .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3162d139a96b
unity_docs
rendering
What is `ParticleSystem.ShapeModule.angle` in Unity? Explain its purpose and usage.
ParticleSystem.ShapeModule.angle public float angle ; Description Angle of the cone to emit particles from. Note that you should specify the value in degrees. Additional resources: ParticleSystem.ShapeModule.shapeType .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_891f6b9e363e
unity_docs
math
What is `Mathf.Atan` in Unity? Explain its purpose and usage.
Mathf.Atan Declaration public static float Atan (float f ); Description Returns the arc-tangent of f - the angle in radians whose tangent is f . ```csharp using UnityEngine;public class ScriptExample : MonoBehaviour { void Start() { print(Mathf.Atan(0.5f)); } } ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4b71f180f20e
unity_docs
scripting
What is `MPE.ChannelService.CloseChannel` in Unity? Explain its purpose and usage.
ChannelService.CloseChannel Declaration public static void CloseChannel (string channelName ); Parameters Parameter Description channelName The name of the channel to close. Description Closes a specific channel and all connections to that channel.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a42c85e6e57a
unity_docs
editor
What is `Device.SystemInfo.supports32bitsIndexBuffer` in Unity? Explain its purpose and usage.
SystemInfo.supports32bitsIndexBuffer public static bool supports32bitsIndexBuffer ; Description This has the same functionality as SystemInfo.supports32bitsIndexBuffer and also mimics platform-specific behavior in the Unity Editor.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_20bd3210f0ab
unity_docs
editor
What is `EditorStyles.whiteLabel` in Unity? Explain its purpose and usage.
EditorStyles.whiteLabel public static GUIStyle whiteLabel ; Description Style for white label. Useful for coloring your labels; set GUI.contentColor to your text color, then use this style.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_b2b47fd06714
unity_docs
rendering
Explain 'Key concepts' in Unity.
There are some concepts you rely on from the moment you open the Unity Editor. Use this page to refresh your memory as you work through tutorials and your first projects. ## GameObjects, components, and scenes GameObjects represent everything in your game, including characters, props, and scenery. In the Unity Editor...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_05d13ad29512
unity_docs
scripting
What is `Experimental.GraphView.ContentDragger.UnregisterCallbacksFromTarget` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. ContentDragger.UnregisterCallbacksFromTarget Declaration protected void UnregisterCallbacksFromTarget (); Description Called to unregister event callbacks from the target element.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d2765c47c09f
unity_docs
scripting
What is `AssetBundle.isStreamedSceneAssetBundle` in Unity? Explain its purpose and usage.
AssetBundle.isStreamedSceneAssetBundle public bool isStreamedSceneAssetBundle ; Description Return true if the AssetBundle contains Unity Scene files An AssetBundle can store either Scenes or Assets, never a mix of the two.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0280cffed51c
unity_docs
scripting
Show me a Unity C# example demonstrating `AudioConfiguration.dspBufferSize`.
oesn't include additional latency caused by multiple DSP buffers or buffers from your platform's audio system. You can use AudioSettings.GetConfiguration.dspBufferSize or AudioSettings.GetDSPBufferSize to get the DSP buffer size but it's recommended you use AudioSettings.GetConfiguration.dspBufferSize. For a code ex...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a9042f419001
unity_docs
scripting
What is `DisplayInfo.workArea` in Unity? Explain its purpose and usage.
DisplayInfo.workArea public RectInt workArea ; Description Specifies the work area rectangle of the display relative to the top left corner. For example, it excludes the area covered by the macOS Dock or the Windows Taskbar.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3a53364abb27
unity_docs
scripting
Show me a Unity C# example demonstrating `PlayerPrefs.SetString`.
alled SetString . The function uses the KeyName variable in PlayerPrefs.SetString as an identifier, and Value as the contents to store. For example, you could use PlayerPrefs.SetString to store the user’s name, like this: PlayerPrefs.SetString(“CharacterName”, “James”) The GetString function then uses the s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3e5f562e0d63
unity_docs
audio
What is `AudioSource.PlayOneShot` in Unity? Explain its purpose and usage.
AudioSource.PlayOneShot Declaration public void PlayOneShot ( AudioClip clip , float volumeScale = 1.0F); Parameters Parameter Description clip The clip being played. volumeScale The scale of the volume. Unity automatically clamps negative scales to zero. Note: Scales larger than one might cause clippi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a7dad593fe18
unity_docs
ui
What is `GUISkin.font` in Unity? Explain its purpose and usage.
GUISkin.font public Font font ; Description The default font to use for all styles. ```csharp using UnityEngine;public class Example : MonoBehaviour { // Modifies the font only of the current GUISkin. public Font font; void OnGUI() { if (!font) { Debug.LogError("No font found, assign one in the inspecto...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5fd4365540be
unity_docs
physics
Show me a Unity C# example demonstrating `Physics.ContactEvent`.
tes: Only Collider collisions are reported in this event and no trigger events will appear in the provided buffer. All the data in the provided buffer is read-only. No writes are permited. The event is invoked after the transform sync. To receive contacts from a Collider, set the Collider.providesContacts propert...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_c21762f22650
unity_docs
physics
In Unity's 'Specify Android Player command-line arguments', what is 'Additional ways to specify command-line arguments' and how does it work?
Apart from the custom activity, you can specify command-line arguments in the following ways: In Android Studio : If you open your project in Android Studio, you can pass startup command-line arguments to Unity through Launch Flags in Run/Debug Configurations dialog . Via Android Debug Bridge (adb) : You can pass comma...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_263aca68256b
unity_docs
scripting
Give me an overview of the `XcodeBuildConfig` class in Unity.
XcodeBuildConfig enumeration Description Build configurations for the Xcode project Unity generates. Properties Property Description Debug Sets the build configuration to Debug for the Xcode project Unity generates. Release Sets the build configuration to Release for the Xcode project Unity generates.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_18b4c6008bf4
unity_docs
animation
What is `Animations.AnimatorStateMachine.RemoveStateMachineTransition` in Unity? Explain its purpose and usage.
AnimatorStateMachine.RemoveStateMachineTransition Declaration public bool RemoveStateMachineTransition ( Animations.AnimatorStateMachine sourceStateMachine , Animations.AnimatorTransition transition ); Parameters Parameter Description transition The transition to remove. sourceStateMachine The source s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5265b0a1bb74
unity_docs
rendering
What is `ShaderVariantCollection.Remove` in Unity? Explain its purpose and usage.
ShaderVariantCollection.Remove Declaration public bool Remove ( ShaderVariantCollection.ShaderVariant variant ); Parameters Parameter Description variant Shader variant to add. Returns bool False if was not in the collection. Description Removes shader variant from the collection. Additional resour...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4eb7143fd222
unity_docs
scripting
What is `UIElements.BaseTreeView.GetItemDataForIndex` in Unity? Explain its purpose and usage.
BaseTreeView.GetItemDataForIndex Declaration public T GetItemDataForIndex (int index ); Parameters Parameter Description index The TreeView item index. Returns T The TreeView item data. Description Gets data for the specified TreeView item index.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2a99942c19d8
unity_docs
math
What are the parameters of `Graphics.RenderMeshPrimitives` in Unity?
Description Renders multiple instances of a Mesh using GPU instancing and a custom shader. This method renders multiple instances of the same Mesh, similar to Graphics.RenderMeshIndirect , but provides the number of instances and other rendering command arguments as function arguments. Use SV_InstanceID semantic in sha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d6e64d6c42c3
unity_docs
scripting
Show me a Unity C# example demonstrating `Handles.ArrowHandleCap`.
ts. Description Draw an arrow like those used by the move tool. On EventType.Layout event, calculates handle distance to mouse and calls HandleUtility.AddControl accordingly. On EventType.Repaint event, draws the handle shape. Arrow Handle Cap in the Scene View. Add the following script to your Assets folder ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b25b7d749fe3
unity_docs
input
Show me a Unity C# example demonstrating `KeyCode.Mouse4`.
KeyCode.Mouse4 Description Additional (fifth) mouse button. Use this for detecting mouse button presses. The “4” mouse button is the fifth button on the user’s mouse if this additional button exists, for example, volume buttons on the mouse. Unity defines this as the "4" Mouse button, as the mouse Button numbering ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d925677a50db
unity_docs
editor
What is `Device.Screen.autorotateToLandscapeRight` in Unity? Explain its purpose and usage.
Screen.autorotateToLandscapeRight public static bool autorotateToLandscapeRight ; Description This has the same functionality as Screen.autorotateToLandscapeRight and also mimics platform-specific behavior in the Unity Editor.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7feaeeb44935
unity_docs
audio
What are the parameters of `Audio.AudioMixer.GetFloat` in Unity?
Returns bool Returns false if the exposed parameter specified doesn't exist. Description Returns the value of the exposed parameter specified. If the parameter doesn't exist the function returns false. Prior to calling SetFloat and after ClearFloat has been called on this parameter the value returned will be that of th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a0353cdcbd83
unity_docs
physics
What is `Physics2D.CapsuleCastAll` in Unity? Explain its purpose and usage.
Physics2D.CapsuleCastAll Declaration public static RaycastHit2D[] CapsuleCastAll ( Vector2 origin , Vector2 size , CapsuleDirection2D capsuleDirection , float angle , Vector2 direction , float distance = Mathf.Infinity, int layerMask = DefaultRaycastLayers, float minDepth = -Mathf.Infinity, float ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_32ee7dcb0b6d
unity_docs
physics
What is `CompositeCollider2D.GenerationType.Manual` in Unity? Explain its purpose and usage.
CompositeCollider2D.GenerationType.Manual Description Sets the Composite Collider geometry to not automatically update when a Collider used by the Composite Collider changes. Use this enumeration value to set the Composite Collider geometry to only be able to be updated manually when a Collider used by the Composit...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_62a62c424d98
unity_docs
rendering
What is `Shader.SetGlobalInteger` in Unity? Explain its purpose and usage.
Shader.SetGlobalInteger Declaration public static void SetGlobalInteger (string name , int value ); Declaration public static void SetGlobalInteger (int nameID , int value ); Parameters Parameter Description nameID The name ID of the property retrieved by Shader.PropertyToID . name The name of the...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_da418c6e730f
unity_docs
physics
What is `BoxcastCommand.queryParameters` in Unity? Explain its purpose and usage.
BoxcastCommand.queryParameters public QueryParameters queryParameters ; Description Structure for specifying additional parameters for a batch query such as layer mask, hit triggers and hit backfaces.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_73a49e591886
unity_docs
scripting
What is `Device.Application.Unload` in Unity? Explain its purpose and usage.
Application.Unload Declaration public static void Unload (); Description This has the same functionality as Application.Unload . 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_man_f34d86bdc3e8
unity_docs
editor
Explain 'Define logging levels' in Unity.
During the update of the binding, errors might occur where binding objects try to access invalid properties, encounter null values along a property path, or encounter missing type converters. If you set the binding system to log all errors to the Console, it can impact performance. To control the console output, you ca...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_14cc359bb73c
unity_docs
scripting
What is `Device.Application.isPlaying` in Unity? Explain its purpose and usage.
Application.isPlaying public static bool isPlaying ; Description This has the same functionality as Application.isPlaying . At the moment, the Device Simulator doesn't support simulation of this property.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e7610688a2bc
unity_docs
scripting
What is `UIElements.RectIntField.ctor` in Unity? Explain its purpose and usage.
RectIntField Constructor Declaration public RectIntField (); Description Initializes and returns an instance of RectIntField. Declaration public RectIntField (string label ); Parameters Parameter Description label The text to use as a label. Description Initializes and returns an instance of Rect...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a29ff02b89d0
unity_docs
math
What is `Vector3Int.RoundToInt` in Unity? Explain its purpose and usage.
Vector3Int.RoundToInt Declaration public static Vector3Int RoundToInt ( Vector3 v ); Description Converts a Vector3 to a Vector3Int by doing a Round to each value. As there is a conversion of float to integer, there is a loss of precision.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4c22fcfd95d4
unity_docs
editor
What is `Compilation.CompilationPipeline.GetPrecompiledAssemblyPaths` in Unity? Explain its purpose and usage.
CompilationPipeline.GetPrecompiledAssemblyPaths Declaration public static string[] GetPrecompiledAssemblyPaths ( Compilation.CompilationPipeline.PrecompiledAssemblySources precompiledAssemblySources ); Parameters Parameter Description precompiledAssemblySources Determines which assembly paths will be return...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8b1d7e58acec
unity_docs
scripting
What are the parameters of `AvatarBuilder.BuildGenericAvatar` in Unity?
Description Create a new generic avatar. All transforms under the root game object will be part of this generic avatar. ```csharp using UnityEngine; using UnityEditor;public class Example : MonoBehaviour { void Start() { GameObject activeGameObject = Selection.activeGameObject; if (activeGameObje...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_25ad590b0c6b
unity_docs
audio
What is `AudioRenderer` in Unity? Explain its purpose and usage.
AudioRenderer class in UnityEngine / Implemented in: UnityEngine.AudioModule Description Allow recording the main output of the game or specific groups in the AudioMixer. Static Methods Method Description GetSampleCountForCaptureFrame Returns the number of samples available since the last time AudioRenderer....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a9651065c1d0
unity_docs
scripting
What is `UIElements.ArcDirection` in Unity? Explain its purpose and usage.
ArcDirection enumeration Description Direction to use when defining an arc (see Painter2D.Arc ). Properties Property Description Clockwise A clockwise direction. CounterClockwise A counter-clockwise direction.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_683ca2a0e250
unity_docs
scripting
What is `UIElements.CreationContext` in Unity? Explain its purpose and usage.
CreationContext struct in UnityEngine.UIElements / Implemented in: UnityEngine.UIElementsModule Description This structure holds information used during UXML template instantiation. Properties Property Description target The element into which the visualTreeAsset is being cloned or instantiated. Visual...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_41394166afea
unity_docs
xr
What is `Unity.IO.LowLevel.Unsafe.AsyncReadManagerSummaryMetrics.AverageWaitTimeMicroseconds` in Unity? Explain its purpose and usage.
AsyncReadManagerSummaryMetrics.AverageWaitTimeMicroseconds public float AverageWaitTimeMicroseconds ; Description The mean time taken from request to the start of reading, in microseconds, for read request metrics included in the summary calculation.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fc536d24bcbe
unity_docs
rendering
What is `Material.renderQueue` in Unity? Explain its purpose and usage.
Material.renderQueue public int renderQueue ; Description Render queue of this material. By default materials use render queue of the shader it uses. You can override the render queue used using this variable. Note that if a shader on the material is changed, the render queue resets to that of the shader its...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f58ec89437c2
unity_docs
rendering
What is `Experimental.Lightmapping.probesIgnoreDirectEnvironment` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. Lightmapping.probesIgnoreDirectEnvironment public static bool probesIgnoreDirectEnvironment ; Description If enabled ignores the direct contribution from the environment lighting in baked probes. This feature is useful in co...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5abd67515266
unity_docs
editor
What is `Unity.Jobs.LowLevel.Unsafe.JobHandleUnsafeUtility` in Unity? Explain its purpose and usage.
JobHandleUnsafeUtility class in Unity.Jobs.LowLevel.Unsafe / Implemented in: UnityEngine.CoreModule Description Contains unsafe utility methods for JobHandle instances. Static Methods Method Description CombineDependencies Combines multiple dependencies into a single one using an unsafe array of job handle...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e61a6bd6677e
unity_docs
scripting
Show me a Unity C# example demonstrating `SystemLanguage.ChineseTraditional`.
SystemLanguage.ChineseTraditional Description ChineseTraditional. ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { //This checks if your computer's operating system is in the Traditional Chinese language if (Application.systemLanguage == SystemLanguage.ChineseTraditional) { //...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_eda2e4bcd1a3
unity_docs
ui
Show me a Unity C# example demonstrating `GUI.HorizontalScrollbar`.
se for the scrollbar background. If left out, the horizontalScrollbar style from the current GUISkin is used. Returns float The modified value. This can be changed by the user by dragging the scrollbar, or clicking the arrows at the end. Description Make a horizontal scrollbar. Scrollbars are what you use t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_321b1264feef
unity_docs
rendering
What is `Light.RemoveAllCommandBuffers` in Unity? Explain its purpose and usage.
Light.RemoveAllCommandBuffers Declaration public void RemoveAllCommandBuffers (); Description Remove all command buffers set on this light. Additional resources: CommandBuffer , RemoveCommandBuffer , RemoveCommandBuffers .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d01faa274b70
unity_docs
rendering
What is `Search.QueryListBlockAttribute` in Unity? Explain its purpose and usage.
QueryListBlockAttribute class in UnityEditor.Search Description This attribute can be used on a class deriving from QueryListBlock to display in query builder mode a special block that will propose a fixed set of values when clicked. The following example shows how to display a custom list block for the shader...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a19391f0833e
unity_docs
editor
What is `GlobalObjectId.targetObjectId` in Unity? Explain its purpose and usage.
GlobalObjectId.targetObjectId public ulong targetObjectId ; Description The local file ID of the referenced object. This is the ID that uniquely identifies each individual object in an asset file. For objects that are not part of a prefab, this is sufficient to identify the object. For more information on asset...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_86c83a634013
unity_docs
rendering
What are the parameters of `Graphics.DrawMeshInstancedIndirect` in Unity?
Description This function is now obsolete. Use Graphics.RenderMeshIndirect instead. Draws the same mesh multiple times using GPU instancing. This function only works on platforms that support compute shaders . Similar to Graphics.DrawMeshInstanced , this function draws many instances of the same mesh, but unlike that m...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a8b15fe7ba2c
unity_docs
rendering
What is `ComputeShader.keywordSpace` in Unity? Explain its purpose and usage.
ComputeShader.keywordSpace public Rendering.LocalKeywordSpace keywordSpace ; Description The local keyword space of this compute shader. Shader keywords determine which shader variants Unity uses. For information on working with local shader keywords and global shader keywords and how they interact, see ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cfca9bb3e53b
unity_docs
rendering
What is `Experimental.Rendering.ShaderWarmup` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. ShaderWarmup class in UnityEngine.Experimental.Rendering / Implemented in: UnityEngine.CoreModule Description Prewarms shaders in a way that is supported by all graphics APIs. For information on shader loading and prewarming...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_30f3e83ba296
github
scripting
Write a Unity C# script called Knight
```csharp using System.Collections; using System.Collections.Generic; using UnityEngine; public class Knight : Piece { public override bool[,] PossibleMoves() { int[] X = { 2, 1, -1, -2, -2, -1, 1, 2 }; int[] Y = { 1, 2, 2, 1, -1, -2, -2, -1 }; bool[,] ret = new bool [8,8]; ...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_man_e5129253ebed
unity_docs
performance
Show me a Unity code example for 'Set up your JavaScript plug-in'.
type You can call functions from your .jslib plug-in files in your Unity C# or native scripts . The .jslib file type uses the --js-library Emscripten module. For more information, refer to the Emscripten documentation about the –js-library Emscripten option . The following code shows an example of a .jslib plug-in fil...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_39315978351c
unity_docs
editor
What is `PlayerSettings.defaultWebScreenWidth` in Unity? Explain its purpose and usage.
PlayerSettings.defaultWebScreenWidth public static int defaultWebScreenWidth ; Description Default horizontal dimension of web player window. Custom player settings. ```csharp using UnityEngine; using UnityEditor; // Simple Script that saves and loads custom // Stand-alone/Web player screen settings among // ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7f8b39c75eb4
unity_docs
ui
What is `DeviceSimulation.DeviceSimulatorPlugin.OnCreateUI` in Unity? Explain its purpose and usage.
DeviceSimulatorPlugin.OnCreateUI Declaration public UIElements.VisualElement OnCreateUI (); Description The VisualElement that this method returns is embedded in the Device Simulator window. If the method returns null, plug-in UI is not embedded.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.