Skip to content

Commit 157b6a6

Browse files
Merge pull request #75 from ruizhengu/main
add an example of getting object ID (entry.anchor)
2 parents ac4eac2 + ab59b39 commit 157b6a6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Unity YAML Parser #
22

3-
This project aims to provide a python3 API to load and dump Unity YAML
4-
files(configurations, prefabs, scenes, serialized data, etc) in the exact same
3+
This project aims to provide a python3 API to load and dump [Unity YAML
4+
files](https://docs.unity3d.com/Manual/TextSceneFormat.html) (configurations, prefabs, scenes, serialized data, etc) in the exact same
55
format the internal Unity YAML serializer does.
66

77
Using this API you will be able to easily manipulate(as python objects)
@@ -50,6 +50,11 @@ doc.dump_yaml()
5050
# calling entry method for a doc with multiple document will return the first one
5151
print(doc.entry.__class__.__name__)
5252
# 'Prefab'
53+
54+
# get the object ID number
55+
# e.g., the first line of an object == '--- !u!1 &42362281700597288'
56+
print(doc.entry.anchor)
57+
# '42362281700597288'
5358
````
5459

5560
## Classes ##

0 commit comments

Comments
 (0)