|
2 | 2 | from __future__ import annotations
|
3 | 3 |
|
4 | 4 | from abc import ABC
|
5 |
| -from typing import List, Optional, Tuple, TypeVar, Union |
| 5 | +from typing import List, Optional, Tuple, TypeVar, Union, TYPE_CHECKING |
6 | 6 |
|
7 | 7 | from attrs import define as attrs_define
|
8 | 8 |
|
@@ -2041,6 +2041,10 @@ class Pipeline(Component):
|
2041 | 2041 | class Renderer(Component):
|
2042 | 2042 | m_GameObject: PPtr[GameObject]
|
2043 | 2043 |
|
| 2044 | + if TYPE_CHECKING: |
| 2045 | + from .legacy_patch.Renderer import export as _export |
| 2046 | + export = _export |
| 2047 | + |
2044 | 2048 |
|
2045 | 2049 | @unitypy_define
|
2046 | 2050 | class BillboardRenderer(Renderer):
|
@@ -2744,6 +2748,32 @@ class GameObject(EditorExtension):
|
2744 | 2748 | m_Name: str
|
2745 | 2749 | m_Tag: int
|
2746 | 2750 |
|
| 2751 | + if TYPE_CHECKING: |
| 2752 | + from .legacy_patch.GameObject import ( |
| 2753 | + _GameObject_Components, _GameObject_GetComponent |
| 2754 | + ) |
| 2755 | + from ..enums import ClassIDType |
| 2756 | + |
| 2757 | + m_Components = property(_GameObject_Components) |
| 2758 | + m_Animator = property( |
| 2759 | + lambda self: _GameObject_GetComponent(self, ClassIDType.Animator) |
| 2760 | + ) |
| 2761 | + m_Animation = property( |
| 2762 | + lambda self: _GameObject_GetComponent(self, ClassIDType.Animation) |
| 2763 | + ) |
| 2764 | + m_Transform = property( |
| 2765 | + lambda self: _GameObject_GetComponent(self, ClassIDType.Transform) |
| 2766 | + ) |
| 2767 | + m_MeshRenderer = property( |
| 2768 | + lambda self: _GameObject_GetComponent(self, ClassIDType.MeshRenderer) |
| 2769 | + ) |
| 2770 | + m_SkinnedMeshRenderer = property( |
| 2771 | + lambda self: _GameObject_GetComponent(self, ClassIDType.SkinnedMeshRenderer) |
| 2772 | + ) |
| 2773 | + m_MeshFilter = property( |
| 2774 | + lambda self: _GameObject_GetComponent(self, ClassIDType.MeshFilter) |
| 2775 | + ) |
| 2776 | + |
2747 | 2777 |
|
2748 | 2778 | @unitypy_define
|
2749 | 2779 | class NamedObject(EditorExtension, ABC):
|
@@ -4054,6 +4084,11 @@ class AudioClip(SampleClip):
|
4054 | 4084 | m_Type: Optional[int] = None
|
4055 | 4085 | m_UseHardware: Optional[bool] = None
|
4056 | 4086 |
|
| 4087 | + if TYPE_CHECKING: |
| 4088 | + from .legacy_patch.AudioClip import _AudioClip_extension, _AudioClip_samples |
| 4089 | + extension = property(_AudioClip_extension) |
| 4090 | + samples = property(_AudioClip_samples) |
| 4091 | + |
4057 | 4092 |
|
4058 | 4093 | @unitypy_define
|
4059 | 4094 | class Avatar(NamedObject):
|
@@ -4451,6 +4486,10 @@ class Mesh(NamedObject):
|
4451 | 4486 | m_VertexData: Optional[VertexData] = None
|
4452 | 4487 | m_Vertices: Optional[List[Vector3f]] = None
|
4453 | 4488 |
|
| 4489 | + if TYPE_CHECKING: |
| 4490 | + from .legacy_patch.Mesh import _Mesh_export |
| 4491 | + export = _Mesh_export |
| 4492 | + |
4454 | 4493 |
|
4455 | 4494 | @unitypy_define
|
4456 | 4495 | class Motion(NamedObject, ABC):
|
@@ -4657,6 +4696,10 @@ class Shader(NamedObject):
|
4657 | 4696 | platforms: Optional[List[int]] = None
|
4658 | 4697 | stageCounts: Optional[List[int]] = None
|
4659 | 4698 |
|
| 4699 | + if TYPE_CHECKING: |
| 4700 | + from .legacy_patch.Shader import _Shader_export |
| 4701 | + export = _Shader_export |
| 4702 | + |
4660 | 4703 |
|
4661 | 4704 | @unitypy_define
|
4662 | 4705 | class ShaderVariantCollection(NamedObject):
|
@@ -4691,6 +4734,10 @@ class Sprite(NamedObject):
|
4691 | 4734 | m_ScriptableObjects: Optional[List[PPtr[MonoBehaviour]]] = None
|
4692 | 4735 | m_SpriteAtlas: Optional[PPtr[SpriteAtlas]] = None
|
4693 | 4736 |
|
| 4737 | + if TYPE_CHECKING: |
| 4738 | + from .legacy_patch.Sprite import _Sprite_image |
| 4739 | + image = property(_Sprite_image) |
| 4740 | + |
4694 | 4741 |
|
4695 | 4742 | @unitypy_define
|
4696 | 4743 | class SpriteAtlas(NamedObject):
|
@@ -4988,6 +5035,14 @@ class Texture2D(Texture):
|
4988 | 5035 | m_StreamingMipmaps: Optional[bool] = None
|
4989 | 5036 | m_StreamingMipmapsPriority: Optional[int] = None
|
4990 | 5037 |
|
| 5038 | + if TYPE_CHECKING: |
| 5039 | + from .legacy_patch.Texture2D import ( |
| 5040 | + _Texture2d_get_image, _Texture2D_get_image_data, _Texture2d_set_image |
| 5041 | + ) |
| 5042 | + image = property(_Texture2d_get_image, _Texture2d_set_image) |
| 5043 | + set_image = _Texture2d_set_image |
| 5044 | + get_image_data = _Texture2D_get_image_data |
| 5045 | + |
4991 | 5046 |
|
4992 | 5047 | @unitypy_define
|
4993 | 5048 | class Cubemap(Texture2D):
|
@@ -5043,6 +5098,10 @@ class Texture2DArray(Texture):
|
5043 | 5098 | m_StreamData: Optional[StreamingInfo] = None
|
5044 | 5099 | m_UsageMode: Optional[int] = None
|
5045 | 5100 |
|
| 5101 | + if TYPE_CHECKING: |
| 5102 | + from legacy_patch.Texture2DArray import _Texture2DArray_get_images |
| 5103 | + images = property(_Texture2DArray_get_images) |
| 5104 | + |
5046 | 5105 |
|
5047 | 5106 | @unitypy_define
|
5048 | 5107 | class Texture3D(Texture):
|
|
0 commit comments