- 博客(10)
- 资源 (5)
- 收藏
- 关注
原创 uniapp 安卓、iOS权限判定
uniapp 安卓、iOS权限判定js:/** * 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启 */var isIos// #ifdef APP-PLUSisIos = (plus.os.name == "iOS")// #endif// 判断推送权限是否开启function judgeIosPermissionPush() { var result = false; var UIApplication = plus.ios.
2021-10-13 11:22:43
551
原创 unity 通过图片的黑色识别,生成对应的txt文本
unity 通过图片的黑色识别,生成对应的txt文本using System;using System.Collections;using System.Collections.Generic;using System.IO;using UnityEngine;using UnityEngine.UI;using Random = System.Random;public class Text1 : MonoBehaviour{ public Texture2D texture;
2021-05-27 09:34:10
246
原创 unity 根据当前设备屏幕宽高截图最大正方形图片
unity 根据当前设备屏幕宽高截图最大正方形图片Texture2D screenShot;int width=(int)Screen.width;int height=(int)Screen.height;Rect rect= new Rect(0, 0, width, height);if(rect.height>rect.width){screenShot = new Texture2D((int)rect.width, (int)rect.width, TextureFormat.
2020-06-06 10:40:51
320
原创 unity解决手势点击物体没有效果
unity解决手势点击物体没有效果这是因为unity是默认点击ui的,如果需要点击物体,那么就需要在相机加上 Physics Raycaster 这样就可以点击物体啦
2020-06-06 10:25:33
691
原创 将屏幕空间上的点转换为位于给定RectTransform平面上的世界空间中的位置
这篇文章主要记录在开发中遇到的问题,当Canvas设置为“Screen Space - Overlay mode”模式的情况下,怎么让手势还能准确的拖动ui。/// /// 鼠标滑动中/// /// private RectTransform curRecTran;public void OnDrag(PointerEventData eventData){ Vector3 globalMousePos; if (RectTransformUtility.ScreenPoint
2020-06-02 20:59:33
200
原创 unity 文本框随字体大小,内容长短自动变化
unity text因为文字字体和长度造成无法显示完整,这个是让text根据文本内容自动变大// /// 字体区域灵活变大,只根据字体变高度,宽度是由用户拖动区域变化/// /// 需要改变的文本物体public void FontAreaChanges(Text text) { RectTransform rect = text.GetComponent<RectTransform>(); // 获取Text的Size Vector2 v2 = rect.re
2020-06-02 20:41:05
2984
原创 unity 判断设备是否平板、手机
安卓判断:float physicscreen = Mathf.Sqrt(Screen.width * Screen.width + Screen.height * Screen.height) / Screen.dpi;if (physicscreen >= 7f){Debug.Log(“安卓平板”);}else{Debug.Log(“安卓手机”);}ios判断:stri...
2019-12-18 18:02:01
1774
原创 unity全局提示和提示按钮事件控制
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;using System;public class TipsView : MonoBehaviour {private Text title;private Text content;pri...
2019-12-18 17:55:35
315
原创 Android平台的unity应用调起另外一个应用
bool fail = false;string bundleId = “com.xxx.xx”;AndroidJavaClass up = new AndroidJavaClass(“com.unity3d.player.UnityPlayer”);AndroidJavaObject ca = up.GetStatic(“currentActivity”);AndroidJavaObje...
2019-12-18 17:49:47
307
unity导出png透明通道图.unitypackage
2020-05-25
HttpUtility
2020-10-24
UniWebView3.18.unitypackage
2020-06-01
Unity UI Soft Mask - 实现Sprite精灵遮罩
2019-12-03
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人