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_7b082ee67855
unity_docs
scripting
Give me an overview of the `ContextMenu` class in Unity.
ContextMenu class in UnityEngine / Implemented in: UnityEngine.CoreModule Description Use the ContextMenu attribute to add commands to the context menu of the Inspector window. In the Inspector window of the attached script, when the user selects the context menu, the function executes. This is most useful for ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a6bdd055d6d9
unity_docs
scripting
What is `Compass.trueHeading` in Unity? Explain its purpose and usage.
Compass.trueHeading public float trueHeading ; Description The heading in degrees relative to the geographic North Pole. (Read Only) The value in this property is always measured relative to the top of the screen in its current orientation. Note, that if you want this property to contain a valid value, you must...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_ca0f518a4e41
unity_docs
physics
Explain 'Use the layer collision matrix to reduce overlaps' in Unity.
Reduce collision calculation overhead by configuring interaction rules between GameObjects with collision layers. Use the Layer Collision Matrix to control how objects on different layers interact with each other in the physics simulation. You can assign objects to a layer in their Inspector , and then use the Layer Co...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_d0782d558059_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
An interactable lever that snaps into an on or off position by a direct interactor Signature: ```csharp public class XRLever : XRBaseInteractable ```
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_b779f63b3f86
unity_docs
rendering
What is `LightTransport.RadeonRaysProbeIntegrator.IntegrateIndirectRadiance` in Unity? Explain its purpose and usage.
RadeonRaysProbeIntegrator.IntegrateIndirectRadiance(IDeviceContext,int,int,int,BufferSlice<SphericalHarmonicsL2>) Parameters Parameter Description context Device context. positionOffset Offset measured from the beginning of the probe position buffer. positionCount Number of probes to integrate. sampleCount ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c4ef38303ce3
unity_docs
editor
Show me a Unity C# example demonstrating `Unity.Profiling.LowLevel.Unsafe.ProfilerRecorderHandle.GetAvailable`.
oid GetAvailable (List<ProfilerRecorderHandle> outRecorderHandleList ); Description Gets all available handles which can be accessed with ProfilerRecorder. Enumerates all available built-in or dynamically created handles of Profiler markers and counters. For a list of built-in Profiler markers and counters avail...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5500c166b793
unity_docs
math
Show me a Unity C# example demonstrating `Graphics.RenderPrimitives`.
umber of instances and primitives that have specific topology. This method requires custom shaders to fetch or calculate vertex data using the SV_VertexID semantic. To access instance ID use SV_InstanceID semantic. Additional resources: RenderPrimitivesIndexed . The following example renders 10 instances of a Mesh...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5af00d7c7731
unity_docs
math
Show me a Unity C# example demonstrating `RectTransform.GetLocalCorners`.
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 that bottom left, for example, is an (x, y, z) vector with x being left and y being bottom. Note : If the RectTransform is rotated in Z then the dimensions of the Get...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7699ebb1740a
unity_docs
ui
What are the parameters of `UIElements.ToggleButtonGroupState.GetInactiveOptions` in Unity?
Description Retrieves a Span of integers containing the inactive options as indices. ```csharp public void HandleInactiveOptions() { var value = myToggleButtonGroup.value; var options = value.GetInactiveOptions(stackalloc int[value.length]); foreach (option in options) { // handle option ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_aa66c14111d9
unity_docs
scripting
What is `SkinnedMeshRenderer.BakeMesh` in Unity? Explain its purpose and usage.
SkinnedMeshRenderer.BakeMesh Declaration public void BakeMesh ( Mesh mesh ); Declaration public void BakeMesh ( Mesh mesh , bool useScale ); Parameters Parameter Description mesh A static mesh that will receive the snapshot of the skinned mesh. useScale Whether to compensate for the SkinnedMeshRen...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f2c25241d793
unity_docs
scripting
What is `MPE.ChannelService.Send` in Unity? Explain its purpose and usage.
ChannelService.Send Declaration public static void Send (int connectionId , byte[] data ); Declaration public static void Send (int connectionId , string data ); Parameters Parameter Description connectionId The connection ID. This matches ChannelClientInfo.channelClientId. data Data to send to the ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_a326a9e5b629_doc_10
github
scripting
What does `DoBefore` do in this Unity script? Explain its purpose and signature.
Prepends an action to an existing coroutine.Especially useful in combination with and in order to execute code even ifthe passed condition is false.private bool _isRunning = false;private IEnumerator RunImpl() { ... }public IEnumerator Run() => DoBefore( () => _isRunning = true, RunImpl().YieldWhile(() => _isRun...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_363ad23a2d86
unity_docs
rendering
Show me a Unity C# example demonstrating `Rendering.FilteringSettings.defaultValue`.
tings defaultValue ; Description Creates a FilteringSettings struct that contains default values for all properties. With these default values, Unity does not perform any filtering. To override values at the time that you create the struct, use the FilteringSettings constructor . This example demonstrates the...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1e1589e662f4
unity_docs
scripting
What is `UIElements.GeometryChangedEvent.GetPooled` in Unity? Explain its purpose and usage.
GeometryChangedEvent.GetPooled Declaration public static UIElements.GeometryChangedEvent GetPooled ( Rect oldRect , Rect newRect ); Parameters Parameter Description oldRect The old dimensions of the element. newRect The new dimensions of the element. Returns GeometryChangedEvent An initialized ev...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c9d1a858e9c3
unity_docs
physics
What is `XR.HapticCapabilities.bufferMaxSize` in Unity? Explain its purpose and usage.
HapticCapabilities.bufferMaxSize public uint bufferMaxSize ; Description The maximum amount of data that can be sent to an InputDevice via InputDevice.SendHapticBuffer . If the InputDevice receives an amount of data greater than this, then InputDevice.SendHapticBuffer fails and a rumble is not triggered. C...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_577b26cdecc3
unity_docs
rendering
In Unity's 'Search provider references', what is 'Search your project and scenes' and how does it work?
The following search providers allow you to search your project and scenes : Provider Token Description Search your project and scenes N/A An overview of searching your project and scenes with the Hierarchy, Project, and Asset Database search providers. Search GameObjects with the Hierarchy search provider h Search Gam...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_39cfaba25803
unity_docs
physics
In Unity's 'Wheel collider component reference', what is 'Suspension Spring' and how does it work?
The Suspension Spring properties simulate the behavior of a vehicle’s suspension system. To do this, the Wheel collider sets a target position on the vertical Y axis that it always tries to return to, and has Spring and Damper properties that apply forces to return it to that position. For more details on the Suspensio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e2c0430d1cff
unity_docs
rendering
What is `Renderer.lightmapIndex` in Unity? Explain its purpose and usage.
Renderer.lightmapIndex public int lightmapIndex ; Description The index of the baked lightmap applied to this renderer. The index refers to the LightmapSettings.lightmaps array. A value of -1 (0xFFFF) means no lightmap has been assigned, which is the default. A value of 0xFFFE is internally used for objects t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c4bb3624f022
unity_docs
scripting
What is `Profiling.HierarchyFrameDataView.GetItemMetadataAsLong` in Unity? Explain its purpose and usage.
HierarchyFrameDataView.GetItemMetadataAsLong Declaration public long GetItemMetadataAsLong (int id , int index ); Parameters Parameter Description id Hierarchy item identifier. index Metadata index. Returns long Value of the metadata as long. Description Returns long representation of hierarchy it...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_13e9b49e663f
unity_docs
physics
What are the parameters of `MonoImporter.SetExecutionOrder` in Unity?
Description Sets the execution order for a MonoScript . This method forces Unity to reimport the MonoImporter for the target script. This is the same execution order that the Script Execution Order Settings window displays. The default execution order for scripts is 0. Additional resources: MonoImporter.GetExecutionOrd...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a9110ac04321
unity_docs
scripting
What is `Rendering.RenderPipelineAsset.CreatePipeline` in Unity? Explain its purpose and usage.
RenderPipelineAsset.CreatePipeline Declaration protected Rendering.RenderPipeline CreatePipeline (); Returns RenderPipeline Created pipeline. Description Create a IRenderPipeline specific to this asset.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_1e16292762c0
github
scripting
Write a Unity C# physics script for Hiding Mechanic
```csharp using System.Collections; using System.Collections.Generic; using UnityEngine; public class HidingMechanic : MonoBehaviour { public GameObject hideText, stopHideText; public GameObject normalPlayer, hidingPlayer; public BasicAhhEnemyAI monsterScript; public Transform monsterTransform; bo...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_sr_9bb7e07feea2
unity_docs
animation
What is `Animations.StateMachineBehaviourContext` in Unity? Explain its purpose and usage.
StateMachineBehaviourContext class in UnityEditor.Animations Description This class contains all the owner's information for this State Machine Behaviour. Additional resources: AnimatorController.FindStateMachineBehaviourContext . Properties Property Description animatorController The AnimatorController that...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e99f577a2243
unity_docs
scripting
What is `Build.Content.ObjectIdentifier.operator_gt` in Unity? Explain its purpose and usage.
ObjectIdentifier.operator > public static bool operator > ( Build.Content.ObjectIdentifier a , Build.Content.ObjectIdentifier b ); Description Returns true if the first ObjectIdentifier is greater than the second ObjectIdentifier. Internal use only. See ObjectIdentifier .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2cfbef9d7996
unity_docs
editor
What is `EditorGUILayout.VerticalScope` in Unity? Explain its purpose and usage.
VerticalScope class in UnityEditor Description Disposable helper class for managing BeginVertical / EndVertical . This is an extension to GUILayout.VerticalScope . It can be used for making compound controls Vertical Compound group. ```csharp using UnityEngine; using UnityEditor;// Create a Vertical Compoun...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_4aae4bbd197e
unity_docs
rendering
Explain 'Paint Texture' in Unity.
Use the Paint Texture tool to add textures, such as grass, snow, or sand, to your Terrain . It allows you to draw areas of tiled texture directly onto the Terrain. In the Terrain Inspector , click the Paint Terrain icon, and select Paint Texture from the list of Terrain tools. To access the Paint Texture tool from an o...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_88921fce296f
unity_docs
scripting
In Unity's 'Configure mesh LOD', what is 'Configure LOD levels' and how does it work?
To manually configure the distance from the camera at which Unity displays each LOD level, use the LOD Group component’s selection bar . The LOD Group component accepts a maximum of eight LOD levels. LOD 0 is the closest to the Camera, and therefore the most detailed LOD level.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e23bd73b08b6
unity_docs
rendering
What is `LightmapParameters.AOAntiAliasingSamples` in Unity? Explain its purpose and usage.
LightmapParameters.AOAntiAliasingSamples public int AOAntiAliasingSamples ; Description The maximum number of times to supersample a texel to reduce aliasing in AO. Increasing this value does not increase baking times as the number of rays is only defined by AO quality. Effectively this parameter controls how ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_7604d7f70ee9
unity_docs
scripting
In Unity's 'Compile a static library as a Unity plug-in', what is 'Steps to use a static library in Unity' and how does it work?
To compile a static library that you can use as a Unity plug-in: Download the Emscripten SDK Configure any existing project scripts Update your compiler options Compile and import your static library files Call your static library functions from C# scripts
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a2ef3a100662
unity_docs
editor
What are the parameters of `VersionControl.Provider.GetAssetByPath` in Unity?
Description Returns the version control information about an asset. Can be used with " AssetList .Add" to add assets to a list for further version control actions. Will return null if the path is not known by the Unity Editor or if the asset is local only and hasn't been added to version control yet. ```csharp using Sy...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8c31d411c2b3
unity_docs
editor
What is `Handles.DrawingScope.ctor` in Unity? Explain its purpose and usage.
Handles.DrawingScope Constructor Declaration public Handles.DrawingScope ( Color color ); Declaration public Handles.DrawingScope ( Color color , Matrix4x4 matrix ); Declaration public Handles.DrawingScope ( Matrix4x4 matrix ); Parameters Parameter Description matrix The matrix to use for dis...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7df9578cc667
unity_docs
scripting
Show me a Unity C# example demonstrating `Quaternion.RotateTowards`.
ternion A unit quaternion rotated towards to by an angular step of maxDegreesDelta . Description Rotates a rotation from towards to . The from quaternion is rotated towards to by an angular step of maxDegreesDelta . The rotation will not overshoot the to quaternion. Negative values of maxDegreesDel...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6608bd2cb67a
unity_docs
animation
What is `Animations.GenericBinding.customTypeID` in Unity? Explain its purpose and usage.
GenericBinding.customTypeID public byte customTypeID ; Description The internal ID for custom animation bindings. Some Unity systems, like shader, are more dynamic and require custom bindings to expose their properties.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5f1d4d045ab7
unity_docs
scripting
What is `AndroidJavaObject.CloneReference` in Unity? Explain its purpose and usage.
AndroidJavaObject.CloneReference Declaration public AndroidJavaObject CloneReference (); Returns AndroidJavaObject A new C# object which references the same Java object as the original instance. Description Creates a clone of the C# object that references the same Java object. Allows you to create multi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d69e637025a8
unity_docs
scripting
What is `Hash128.ctor` in Unity? Explain its purpose and usage.
Hash128 Constructor Declaration public Hash128 (uint u32_0 , uint u32_1 , uint u32_2 , uint u32_3 ); Declaration public Hash128 (ulong u64_0 , ulong u64_1 ); Parameters Parameter Description u32_0 First 32 bits of hash value. u32_1 Second 32 bits of hash value. u32_2 Third 32 bits of hash value....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a407031e234a
unity_docs
scripting
What is `Search.SearchDocument.Equals` in Unity? Explain its purpose and usage.
SearchDocument.Equals Declaration public bool Equals ( Search.SearchDocument other ); Declaration public bool Equals (object other ); Parameters Parameter Description other Another document to compare to. Returns bool If true both document are equals. Description Compare this document against a...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_96e25f5ec895
unity_docs
editor
What is `Handles.DrawOutline` in Unity? Explain its purpose and usage.
Handles.DrawOutline Declaration public static void DrawOutline (GameObject[] objects , Color parentNodeColor , Color childNodeColor , float fillOpacity ); Declaration public static void DrawOutline (GameObject[] objects , Color color , float fillOpacity ); Declaration public static void DrawOutl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_06305cff03e8
unity_docs
physics
What are the parameters of `MonoBehaviour.OnCollisionStay` in Unity?
Description OnCollisionStay is called once per frame for every Collider or Rigidbody that touches another Collider or Rigidbody. In contrast to OnTriggerStay, OnCollisionStay is passed the Collision class and not a Collider . The Collision class contains information about contact points, impact velocity etc. If you don...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3bc46ad35e7d
unity_docs
scripting
Show me a Unity C# example demonstrating `Rendering.ReflectionProbeClearFlags.Skybox`.
ReflectionProbeClearFlags.Skybox Description Clear with the skybox. If a skybox is not set up, the Reflection Probe will clear with a backgroundColor . Additional resources: ReflectionProbe.clearFlags property. ```csharp using UnityEngine; using System.Collections; public class ExampleScript : MonoBehaviour { ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_157014e15ff1
unity_docs
audio
What is `iOSBackgroundMode` in Unity? Explain its purpose and usage.
iOSBackgroundMode enumeration Description Background modes supported by the application corresponding to project settings in Xcode. For more information, refer to the BackgroundFetch GitHub project . Properties Property Description None No background modes supported. AudioAirplayPiP Audio, AirPlay and Pictur...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_601879035a08
unity_docs
rendering
What is `ShaderUtil.PassHasKeyword` in Unity? Explain its purpose and usage.
ShaderUtil.PassHasKeyword(Shader,Rendering.PassIdentifier,Rendering.LocalKeyword) Parameters Parameter Description s The shader the Pass belongs to. passIdentifier The identifier of a Pass within the given shader. keyword The local shader keyword to check. Returns void Returns true if the keyword is valid...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0325f5c46d07
unity_docs
audio
Show me a Unity C# example demonstrating `MonoBehaviour.OnAudioFilterRead`.
p too much time, meaning the mixer will be starved of audio data. Also note that OnAudioFilterRead is called on a different thread from the main thread (namely the audio thread) so calling into many Unity functions from this function is not allowed (if you try, a warning shows up at run time). Note : OnAudioFilterRead...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_59b67d0fc202
unity_docs
rendering
What is `LineRenderer.SetPositions` in Unity? Explain its purpose and usage.
LineRenderer.SetPositions Declaration public void SetPositions (Vector3[] positions ); Declaration public void SetPositions (NativeArray<Vector3> positions ); Declaration public void SetPositions (NativeSlice<Vector3> positions ); Parameters Parameter Description positions The array of positions t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_316f80a11284
unity_docs
scripting
What is `PrimitiveType.Cylinder` in Unity? Explain its purpose and usage.
PrimitiveType.Cylinder Description A cylinder primitive. Additional resources: GameObject.CreatePrimitive . ```csharp using UnityEngine; using System.Collections;// Creates a cylinder primitivepublic class ExampleClass : MonoBehaviour { void Start() { GameObject cylinder = GameObject.CreatePrimitive(PrimitiveT...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6121bcbcdfb3
unity_docs
physics
Show me a Unity C# example demonstrating `GUILayout.EndScrollView`.
GUILayout.EndScrollView Declaration public static void EndScrollView (); Description End a scroll view begun with a call to BeginScrollView. Additional resources: GUILayout.BeginScrollView Scroll View in the Game View.. ```csharp using UnityEngine;public class ExampleScript : MonoBehaviour { // The variable...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_fafb518f2a26
github
scripting
Write a Unity C# UI script for Score Manager
```csharp using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ScoreManager : MonoBehaviour { public int playerScore = 0; public int opponentScore = 0; public TMPro.TextMeshProUGUI playerScoreText; public TMPro.TextMeshProUGUI opponentScoreT...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_44a23eba93a9
unity_docs
ui
What are the parameters of `GUI.VerticalScrollbar` in Unity?
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 vertical scrollbar. Scrollbars are what you use to scroll through a document. Most likely, you want to use scrollViews instead. ```csharp using UnityEngine; using System.Col...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_95922e10dd1d
unity_docs
scripting
Give me an overview of the `BatteryStatus` class in Unity.
BatteryStatus enumeration Description Enumeration for SystemInfo.batteryStatus which represents the current status of the device's battery. Properties Property Description Unknown The device's battery status cannot be determined. If battery status is not available on your target platform, SystemInfo.batterySt...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_07aac343774d
unity_docs
scripting
What is `UIElements.EasingFunction` in Unity? Explain its purpose and usage.
EasingFunction struct in UnityEngine.UIElements / Implemented in: UnityEngine.UIElementsModule Description Determines how intermediate values are calculated for a transition. Properties Property Description mode The value of the EasingMode. Constructors Constructor Description EasingFunction Cre...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b1a312c0cd42
unity_docs
input
What is `LocationService` in Unity? Explain its purpose and usage.
LocationService class in UnityEngine / Implemented in: UnityEngine.InputLegacyModule Description Provides methods that allow an application to access the device's location. Properties Property Description isEnabledByUser Indicates whether the device allows the application to access the location service. las...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_58d584c15cf1
unity_docs
editor
What is `EditorApplication.SaveAssets` in Unity? Explain its purpose and usage.
Removed EditorApplication.SaveAssets Obsolete Use AssetDatabase.SaveAssets instead. Upgrade to SaveAssets Declaration public static void SaveAssets (); Description Saves all serializable assets that have not yet been written to disk (eg. Materials). Also makes sure the asset database is written. This funct...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2b10f1eb22f3
unity_docs
scripting
What is `SceneManagement.StageUtility.GetMainStageHandle` in Unity? Explain its purpose and usage.
StageUtility.GetMainStageHandle Declaration public static SceneManagement.StageHandle GetMainStageHandle (); Returns StageHandle The main stage. Description Get the main stage which contains all the currently open regular Scenes.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_69f3c868d8fe
unity_docs
animation
Explain 'Humanoid Avatar' in Unity.
Unity’s Animation System has special features for working with humanoid characters. Because humanoid characters are so common in games, Unity provides a specialized workflow, and an extended tool set for humanoid animations . The Avatar system is how Unity identifies that a particular animated model is a humanoid, and ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_76057689aad1
unity_docs
scripting
What is `SearchService.AdvancedObjectSelectorParameters.context` in Unity? Explain its purpose and usage.
AdvancedObjectSelectorParameters.context public SearchService.ObjectSelectorSearchContext context ; Description The search context. This context contains information about the current search session. It is always set. Additional resources: ObjectSelectorSearchContext .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c48aca4315a5
unity_docs
ui
Show me a Unity C# example demonstrating `PlayerSettings.iOS.hideHomeButton`.
is setting is enabled, the home button is hidden from view whenever the user has not touched the screen for several seconds. Note that iOS Human interface guidelines do not recommend enabling this behavior for applications not containing passive viewing experiences such as viewing a video or a photo slideshow. Home but...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_ec83cac07ce1
unity_docs
xr
Show me a Unity C# example demonstrating `Networking.UnityWebRequest.Dispose`.
that this UnityWebRequest is no longer being used, and should clean up any resources it is using. You must call Dispose once you have finished using a UnityWebRequest object, regardless of whether the request succeeded or failed. For safety, it is usually a best practice to employ the using statement to ensure t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7d026e97839c
unity_docs
rendering
What is `MaterialPropertyDrawer.GetPropertyHeight` in Unity? Explain its purpose and usage.
MaterialPropertyDrawer.GetPropertyHeight Declaration public float GetPropertyHeight ( MaterialProperty prop , string label , MaterialEditor editor ); Parameters Parameter Description prop The MaterialProperty to make the custom GUI for. label The label of this property. editor Current material edi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_de946cb36c39
unity_docs
rendering
What is `Windows.WebCam.VideoCapture.StartRecordingAsync` in Unity? Explain its purpose and usage.
VideoCapture.StartRecordingAsync Declaration public void StartRecordingAsync (string filename , Windows.WebCam.VideoCapture.OnStartedRecordingVideoCallback onStartedRecordingVideoCallback ); Parameters Parameter Description filename The name of the video to be recorded to. onStartedRecordingVideoCallback...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8698ed12bbb5
unity_docs
scripting
What is `Graphics.CopyTexture` in Unity? Explain its purpose and usage.
Graphics.CopyTexture Declaration public static void CopyTexture ( Texture src , Texture dst ); Declaration public static void CopyTexture ( Texture src , int srcElement , Texture dst , int dstElement ); Declaration public static void CopyTexture ( Texture src , int srcElement , int srcMip , ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3c4753b6dd58
unity_docs
scripting
Show me a Unity C# example demonstrating `PenStatus.None`.
PenStatus.None Description The pen is in a neutral state. ```csharp using UnityEngine;public class Example : MonoBehaviour { void OnGUI() { Event m_Event = Event.current; if (m_Event.type == EventType.MouseDown) { if (m_Event.pointerType == PointerType.Pen) //Check if it's a pen event. { if (m_Event.penStatu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_a54a591c095d
unity_docs
rendering
In Unity's 'ZTest command in ShaderLab reference', what is 'Syntax' and how does it work?
This command makes a change to the render state. Use it in a Pass block to set the render state for that Pass, or use it in a SubShader block to set the render state for all Passes in that SubShader. Signature Example syntax Function ZTest [operation] ZTest Less Set the conditions under which geometry passes or fails d...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_49a1d18d1e65
unity_docs
editor
What is `EditorUtility.activePlayModeTint` in Unity? Explain its purpose and usage.
EditorUtility.activePlayModeTint public static Color activePlayModeTint ; Description The tint color that is currently applied the editor UI. Returns Color.white when in Edit Mode, and the user-configured Play Mode tint color when in Play Mode. Multiply this color against your custom editor UI colors to mak...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_6910d9d9a9ea_doc_5
github
scripting
What does `OnCollisionEnterAsObservable` do in this Unity script? Explain its purpose and signature.
OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider. Signature: ```csharp public static IObservable<Collision> OnCollisionEnterAsObservable(this Component component) ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_472eea039a3e
unity_docs
scripting
Show me a Unity C# example demonstrating `Application.logMessageReceivedThreaded`.
ti-threaded variant will also be called for messages on the main thread. Note: Application.logMessageReceivedThreaded event is triggered even when you use a custom ILogHandler . This event triggers when any log message is processed by Unity's internal logging system, regardless of its origin or how it's being handl...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_770dead36a44
unity_docs
rendering
In Unity's 'Self-Illuminated Diffuse', what is 'Self-Illuminated Properties' and how does it work?
Note. Unity 5 introduced the Standard Shader which replaces this shader. This shader allows you to define bright and dark parts of the object. The alpha channel of a secondary texture will define areas of the object that “emit” light by themselves, even when no light is shining on it. In the alpha channel, black is zer...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_760073fe9fb9
unity_docs
scripting
Explain 'AppCallbacks class reference' in Unity.
You can use the AppCallbacks class to connect your main application to the Unity engine. ## App.xaml.cppfile ```csharp App::App() { InitializeComponent(); SetupOrientation(); m_AppCallbacks = ref new AppCallbacks(); } void App::OnLaunched(LaunchActivatedEventArgs^ e) { m_SplashScreen = e->SplashScreen; Initiali...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4bf5ec6355ba
unity_docs
editor
Show me a Unity C# example demonstrating `EditorUtility.SaveFolderPanel`.
EditorUtility.SaveFolderPanel Declaration public static string SaveFolderPanel (string title , string folder , string defaultName ); Description Displays the "save folder" dialog and returns the selected path name. Additional resources: SaveFilePanel , OpenFilePanel functions. Save Folder Panel. ```csha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7663dd16d606
unity_docs
rendering
Show me a Unity C# example demonstrating `Material.color`.
ty name name "_Color" to be the main color. Use the [MainColor] ShaderLab Properties attribute to make Unity consider a color with a different property name to be the main color. This is the same as calling GetColor or SetColor with the property name of the main color as a parameter. Additional resources: Se...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fa881bfa1a15
unity_docs
editor
What is `TerrainTools.TerrainToolShortcutContext` in Unity? Explain its purpose and usage.
TerrainToolShortcutContext class in UnityEditor.TerrainTools Implements interfaces: IShortcutContext Description The shortcut context that is active while editing Terrain. Use this context to define shortcut hotkeys that are active only while editing Terrain. Public Methods Method Description SelectPaintTool...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1fbbe0e4f562
unity_docs
editor
What is `Build.Content.GameManagerDependencyInfo` in Unity? Explain its purpose and usage.
GameManagerDependencyInfo struct in UnityEditor.Build.Content Description Contains dependency information for internal Unity game manager classes. Call ContentBuildInterface.WriteGameManagersSerializedFile or ContentBuildInterface.CalculatePlayerDependenciesForGameManagers to get an instance of this class. No...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8a1c00df4ce6
unity_docs
physics
In Unity's 'Build for QNX from the command line', what is 'Command line arguments' and how does it work?
Prerequisites Make sure you’ve followed these instructions before building the project using the command line: Set up QNX_TARGET and QNX_HOST as per Install the Unity Editor for QNX . To instruct Unity to start in CLI mode and build the project at <path-to-unity-project-root> for QNX, run the following command: ``` Uni...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_87eed0710efd
unity_docs
ui
In Unity's 'ToolbarToggle', what is 'Create a ToolbarToggle' and how does it work?
You can create a ToolbarToggle with UI Builder, UXML, or C#. The following C# example creates a ToolbarToggle with a label: ```csharp using UnityEditor.UIElements; ... var toolbarToggle = new ToolbarToggle() { text = "Toggle me" }; ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_be3ef1fdb9da
unity_docs
scripting
What are the parameters of `GridLayout.CellToWorld` in Unity?
Returns Vector3 World position of the cell position. Description Converts a cell position to world position space. ```csharp // Snap the GameObject to parent GridLayout using UnityEngine;public class ExampleClass : MonoBehaviour { void Start() { GridLayout gridLayout = transform.parent.GetComponentInPar...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_23b2b5eac67b
unity_docs
xr
What is `Networking.UploadHandler.progress` in Unity? Explain its purpose and usage.
UploadHandler.progress public float progress ; Description Returns the proportion of data uploaded to the remote server compared to the total amount of data to upload. (Read Only) Behaves identically to UnityWebRequest.uploadProgress .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8c15832b6772
unity_docs
scripting
Show me a Unity C# example demonstrating `Pool.HashSetPool_1`.
HashSetPool<T0> class in UnityEngine.Pool / Inherits from: Pool.CollectionPool_2 / Implemented in: UnityEngine.CoreModule Description A version of CollectionPool<T0,T1> for HashSets. ```csharp using UnityEngine.Pool;public class Example { void GetPooled() { // Get a pooled instance var instance = HashSe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5f3a14d77af2
unity_docs
scripting
What is `WSA.Tile.UpdateBadgeImage` in Unity? Explain its purpose and usage.
Tile.UpdateBadgeImage Declaration public void UpdateBadgeImage (string image ); Parameters Parameter Description image Image identifier. Description Sets or updates badge on a tile to an image. An image on a badge must be one of predefined glyphs: http://msdn.microsoft.com/en-us/library/windows/apps/hh779...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_794ebe4f25f9
unity_docs
rendering
Show me a Unity C# example demonstrating `ParticleSystem.MainModule.startRotationX`.
ParticleSystem.MainModule.startRotationX public ParticleSystem.MinMaxCurve startRotationX ; Description The initial rotation of particles around the x-axis when emitted. Note that you should specify the value in radians. Additional resources: MinMaxCurve . ```csharp using UnityEngine; using System.Collecti...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_43d3f841ff66
unity_docs
scripting
What is `Profiling.HierarchyFrameDataView.columnObjectName` in Unity? Explain its purpose and usage.
HierarchyFrameDataView.columnObjectName public static int columnObjectName ; Description The Object Name column. The name of this column corresponds with the UnityEngine.Object associated with a sample.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b38bd281774f
unity_docs
scripting
Show me a Unity C# example demonstrating `Video.VideoPlayer.Prepare`.
on't prepare the VideoPlayer before you play a video, the VideoPlayer.Play method will do the preparation but the video won't play instantly. If you use VideoPlayer.Stop , the VideoPlayer becomes unprepared again because it frees its resources for performance reasons. To halt a video but keep its preparation, use...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_41fb39036239
unity_docs
rendering
What is `ShaderUtil.GetTexDim` in Unity? Explain its purpose and usage.
ShaderUtil.GetTexDim Declaration public static Rendering.TextureDimension GetTexDim ( Shader s , int propertyIdx ); Parameters Parameter Description s The shader to get the property from. propertyIdx The property index to use. Returns TextureDimension Texture dimension. Description Gets texture...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_85cde15874c3
unity_docs
editor
Explain 'Search the Unity Editor main menu' in Unity.
Use the Menus search provider to access the Unity Editor main menu commands. ## Query syntax Provider token: m: Query example: List all menu commands related to splines, from all submenus. ``` m: splines ``` ## Provider filters The Menus provider has additional filters in the visual query builder . This table lists...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c511c53f4fd0
unity_docs
ui
What is `UIElements.ToggleButtonGroupState.ctor` in Unity? Explain its purpose and usage.
ToggleButtonGroupState Constructor Declaration public ToggleButtonGroupState (ulong optionsBitMask , int length ); Parameters Parameter Description optionsBitMask A bit value where each bit represents the binary state of the corresponding button. length The number of toggle button options. Description ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_106dbefa3d69
unity_docs
rendering
In Unity's 'Play video on mobile platforms', what is 'iOS' and how does it work?
Movie Textures are not supported on iOS. Instead, full-screen streaming playback is provided using Handheld.PlayFullScreenMovie . Keep your videos inside the StreamingAssets folder located in the Assets folder of your project. Unity iOS supports any movie file types that play correctly on an iOS device, implying files ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e25218edcde8
unity_docs
audio
What is `Gyroscope.rotationRate` in Unity? Explain its purpose and usage.
Gyroscope.rotationRate public Vector3 rotationRate ; Description Returns rotation rate as measured by the device's gyroscope. The rotation rate is given as a Vector3 representing the speed of rotation around each of the three axes in radians per second. This is the value as it is reported by the gyroscope ha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_4443dc71a872
unity_docs
ui
In Unity's 'Child selectors', what is 'Syntax' and how does it work?
A child selector consists of multiple simple selectors separated by > . ``` selector1 > selector2 {...} ``` You can include the wildcard selector in complex selectors. For example, the following USS rule uses the wildcard selector in a child selector . This USS rule matches buttons that are children of elements that ar...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0b217f9a0869
unity_docs
editor
What is `iOS.Xcode.PBXProject.InsertShellScriptBuildPhase` in Unity? Explain its purpose and usage.
PBXProject.InsertShellScriptBuildPhase Declaration public string InsertShellScriptBuildPhase (int index , string targetGuid , string name , string shellPath , string shellScript ); Parameters Parameter Description index The position at which to insert the new build phase. If it's higher than the total nu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_249577671607
unity_docs
xr
What is `ObjectChangeEventStream.GetDestroyAssetObjectEvent` in Unity? Explain its purpose and usage.
ObjectChangeEventStream.GetDestroyAssetObjectEvent Declaration public void GetDestroyAssetObjectEvent (int eventIdx , out DestroyAssetObjectEventArgs data ); Parameters Parameter Description eventIdx The index of the event to get the data for. data The data associated with the event. Description Retri...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3d89a6cde57d
unity_docs
editor
What is `EditorApplication.isTemporaryProject` in Unity? Explain its purpose and usage.
EditorApplication.isTemporaryProject public static bool isTemporaryProject ; Description Returns true if the current project was created as a temporary project. A temporary project is one that was created using the "-temporary" command line argument. It is located in a temporary location in the filesystem (e.g....
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0a6a4144d065
unity_docs
math
Show me a Unity C# example demonstrating `Mathf.Sqrt`.
Mathf.Sqrt Declaration public static float Sqrt (float f ); Description Returns square root of f . ```csharp using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { // The formula made famous by Pythagoras, also used internally by // Vector3.Distance and several other standa...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_198216ee6e96
unity_docs
input
What is `IMGUI.Controls.SearchField.searchFieldControlID` in Unity? Explain its purpose and usage.
SearchField.searchFieldControlID public int searchFieldControlID ; Description This is the controlID used for the text field to obtain keyboard focus. A controlID is allocated when the SearchField is created.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3b8c780cc0fd
unity_docs
rendering
What is `Texture3D.Apply` in Unity? Explain its purpose and usage.
Texture3D.Apply Declaration public void Apply (bool updateMipmaps = true, bool makeNoLongerReadable = false); Parameters Parameter Description updateMipmaps When the value is true , Unity recalculates mipmap levels, using mipmap level 0 as the source. The default value is true . makeNoLongerReadable ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e799636d4c6c
unity_docs
scripting
Show me a Unity C# example demonstrating `CrashReport`.
option to "Fast but no Exceptions". After you build your Xcode project in Unity, open it and edit trampoline file: Classes/CrashReporter.h. Change ENABLE_CUSTOM_CRASH_REPORTER define from 0 to 1. Note that the iOS Player Settings has a Crash Reporting setting with an "Enable CrashReport API". Note: this API currently i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_034234fc1fb2
unity_docs
rendering
What is `Experimental.GlobalIllumination.LightDataGI` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. LightDataGI struct in UnityEngine.Experimental.GlobalIllumination / Implemented in: UnityEngine.CoreModule Description The interop structure to pass light information to the light baking backends. There are helper structures ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_830bdfd94ecb
unity_docs
scripting
What are the parameters of `Handles.RectangleHandleCap` in Unity?
Description Draw a rectangle handle. Pass this into handle functions. On EventType.Layout event, calculates handle distance to mouse and calls HandleUtility.AddControl accordingly. On EventType.Repaint event, draws the handle shape. Rectangle 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_0ff6fac1f2d4
unity_docs
rendering
Give me an overview of the `WebCamKind` class in Unity.
WebCamKind enumeration Description Enum representing the different types of web camera device. On iOS devices, the WebCamDevice.kind is reported directly by the hardware. On Android devices, the hardware does not report this value, so Unity determines the WebCamDevice.kind by calculating the Equivalent Focal ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_069741f24bee
unity_docs
physics
Explain 'Introduction to 2D' in Unity.
You can use Unity to create 2D projects. This page introduces the gameplay, graphics, and physics specific to 2D Unity projects. ## Gameplay in 2D The familiar functions of the Unity Editor when you use 3D mode are still available but with helpful additions to simplify 2D development. The most noticeable feature is t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_418eb6131002
unity_docs
scripting
What is `Rendering.BlendState.ctor` in Unity? Explain its purpose and usage.
BlendState Constructor Declaration public BlendState (bool separateMRTBlend , bool alphaToMask ); Parameters Parameter Description separateMRTBlend Determines whether each render target uses a separate blend state. alphaToMask Turns on alpha-to-coverage. Description Creates a new blend state with the sp...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b5e823bf82de
unity_docs
scripting
What is `Experimental.Rendering.IScriptableBakedReflectionSystemStageNotifier.SetIsDone` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. IScriptableBakedReflectionSystemStageNotifier.SetIsDone Declaration public void SetIsDone (bool isDone ); Parameters Parameter Description isDone Whether the baking is complete. Description Indicates whether the baking ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5c94a5fc00ea
unity_docs
scripting
Give me an overview of the `Il2CppStacktraceInformation` class in Unity.
Il2CppStacktraceInformation enumeration Description Stack trace information options to choose how much information to include in IL2CPP generated stack traces. Properties Property Description MethodOnly MethodOnly will only provide the method name in managed stack traces. MethodFileLineNumber MethodFileLineNum...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1b29ed85d24c
unity_docs
scripting
What is `RectInt.allPositionsWithin` in Unity? Explain its purpose and usage.
RectInt.allPositionsWithin public RectInt.PositionEnumerator allPositionsWithin ; Description A RectInt.PositionCollection that contains all positions within the RectInt . Positions within the RectInt are not inclusive of the positions on the upper limits of the RectInt. This iterator will only return positi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.