Documentation ¶
Index ¶
- Variables
- func DumpScene(s *Scene, dumpComponents bool)
- type Asset
- type Assets
- type BaseComponent
- type BoxCollider
- type CapsuleCollider
- type Color
- type Component
- type Element
- type GameObject
- type Material
- type MeshCollider
- type MeshFilter
- type MeshRenderer
- type MetaFile
- type MonoBehaviour
- type PrefabInstance
- type Ref
- type Rigidbody
- type Scene
- type SphereCollider
- type TextureEnv
- type Transform
- type YAMLDoc
Constants ¶
This section is empty.
Variables ¶
View Source
var UnityMeshes = map[Ref]string{
{FileID: 10202, GUID: "0000000000000000e000000000000000"}: "Cube",
{FileID: 10206, GUID: "0000000000000000e000000000000000"}: "Cylinder",
{FileID: 10207, GUID: "0000000000000000e000000000000000"}: "Sphere",
{FileID: 10208, GUID: "0000000000000000e000000000000000"}: "Capsule",
{FileID: 10209, GUID: "0000000000000000e000000000000000"}: "Plane",
{FileID: 10210, GUID: "0000000000000000e000000000000000"}: "Quad",
}
View Source
var UnityShaders = map[Ref]string{
{FileID: 45, GUID: "0000000000000000f000000000000000"}: "StandardSpecularSetup",
{FileID: 46, GUID: "0000000000000000f000000000000000"}: "Standard",
{FileID: 47, GUID: "0000000000000000f000000000000000"}: "AutodeskInteractive ",
{FileID: 4800000, GUID: "933532a4fcc9baf4fa0491de14d08ed7"}: "URP/Lit ",
{FileID: 4800000, GUID: "650dd9526735d5b46b79224bc6e94025"}: "URP/Unlit ",
{FileID: 4800000, GUID: "8d2bb70cbf9db8d4da26e15b26e74248"}: "URP/SimpleLit ",
}
Functions ¶
Types ¶
type Assets ¶
type Assets interface { GetSourcePath() string GetAsset(guid string) *Asset GetAssetByPath(assetPath string) *Asset GetAllAssets() []*Asset GetMetaFile(asset *Asset) (*MetaFile, error) Open(assetPath string) (fs.File, error) Close() error }
func OpenPackage ¶
OpenPackage opens .unitypackage file or dir.
func OpenProject ¶ added in v0.3.5
OpenProject opens Unity project.
type BaseComponent ¶ added in v0.3.5
type BaseComponent struct { Scene *Scene `yaml:"-"` ObjectHideFlags int `yaml:"m_ObjectHideFlags"` PrefabInternal Ref `yaml:"m_PrefabInternal"` GameObject Ref `yaml:"m_GameObject"` CorrespondingSourceObject *Ref `yaml:"m_CorrespondingSourceObject"` PrefabInstance *Ref `yaml:"m_PrefabInstance"` }
func (*BaseComponent) GetGameObject ¶ added in v0.3.5
func (c *BaseComponent) GetGameObject() *GameObject
type BoxCollider ¶ added in v0.3.5
type CapsuleCollider ¶ added in v0.3.5
type Component ¶
type Component interface { GetGameObject() *GameObject // contains filtered or unexported methods }
type GameObject ¶
type GameObject struct { Name string `yaml:"m_Name"` IsActive int `yaml:"m_IsActive"` TagString string `yaml:"m_TagString"` Components []*struct { Ref Ref `yaml:"component"` } `yaml:"m_Component"` CorrespondingSourceObject *Ref `yaml:"m_CorrespondingSourceObject"` PrefabInstance *Ref `yaml:"m_PrefabInstance"` Scene *Scene `yaml:"-"` }
func (*GameObject) Dump ¶
func (o *GameObject) Dump(indent int, recursive, component bool)
func (*GameObject) GetComponent ¶
func (o *GameObject) GetComponent(target interface{}) bool
func (*GameObject) GetComponents ¶ added in v0.3.5
func (o *GameObject) GetComponents(target interface{})
func (*GameObject) GetTransform ¶
func (o *GameObject) GetTransform() *Transform
type Material ¶
type Material struct { Name string `yaml:"m_Name"` Shader *Ref `yaml:"m_Shader"` ShaderKeywords string `yaml:"m_ShaderKeywords"` LightmapFlags int `yaml:"m_LightmapFlags"` EnableInstancingVariants int `yaml:"m_EnableInstancingVariants"` DoubleSidedGI int `yaml:"m_DoubleSidedGI"` CustomRenderQueue int `yaml:"m_CustomRenderQueue"` StringTagMap map[string]string `yaml:"stringTagMap"` DisabledShaderPasses []string `yaml:"disabledShaderPasses"` SavedProperties struct { TexEnvs []map[string]*TextureEnv `yaml:"m_TexEnvs"` Floats []map[string]float32 `yaml:"m_Floats"` Colors []map[string]*Color `yaml:"m_Colors"` } `yaml:"m_SavedProperties"` }
func (*Material) GetColorProperty ¶
func (*Material) GetFloatProperty ¶
func (*Material) GetTextureProperty ¶
func (m *Material) GetTextureProperty(name string) *TextureEnv
type MeshCollider ¶ added in v0.3.5
type MeshCollider struct { BaseComponent `yaml:",inline"` Enabled int `yaml:"m_Enabled"` Mesh *Ref `yaml:"m_Mesh"` IsTrigger int `yaml:"m_IsTrigger"` }
type MeshFilter ¶
type MeshFilter struct { BaseComponent `yaml:",inline"` Mesh *Ref `yaml:"m_Mesh"` }
type MeshRenderer ¶
type MeshRenderer struct { BaseComponent `yaml:",inline"` Enabled int `yaml:"m_Enabled"` CastShadows int `yaml:"m_CastShadows"` ReceiveShadows int `yaml:"m_ReceiveShadows"` DynamicOccludee int `yaml:"m_DynamicOccludee"` MotionVectors int `yaml:"m_MotionVectors"` LightProbeUsage int `yaml:"m_LightProbeUsage"` ReflectionProbeUsage int `yaml:"m_ReflectionProbeUsage"` Materials []*Ref `yaml:"m_Materials"` }
type MetaFile ¶
type MetaFile struct { FileFormatVersion int `yaml:"fileFormatVersion"` GUID string `yaml:"guid"` NativeFormatImporter map[string]interface{} `yaml:"NativeFormatImporter"` TextureImporter map[string]interface{} `yaml:"TextureImporter"` ModelImporter *struct { FileIDToRecycleName map[int64]string `yaml:"fileIDToRecycleName"` } `yaml:"ModelImporter"` RawData map[string]interface{} `yaml:",inline"` }
func (*MetaFile) GetRecycleNameByFileID ¶
type MonoBehaviour ¶
type MonoBehaviour struct { BaseComponent `yaml:",inline"` Enabled int `yaml:"m_Enabled"` Script *Ref `yaml:"m_Script"` RawData map[string]interface{} `yaml:",inline"` }
type PrefabInstance ¶
type PrefabInstance struct { Modification struct { Modifications []struct { Target *Ref `yaml:"target"` PropertyPath string `yaml:"propertyPath"` Value interface{} `yaml:"value"` ObjectReference *Ref `yaml:"objectReference"` } `yaml:"m_Modifications"` TransformParent *Ref `yaml:"m_TransformParent"` RemovedComponents []interface{} `yaml:"m_RemovedComponents"` } `yaml:"m_Modification"` SourcePrefab *Ref `yaml:"m_SourcePrefab"` PrefabScene *Scene `yaml:"-"` }
type Rigidbody ¶ added in v0.3.5
type Rigidbody struct { BaseComponent `yaml:",inline"` Mass float32 `yaml:"m_Mass"` Drag float32 `yaml:"m_Drag"` AngularDrag float32 `yaml:"m_AngularDrag"` UseGravity int `yaml:"m_UseGravity"` IsKinematic int `yaml:"m_IsKinematic"` Interpolate int `yaml:"m_Interpolate"` Constraints int `yaml:"m_Constraints"` CollisionDetection int `yaml:"m_CollisionDetection"` }
type Scene ¶
type Scene struct { GUID string Objects []*GameObject Elements map[int64]Element Assets Assets }
func (*Scene) GetElement ¶
func (*Scene) GetGameObject ¶
func (s *Scene) GetGameObject(ref *Ref) *GameObject
type SphereCollider ¶ added in v0.3.5
type SphereCollider struct { BaseComponent `yaml:",inline"` IsTrigger int `yaml:"m_IsTrigger"` Center geom.Vector3 `yaml:"m_Center"` Radius float32 `yaml:"m_Radius"` }
type TextureEnv ¶
type Transform ¶
type Transform struct { BaseComponent `yaml:",inline"` Father Ref `yaml:"m_Father"` Children []*Ref `yaml:"m_Children"` LocalRotation geom.Vector4 `yaml:"m_LocalRotation"` LocalPosition geom.Vector3 `yaml:"m_LocalPosition"` LocalScale geom.Vector3 `yaml:"m_LocalScale"` RootOrder int `yaml:"m_RootOrder"` // contains filtered or unexported fields }
func (*Transform) GetChildren ¶
func (*Transform) GetWorldMatrix ¶
Click to show internal directories.
Click to hide internal directories.