using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
public class ClientTools:MonoBehaviour {
// Start is called before the first frame update
public GameObject obj;
public Text text;
private FileInfo[] floders;
private string AndroidDirectory = "/storage/emulated/0/Android/";//安卓路径
private string WindowsDirectory = System.Environment.CurrentDirectory + "/资源/";//Windows路径
private string filePath;
/// <summary>
/// /storage/emulated/0/ Android 外置内存根目录
/// Application.persistentDataPath; 来检测Android 外置内存根目录的方法
/// </summary>
void Start() {
EventTriggerListener.Get(obj).onClick = onClick;
} private void onClick(GameObject sender) {
ClientUDP.instance.Send("123123");
if(Directory.Exists(WindowsDirectory)) {
filePath = WindowsDirectory;
} else if(Directory.Exists(AndroidDirectory)) {
filePath = WindowsDirectory;
} else {
return;
} DirectoryInfo direction = new DirectoryInfo(filePath);
floders = direction.GetFiles("*.jpg",SearchOption.TopDirectoryOnly);
// text.text += floders.Length.ToString() + "_____****";
if(floders.Length > 0) {
LoaderPic.LoadByIo(floders[0].ToString(),obj);
} }
}

unity Android路径的相关部分代码的更多相关文章

  1. Unity Android路径及注意事项

    Application.temporaryCachePath==/storage/emulated/0/Android/data/com.***.***/cache Application.persi ...

  2. unity Android在streamingAssets路径下文件无法读取的的解决方法

    unity Android在streamingAssets路径下文件,有时候plugin下的.jar或者.so无法直接读取: 解决方法之一,拷贝至其他路径: #if UNITY_ANDROID str ...

  3. unity android相互调用

    简介 有一些手机功能,Unity没有提供相应的接口,例如震动,例如不锁屏,例如GPS,例如... 有太多的特殊功能Unity都没有提供接口,这时候,我们就需要通过使用Android原生的ADT编辑器去 ...

  4. 与Android应用程序相关的文件目录都有哪些?(转载)

    与Android应用程序相关的文件目录都有哪些? | 浏览:1312 | 更新:2014-09-28 19:43 | 标签:android 一.方法介绍:   每个Android应用程序都可以通过Co ...

  5. Android 命名规范 (提高代码可以读性)

    android文件众多,根据名称来辨别用途很重要,因此命名要规范 这篇文章可参考:Android 命名规范 (提高代码可以读性) 刚接触android的时候,命名都是按照拼音来,所以有的时候想看懂命名 ...

  6. Android视频媒体相关,VideoView和开源框架vitamio

    虽然Android已经内置了VideoView组件和MediaPlayer类来支持开发视频播放器,但支持格式.性能等各方面都十分有限,但是Vitamio的确强大到没朋友! Vitamio 是一款 An ...

  7. delphi android路径 TPath 文件路径,文件管理

    获取Android相关文档路径 delphi 新路径.文件功能 IOUtils单元,文件路径,文件管理 http://docwiki.embarcadero.com/RADStudio/Berlin/ ...

  8. [Unity] Android插件

    1> 编写eclipse android代码. 2> 把unity下class.jar拷入eclipse libs目录下, 工程中右键build path, add to build pa ...

  9. Android JUnit Test——批量运行测试代码

    转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ Android测试三要素 写Android测试用例有三要素,一是我们用的“安卓模拟器device” ...

  10. Android清除本地数据缓存代码案例

    Android清除本地数据缓存代码案例 直接上代码: /*  * 文 件 名:  DataCleanManager.java  * 描    述:  主要功能有清除内/外缓存,清除数据库,清除shar ...

随机推荐

  1. Canvas:绘制失败的问题

    beginPath 绘制路径必须添加 beginPath().它标志着一个画笔在画布中哪个地方开始画起.没有它,新起的画笔位置必定与上一次画笔结束的位置相连. // 第一个半圆 ctx.arc(60, ...

  2. 慧销平台ThreadPoolExecutor内存泄漏分析

    作者:京东零售 冯晓涛 问题背景 京东生旅平台慧销系统,作为平台系统对接了多条业务线,主要进行各个业务线广告,召回等活动相关内容与能力管理. 最近根据告警发现内存持续升高,每隔2-3天会收到内存超过阈 ...

  3. PostgreSQL中的row_number() 与distinct用法说明

    一.示例 这两个SQL执行所得到的数据是一样的! select count(s.*) from (  select *, row_number() over (partition by fee_dat ...

  4. 详解http和https

    前言 大家好,我是小卷! 近几年,互联网发生着翻天覆地的变化,尤其是我们一直习以为常的HTTP协议,在逐渐的被HTTPS协议所取代,在浏览器.搜索引擎.CA机构.大型互联网企业的共同促进下,互联网迎来 ...

  5. Git Please commit your changes or stash them before you merge.

    本地分支和远程修改了同一个文件代码,pull远程分支的代码的时候会文件冲突 出现这个错误 Please commit your changes or stash them before you mer ...

  6. [NPUCTF2020]认清形势,建立信心

    [NPUCTF2020]认清形势,建立信心 题目 from Crypto.Util.number import * from gmpy2 import * from secret import fla ...

  7. Mysql数据库基础第六章:变量、存储过程与函数

    Mysql数据库基础系列 软件下载地址 提取码:7v7u 数据下载地址 提取码:e6p9 mysql数据库基础第一章:(一)数据库基本概念 mysql数据库基础第一章:(二)mysql环境搭建 mys ...

  8. BOOK01:《过目不忘的读书法》

    BOOK01:<过目不忘的读书法> 01 区分"信息"和"知识" 一年之后过时的是"信息",十年也不过时的是"知识&q ...

  9. js计算时间为刚刚、几分钟前、几小时前、几天前··

    //dateTimeStamp是一个时间毫秒,注意时间戳是秒的形式,在这个毫秒的基础上除以1000,就是十位数的时间戳.13位数的都是时间毫秒.     function timeago(dateTi ...

  10. centos安装Jenkins报错

    [SKIPPED] jenkins-2.249.3-1.1.noarch.rpm: Already downloaded warning: /var/cache/dnf/jenkins-0919f06 ...