Пример #1
0
        public static void dump(this GameObject go, string filename = null, int dumpParent = 0)
        {
            while (dumpParent-- > 0 && go.getParent())
            {
                go = go.getParent();
            }

            filename ??= go.name.Replace("(Clone)", "").ToLower();
#if DEBUG
            Paths.ensurePath(pathForDumps);
            filename = pathForDumps + filename;
#endif
            ObjectDumper.dump(go, true, true).saveToFile(filename + ".yml");
        }
Пример #2
0
 static _C _get <_C>(GameObject _go) where _C : Component => !_go? null : (_go.GetComponent <_C>() ?? _get <_C>(_go.getParent()));