id
stringlengths
15
22
source
stringclasses
2 values
category
stringclasses
12 values
instruction
stringlengths
22
180
response
stringlengths
100
46.1k
system
stringclasses
5 values
local_man_5d5c1f7f2e62
unity_docs
editor
In Unity's 'Set up the Android SDK Target API', what is 'Older Target API version' and how does it work?
If you select a Target API version that’s not installed and is older than the latest installed version, the Unity Android SDK Updater can’t perform the update and Unity displays an error message. In this case, to update the Android SDK Target API, you must use the Android sdkmanager from either Android Studio or the co...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_46b90b00bb91
unity_docs
rendering
In Unity's 'UsePass directive in ShaderLab reference', what is 'Syntax' and how does it work?
Signature Function UsePass "Shader object name/PASS NAME IN UPPERCASE" Inserts the named Pass from the named Shader object. If the named Shader object contains more than one SubShader, Unity iterates over the SubShaders until it finds the first supported SubShader that contains a Pass with the given name. For informati...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b56dff0d1f3b
unity_docs
math
What is `Quaternion.operator_multiply` in Unity? Explain its purpose and usage.
Quaternion.operator * public static Quaternion operator * ( Quaternion lhs , Quaternion rhs ); Parameters Parameter Description lhs Left-hand side quaternion. rhs Right-hand side quaternion. Description Combines rotations lhs and rhs . Rotating by the product lhs * rhs is the same as apply...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_1508d8be65e1_doc_0
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
Affordance component used in conjunction with a to display an objectpointing at the target teleport destination while climbing. Signature: ```csharp public class ClimbTeleportDestinationIndicator : MonoBehaviour ```
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_man_05f1557b2467
unity_docs
physics
In Unity's 'Configure driving forces on a Configurable Joint', what is 'Apply a target position' and how does it work?
To apply a spring-like behavior that always tries to return the object to a specified position or rotation, set a target position . You can set a linear position, a rotational position, or both. To set a position in the space defined by Axis , use the Target Position ’s X , Y and Z values. To set a rotation the space d...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_912e9b42db26
unity_docs
audio
What is `AudioDataLoadState.Unloaded` in Unity? Explain its purpose and usage.
AudioDataLoadState.Unloaded Description Value returned by AudioClip.loadState for an AudioClip that has no audio data loaded and where loading has not been initiated yet. This is the initial value of AudioClip.loadState that has the option "Preload audio data" unchecked.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0ffa0805037e
unity_docs
scripting
Give me an overview of the `ApplicationSandboxType` class in Unity.
ApplicationSandboxType enumeration Description Application sandbox type. Properties Property Description Unknown Application sandbox type is unknown. NotSandboxed Application not running in a sandbox. Sandboxed Application is running in a sandbox. SandboxBroken Application is running in broken sandbox.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_2ffee8941865
unity_docs
ui
In Unity's 'DropdownField', what is 'Examples' and how does it work?
The following UXML example creates a DropdownField: ``` <UXML xmlns="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements"> <DropdownField label="UXML Field" name="the-uxml-field" /> </UXML> ``` The following C# example illustrates some of the customizable functionalities of the DropdownField: ``` /// <sample> //...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6134c26db230
unity_docs
rendering
What is `Rendering.BatchDrawCommandFlags.UseLegacyLightmapsKeyword` in Unity? Explain its purpose and usage.
BatchDrawCommandFlags.UseLegacyLightmapsKeyword Description The draw command has USE_LEGACY_LIGHTMAPS keyword enabled. When this flag is set, BatchDrawCommand.lightmapIndex is used to determine batching. Additional resources: BatchDrawCommand.lightmapIndex .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a615ce952eda
unity_docs
performance
What is `Unity.Jobs.LowLevel.Unsafe.JobsUtility.GetWorkStealingRange` in Unity? Explain its purpose and usage.
JobsUtility.GetWorkStealingRange Declaration public static bool GetWorkStealingRange (ref Unity.Jobs.LowLevel.Unsafe.JobRanges ranges , int jobIndex , out int beginIndex , out int endIndex ); Returns bool Returns true if successful. Description Gets a work stealing range.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_ece6df705310
unity_docs
scripting
In Unity's 'Leaderboards Building Block', what is 'Deploy the Cloud Code modules' and how does it work?
The test scene uses the BlocksGameModule.ccmr Cloud Code module to update the global score. To use this Cloud Code module, deploy it in the scene: Set up deployment in your project . Go to Services > Deployment . In the Deployment window, expand the Blocks.CloudCode section. Select the BlocksGameModule.ccmr and BlocksA...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_79402c32f441
unity_docs
math
What is `Rendering.BatchCullingOutputDrawCommands.visibleInstanceCount` in Unity? Explain its purpose and usage.
BatchCullingOutputDrawCommands.visibleInstanceCount public int visibleInstanceCount ; Description The number of elements in the BatchCullingOutputDrawCommands.visibleInstances array. You must set this in the OnPerformCulling callback.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_c3475ad168a3
unity_docs
scripting
Show me a Unity code example for 'Property visitors'.
o get started. However, for more extensive customization of the visitation behavior for both the property bags and the properties, use the second approach, which offers greater flexibility and the potential for performance improvements. The following example uses the PropertyVisitor class to create a simple visitor tha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_de87a00b2c23
unity_docs
editor
Show me a Unity C# example demonstrating `Debug.developerConsoleVisible`.
onsoleVisible ; Description Controls whether the development console is visible. The developer console is a window that can appear when a development build of your project is running. It is similar to the Console window in the Editor, but appears at runtime. The development console automatically appears when an er...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_0612d5b49cd0
unity_docs
rendering
In Unity's 'Introduction to the BatchRendererGroup API in URP', what is 'Render pipeline compatibility' and how does it work?
The following table shows which render pipelines support BRG. Feature name Universal Render Pipeline (URP) High Definition Render Pipeline (HDRP) Custom SRP Built-in Render Pipeline BatchRendererGroup Yes (1) Yes (1) Yes (1) No Notes : If the project uses the SRP Batcher.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_33ce76c4cfe5
unity_docs
xr
Show me a Unity C# example demonstrating `Android.Permission.ShouldShowRequestPermissionRationale`.
ng permission ); Parameters Parameter Description permission A string identifier for permission. This is the value of Android constant. Returns bool The value returned by equivalent Android method. Description Check whether to display the UI explaining the reason for permission before requesting it. Fo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7cc82cb49d3a
unity_docs
ui
What is `UIElements.PenButton` in Unity? Explain its purpose and usage.
PenButton enumeration Description Describes a PenButton. Based on W3 conventions: https://www.w3.org/TR/pointerevents2/#the-buttons-property. Properties Property Description PenContact The Pen is in Contact. PenBarrel The Pen Barrel Button. PenEraser The Pen Eraser.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_61135bc23e27
unity_docs
scripting
What is `PlayerSettings.enableFrameTimingStats` in Unity? Explain its purpose and usage.
PlayerSettings.enableFrameTimingStats public static bool enableFrameTimingStats ; Description Enable frame timing statistics. When enabled, the player collects CPU and GPU frame timing statistics. You can access these statistics using the FrameTimingManager class.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_660e43c41225
unity_docs
scripting
What is `BrokenPrefabAsset` in Unity? Explain its purpose and usage.
BrokenPrefabAsset class in UnityEditor / Inherits from: DefaultAsset Description BrokenPrefabAsset is for Prefab files where the file content cannot be loaded without errors. A Prefab Asset can be broken if the content of the file invalid or if it is a Variant Prefab where the parent Prefab is either invalid or...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_fd6ddaf2053f
unity_docs
scripting
What is `Networking.UploadHandlerRaw` in Unity? Explain its purpose and usage.
UploadHandlerRaw class in UnityEngine.Networking / Inherits from: Networking.UploadHandler / Implemented in: UnityEngine.UnityWebRequestModule Description A general-purpose UploadHandler subclass, using a native-code memory buffer. This subclass copies input data into a native-code memory buffer at construc...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c79784fb439a
unity_docs
scripting
What is `GUI.SetNextControlName` in Unity? Explain its purpose and usage.
GUI.SetNextControlName Declaration public static void SetNextControlName (string name ); Description Set the name of the next control. This makes the following control be registered with a given name. Additional resources: GetNameOfFocusedControl , FocusControl . ```csharp // Sets the login textfield with "...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b883eb4d6442
unity_docs
physics
What is `IMGUI.Controls.JointAngularLimitHandle.yRange` in Unity? Explain its purpose and usage.
JointAngularLimitHandle.yRange public Vector2 yRange ; Description Returns or specifies the range of valid values for angular motion about the y-axis. Defaults to [-180.0, 180.0]. The x-value is the lower limit of the range and the y-value is the upper limit of the range. Additional resources: yMin , yMax .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3c6f0e17d9bc
unity_docs
editor
In Unity's 'Set a layerMask', what is 'Use a serialized layerMask property' and how does it work?
The simplest way to set a layermask in the Unity Editor is to create a property that uses Unity’s LayerMask class. If the property is public or uses the SerializeField attribute, Unity provides an interface in the Inspector that you can use to select which layers the layermask represents. ```csharp using UnityEngine; ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3971bb2d1126
unity_docs
math
What is `IMGUI.Controls.ArcHandle.DefaultAngleHandleSizeFunction` in Unity? Explain its purpose and usage.
ArcHandle.DefaultAngleHandleSizeFunction Declaration public static float DefaultAngleHandleSizeFunction ( Vector3 position ); Parameters Parameter Description position The current position of the handle in the space of Handles.matrix . Returns float The size to use for a handle at the specified positio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0cad7c8790bf
unity_docs
editor
What is `EditorGUI.DrawRect` in Unity? Explain its purpose and usage.
EditorGUI.DrawRect Declaration public static void DrawRect ( Rect rect , Color color ); Parameters Parameter Description rect The position and size of the rectangle to draw. color The color of the rectange. Description Draws a filled rectangle of color at the specified position and size within the cu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a6fe6172a804
unity_docs
scripting
Show me a Unity C# example demonstrating `XR.XRDisplaySubsystem.displayFocusChanged`.
XRDisplaySubsystem.displayFocusChanged Parameters Parameter Description value Delegate method to call when the event is sent. Description Event sent when XR display focus changes. This event is sent on the main thread. ```csharp using UnityEngine; using UnityEngine.XR;public class ExampleClass : MonoBehaviour...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_74537c9197a6
unity_docs
scripting
What is `UIElements.Slider` in Unity? Explain its purpose and usage.
Slider class in UnityEngine.UIElements / Inherits from: UIElements.BaseSlider_1 / Implemented in: UnityEngine.UIElementsModule Description A slider containing floating point values. The Slider control is a horizontal or vertical bar with a handle that can be moved to select a value from a range. The rang...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_44b8979732a1
github
scripting
Write a Unity C# MonoBehaviour script called Player Behaviour
```csharp using UnityEngine; [RequireComponent(typeof(Player))] abstract class PlayerBehaviour : MonoBehaviour { public virtual void OnPlayerCreate(Player player) { _player = player; } public virtual void OnPlayerPreUpdate() { } public virtual void OnPlayerUpdate() { } public virtual...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_898ad4c3546a
unity_docs
rendering
What is `Terrain.drawTreesAndFoliage` in Unity? Explain its purpose and usage.
Terrain.drawTreesAndFoliage public bool drawTreesAndFoliage ; Description Specify if terrain trees and details should be drawn. If disabled, this will also disable updates to renderer positions for trees and details. Tree and detail renderer positions will update again once this setting is re-enabled.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8c1bf87897ae
unity_docs
animation
What is `PlayMode` in Unity? Explain its purpose and usage.
PlayMode enumeration Description Used by Animation.Play function. Properties Property Description StopSameLayer Will stop all animations that were started in the same layer. This is the default when playing animations. StopAll Will stop all animations that were started with this component before playing.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_107572c52b4e
unity_docs
ui
What are the parameters of `GUI.FocusControl` in Unity?
Description Move keyboard focus to a named control. Additional resources: SetNextControlName , GetNameOfFocusedControl . For focusing text in Editor GUI text fields, see EditorGUI.FocusTextInControl . ```csharp using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { // When pressed t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_75dffc677c57
unity_docs
math
Give me an overview of the `HashUtilities` class in Unity.
HashUtilities class in UnityEngine / Implemented in: UnityEngine.CoreModule Description Utilities to compute hashes. Static Methods Method Description AppendHash Append inHash in outHash. ComputeHash128 Compute a 128 bit hash based on a value. the type of the value must be a value type. QuantisedMatrixHash...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5103721bd65f
unity_docs
rendering
Give me an overview of the `Cubemap` class in Unity.
Cubemap class in UnityEngine / Inherits from: Texture / Implemented in: UnityEngine.CoreModule Description Class for handling cube maps, Use this to create or modify existing cube map assets . This class does not support Cubemap creation with a Crunch compression TextureFormat . Properties Property Descr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4f2aefdef5f8
unity_docs
scripting
Show me a Unity C# example demonstrating `ClosestPointCommand`.
are performed asynchronously and in parallel to each other. The results of the closest points are written to the results buffer. Because the results are written asynchronously, the results buffer cannot be accessed until the job has been completed. The result for a command at index N in the command buffer is stored at ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_0bac0407f08c
github
scripting
Write a Unity Editor script for Lynx Scrollbar Editor
```csharp // ============================================================================== // | LynxInterfaces (2023) | // |====================================== | // | LynxToggleButton Editor Script ...
You are a knowledgeable Unity developer. Explain Unity concepts clearly and provide practical, tested code examples.
local_man_8d0362fafaac
unity_docs
physics
Explain 'Search settings and preferences' in Unity.
Use the Settings search provider to find settings in the Project Settings and Preferences windows. ## Query syntax Provider token: set: Query example: Searches for all light-related settings and preferences. ``` set: light ``` ## Provider filters The Settings provider has additional filters in the visual query buil...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c7dae6b7728d
unity_docs
animation
What is `Animation.Blend` in Unity? Explain its purpose and usage.
Animation.Blend Declaration public void Blend (string animation , float targetWeight = 1.0F, float fadeLength = 0.3F); Description Blends the animation named animation towards targetWeight over the next time seconds. Playback of other animations will not be affected.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_63e65d356e41
unity_docs
scripting
What is `ArticulationBody.maxLinearVelocity` in Unity? Explain its purpose and usage.
ArticulationBody.maxLinearVelocity public float maxLinearVelocity ; Description The maximum linear velocity of the articulation body measured in meters per second. The linear velocity of articulation bodies is clamped to maxLinearVelocity to avoid numerical instability with fast moving bodies. The maxLinearVel...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8fced66be96a
unity_docs
scripting
In Unity's 'Vector3IntField', what is 'Create a Vector3IntField' and how does it work?
You can create a Vector3IntField with UI Builder, UXML, and C#. The following C# example creates a Vector3IntField with the default value (15, 12, 14) : ``` Vector3IntField myElement = new Vector3IntField("Label text"); // Set the default value to (15, 12, 14). myElement.value = new Vector3Int(15, 12, 14); ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_84bf2e2c9e36
unity_docs
input
In Unity's 'Manipulators', what is 'Examples' and how does it work?
The following examples demonstrate how to use manipulators to handle events. They do the following: Inherit the manipulators from the PointerManipulators class, which handles mouse input. Use the activators list to specify the conditions that activate the manipulator. For example, to activate the manipulator when the u...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2fcfc24be500
unity_docs
physics
Give me an overview of the `RigidbodyInterpolation2D` class in Unity.
RigidbodyInterpolation2D enumeration Description Interpolation mode for Rigidbody2D objects. Properties Property Description None Do not apply any smoothing to the object's movement. Interpolate Smooth movement based on the object's positions in previous frames. Extrapolate Smooth an object's movement based o...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_79e18c35e04d
unity_docs
rendering
What is `LightingSettings.filteringGaussianRadiusDirect` in Unity? Explain its purpose and usage.
LightingSettings.filteringGaussianRadiusDirect public float filteringGaussianRadiusDirect ; Description Specifies the radius the Progressive Lightmapper uses to filter the indirect lighting component of the lightmap when you use the Gaussian filter. (Editor only). The range is 0.0 through 5.0. The default val...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c11b7313a1fb
unity_docs
physics
What is `Rigidbody2D.AddRelativeForceY` in Unity? Explain its purpose and usage.
Rigidbody2D.AddRelativeForceY Declaration public void AddRelativeForceY (float force , ForceMode2D mode = ForceMode2D.Force); Parameters Parameter Description force The force to add to the Y component of the Linear Velocity in the local space of the Rigidbody2D . mode The method used to apply the spec...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f5255d55033d
unity_docs
scripting
Show me a Unity C# example demonstrating `SystemLanguage.Bulgarian`.
SystemLanguage.Bulgarian Description Bulgarian. ```csharp using UnityEngine;public class Example : MonoBehaviour { void Start() { //This checks if your computer's operating system is in the Bulgarian language if (Application.systemLanguage == SystemLanguage.Bulgarian) { //Outputs into console that the system ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8816f4cc12c7
unity_docs
scripting
What is `Experimental.GlobalIllumination.AngularFalloffType.AnalyticAndInnerAngle` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. AngularFalloffType.AnalyticAndInnerAngle Description No falloff inside inner angle then compute falloff using analytic formula.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_7b17cba2cde1
unity_docs
scripting
What is `AndroidApplicationEntry` in Unity? Explain its purpose and usage.
AndroidApplicationEntry enumeration Description Options for which application entries to include when Unity generates a Gradle project. Properties Property Description Activity Include an application entry which derives from the Activity class. GameActivity Include an application entry which derives from the G...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f327bb1b1be6
unity_docs
editor
Show me a Unity C# example demonstrating `EditorApplication.wantsToQuit`.
uit. Add an event handler to this event to receive a notification that the application is attempting to quit. When this event is raised the quit process has started but can be cancelled. This means the editor is not guaranteed to quit. For a guaranteed quit event take a look at EditorApplication.quitting Return true ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_28bf1879652f
unity_docs
rendering
What is `Rendering.CommandBuffer.SetRayTracingShaderPass` in Unity? Explain its purpose and usage.
CommandBuffer.SetRayTracingShaderPass Declaration public void SetRayTracingShaderPass ( Rendering.RayTracingShader rayTracingShader , string passName ); Parameters Parameter Description rayTracingShader RayTracingShader to set parameter for. passName The Shader Pass to use when executing ray tracing sha...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6991481cdfcc
unity_docs
input
Show me a Unity code example for 'TextField'.
to ensure that the entered data meets certain requirements. Note : To align a TextField with other fields in an Inspector window, simply apply the.unity-base-field__aligned USS class to it. For more information, refer to BaseField . ## Create a TextField You can create a TextField with UI Builder, UXML, and C#. The f...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_95787382ac5f
unity_docs
rendering
Give me an overview of the `ImageConversion` class in Unity.
ImageConversion class in UnityEngine / Implemented in: UnityEngine.ImageConversionModule Description This class provides utility and extension methods to convert image data to and from PNG, JPEG and EXR formats, and to encode image data to TGA format. Static Properties Property Description EnableLegacyPngGam...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_621d946bb68d
unity_docs
scripting
What is `Light.spotAngle` in Unity? Explain its purpose and usage.
Light.spotAngle public float spotAngle ; Description The angle of the spot light's cone in degrees. This is used primarily for Spot lights and has no effect for Point lights Additional resources: Light component . ```csharp using UnityEngine;public class Example : MonoBehaviour { // Change spot angle ra...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_dd146d5321c0
unity_docs
scripting
Show me a Unity C# example demonstrating `Logger.LogWarning`.
tring tag , object message , Object context ); Parameters Parameter Description tag Used to identify the source of a log message. It usually identifies the class where the log call occurs. message String or object to be converted to string representation for display. context Object to which the message ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8b4c03495cdc
unity_docs
editor
Show me a Unity C# example demonstrating `AssetDatabase.GetCacheServerPort`.
n Editor Settings. Returns 0 if Port number is not set in Editor Settings. Description Gets the Port number of the Cache Server in Editor Settings. Note: If you set a new value for the Port number, your new settings are not applied until you call AssetDatabase.RefreshSettings(). However, this method will return th...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_89184a6a3fe0
unity_docs
math
What is `Rendering.CullingResults.ComputeDirectionalShadowMatricesAndCullingPrimitives` in Unity? Explain its purpose and usage.
CullingResults.ComputeDirectionalShadowMatricesAndCullingPrimitives Declaration public bool ComputeDirectionalShadowMatricesAndCullingPrimitives (int activeLightIndex , int splitIndex , int splitCount , Vector3 splitRatio , int shadowResolution , float shadowNearPlaneOffset , out Matrix4x4 viewMatrix , ou...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5e1e3808b532
unity_docs
rendering
Show me a Unity C# example demonstrating `ParticleSystemRenderer.SetActiveVertexStreams`.
ParticleSystemRenderer.SetActiveVertexStreams Declaration public void SetActiveVertexStreams (List<ParticleSystemVertexStream> streams ); Parameters Parameter Description streams The new array of enabled vertex streams. Description Enables a set of Vertex Shader streams on the ParticleSystemRenderer . Ad...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4f07ddc34ebf
unity_docs
scripting
What is `AndroidJNI.ExceptionDescribe` in Unity? Explain its purpose and usage.
AndroidJNI.ExceptionDescribe Declaration public static void ExceptionDescribe (); Description Prints an exception and a backtrace of the stack to the logcat 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_b663fe68e9e2
unity_docs
editor
What is `Search.SearchProvider.isExplicitProvider` in Unity? Explain its purpose and usage.
SearchProvider.isExplicitProvider public bool isExplicitProvider ; Description This search provider is only active when specified explicitly using the filterId. ```csharp using UnityEditor; using UnityEditor.Search; using UnityEngine; static class SearchProvider_isExplicitProvider { internal static string typ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6fcaffa7f5e5
unity_docs
xr
What is `Caching.compressionEnabled` in Unity? Explain its purpose and usage.
Caching.compressionEnabled public static bool compressionEnabled ; Description Controls compression of cache data. Enabled by default. If cache compression is enabled, then all data will be stored in a compressed form using fast LZ4 algorithm. This property affects only further downloads. It doesn't compress or...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_7587ad461bea
unity_docs
xr
Explain 'Details panel reference' in Unity.
The right panel of the Package Manager window displays details for the selected package. These details include the following information: (A) The display name. (B) The package version , the date the package was published to the registry or the Asset Store, and any source or asset labels . Other information might displa...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3c0b165ba859
unity_docs
math
What is `Experimental.GraphView.StackNode.GetInsertionIndex` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. StackNode.GetInsertionIndex Declaration public int GetInsertionIndex ( Vector2 worldPosition ); Parameters Parameter Description worldPosition The world position to get an index from. Returns int Returns the insertio...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_0f024482d86e
unity_docs
rendering
Explain 'Toon shading Surface Shader example in the Built-In Render Pipeline' in Unity.
The following example shows a “Ramp” lighting model that uses a Texture ramp to define how surfaces respond to the angles between the light and the normal. This can be used for a variety of effects, and is especially effective when used with Toon lighting. ```csharp ...ShaderLab code... CGPROGRAM #pragma surface surf...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_78a667eecf72
unity_docs
editor
What is `EditorGUILayout.LabelField` in Unity? Explain its purpose and usage.
EditorGUILayout.LabelField Declaration public static void LabelField (string label , params GUILayoutOption[] options ); Declaration public static void LabelField (string label , GUIStyle style , params GUILayoutOption[] options ); Declaration public static void LabelField ( GUIContent label , param...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_e4ec3883399c
github
scripting
Write a Unity C# XR/VR script for Brush Lister
```csharp // Copyright 2021 The Tilt Brush Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicab...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
gh_32bf1d62537c
github
scripting
Write a Unity C# script called Mesh Builder
```csharp using Wrld.Common.Maths; using System.Collections.Generic; using System.Linq; using UnityEngine; namespace Wrld.Meshes { public static class MeshBuilder { public static PreparedMesh[] CreatePreparedMeshes(Vector3[] verts, Vector2[] uvs, Vector2[] uv2s, Vector3[] normals, Color32[] co...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_f74aa81def5c
unity_docs
rendering
What is `Light.useViewFrustumForShadowCasterCull` in Unity? Explain its purpose and usage.
Light.useViewFrustumForShadowCasterCull public bool useViewFrustumForShadowCasterCull ; Description Whether to cull shadows for this Light when the Light is outside of the view frustum. Set this to true to calculate shadows for the Light only when it is within the view frustum, and cull shadows for this Light ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_202783e46683
unity_docs
rendering
What is `MaterialEditor.GetFlexibleRectBetweenLabelAndField` in Unity? Explain its purpose and usage.
MaterialEditor.GetFlexibleRectBetweenLabelAndField Declaration public static Rect GetFlexibleRectBetweenLabelAndField ( Rect r ); Parameters Parameter Description r Field Rect. Returns Rect A sub rect of the input Rect. Description Utility method for GUI layouting ShaderGUI.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e6ef8c1c2676
unity_docs
scripting
In Unity's 'LayerMaskField', what is 'Create a LayerMaskField' and how does it work?
You can create a LayerMaskField with UI Builder, UXML, and C#. The following C# example creates a LayerMaskField with the default value: ``` LayerMaskField myElement = new LayerMaskField("Label text"); // Sets the default value to 0. myElement.value = 0; ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6b192c083f88
unity_docs
scripting
Give me an overview of the `SnapAxis` class in Unity.
SnapAxis enumeration Description Defines the axes that can be snapped. Properties Property Description None No axes support snapping. X Snapping is available only on the \x\ axis. Y Snapping is available only on the \y\ axis. Z Snapping is available only on the \z\ axis. All Snapping is available on all axe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5c379aac38c2
unity_docs
rendering
In Unity's 'Make shader behavior conditional on keywords', what is 'Branch when all keywords in a set are disabled' and how does it work?
To execute code when all keywords in a shader_feature or multi_compile set are disabled, Unity must create an additional shader variant for that state. If you use shader_feature to create a single keyword, Unity automatically creates an additional shader variant. For example: ``` // Creates a variant for when FEATURE_1...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_2ddcb0636c36
github
scripting
Write a Unity C# animation script for Abstract Character View
```csharp using PacEngine.characters; using PacEngine.utils; using UnityEngine; using DG.Tweening; public abstract class AbstractCharacterView : MonoBehaviour { private const string ANIMTOR_X_VELOCITY = "xVelocity"; private const string ANIMTOR_Y_VELOCITY = "yVelocity"; public AbstractCharacter...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_fd79fe125a91
unity_docs
editor
What is `PlayerConnectionInitiateMode` in Unity? Explain its purpose and usage.
PlayerConnectionInitiateMode enumeration Description Describes how the player connects to the Editor. Properties Property Description None Player connection mode not set. PlayerConnectsToHost Player connection is initiated by the player connecting to the host, usually the host is the Editor. PlayerListens Pla...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6df702605110
unity_docs
math
What is `SceneView.LookAtDirect` in Unity? Explain its purpose and usage.
SceneView.LookAtDirect Declaration public void LookAtDirect ( Vector3 point , Quaternion direction ); Declaration public void LookAtDirect ( Vector3 point , Quaternion direction , float newSize ); Parameters Parameter Description point The position in world space to frame. direction The direc...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_2eea86ab0044
unity_docs
rendering
What is `Rendering.LightEvent.BeforeShadowMapPass` in Unity? Explain its purpose and usage.
LightEvent.BeforeShadowMapPass Description Before shadowmap pass is rendered. When this event is triggered, the shadowmap render target has been set and cleared, but shadow casters in the pass have not yet been rendered. This event differs from LightEvent.BeforeShadowMap in that for light types that render shadow...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_590d232ecd71
unity_docs
editor
What is `Search.SearchIndexer.AddWord` in Unity? Explain its purpose and usage.
SearchIndexer.AddWord Declaration public void AddWord (string word , int score , int documentIndex ); Declaration public void AddWord (string word , int size , int score , int documentIndex ); Declaration public void AddWord (string word , int minVariations , int maxVariations , int score , int d...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_177778e82b95_doc_1
github
scripting
What does `this member` do in this Unity script? Explain its purpose and signature.
class WorldContextsManagerUtilsThe static class contains helper methods to initialize WorldContextsManager Signature: ```csharp public static class WorldContextsManagerUtils ```
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_man_987b54e830e4
unity_docs
animation
Explain 'Legacy Animation component' in Unity.
This is the Legacy Animation component, which was used on GameObjects for animation purposes prior to the introduction of the Mecanim Animation system. This component is retained in Unity for backwards compatibility. For new projects, use the Animator component . ## Properties Property Function Animation The default ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_914da9f65746
unity_docs
scripting
What is `Experimental.Rendering.GraphicsFormat.R16G16B16A16_UInt` in Unity? Explain its purpose and usage.
Experimental : this API is experimental and might be changed or removed in the future. GraphicsFormat.R16G16B16A16_UInt Description A four-component, 64-bit unsigned integer format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B component in bytes 4..5, and a 16-bit A com...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_eaf7395f1911
unity_docs
scripting
What is `UIElements.UxmlFloatAttributeDescription.GetValueFromBag` in Unity? Explain its purpose and usage.
UxmlFloatAttributeDescription.GetValueFromBag Declaration public float GetValueFromBag ( UIElements.IUxmlAttributes bag , UIElements.CreationContext cc ); Parameters Parameter Description bag The bag of attributes. cc The context in which the values are retrieved. Returns float The value of the att...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_6fa11e40e80e
unity_docs
rendering
In Unity's 'Windows Player settings', what is 'Resolution' and how does it work?
This section allows you to customize the screen mode and default size. Property Description Run In Background Enable this option to allow the application to run in the background when it loses focus. When disabled, the application pauses when it loses focus. Fullscreen Mode Choose the full-screen mode. This defines the...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5cd5a71e9c5f
unity_docs
scripting
What is `Vector3.ctor` in Unity? Explain its purpose and usage.
Vector3 Constructor Declaration public Vector3 (float x , float y , float z ); Description Creates a new vector with given x, y, z components. ```csharp //Attach this script to a GameObject. //Attach a Rigidbody component to the GameObject (Click Add Component button in the Inspector window and go to Physics...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_699bca61a9f0
unity_docs
scripting
What is `TerrainData.detailResolutionPerPatch` in Unity? Explain its purpose and usage.
TerrainData.detailResolutionPerPatch public int detailResolutionPerPatch ; Description Detail Resolution of each patch. A larger value will decrease the number of batches used by detail objects.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e6cdcfd30666
unity_docs
xr
In Unity's 'OpenXR Plugin', what is 'Compatible with Unity' and how does it work?
These package versions are available in Unity version 6000.0: Documentation location: State Versions available: com.unity.xr.openxr@1.17 compatible 1.17.0-pre.1, 1.17.0-pre.2 com.unity.xr.openxr@1.16 released 1.16.1
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b58856daf0b6
unity_docs
scripting
What is `IMGUI.Controls.TreeView.BeforeRowsGUI` in Unity? Explain its purpose and usage.
TreeView.BeforeRowsGUI Declaration protected void BeforeRowsGUI (); Description This is called before any rows have their RowGUI called. Can be used together with AfterRowsGUI to postprocess items or rendering.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_c4d375a2d9c9
unity_docs
audio
In Unity's 'Validate and upload assets to your package', what is 'Upload assets to the Publisher Portal' and how does it work?
Use the Asset Store Uploader to create and upload a.unitypackage file that includes your assets to the Publisher Portal. To do this: In the Main Menu, select Tools > Asset Store > Uploader . Enter your Unity ID login details. Select the package draft to add these assets to. Select Export and Upload . Open the Publisher...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f5d6bfb401d2
unity_docs
scripting
What is `Unity.Android.Gradle.Dependencies` in Unity? Explain its purpose and usage.
Dependencies class in Unity.Android.Gradle / Inherits from: Unity.Android.Gradle.BaseBlock Description The C# definition of the dependencies element in a gradle file. For more information about the element, see Android's documentation: dependencies Constructors Constructor Description Dependencies Elemen...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f5f4de39df4e
unity_docs
scripting
What is `ModelImporterMeshCompression.High` in Unity? Explain its purpose and usage.
ModelImporterMeshCompression.High Description High amount of mesh compression. Vertex positions, normals/tangents and UVs will be quantized to respectively 10, 6, 8 bits per component. Skinning information will be compressed. Additional resources: ModelImporter.meshCompression .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8154566c15b6
unity_docs
rendering
What is `Camera.SetTargetBuffers` in Unity? Explain its purpose and usage.
Camera.SetTargetBuffers Declaration public void SetTargetBuffers ( RenderBuffer colorBuffer , RenderBuffer depthBuffer ); Declaration public void SetTargetBuffers (RenderBuffer[] colorBuffer , RenderBuffer depthBuffer ); Parameters Parameter Description colorBuffer The RenderBuffer(s) to which c...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1754736a9a06
unity_docs
scripting
What is `MonoBehaviour.Reset` in Unity? Explain its purpose and usage.
MonoBehaviour.Reset() Description Reset a component to default values. Reset is called when you select Reset in the Inspector's context menu or when you add a component for the first time, either by dragging and dropping in the Inspector or by calling GameObject.AddComponent from an Editor script. Reset is mos...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3466c7c9f99b
unity_docs
physics
What is `Collider.OnTriggerStay` in Unity? Explain its purpose and usage.
Collider.OnTriggerStay(Collider) Parameters Parameter Description other The other Collider involved in this collision. Description OnTriggerStay is called almost all the frames for every Collider other that is touching the trigger. The function is on the physics timer so it won't necessarily run every fra...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_a71660bf6b8a
unity_docs
rendering
In Unity's 'Graphics', what is 'Shader stripping' and how does it work?
These properties allow you to configure shader variant stripping in your build. By default, Unity examines the scenes in the build and automatically strips shader variants that are not used in those scenes. However, this can cause problems if you want to use shaders or variants at runtime that would not otherwise be in...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_534f1274e605
unity_docs
rendering
What is `Rendering.RenderPipelineAsset.default2DMaskMaterial` in Unity? Explain its purpose and usage.
RenderPipelineAsset.default2DMaskMaterial public Material default2DMaskMaterial ; Returns Material Returns the default material. Description Gets the default 2D Mask Material used by Sprite Masks in Universal Render Pipeline. This method returns the default material for Sprite Masks. Unity calls this ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_1150c83bd289
unity_docs
math
What is `AndroidJNI.CallStaticFloatMethodUnsafe` in Unity? Explain its purpose and usage.
AndroidJNI.CallStaticFloatMethodUnsafe Declaration public static float CallStaticFloatMethodUnsafe (IntPtr clazz , IntPtr methodID , jvalue* args ); Description Invokes the specified methodID static method on a Java object, optionally passing in an array of arguments ( args ). Additional resources: Java N...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4c374487efa8
unity_docs
editor
What are the parameters of `AssetDatabase.GetMainAssetTypeAtPath` in Unity?
Returns Type Returns the type of the main asset object at assetPath . Description Obtains the type of the main asset object. All paths are relative to the Project folder, for example: "Assets/MyTextures/hello.png". ```csharp using System.Collections.Generic; using UnityEngine; using UnityEditor;public class AssetDataba...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_0d6cf08f0b89
unity_docs
math
In Unity's 'Profiling low-level native plug-ins', what is 'IUnityProfilerCallbacks API callbacks' and how does it work?
The native Profiler plug-in API provides an interface between Unity’s subsystems and third-party profiling APIs so you can use an external profiling tool to profile your Unity application. The IUnityProfilerCallbacks header exposes the API, which Unity stores in the <UnityInstallPath>\Editor\Data\PluginAPI folder of yo...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_788eb09371c8
unity_docs
ui
Show me a Unity C# example demonstrating `PropertyAttribute.applyToCollection`.
PropertyAttribute.applyToCollection public bool applyToCollection ; Description Makes attribute affect collections instead of their items. ```csharp using UnityEditor; using UnityEditor.UIElements; using UnityEngine; using UnityEngine.UIElements;public class Collection : MonoBehaviour { public int before; [Gr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f294f487b83b
unity_docs
physics
Show me a Unity C# example demonstrating `CharacterController.OnControllerColliderHit`.
CharacterController.OnControllerColliderHit(ControllerColliderHit) Description OnControllerColliderHit is called when the controller hits a collider while performing a Move. This can be used to push objects when they collide with the character. ```csharp using UnityEngine;public class Example : MonoBehaviour { /...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_22630b8e6813
unity_docs
rendering
In Unity's 'Additional Search filters', what is 'Combine search tokens for complex searches' and how does it work?
You can combine search tokens to create more complex queries. The queries are written on one line with one character space between tokens. The character space between each new token is an “And” operation, so both filters must be true for the query to return a result. Add another operator (or, <, >) to return different ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_4c879d382394
unity_docs
scripting
Explain 'Check the status of an Asset Store asset package' in Unity.
When you submit a package to the Asset Store the package status changes from Draft to Pending Review . To check the approval status of your package: Open the Asset Store Publisher Portal . Select the All tab. Find the package you submitted for approval. Go to the Status column. A tab for each state appears when at leas...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_082c465c656a
unity_docs
rendering
What is `LightProbeProxyVolume.DataFormat` in Unity? Explain its purpose and usage.
DataFormat enumeration Description The texture data format used by the Light Probe Proxy Volume 3D texture. Additional resources: Light Probes , Light Probe Proxy Volume . Properties Property Description HalfFloat A 16-bit half floating-point format is used for the Light Probe Proxy Volume 3D texture. Floa...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_548d70bc3f99
unity_docs
scripting
What is `Search.PropertyDatabase.valid` in Unity? Explain its purpose and usage.
PropertyDatabase.valid public bool valid ; Description Boolean indicating if the PropertyDatabase is valid. The PropertyDatabase can be invalid if it has been disposed or if it wasn't opened properly.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.