Example #1
0
        public void OnAtlasPreRender(Camera camera = null)
        {
            SVGImporterSettings.UpdateAntialiasing();

            if (_atlasHasChanged)
            {
                RebuildAtlas();
                _atlasHasChanged = false;
#if UNITY_EDITOR
                UpdateMaterialList();
#endif
            }
        }
Example #2
0
        public void OnAtlasPreRender(Camera camera = null)
        {
            //Debug.Log("OnAtlasPreRender: "+camera);
            if (camera != null)
            {
                //Debug.Log("OnAtlasPreRender: "+camera.gameObject.name);
                SVGImporterSettings.UpdateAntialiasing(camera.pixelWidth, camera.pixelHeight);
            }

            if (_atlasHasChanged)
            {
                RebuildAtlas();
                _atlasHasChanged = false;
#if UNITY_EDITOR
                UpdateMaterialList();
#endif
            }
        }
        protected static void CreateSettings()
        {
            if(_settings == null)
            {
                string[] guids = AssetDatabase.FindAssets("t:SVGImporterSettings");
                if(guids == null || guids.Length == 0)
                {
                    ScriptableObject asset = ScriptableObject.CreateInstance<SVGImporterSettings>();                        
                    AssetDatabase.CreateAsset(asset, path + slash + assetName);
                    AssetDatabase.SaveAssets();

					_settings = (SVGImporterSettings)AssetDatabase.LoadAssetAtPath(path + assetName, typeof(SVGImporterSettings));
                    if(_settings != null)
                    {
                        EditorUtility.SetDirty(_settings);
                    }
                } else {
					_settings = (SVGImporterSettings)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guids[0]), typeof(SVGImporterSettings));
                }
            }
        }
Example #4
0
        protected static void CreateSettings()
        {
            if (_settings == null)
            {
                string[] guids = AssetDatabase.FindAssets("t:SVGImporterSettings");
                if (guids == null || guids.Length == 0)
                {
                    ScriptableObject asset = ScriptableObject.CreateInstance <SVGImporterSettings>();
                    AssetDatabase.CreateAsset(asset, path + slash + assetName);
                    AssetDatabase.SaveAssets();

                    _settings = (SVGImporterSettings)AssetDatabase.LoadAssetAtPath(path + assetName, typeof(SVGImporterSettings));
                    if (_settings != null)
                    {
                        EditorUtility.SetDirty(_settings);
                    }
                }
                else
                {
                    _settings = (SVGImporterSettings)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guids[0]), typeof(SVGImporterSettings));
                }
            }
        }