id
stringlengths
15
22
source
stringclasses
2 values
category
stringclasses
12 values
instruction
stringlengths
22
180
response
stringlengths
100
46.1k
system
stringclasses
5 values
gh_3818d43b8521
github
scripting
Write a Unity C# XR/VR script for Start XR Button
```csharp using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; public class StartXRButton : MonoBehaviour { [SerializeField] private Text text; [SerializeField] private Button button; public void SetLabel(string label) { text.text = label; text.resizeTextForBestFit = true...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_3379f3d05868
unity_docs
rendering
Show me a Unity C# example demonstrating `ParticleSystemRenderer.normalDirection`.
ParticleSystemRenderer.normalDirection public float normalDirection ; Description Specifies how to calculate lighting for the billboard. A value of 0 means Unity calculates lighting as though the billboard was a sphere. This results in the billboard looking more like a sphere. A value of 1 means Unity calculate...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9ae30a40f154
unity_docs
scripting
What is `TerrainTools.TerrainPaintTool_1.OnExitToolMode` in Unity? Explain its purpose and usage.
TerrainPaintTool<T0>.OnExitToolMode Declaration public void OnExitToolMode (); Description Called when the tool becomes inactive. Unity calls this method when the tool is no longer the active tool.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8adaac687a84
unity_docs
scripting
What is `XR.InputDevices.deviceDisconnected` in Unity? Explain its purpose and usage.
InputDevices.deviceDisconnected Parameters Parameter Description value The InputDevice that just disconnected. Description Defines the delegate to use to register events when an InputDevice is disconnected. This delegate allows you to receive device disconnection events, so you know when the list of device...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_920891e64534
unity_docs
scripting
In Unity's 'Rig tab Import Settings reference', what is 'Animation Type' and how does it work?
The value you select for the Animation Type determines the layout for the Rig tab. By default, when you select a model in the Project view, Unity determines which Animation Type best matches the selected model and displays it in the Rig tab. If Unity has never imported the file, the Animation Type is set to None . Prop...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_52698fd235ab
unity_docs
scripting
Show me a Unity C# example demonstrating `AnimationState.normalizedSpeed`.
AnimationState.normalizedSpeed public float normalizedSpeed ; Description The normalized playback speed. This is most commonly used to synchronize playback speed when blending between two animations. In most cases it is easier and better to use Animation Layer syncing instead. ```csharp using UnityEngine; us...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_43a6474e54a7
unity_docs
performance
What is `Rendering.BatchCullingOutput.drawCommands` in Unity? Explain its purpose and usage.
BatchCullingOutput.drawCommands public NativeArray<BatchCullingOutputDrawCommands> drawCommands ; Description A single-element array of BatchCullingOutputDrawCommands that OnPerformCulling can write into without unnecessary copying.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e1a6d8ce842c
unity_docs
scripting
What is `Device.Screen.brightness` in Unity? Explain its purpose and usage.
Screen.brightness public static float brightness ; Description This has the same functionality as Screen.brightness . At the moment, the Device Simulator doesn't support simulation of this property.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_0c45fa5ca3c0
unity_docs
rendering
What is `InSceneAssetInformation.inSceneAsset` in Unity? Explain its purpose and usage.
InSceneAssetInformation.inSceneAsset public Object inSceneAsset ; Description The collected in-scene asset. In-scene assets are scene objects that are referenced by one or more objects in a scene and are of an asset type. Examples of asset types include, but are not limited to, Mesh , Material , and Scriptab...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8a6549db6c92
unity_docs
scripting
In Unity's 'License troubleshooting', what is 'Activation issues' and how does it work?
The following issues can cause error codes or other problems during the activation process: Issue Solution No internet access Serial-based license: You can activate your serial-based license with a license request. For more information, refer to Manual license activation . Named user license: You can’t activate a named...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_73c85084772d
unity_docs
scripting
What is `RenderPickingResult.NoOperation` in Unity? Explain its purpose and usage.
RenderPickingResult.NoOperation public static RenderPickingResult NoOperation ; Description The constant value to be returned from RenderPickingCallback delegates signifying that nothing has been rendered.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f21f19194e31
unity_docs
rendering
What is `Rendering.BatchCullingFlags.CullLightmappedShadowCasters` in Unity? Explain its purpose and usage.
BatchCullingFlags.CullLightmappedShadowCasters Description This culling invocation should cull static objects whose shadows have been baked in lightmaps. This flag will only be set when BatchCullingContext.viewType is BatchCullingViewType.Light , for lights that use a mixture of baked and dynamic shadows. When s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_9e04341fe61b
unity_docs
editor
In Unity's 'Create a command file to set environment variables and open applications', what is 'Create a command file (macOS and Linux)' and how does it work?
These instructions create an executable file named launchUnityHub.command . Close the Unity Hub, if it’s running. Open a Terminal window. Run the following command, adjusting as necessary: Include only the required environment variables, and set their values properly. Refer to Before you begin . Set the Hub path to mat...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c2138eff0f1c
unity_docs
scripting
What is `ShortcutManagement.ShortcutModifiers.Control` in Unity? Explain its purpose and usage.
ShortcutModifiers.Control Description Marks that the Control key modifier is part of the key combination. Resolves to control key on Windows, macOS, and Linux. For most cases it is best to use Action as it will represent the most appropriate action key for each particular platform.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b5e0a2205f5f
unity_docs
editor
What is `AssetDatabase.ValidateMoveAsset` in Unity? Explain its purpose and usage.
AssetDatabase.ValidateMoveAsset Declaration public static string ValidateMoveAsset (string oldPath , string newPath ); Parameters Parameter Description oldPath The path where the asset currently resides. newPath The path which the asset should be moved to. Returns string An empty string if the asset c...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_aa82c961cc11
unity_docs
animation
What is `Animations.TransformSceneHandle.GetPosition` in Unity? Explain its purpose and usage.
TransformSceneHandle.GetPosition Declaration public Vector3 GetPosition ( Animations.AnimationStream stream ); Parameters Parameter Description stream The AnimationStream that manages this handle. Returns Vector3 The position of the transform in world space. Description Gets the position of the tr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_6aacfab82af0
github
scripting
Write a Unity C# MonoBehaviour script called Behaviour With Qualified References
```csharp namespace AncientLightStudios.Nanoject.Tests { using UnityEngine; using AncientLightStudios.Nanoject; public class BehaviourWithQualifiedReferences : MonoBehaviour { public SimpleBehaviour First { get; private set; } public SimpleBehaviour Second { get; private set; } ...
You are an expert Unity game developer. Provide clear, accurate, and practical answers about Unity development.
local_man_46a4aecf7e6a
unity_docs
rendering
In Unity's 'Control when a Custom Render Texture updates', what is 'Update Zones' and how does it work?
When Unity updates a Custom Render Texture , it uses the Material to update the whole texture at once by default. The Custom Render Texture allows you to define zones of partial update. You can use this to define as many zones as you want and the order in which the zones are processed. You can use update zones for vari...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_260d70486628
unity_docs
rendering
Show me a Unity C# example demonstrating `Rendering.RenderPipelineManager.endContextRendering`.
stom Scriptable Render Pipeline, you must call the method yourself. This functionality is not compatible with the Built-in Render Pipeline. This delegate works in the same way as RenderPipelineManager.endFrameRendering , except that this version does not cause heap allocations. The following code example demonstrates ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bc28d5f61d60
unity_docs
scripting
Show me a Unity C# example demonstrating `ScreenOrientation.AutoRotation`.
ning properties to false. WebGL builds only support autorotation on the mobile Chrome browser, and only allows orienting to a subset of combinations, these are: Individual orientations Opposite pairs of orientations All four of the above orientations. If another combination is set, autorotation defaults to all four...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_94cfef734e0a
unity_docs
scripting
What is `AndroidJavaRunnable` in Unity? Explain its purpose and usage.
AndroidJavaRunnable Declaration public delegate void AndroidJavaRunnable (); Description AndroidJavaRunnable is the Unity representation of a java.lang.Runnable object. Note that this is a delegate. As such, a new java.lang.reflect.Proxy object is created every time it is passed as an argument to Java. This mea...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_533cee989e29
unity_docs
xr
What is `Screen.msaaSamples` in Unity? Explain its purpose and usage.
Screen.msaaSamples public static int msaaSamples ; Description Get the requested MSAA sample count of the screen buffer. Gets the sample count last requested by SetMSAASamples . This value might be different from the actual sample count that Unity uses for the render target during this frame, since Unity does ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_aaf58131340a
unity_docs
animation
What is `Animations.AnimatorControllerPlayable.HasState` in Unity? Explain its purpose and usage.
AnimatorControllerPlayable.HasState Declaration public bool HasState (int layerIndex , int stateID ); Parameters Parameter Description layerIndex The layer index. stateID The state ID. Returns bool True if the state exists in this layer, false otherwise. Description Returns true if the state exist...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_10caf7036525
unity_docs
math
Show me a Unity C# example demonstrating `Quaternion.SetFromToRotation`.
Quaternion.SetFromToRotation Declaration public void SetFromToRotation ( Vector3 fromDirection , Vector3 toDirection ); Description Creates a rotation which rotates from fromDirection to toDirection . Use this to create a rotation which starts at the first Vector (fromDirection) and rotates to the seco...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_24cc59591548
unity_docs
editor
What is `EditorUserBuildSettings.GetBuildLocation` in Unity? Explain its purpose and usage.
EditorUserBuildSettings.GetBuildLocation Declaration public static string GetBuildLocation ( BuildTarget target ); Description Returns the location used for the last saved build. The location is updated when you select Build in the Build Profiles window and choose a build location using the UI, or call E...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bf5d64dc4f8b
unity_docs
scripting
What is `AndroidJNI.GetDirectBufferCapacity` in Unity? Explain its purpose and usage.
AndroidJNI.GetDirectBufferCapacity Declaration public static long GetDirectBufferCapacity (IntPtr buffer ); Description Fetches and returns the capacity of the memory region referenced by the given direct java.nio.Buffer. 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_man_eb3cc20ab54f
unity_docs
scripting
Explain 'Build a Linux application' in Unity.
To build your Unity application on the Linux platform, use the following steps: Open the Build Profiles window (menu: File > Build Profiles ). From the list of platforms in the Platforms panel, select Linux or create a build profile for the Linux platform. Select Switch Profile to set the new build profile as the activ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_cadff438a072
unity_docs
editor
What are the parameters of `Search.QueryEngine_1.AddTypeParser` in Unity?
Description Adds a type parser that parses a string and returns a custom type. Used by custom operator handlers (see AddOperatorHandler ). <TFilterConstant>: The type of the parsed operand that is on the right-hand side of the operator. ```csharp using System.Collections.Generic; using System.Globalization; using Syste...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_ca6d19f11208
github
scripting
Write a Unity C# MonoBehaviour script called Filters Test Composition Root
```csharp using starikcetin.Joy.Core; using UnityEngine; namespace FiltersTest { public class FiltersTestCompositionRoot : MonoBehaviour { private Entity[] _entitiesAlreadyInScene; private void Awake() { RecordSceneEntities(); RegisterSystems(); } private void Start () { RegisterSceneEntities...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_man_c3556bede703
unity_docs
editor
Explain 'Import Activity window introduction' in Unity.
The Import Activity window provides you with information about what happens when Unity imports your assets. You can use this information to identify the assets in your project that Unity recently imported, how long each asset took to import, and why Unity imported it. This information can inform decisions about how to ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8e3c9de83599
unity_docs
editor
Show me a Unity C# example demonstrating `VersionControl.VersionControlManager.SetVersionControl`.
turns true if VCS has been activated. false otherwise. Description Sets the active version control system. If a different VCS was previously active, it will be deactivated. You can use the versionControlDescriptors property to retrieve all the available version control systems. You can check the newly activa...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_119f67fcb2c6
unity_docs
rendering
Show me a Unity C# example demonstrating `ParticleSystemRenderer.meshCount`.
ParticleSystemRenderer.meshCount public int meshCount ; Description The number of Meshes the system uses for particle rendering. Additional resources: ParticleSystemRenderer.renderMode . ```csharp using UnityEngine; using System.Collections;[RequireComponent(typeof(ParticleSystem))] public class ExampleClass ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b885db6748ea
unity_docs
scripting
What is `AndroidJNIHelper.CreateJavaProxy` in Unity? Explain its purpose and usage.
AndroidJNIHelper.CreateJavaProxy Declaration public static IntPtr CreateJavaProxy ( AndroidJavaProxy proxy ); Parameters Parameter Description proxy An implementatinon of a java interface in c#. Description Creates a java proxy object which connects to the supplied proxy implementation. Additional resour...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_d580c03076b5_doc_5
github
scripting
What does `GetCameraPoseInWorld` do in this Unity script? Explain its purpose and signature.
Returns the world pose of a passthrough camera at a given time.The LENS_POSE_TRANSLATION and LENS_POSE_ROTATION keys in 'android.hardware.camera2' are relative to the origin, so they can be cached to improve performance.The passthrough cameraThe passthrough camera's world pose Signature: ```csharp public static Pose G...
You are an experienced Unity developer specializing in C# scripting, XR/VR development, and performance optimization.
local_sr_d92129565de5
unity_docs
scripting
What is `Android.AndroidSharedLibraryType.Symbol` in Unity? Explain its purpose and usage.
AndroidSharedLibraryType.Symbol Description The shared library contains Android symbols that translate active memory addresses into information you can use, like a method name. When Unity creates an Android symbols package , it adds shared library files that have this flag to the symbols package.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5fa7fb173fdc
unity_docs
input
What is `UIElements.PointerUpEvent` in Unity? Explain its purpose and usage.
PointerUpEvent class in UnityEngine.UIElements / Inherits from: UIElements.PointerEventBase_1 / Implemented in: UnityEngine.UIElementsModule Description This event is sent when a pointer's last pressed button is released. The last pressed button may or may not be the same button that triggered the Pointe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f49e31513939
unity_docs
editor
Show me a Unity C# example demonstrating `Debug.isDebugBuild`.
bugBuild public static bool isDebugBuild ; Description In the Build Settings dialog there is a check box called "Development Build". If it is checked isDebugBuild will be true. In the editor isDebugBuild always returns true. It is recommended to remove all calls to Debug.Log when deploying a game, this way...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_59cd455de7c9
unity_docs
physics
What is `CollisionDetectionMode2D.Continuous` in Unity? Explain its purpose and usage.
CollisionDetectionMode2D.Continuous Description Ensures that all collisions are detected when a Rigidbody2D moves. When using this mode, the collision detection system will detect all collisions in the path that a Rigidbody2D moves along therefore preventing colliders attached to the rigidbody passing through o...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_909a99e84550
unity_docs
editor
What is `EditorPrefs` in Unity? Explain its purpose and usage.
EditorPrefs class in UnityEditor Description Stores and accesses Unity Editor preferences. On macOS, EditorPrefs are stored in ~/Library/Preferences/com.unity3d.UnityEditor5.x.plist . On Windows, EditorPrefs are stored in the registry under the HKCU\Software\Unity Technologies\Unity Editor 5.x key. On Linux, E...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_6ae7d2123e8e
unity_docs
scripting
Show me a Unity C# example demonstrating `ReflectionProbe`.
eflection probe is used to capture the surroundings into a texture which is passed to the shaders and used for reflections. The properties are an exact match for the values shown in the Inspector. This class is a script interface for a reflection probe component. Reflection probes are usually just created in the Ed...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e364a9434ece
unity_docs
editor
Show me a Unity C# example demonstrating `UIElements.Clickable.ctor`.
Clickable.ctor(System.Action,long,long) Parameters Parameter Description delay Determines when the event begins. Value is defined in milliseconds. Applies if delay is greater than 0 . interval Determines the time delta between event repetition. Value is defined in milliseconds. Applies if interval is greater t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f69650736712
unity_docs
scripting
Give me an overview of the `Animation` class in Unity.
Animation class in UnityEngine / Inherits from: Behaviour / Implemented in: UnityEngine.AnimationModule Description The animation component is used to play back animations. You can assign animation clips to the animation component and control playback from your script. The animation system in Unity is weight...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_38b7f835682a
unity_docs
physics
What is `Rigidbody2D` in Unity? Explain its purpose and usage.
Rigidbody2D class in UnityEngine / Inherits from: Component / Implemented in: UnityEngine.Physics2DModule Description Provides physics movement and other dynamics, and the ability to attach Collider2D to it. The Rigidbody2D is a fundamental physics component that provides multiple simulation dynamics, suc...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_09526f58180f
unity_docs
rendering
What is `AndroidETC2FallbackOverride` in Unity? Explain its purpose and usage.
AndroidETC2FallbackOverride enumeration Description This enumeration has values for different qualities to decompress an ETC2 texture on Android devices that don't support the ETC2 texture format. Properties Property Description UseBuildSettings Use the value defined in Player build settings. Quality32Bit Text...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e53ae354af01
unity_docs
scripting
What are the parameters of `MonoBehaviour.OnApplicationFocus` in Unity?
Description Sent to all GameObjects when the player gets or loses focus. OnApplicationFocus is called when the application loses or gains focus. Alt-tabbing or Cmd-tabbing can take focus away from the Unity application to another desktop application. This causes the GameObjects to receive an On...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_e86ebf2b0978_doc_10
github
scripting
What does `IPoolable` do in this Unity script? Explain its purpose and signature.
Releases all objects in the non-MonoBehaviour-based pool.The type of non-MonoBehaviour objects to release. Signature: ```csharp public void ReleaseAllPure<T>() where T : class, IPoolable => GetPool<PurePool<T>, T>(_purePools).ReleaseAll(); ```
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_803ffe68dfe4
unity_docs
scripting
What is `Search.ISearchView.currentGroup` in Unity? Explain its purpose and usage.
ISearchView.currentGroup public string currentGroup ; Description Indicates the current group that is selected by the user. A search group is usually represented as a Tab in the Search Window.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_55699dd04d78
unity_docs
ui
What is `UIElements.Foldout.checkmarkUssClassName` in Unity? Explain its purpose and usage.
Foldout.checkmarkUssClassName public static string checkmarkUssClassName ; Description The USS class name for the Label element in a Foldout. Unity adds this USS class to the VisualElement that represents the checkmark of the Toggle sub-element of every Foldout . Any styling applied to this class affe...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_62f44ea0e924
unity_docs
math
What is `Overlays.Overlay.maxSize` in Unity? Explain its purpose and usage.
Overlay.maxSize public Vector2 maxSize ; Description Maximum size of the Overlay. Overlays can be resized. The maxSize variable is the maximum width and height that the Overlay can be resized. This is typically a Vector2(4000,4000). If the axis of both the minSize and maxSize are set to 0, resizing is disable...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_93c5c48f3048
unity_docs
scripting
What is `Canvas.renderMode` in Unity? Explain its purpose and usage.
Canvas.renderMode public RenderMode renderMode ; Description Is the Canvas in World or Overlay mode? ```csharp //Attach this script to your Canvas GameObjectusing UnityEngine;public class Example : MonoBehaviour { enum RenderModeStates { camera, overlay, world }; RenderModeStates m_RenderModeStates; Canva...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_b845be6cef9b
unity_docs
physics
What is `OverlapSphereCommand.ctor` in Unity? Explain its purpose and usage.
OverlapSphereCommand Constructor Declaration public OverlapSphereCommand ( Vector3 point , float radius , QueryParameters queryParameters ); Parameters Parameter Description point The center of the sphere. radius The radius of the sphere. queryParameters Structure for specifying additional parameter...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e265b1ab052d
unity_docs
editor
What is `EditorBuildSettingsScene.enabled` in Unity? Explain its purpose and usage.
EditorBuildSettingsScene.enabled public bool enabled ; Description Whether this Scene is enabled for inclusion in the build. Set to true when the Scene is enabled for inclusion in the Build Profiles window. See EditorBuildSettings.scenes for an example of how to use this class. Additional resources: Edit...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_f712a2fd3e1e
unity_docs
ui
Show me a Unity code example for 'Create a complex list view'.
ample builds the visual elements in the list from a C# script. It uses a custom CharacterInfoVisualElement class that inherits from VisualElement , and binds the custom elements to CharacterInfo objects. Create a Unity project with any template. In the Project window , create a folder named Editor . In the Editor folde...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_15e01270d251
unity_docs
rendering
What is `Renderer.realtimeLightmapScaleOffset` in Unity? Explain its purpose and usage.
Renderer.realtimeLightmapScaleOffset public Vector4 realtimeLightmapScaleOffset ; Description The UV scale & offset used for a real-time lightmap. Same as lightmapScaleOffset , but for real-time lightmaps. A real-time lightmap is a texture atlas and multiple Renderers can use different portions of the same l...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3ccb09adec2a
unity_docs
physics
What is `PhysicsSceneExtensions2D.GetPhysicsScene2D` in Unity? Explain its purpose and usage.
PhysicsSceneExtensions2D.GetPhysicsScene2D Declaration public static PhysicsScene2D GetPhysicsScene2D ( SceneManagement.Scene scene ); Parameters Parameter Description scene The Scene from which to return the 2D physics Scene. Returns PhysicsScene2D The 2D physics Scene used by the Scene. Descripti...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_866c8d55c260
unity_docs
scripting
In Unity's 'Create a bindable custom control', what is 'Use the custom control in a UXML file' and how does it work?
In the ExampleField folder, create a UI Document named ExampleField.uxml . Open ExampleField.uxml in a text editor and replace its contents with the following: ``` <ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:example="UIToolkitExamples"> <example:ExampleField label="Binding Target" binding-path="m_Value" /> </ui:U...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_24795130ecf7
unity_docs
rendering
What is `TextureMipmapLimitBiasMode.OverrideGlobalLimit` in Unity? Explain its purpose and usage.
TextureMipmapLimitBiasMode.OverrideGlobalLimit Description Indicates that TextureMipmapLimitSettings overrides the global texture mipmap limit by the TextureMipmapLimitSettings.limitBias value, instead of offsetting it. Additional resources: TextureMipmapLimitSettings , TextureMipmapLimitSettings.limitBiasMod...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_feebd04f1445
unity_docs
scripting
Show me a Unity C# example demonstrating `SerializedProperty.boxedValue`.
essed, unless they contain fixed buffers. The property cannot be an array or list. But accessing a property that is an element of an array or list is supported. Unity built-in Struct types that are categorized in the Generic type cannot be accessed. But built-in types like Vector3 that have a their own entry in the...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_081134ca8b90
unity_docs
ui
In Unity's 'Extending IMGUI', what is 'Compound Controls' and how does it work?
There might be situations in your GUI where two types of Controls always appear together. For example, maybe you are creating a Character Creation screen, with several Horizontal Sliders. All of those Sliders need a Label to identify them, so the player knows what they are adjusting. In this case, you could partner eve...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e4b8b7746ccb
unity_docs
input
What is `TouchScreenKeyboard.Open` in Unity? Explain its purpose and usage.
TouchScreenKeyboard.Open Declaration public static TouchScreenKeyboard Open (string text , TouchScreenKeyboardType keyboardType = TouchScreenKeyboardType.Default, bool autocorrection = true, bool multiline = false, bool secure = false, bool alert = false, string textPlaceholder = "", int characterL...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_db6108c6193b
unity_docs
scripting
What is `UIElements.BaseVerticalCollectionView.Rebuild` in Unity? Explain its purpose and usage.
BaseVerticalCollectionView.Rebuild Declaration public void Rebuild (); Description Clears the collection view, recreates all visible visual elements, and rebinds all items. Call this method whenever a structural change is made to the view.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_ed21192b48f4
unity_docs
rendering
Show me a Unity code example for 'Declare DOTS Instancing properties in a custom shader in URP'.
To load instance data, such as transform matrices, the shader needs to define DOTS Instanced properties. Below is an example of a simple DOTS Instanced property block: ``` UNITY_DOTS_INSTANCING_START(MaterialPropertyMetadata) UNITY_DOTS_INSTANCED_PROP(float4, Color) UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata) ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_21c199106e33
unity_docs
scripting
What is `EditorUtility.DisplayPopupMenu` in Unity? Explain its purpose and usage.
EditorUtility.DisplayPopupMenu Declaration public static void DisplayPopupMenu ( Rect position , string menuItemPath , MenuCommand command ); Description Displays a popup menu. Menu is shown at position pos , generated from a submenu specified by menuItemPath using a MenuCommand as menu context. ```...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_3d3019056a70
unity_docs
xr
What is `Android.Permission.ExternalStorageWrite` in Unity? Explain its purpose and usage.
Permission.ExternalStorageWrite public static string ExternalStorageWrite ; Description Used when requesting permission or checking if permission has been granted to write to external storage such as a SD card.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_864861981907
unity_docs
rendering
What is `MaterialEditor.ShaderProperty` in Unity? Explain its purpose and usage.
MaterialEditor.ShaderProperty Declaration public void ShaderProperty ( MaterialProperty prop , string label ); Declaration public void ShaderProperty ( Rect position , MaterialProperty prop , string label ); Description Handes UI for one shader property. This function will draw appropriate UI for t...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_b1ad05fe7ecb
unity_docs
rendering
Explain 'Android App Manifest' in Unity.
The Android App Manifest contains information about an Android application. Each application has a single Android App Manifest XML file at the root of the source set called AndroidManifest.xml . The Android operating system and digital distribution services (for example, Google Play) use Android App Manifests to find i...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_82f2d46010ce
unity_docs
scripting
What is `Search.SearchExpressionRuntime.ToString` in Unity? Explain its purpose and usage.
SearchExpressionRuntime.ToString Declaration public string ToString (); Returns string Returns a string representation of the current runtime. Description Get a string representation of the current SearchExpressionRuntime .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_e7cd3274b703
unity_docs
editor
Explain 'Configuration files' in Unity.
You can use a configuration file to store custom settings for the Package Manager. For example, you can use configuration files to: Override the location or size of the global cache. Store your token information for each scoped registry that requires authentication. Package Manager supports two configuration files: a g...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_4b47cc87edff
unity_docs
xr
Show me a Unity C# example demonstrating `MPE.ChannelClient`.
lClient is created on a specific channel. A channel name matches the last part of a WebSocket URL. For example: 127.0.0.1:9090/<channelName>. The EventService is a ChannelClient connected to the "events" channel. You can create custom channels using the ChannelService , and connect to them using a ChannelClient. For...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_89758d6dd09a
unity_docs
physics
What are the parameters of `PhysicsShapeGroup2D.Add` in Unity?
Description Adds a copy of all the PhysicsShape2D and their geometry from the specified physicsShapeGroup into this shape group. The specified physicsShapeGroup is not modified. ```csharp using UnityEngine; using UnityEngine.Assertions;public class Example : MonoBehaviour { private const int ShapeCount = 10; voi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_32e0a62a4234
unity_docs
editor
In Unity's 'ML Agents', 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.ml-agents@4.0 released 4.0.0, 4.0.1, 4.0.2 com.unity.ml-agents@3.0 released 3.0.0-exp.1, 3.0.0 com.unity.ml-agents@2.3 compatible 2.3.0-exp.1, 2.3.0-exp.2, 2.3.0-exp.3 com.unity.ml-agents@2.2 compat...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_bd258ea63329
unity_docs
performance
Show me a Unity C# example demonstrating `Unity.Collections.ReadOnlyAttribute`.
ve containers are read-write by default when used in a job. This means that you can't schedule two jobs that reference the same containers simultaneously. Add the ReadOnly attribute to a native container field in a job struct to mark the container as read-only. This allows two jobs to run in parallel and read data fr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_8e0a44a8778b
unity_docs
xr
What is `LightTransport.BakeProgressState.WasCancelled` in Unity? Explain its purpose and usage.
BakeProgressState.WasCancelled Declaration public bool WasCancelled (); Returns bool True if the work was cancelled. Description Checks whether the work represented by this progress state was cancelled. Returns true if Cancel was called on this progress state. This method can be used by both the implement...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f8287b8dc9d0
unity_docs
scripting
What is `UIElements.UxmlHash128AttributeDescription` in Unity? Explain its purpose and usage.
UxmlHash128AttributeDescription class in UnityEngine.UIElements / Inherits from: UIElements.TypedUxmlAttributeDescription_1 / Implemented in: UnityEngine.UIElementsModule Description Describes a UXML Hash128 attribute. Properties Property Description defaultValueAsString The default value for the at...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_144e863e1b77
unity_docs
animation
What is `AnimationClip.SampleAnimation` in Unity? Explain its purpose and usage.
AnimationClip.SampleAnimation Declaration public void SampleAnimation ( GameObject go , float time ); Parameters Parameter Description go The animated game object. time The time to sample an animation. Description Samples an animation at a given time for any animated properties. It is recommended to ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_e1faacb72cf0
unity_docs
rendering
What is `XR.XRDisplaySubsystem.XRBlitParams` in Unity? Explain its purpose and usage.
XRBlitParams struct in UnityEngine.XR / Implemented in: UnityEngine.XRModule Description This struct holds data for a single blit operation. Properties Property Description destRect Destination Rect area that the blit operation wants to blit to. foveatedRenderingInfo A pointer to a native struct containing ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_c5794536662e
unity_docs
rendering
What is `Search.SearchAction.enabled` in Unity? Explain its purpose and usage.
SearchAction.enabled public Func<IReadOnlyCollection<SearchItem>,bool> enabled ; Description Callback used to check if the action is enabled based on the current context. ``` new SearchAction("scene", "toggle_cast_shadows", new GUIContent("Toggle Cast Shadows", null, "Toggle Cast Shadows on a Mesh")) { // Only...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_5822356be938
unity_docs
rendering
Explain 'New in Unity 2023.1' in Unity.
## Release Notes To find out more about the new features, changes, and improvements to this Unity version, refer to the 2023.1 Release Notes . To find the release notes for other releases, refer to the Unity download archive . ## Upgrade Guide If you are upgrading existing projects from 2022 LTS, read the Upgrade Gu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_9910252b4640
unity_docs
rendering
What is `LightmapParameters.pushoff` in Unity? Explain its purpose and usage.
LightmapParameters.pushoff public float pushoff ; Description The distance to offset the ray origin from the geometry when performing ray tracing, in modelling units. Unity applies the offset to all baked lighting: direct lighting, indirect lighting, environment lighting and ambient occlusion. Changing the val...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_add993794a6c
unity_docs
rendering
Explain 'Sky' in Unity.
Resources for adding sky to the background of your scene using a skybox material and shader . Page Description Introduction to sky Learn about skybox materials, and how the sky solution choose depends on which render pipeline your project uses. Create a skybox Create a skybox material, and draw the sky for all your cam...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_5b998e1531a3
unity_docs
math
What is `UIElements.Scale` in Unity? Explain its purpose and usage.
Scale struct in UnityEngine.UIElements / Implemented in: UnityEngine.UIElementsModule Description Represents the scale applied as element transformations. The center point that doesn't move when the scaling is applied is the TransformOrigin . Constructors Constructor Description Scale Creates a new Sca...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_d6b6a61051ee
unity_docs
rendering
What is `ShaderKeywordFilter.GraphicsAPIConstraintAttribute` in Unity? Explain its purpose and usage.
GraphicsAPIConstraintAttribute class in UnityEditor.ShaderKeywordFilter Description Enable or disable shader keyword filter attributes based on the graphics API. You can use GraphicsAPIConstraintAttribute to enable or disable filter attributes based on the GraphicsDeviceType , so you can filter shader keywor...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_15453dd597bf
unity_docs
performance
Explain 'Burst compilation' in Unity.
Burst is a compiler that works on a subset of C# referred to in the Unity context as High-Performance C# (HPC#). Burst uses LLVM to translate .NET Intermediate Language (IL) to code that’s optimized for performance on the target CPU architecture. Burst was originally designed for use with Unity’s job system. Jobs are s...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_1a4d33ce457b
unity_docs
rendering
Explain 'Create a lens flare' in Unity.
Create a flare and apply it to a lens flare component, then configure it to be visible by cameras. Note: This workflow is compatible only with the Built-in Render Pipeline . For similar functionality in other render pipelines, see Lens flares and halos . ## Apply a Flare asset Assign the Flare asset to a Light compon...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_548ab585e211
unity_docs
ui
Show me a Unity C# example demonstrating `GUIStyle.none`.
GUIStyle.none public static GUIStyle none ; Description Shortcut for an empty GUIStyle. This style contains no decoration and just renders everything in the default font. ```csharp using UnityEngine;public class Example : MonoBehaviour { void OnGUI() { // Make a button with no decoration GUI.Button(new ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_a2a1cf1d4bc4
unity_docs
rendering
Show me a Unity C# example demonstrating `WebCamTexture.videoRotationAngle`.
WebCamTexture.videoRotationAngle public int videoRotationAngle ; Description Returns an clockwise angle (in degrees), which can be used to rotate a polygon so camera contents are shown in correct orientation. Call Application.RequestUserAuthorization before creating a WebCamTexture. ```csharp // Starts a cam...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_95601e69632a
unity_docs
rendering
What is `Rendering.BatchFilterSettings.receiveShadows` in Unity? Explain its purpose and usage.
BatchFilterSettings.receiveShadows public bool receiveShadows ; Description Indicates whether instances from draw commands in this draw range should receive shadows. This corresponds to Renderer.receiveShadows .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_8688fca7d720
unity_docs
scripting
In Unity's 'Details of disabling domain and scene reload', what is 'What Unity does when scene reloading and domain reloading are both enabled' and how does it work?
With scene reload and domain reload enabled, this is the full list of all processes and events that Unity performs when entering Play mode: The AssemblyReloadEvent beforeAssemblyReload event is raised. The C# domain is stopped: a. OnDisable() is called for all ScriptableObjects and MonoBehaviours. b. Unity waits for al...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_349dd8c47f2f
unity_docs
rendering
What is `MaterialPropertyBlock.SetColor` in Unity? Explain its purpose and usage.
MaterialPropertyBlock.SetColor Declaration public void SetColor (string name , Color value ); Declaration public void SetColor (int nameID , Color value ); Parameters Parameter Description name The name of the property. nameID The name ID of the property retrieved by Shader.PropertyToID . valu...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_acc5157f505d
unity_docs
animation
Explain 'Event examples' in Unity.
Learn UI Toolkit events by examples. ## Transition Topics Description Create a simple transition with UI Builder and C# scripts Create a custom Editor window with three labels that rotate and scale when you hover over them. Create a transition event Create a custom Editor window with a button and color palette. Creat...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_99cbe449544a
unity_docs
rendering
What is `Rendering.CommandBuffer.CreateGraphicsFence` in Unity? Explain its purpose and usage.
CommandBuffer.CreateGraphicsFence Declaration public Rendering.GraphicsFence CreateGraphicsFence ( Rendering.GraphicsFenceType fenceType , Rendering.SynchronisationStageFlags stage ); Parameters Parameter Description fenceType The GraphicsFenceType to create. Currently the only supported value is Gr...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_f70661a393f5
unity_docs
scripting
What is `Windows.WebCam.PhotoCapture.PhotoCaptureResult.resultType` in Unity? Explain its purpose and usage.
PhotoCapture.PhotoCaptureResult.resultType public Windows.WebCam.PhotoCapture.CaptureResultType resultType ; Description A generic result that indicates whether or not the PhotoCapture operation succeeded.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_03a0a51b193e
unity_docs
animation
What is `Animations.AnimatorStateMachine.AddStateMachineBehaviour` in Unity? Explain its purpose and usage.
AnimatorStateMachine.AddStateMachineBehaviour Declaration public T AddStateMachineBehaviour (); Description Adds a state machine behaviour class of type T to the AnimatorStateMachine. Note that there is no corresponding "Remove" method. To remove a state machine behaviour, use Object.Destroy . Declaration publ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_man_3c78f43fb98d
unity_docs
xr
In Unity's 'Introduction to Verified Solutions', what is 'Getting listed on the Verified Solutions page' and how does it work?
The Verified Solutions team adds all Verified Solutions to the business and creator pages on the Asset Store website ( assetstore.unity.com ). You must submit the following information to the Verified Solutions team before your solution is added to the Unity.com website: A logo of the company or solution as an .EPS or ...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_841703317364
unity_docs
rendering
What are the parameters of `ObjectFactory.CreateInstance` in Unity?
Description Create a new instance of the given type. Use this method to create any type of serialized object in the Editor. The created instance uses default values. ```csharp using UnityEngine; using UnityEditor;public class CreateInstanceExample { [MenuItem("ObjectFactoryExample/Create Material Asset")] publi...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_1724f442d80c_doc_14
github
scripting
What does `ChangeBasis` do in this Unity script? Explain its purpose and signature.
Given a transform, returns that transform in another basis.The new basis is specified by outputFromInput.Not guaranteed to work if the change-of-basis matrix has non-uniformscale. Otherwise, the resulting transform will not "fit" in a TrTransform. Signature: ```csharp public static TrTransform ChangeBasis( ...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_2787de47293f
unity_docs
scripting
Show me a Unity C# example demonstrating `Networking.UnityWebRequest`.
form your application runs on, UnityWebRequest either sets the User-Agent header itself or leaves it for the operating system to set. UnityWebRequest sets the User-Agent header for all platforms except iOS, Xbox platforms, and WebGL. Note : If the device that the application runs on uses proxy settings, UnityW...
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
local_sr_de47022d870c
unity_docs
math
What is `GridLayout.WorldToLocal` in Unity? Explain its purpose and usage.
GridLayout.WorldToLocal Declaration public Vector3 WorldToLocal ( Vector3 worldPosition ); Parameters Parameter Description worldPosition World Position to convert. Returns Vector3 Local position of the world position. Description Converts a world position to local position.
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.
gh_c0bca1f94f2b
github
scripting
Write a Unity C# script called Prefab Pool
```csharp using System; using Gilzoide.PrefabPool.Internal; using UnityEngine; using Object = UnityEngine.Object; namespace Gilzoide.PrefabPool { [Serializable] public class PrefabPool<T> : APrefabPool<T> where T : Object { [Tooltip("Prefab which instances will be pooled.")] [Serial...
You are a senior Unity engineer. Answer questions about Unity scripting, XR/VR development, and game systems with working code examples.
local_sr_96bcf2264794
unity_docs
scripting
What is `VideoCodec.H264` in Unity? Explain its purpose and usage.
VideoCodec.H264 Description Encode video with the H.264 codec. The MPEG–4 Advanced Video Coding (AVC) video codec. This codec is supported by hardware on most platforms. For more information about video encoding, refer to Video encoding compatibility reference .
You are a Unity game development assistant. Help developers understand Unity APIs, best practices, and solve implementation challenges.