示例#1
0
        private static void CopyFiles(string _sourceFolderPath, string _destinationFolderPath, bool _lowercaseDestinationFileNames = false, bool _deleteExistingDestinationDirectory = true)
        {
#if !(UNITY_WEBPLAYER || UNITY_WEBGL || NETFX_CORE)
            // Get the file list - which has meta option
            // Save with a lower case file name
            DirectoryInfo _sourceDirectoryInfo      = new DirectoryInfo(_sourceFolderPath);
            DirectoryInfo _destinationDirectoryInfo = new DirectoryInfo(_destinationFolderPath);

            if (_deleteExistingDestinationDirectory && _destinationDirectoryInfo.Exists)
            {
                _destinationDirectoryInfo.Delete(true);
            }

            _destinationDirectoryInfo.Create();

            FileInfo[] _files = _sourceDirectoryInfo.GetFiles("*", SearchOption.AllDirectories);

            foreach (FileInfo _curFileInfo in _files)
            {
                if (_curFileInfo.Extension == ".meta")
                {
                    continue;
                }

                IOExtensions.CopyFile(_curFileInfo, _destinationDirectoryInfo.FullName, _curFileInfo.Name.ToLower());
            }
#endif
        }
示例#2
0
        private void CopyNotificationAssets()
        {
#if USES_NOTIFICATION_SERVICE
            // Copy save the texture data in res/drawable folder
            Texture2D[] _smallIcons = new Texture2D[]
            {
                m_notificationSettings.Android.WhiteSmallIcon,
                m_notificationSettings.Android.ColouredSmallIcon
            };
            string[] _paths = new string[]
            {
                Constants.kAndroidPluginsLibraryPath + "/res/drawable/app_icon_custom_white.png",
                Constants.kAndroidPluginsLibraryPath + "/res/drawable/app_icon_custom_coloured.png"
            };
            int _iconsConfiguredCount = 0;

            for (int _i = 0; _i < _smallIcons.Length; _i++)
            {
                if (_smallIcons[_i] != null)
                {
                    string _destinationPath = UnityEngine.Application.dataPath + "/../" + _paths[_i];

                    IOExtensions.CopyFile(AssetDatabase.GetAssetPath(_smallIcons[_i]), _destinationPath, true);
                    _iconsConfiguredCount++;
                }
            }

            if (_iconsConfiguredCount == 1)
            {
#if NP_DEBUG
                Debug.LogError("[NPSettings] You need to set both(white & coloured) icons for proper functionality on all devices. As, White icon will be used by post Android L devices and coloured one by pre Android L Devices.");
#endif
            }
#endif
        }