- Home /
Question by
utophobia · Jan 11, 2021 at 12:56 PM ·
assemblyeditor extension
How to acquire rootNamespace of a asmdef file?
Hi folks, I want to generate scripts automatically (by editor extension) with namespace same as which will be used by Unity's standard creating process.
Suppose we have 2 directories Assets/A
and Assets/B
and asmdef files are placed on each directories, and rootNamespace of these are named as Game.A
and Game.B
.
How to fetch the string Game.A
from somewhere, as Unity accomplishes it somehow?
My (ugly) idea is traverse the asmdef files and find nearest one, read as text, parse as json, get rootNamespace.
Is there any better ideas?
Comment