Exemplo n.º 1
0
            private static bool HandleNewAnimationClipOnSelection(UnityEngine.Object obj)
            {
                string assetPath = AssetDatabase.GetAssetPath(obj);

                if (Utility.IsUntyNewAnimation(assetPath))
                {
                    var guid             = AssetDatabase.AssetPathToGUID(assetPath);
                    var animationInCache = APCache.GetValue(guid) as APAnimation;

                    if (animationInCache == null)
                    {
                        return(false);
                    }

                    var currentAnimation = APResources.GetAPAnimationFromClip(obj as AnimationClip);
                    currentAnimation.Id = guid;

                    if (animationInCache.CycleOffset - currentAnimation.CycleOffset > 0.001f ||
                        animationInCache.LoopPose != currentAnimation.LoopPose ||
                        animationInCache.LoopTime != currentAnimation.LoopTime ||
                        animationInCache.FPS != currentAnimation.FPS ||
                        animationInCache.InAssetBundle != currentAnimation.InAssetBundle ||
                        animationInCache.Length - currentAnimation.Length > 0.001f)
                    {
                        webCommunicationService.UpdateObjectsIntoCache(APAssetType.AnimationClip, currentAnimation, SyncManager.ModifiedAssets);
                        return(true);
                    }
                }

                return(false);
            }