PostProcessWSA.CopyImage C# (CSharp) Method

CopyImage() protected method

protected CopyImage ( PlayerSettings type, PlayerSettings scale, string defaultSource, string destinationFileName ) : string
type PlayerSettings
scale PlayerSettings
defaultSource string
destinationFileName string
return string
    protected string CopyImage(PlayerSettings.WSAImageType type, PlayerSettings.WSAImageScale scale, string defaultSource, string destinationFileName)
    {
        string visualAssetsImage = PlayerSettings.WSA.GetVisualAssetsImage(type, scale);
        if (string.IsNullOrEmpty(visualAssetsImage))
        {
            if (string.IsNullOrEmpty(defaultSource))
            {
                return null;
            }
            visualAssetsImage = defaultSource;
        }
        destinationFileName = Path.ChangeExtension(destinationFileName, Path.GetExtension(visualAssetsImage));
        string str3 = Path.ChangeExtension(Utility.CombinePath("Assets", Path.GetFileName(!string.IsNullOrEmpty(defaultSource) ? defaultSource : visualAssetsImage)), Path.GetExtension(visualAssetsImage));
        if (string.IsNullOrEmpty(destinationFileName))
        {
            destinationFileName = str3;
        }
        else
        {
            destinationFileName = Utility.CombinePath("Assets", Path.GetFileName(destinationFileName));
        }
        string path = Utility.CombinePath(base.StagingArea, destinationFileName);
        Utility.CreateDirectory(Path.GetDirectoryName(path));
        FileUtil.CopyFileOrDirectory(visualAssetsImage, path);
        return (destinationFileName.Substring(0, destinationFileName.IndexOf('.')) + Path.GetExtension(visualAssetsImage));
    }