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);
} }
}

最新文章

  1. AlloyTeam2015前端大会都说了啥
  2. 【代码笔记】iOS-iCarouselDemo
  3. POJ 1258 Agri-Net(最小生成树 Prim+Kruskal)
  4. Linux中source是什么指令?
  5. Android开发笔记:eclipse导入java项目
  6. 【Linux学习】 写一个简单的Makefile编译源码获取当前系统时间
  7. asp.net 备份和恢复数据库
  8. DLL Export 报错
  9. js跨浏览器事件对象、事件处理程序
  10. TCP的阻塞和重传
  11. 设计模式 ( 十六 ) 观察者模式Observer(对象行为型)
  12. 极路由器刷机安装ss插件最新教程
  13. vue的增删改查
  14. Servlet案例3:验证码功能
  15. heapy() :python自带的堆排序
  16. HDU 1425 sort C语言实现快速排序
  17. SQL优化之索引分析
  18. p2 入门
  19. 分享基于Sails.js和React.js的全栈聊天室
  20. JAVA card 应用开发(一) 创建第一个APPLET

热门文章

  1. 解析关于Tomcat Servlet-request的获取请求参数及几种常用方法
  2. docker-compose部署rocketmq
  3. 路飞项目使用mysql数据库详细讲解
  4. 从安装开发环境到第一个“hello world”
  5. 理论+实战,详解Sharding Sphere-jdbc
  6. Springboot2.0解决跨域问题
  7. ssh操作
  8. Ubuntu docker安装、验证、卸载
  9. python生成csv并发送邮件
  10. python 操作配置文件(configparser模块)