Example #1
0
        public bool InitializeAnimation()
        {
            if (prototype == null)
            {
                Debug.LogError("The prototype is NULL. Please select the prototype first.");
            }
            //Debug.Assert(prototype != null);
            GameObject thisPrefab = prototype;

            isMeshRender = false;
            if (lodInfo[0].skinnedMeshRenderer.Length == 0)
            {
                // This is only a MeshRenderer, it has no animations.
                isMeshRender = true;
                AnimationInstancingMgr.Instance.AddMeshVertex(prototype.name,
                                                              lodInfo,
                                                              null,
                                                              null,
                                                              bonePerVertex);
                return(true);
            }

            AnimationManager.InstanceAnimationInfo info = AnimationManager.Instance.FindAnimationInfo(prototype, this);
            if (info != null)
            {
                aniInfo = info.listAniInfo;
                Prepare(aniInfo, info.extraBoneInfo);
            }
            searchInfo = new AnimationInfo();
            comparer   = new ComparerHash();
            return(true);
        }
        public bool InitializeAnimation()
        {
            if (prefab == null)
            {
                prefab = GameObject.Find(prefabName);
            }
            Debug.Assert(prefab != null);
            GameObject thisPrefab = prefab;

            isMeshRender = false;
            if (lodInfo[0].skinnedMeshRenderer.Length == 0)
            {
                // This is only a MeshRenderer, it has no animations.
                isMeshRender = true;
                AnimationInstancingMgr.Instance.AddMeshVertex(prefab.name,
                                                              lodInfo,
                                                              null,
                                                              null,
                                                              bonePerVertex);
                return(true);
            }

            AnimationManager.InstanceAnimationInfo info = AnimationManager.Instance.FindAnimationInfo(prefab, this);
            if (info != null)
            {
                aniInfo = info.listAniInfo;
                Prepare(aniInfo, info.extraBoneInfo);
            }
            searchInfo = new AnimationInfo();
            comparer   = new ComparerHash();
            return(true);
        }
Example #3
0
        public bool InitializeAnimation()
        {
//            if (prefab == null)
            //                prefab = GameObject.Find(prefabName);
            Debug.Assert(cfgName != "");
//            GameObject thisPrefab = prefab;
            isMeshRender = false;
            if (lodInfo[0].skinnedMeshRenderer.Length == 0)
            {
                // This is only a MeshRenderer, it has no animations.
                isMeshRender = true;
                AnimationInstancingMgr.Instance.AddMeshVertex(this,
                                                              lodInfo,
                                                              null,
                                                              null,
                                                              bonePerVertex);
                return(true);
            }
            if (animationInfo == null)
            {
                animationInfo = AnimationManager.Instance.FindAnimationInfo(cfgName, this);
            }

            if (animationInfo != null)
            {
                aniInfo = animationInfo.listAniInfo;
                Prepare(aniInfo, animationInfo.extraBoneInfo);
            }
            if (searchInfo == null)
            {
                searchInfo = new AnimationInfo();
            }
            if (comparer == null)
            {
                comparer = new ComparerHash();
            }
            return(true);
        }