Ejemplo n.º 1
0
            private static bool HandleRenderTextureOnSelection(UnityEngine.Object obj)
            {
                string assetPath = AssetDatabase.GetAssetPath(obj);
                string guid      = AssetDatabase.AssetPathToGUID(assetPath);
                var    rtInCache = APCache.GetValue(guid) as APTexture;

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

                var rtCurrent = APResources.GetAPTextureFromAssetGuid(guid);

                if (rtInCache.Width != rtCurrent.Width ||
                    rtInCache.Height != rtCurrent.Height ||
                    rtInCache.MipMap != rtCurrent.MipMap)
                {
                    webCommunicationService.UpdateObjectsIntoCache(APAssetType.Texture, AssetDatabase.AssetPathToGUID(assetPath), SyncManager.ModifiedAssets);
                    return(true);
                }

                return(false);
            }