• 大小: 2.48MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-08
  • 语言: 其他
  • 标签: unity  andriod  相机  

资源简介

此代码,是unity拉取安卓苹果的插件,里面集成了安卓和ios的所有功能,直接用里面的代码也可以,也可以自己重写方法,按自己的需求来。有不懂的尽管提问

资源截图

代码片段和文件信息

using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using System.Diagnostics;
using System.IO;
using Debug = UnityEngine.Debug;

namespace Kakera.Unimgpicker
{
    public class XcodeProjectConfigurator
    {
        [PostProcessBuild]
        static void OnPostprocessBuild(BuildTarget buildTarget string buildPath)
        {
            if (buildTarget != BuildTarget.iOS)
                return;

            ConfigurePlist(buildPath “Info.plist“);
        }

        static void ConfigurePlist(string buildPath string plistPath)
        {
            var plist = new PlistDocument();
            var path = Path.Combine(buildPath plistPath);

            plist.ReadFromFile(path);

            var descriptionFilePath = Path.Combine(Application.dataPath “Unimgpicker/Editor/NSPhotoLibraryUsageDescription.txt“);
            if (!File.Exists(descriptionFilePath))
            {
                Debug.LogError(string.Format(“[Unimgpicker]:File {0} is not found.“ descriptionFilePath));
                return;
            }

            var description = File.ReadAllText(descriptionFilePath);

            plist.root.SetString(“NSPhotoLibraryUsageDescription“ description);
            Debug.Log(string.Format(“[Unimgpicker]:Set NSPhotoLibraryUsageDescription as \“{0}\““ description));

            plist.WriteToFile(path);
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-03-19 23:05  unimgpicker-master\
     文件         547  2018-03-19 23:05  unimgpicker-master\.gitignore
     目录           0  2018-03-19 23:05  unimgpicker-master\Assets\
     文件         191  2018-03-19 23:05  unimgpicker-master\Assets\Plugins.meta
     目录           0  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\
     文件         191  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\Android.meta
     目录           0  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\Android\
     文件         409  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\Android\Unimgpicker.meta
     目录           0  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\Android\Unimgpicker\
     文件         195  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\Android\Unimgpicker\AndroidManifest.xml
     文件         177  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\Android\Unimgpicker\AndroidManifest.xml.meta
     文件         191  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\Android\Unimgpicker\libs.meta
     目录           0  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\Android\Unimgpicker\libs\
     文件        3999  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\Android\Unimgpicker\libs\unimgpicker.jar
     文件         174  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\Android\Unimgpicker\libs\unimgpicker.jar.meta
     文件          21  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\Android\Unimgpicker\project.properties
     文件         174  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\Android\Unimgpicker\project.properties.meta
     文件         191  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\iOS.meta
     目录           0  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\iOS\
     文件         191  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\iOS\Unimgpicker.meta
     目录           0  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\iOS\Unimgpicker\
     文件         491  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\iOS\Unimgpicker\Picker.h
     文件         437  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\iOS\Unimgpicker\Picker.h.meta
     文件        3725  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\iOS\Unimgpicker\Picker.mm
     文件         437  2018-03-19 23:05  unimgpicker-master\Assets\Plugins\iOS\Unimgpicker\Picker.mm.meta
     文件         191  2018-03-19 23:05  unimgpicker-master\Assets\Unimgpicker.meta
     目录           0  2018-03-19 23:05  unimgpicker-master\Assets\Unimgpicker\
     文件         191  2018-03-19 23:05  unimgpicker-master\Assets\Unimgpicker\Editor.meta
     目录           0  2018-03-19 23:05  unimgpicker-master\Assets\Unimgpicker\Editor\
     文件          37  2018-03-19 23:05  unimgpicker-master\Assets\Unimgpicker\Editor\NSPhotoLibraryUsageDescription.txt
     文件         177  2018-03-19 23:05  unimgpicker-master\Assets\Unimgpicker\Editor\NSPhotoLibraryUsageDescription.txt.meta
............此处省略139个文件信息

评论

共有 条评论