|
128 | 128 | "example": "rb.MovePosition(rb.position + velocity * Time.fixedDeltaTime);" |
129 | 129 | }, |
130 | 130 | { |
131 | | - "name": "Rigidbody.velocity", |
| 131 | + "name": "Rigidbody.linearVelocity", |
132 | 132 | "namespace": "UnityEngine", |
133 | 133 | "category": "physics", |
134 | | - "description": "The velocity vector of the Rigidbody in world space. Setting directly bypasses physics simulation - prefer AddForce for realistic movement.", |
135 | | - "signature": "Vector3 Rigidbody.velocity { get; set; }", |
136 | | - "example": "rb.velocity = new Vector3(rb.velocity.x, jumpSpeed, rb.velocity.z);" |
| 134 | + "description": "The linear velocity vector of the Rigidbody in world space (renamed from Rigidbody.velocity in Unity 6). Setting directly bypasses physics simulation - prefer AddForce for realistic movement.", |
| 135 | + "signature": "Vector3 Rigidbody.linearVelocity { get; set; }", |
| 136 | + "example": "rb.linearVelocity = new Vector3(rb.linearVelocity.x, jumpSpeed, rb.linearVelocity.z);" |
| 137 | + }, |
| 138 | + { |
| 139 | + "name": "Rigidbody.linearDamping", |
| 140 | + "namespace": "UnityEngine", |
| 141 | + "category": "physics", |
| 142 | + "description": "Linear drag applied to the Rigidbody (renamed from Rigidbody.drag in Unity 6). angularDamping replaces angularDrag.", |
| 143 | + "signature": "float Rigidbody.linearDamping { get; set; }", |
| 144 | + "example": "rb.linearDamping = 0.5f;" |
137 | 145 | }, |
138 | 146 | { |
139 | 147 | "name": "Rigidbody2D.AddForce", |
|
470 | 478 | "description": "Finds the first loaded object of the given type with deterministic ordering by instance ID. Unity 2023.1+.", |
471 | 479 | "signature": "static T Object.FindFirstObjectByType<T>(FindObjectsInactive findObjectsInactive = FindObjectsInactive.Exclude)", |
472 | 480 | "example": "var player = FindFirstObjectByType<PlayerController>();" |
| 481 | + }, |
| 482 | + { |
| 483 | + "name": "InputSystem.actions", |
| 484 | + "namespace": "UnityEngine.InputSystem", |
| 485 | + "category": "input", |
| 486 | + "description": "The project-wide Input Action Asset (Unity 6). Configure actions in Project Settings > Input System Package and look them up by name at runtime.", |
| 487 | + "signature": "static InputActionAsset InputSystem.actions { get; set; }", |
| 488 | + "example": "var move = InputSystem.actions.FindAction(\"Move\");" |
| 489 | + }, |
| 490 | + { |
| 491 | + "name": "InputActionAsset.FindAction", |
| 492 | + "namespace": "UnityEngine.InputSystem", |
| 493 | + "category": "input", |
| 494 | + "description": "Finds an action by name, \"Map/Action\" path, or ID. Cache the result in Awake or Start instead of looking it up every frame.", |
| 495 | + "signature": "InputAction InputActionAsset.FindAction(string actionNameOrId, bool throwIfNotFound = false)", |
| 496 | + "example": "_jump = InputSystem.actions.FindAction(\"Player/Jump\", throwIfNotFound: true);" |
| 497 | + }, |
| 498 | + { |
| 499 | + "name": "InputAction.ReadValue", |
| 500 | + "namespace": "UnityEngine.InputSystem", |
| 501 | + "category": "input", |
| 502 | + "description": "Reads the current value of the action, for example a Vector2 for a move stick or composite.", |
| 503 | + "signature": "TValue InputAction.ReadValue<TValue>() where TValue : struct", |
| 504 | + "example": "Vector2 move = _move.ReadValue<Vector2>();" |
| 505 | + }, |
| 506 | + { |
| 507 | + "name": "InputAction.WasPressedThisFrame", |
| 508 | + "namespace": "UnityEngine.InputSystem", |
| 509 | + "category": "input", |
| 510 | + "description": "Returns true if the action was pressed during the current frame. Replaces Input.GetButtonDown polling.", |
| 511 | + "signature": "bool InputAction.WasPressedThisFrame()", |
| 512 | + "example": "if (_jump.WasPressedThisFrame()) Jump();" |
| 513 | + }, |
| 514 | + { |
| 515 | + "name": "UIDocument.rootVisualElement", |
| 516 | + "namespace": "UnityEngine.UIElements", |
| 517 | + "category": "ui", |
| 518 | + "description": "The root VisualElement of a UI Toolkit document. Query it in OnEnable, since the tree is rebuilt when the UIDocument is enabled.", |
| 519 | + "signature": "VisualElement UIDocument.rootVisualElement { get; }", |
| 520 | + "example": "var root = GetComponent<UIDocument>().rootVisualElement;" |
| 521 | + }, |
| 522 | + { |
| 523 | + "name": "UQueryExtensions.Q", |
| 524 | + "namespace": "UnityEngine.UIElements", |
| 525 | + "category": "ui", |
| 526 | + "description": "Returns the first descendant element matching the type, name, and/or USS class.", |
| 527 | + "signature": "static T UQueryExtensions.Q<T>(this VisualElement e, string name = null, string className = null) where T : VisualElement", |
| 528 | + "example": "var playButton = root.Q<Button>(\"play-button\");" |
| 529 | + }, |
| 530 | + { |
| 531 | + "name": "Button.clicked", |
| 532 | + "namespace": "UnityEngine.UIElements", |
| 533 | + "category": "ui", |
| 534 | + "description": "Event raised when a UI Toolkit Button is clicked. Unsubscribe in OnDisable to avoid duplicate handlers.", |
| 535 | + "signature": "event Action Button.clicked", |
| 536 | + "example": "playButton.clicked += OnPlayClicked;" |
| 537 | + }, |
| 538 | + { |
| 539 | + "name": "VisualElement.SetBinding", |
| 540 | + "namespace": "UnityEngine.UIElements", |
| 541 | + "category": "ui", |
| 542 | + "description": "Runtime data binding (Unity 6): binds an element property to a path on its dataSource.", |
| 543 | + "signature": "void VisualElement.SetBinding(BindingId bindingId, Binding binding)", |
| 544 | + "example": "label.dataSource = playerData; label.SetBinding(\"text\", new DataBinding { dataSourcePath = new PropertyPath(nameof(PlayerData.Name)) });" |
| 545 | + }, |
| 546 | + { |
| 547 | + "name": "NetworkManager.StartHost", |
| 548 | + "namespace": "Unity.Netcode", |
| 549 | + "category": "networking", |
| 550 | + "description": "Starts a server and a local client (Netcode for GameObjects). Use StartServer or StartClient for dedicated roles.", |
| 551 | + "signature": "bool NetworkManager.StartHost()", |
| 552 | + "example": "NetworkManager.Singleton.StartHost();" |
| 553 | + }, |
| 554 | + { |
| 555 | + "name": "NetworkVariable", |
| 556 | + "namespace": "Unity.Netcode", |
| 557 | + "category": "networking", |
| 558 | + "description": "A value synchronized from the server (or owner) to clients. Subscribe to OnValueChanged in OnNetworkSpawn.", |
| 559 | + "signature": "NetworkVariable<T>(T value = default, NetworkVariableReadPermission readPerm = NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission writePerm = NetworkVariableWritePermission.Server)", |
| 560 | + "example": "private readonly NetworkVariable<int> _health = new(100);" |
| 561 | + }, |
| 562 | + { |
| 563 | + "name": "RpcAttribute", |
| 564 | + "namespace": "Unity.Netcode", |
| 565 | + "category": "networking", |
| 566 | + "description": "Universal RPC attribute (Netcode for GameObjects 1.8+ and 2.x) that replaces [ServerRpc] and [ClientRpc]. The method name must end in Rpc.", |
| 567 | + "signature": "[Rpc(SendTo target)]", |
| 568 | + "example": "[Rpc(SendTo.Server)] private void FireRpc(Vector3 direction) { /* runs on server */ }" |
| 569 | + }, |
| 570 | + { |
| 571 | + "name": "EditorWindow.GetWindow", |
| 572 | + "namespace": "UnityEditor", |
| 573 | + "category": "editor", |
| 574 | + "description": "Returns the first open EditorWindow of type T, creating and showing one if none exists.", |
| 575 | + "signature": "static T EditorWindow.GetWindow<T>(string title) where T : EditorWindow", |
| 576 | + "example": "[MenuItem(\"Tools/Level Builder\")] static void Open() => GetWindow<LevelBuilderWindow>(\"Level Builder\");" |
| 577 | + }, |
| 578 | + { |
| 579 | + "name": "Editor.CreateInspectorGUI", |
| 580 | + "namespace": "UnityEditor", |
| 581 | + "category": "editor", |
| 582 | + "description": "Override to build a custom inspector with UI Toolkit. Return a VisualElement; use InspectorElement.FillDefaultInspector to include the default fields.", |
| 583 | + "signature": "virtual VisualElement Editor.CreateInspectorGUI()", |
| 584 | + "example": "public override VisualElement CreateInspectorGUI() { var root = new VisualElement(); InspectorElement.FillDefaultInspector(root, serializedObject, this); return root; }" |
| 585 | + }, |
| 586 | + { |
| 587 | + "name": "PrefabUtility.InstantiatePrefab", |
| 588 | + "namespace": "UnityEditor", |
| 589 | + "category": "editor", |
| 590 | + "description": "Instantiates a prefab asset in the scene while keeping the prefab connection. Returns null if passed a scene object instead of an asset.", |
| 591 | + "signature": "static Object PrefabUtility.InstantiatePrefab(Object assetComponentOrGameObject)", |
| 592 | + "example": "var go = (GameObject)PrefabUtility.InstantiatePrefab(prefab); Undo.RegisterCreatedObjectUndo(go, \"Place Prefab\");" |
| 593 | + }, |
| 594 | + { |
| 595 | + "name": "Undo.RegisterCreatedObjectUndo", |
| 596 | + "namespace": "UnityEditor", |
| 597 | + "category": "editor", |
| 598 | + "description": "Registers a newly created object so the creation can be undone with Ctrl+Z.", |
| 599 | + "signature": "static void Undo.RegisterCreatedObjectUndo(Object objectToUndo, string name)", |
| 600 | + "example": "Undo.RegisterCreatedObjectUndo(go, \"Create Enemy\");" |
473 | 601 | } |
474 | 602 | ] |
0 commit comments