Пример #1
0
        protected void buildFromTransform(JsonSkeleton result, Transform skeletonRoot)
        {
            if (!skeletonRoot)
            {
                throw new System.ArgumentNullException("skeletonRoot");
            }

            var transformIds = gatherIds(skeletonRoot);

            Debug.LogFormat("Transofrm skeleton:");
            printSkeleton(transformIds);

            result.clear();
            result.assignFrom(skeletonRoot, transformIds);
            result.name = findSkeletonName(skeletonRoot);
        }
Пример #2
0
        protected void build(JsonSkeleton result, SkinnedMeshRenderer[] meshRenders)
        {
            var commonRoot = findSkinMeshCommonRoot(meshRenders);

            if (!commonRoot)
            {
                throw new System.ArgumentException("Coudl not find common root for skin mesh renderers");
            }

            var finalIds = gatherIds(commonRoot);            //gatherFilteredIds(prefabRoot.transform, commonRoot);

            Debug.LogFormat("Skinned mesh renderer skeleton:");
            printSkeleton(finalIds);

            result.clear();
            result.assignFrom(commonRoot, finalIds);
            result.name = findSkeletonName(commonRoot);
        }
Пример #3
0
        protected void build(JsonSkeleton result, GameObject prefabRoot)
        {
            checkPrefabRoot(prefabRoot);

            var transformIds = gatherIds(prefabRoot.transform);

            Debug.LogFormat("Full skeleton:");
            printSkeleton(transformIds);

            var skinRenderers = prefabRoot.GetComponentsInChildren <SkinnedMeshRenderer>(true);
            var commonRoot    = findSkinMeshCommonRoot(skinRenderers, prefabRoot);
            var finalIds      = gatherFilteredIds(prefabRoot.transform, commonRoot);

            Debug.LogFormat("Short skeleton:");
            printSkeleton(finalIds);

            result.clear();
            result.assignFrom(commonRoot, finalIds);
            result.name = findSkeletonName(commonRoot);
        }