- 博客(14)
- 资源 (9)
- 收藏
- 关注
原创 GPU 回调 截图
using Unity.Collections;using UnityEngine;using UnityEngine.Rendering;public sealed class AsyncCapture : MonoBehaviour{ (RenderTexture grab, RenderTexture flip) _rt; NativeArray<byte> _buffer; System.Collections.IEnumerator Start()...
2022-01-28 09:54:46 2914
原创 unity PlatformNotSupportedException: Operation is not supported on this platform
做项目开发的时候用到了Excel文件的读写,在编辑器里正常读取与写入,生成都没有问题,但发布exe后提示标题信息,经过一查才知道原来api改为 4.x就可以了,隐约记得好像用的就是4.x,谁给我改成2.0了,瞎耽误功夫......
2022-01-14 17:42:02 2330 1
原创 Unity Loom 脚本
using UnityEngine;using System.Collections;using System.Collections.Generic;using System;using System.Threading;using System.Linq;public class Loom : Singleton<Loom>{ //线程中无法自创建,所以需要使用此类时在start中先运行一下这个属性 public string getLoomVer {...
2022-01-03 11:24:05 1694 2
原创 Unity Json插件-SimpleJson|LitJson
public void ReadCanonConfig() { string str = FileManager.GetUidFromJson(ConstPath.canonConfig); var json = SimpleJSON.JSON.Parse(str); if (System.Convert.ToBoolean(json["auto"].AsInt)) { print(json["li...
2021-12-30 13:04:49 2652
原创 Unity 显示Fps 帧率
public Text fpsText; float time; int frameCount; // Update is called once per frame void Update() { time += Time.unscaledDeltaTime; frameCount++; if (time >= 1 && frameCount >= 1) { ...
2021-12-28 10:56:44 1951
原创 正则表达式
获取中括号中的内容:public static string GetBracketsValue(string content) { System.Text.RegularExpressions.Regex rgx = new System.Text.RegularExpressions.Regex(@"(?i)(?<=\[)(.*)(?=\])"); return rgx.Match(content).Value; }字符串多空格截取 ...
2021-12-28 07:59:43 147
原创 unity衣服模拟插件MagicaCloth
此插件的物理是独立于unity物理引擎的,两者互不影响,碰撞块是自己实现的,但暂时只支持三轴放缩,单轴放缩将来可能会支持,如果没有硬性需求也够用了,效果还是很不错的。主要使用到的是骨骼与布料模拟,骨骼可以使用在处理头发上,布料的应用就是衣服最常见的是处理裙子的摆动。内置的参数各种效果差不多都已有应用参数了,自己需要的效果在它原有的参数基础上稍稍修改还是很方便的。其实刚开始我也没有想到用人家开发好的插件调物理效果竟是我日常的工作之一,尤其是角色还有舞蹈的情况下,以为在静止状态下调好的效果可以适应所有环
2021-03-19 14:27:23 2814 6
原创 ARFoundation ARPlaneManager 动态查看变更信息
using System;using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.XR.ARFoundation;public class ARPlaneInfo : MonoBehaviour{ public ARPlaneManager arPlaneManager; // Start is called before the first f.
2021-03-12 14:17:50 351
原创 ARFoundation 静态方法_检测是否支持人脸跟踪
public static bool IsFaceTrackingSupported() { var descriptors = new List<XRFaceSubsystemDescriptor>(); SubsystemManager.GetSubsystemDescriptors(descriptors); if (descriptors.Any()) { var descriptor = descriptors.First(); .
2021-02-20 16:51:48 253
原创 The type or namespace name ‘EditorWindow‘ could not be found
EditorWindow类无法打包出EXE 添加unity关键字定义如下文所示:#if UNITY_EDITORusing UnityEditor;public class TestEditor : EditorWindow{[MenuItem("Tools/TestMenu", false, 0)]static void TestMenu() { Debug.Log("TestMenu"); }}#endif...
2020-12-24 09:26:45 1256
原创 Unity 坐标转换之3D物体跟随鼠标移动
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;public class FollowMouse : MonoBehaviour { void Update() { if(Input.GetMouseButton(0)) { Vector3 tmp = Camera.ma.
2020-12-05 15:25:19 131
原创 NatCam 移动端插件 for Unity3d 使用设置
插件导入后需要将ios模块库更改为取消安卓平台编译,我是应用在安卓手机上故有此设置一步,发布ios平台的可以无视。插件样例介绍不是很多,但设置起来很方便,亲测不仅后置摄像头可以调整焦距,就连前置摄像头也可以调整,比系统自带的还厉害,真是 i 服了 u 了。曝光度调节 手电筒开关等等必需的设置都有了相对于手机端摄像头。具体设置如下:曝光调节NatCam.Camera.ExposureBias =value;焦距调节 NatCam.Camera.ZoomRatio = value ;手电筒.
2020-08-04 13:24:59 1104
原创 Unity3d 集成 Android 系统打印功能
研究了一段时间Android 系统打印功能,看到早在Android 4.0 也就是API Level>=19版本中就不需要再额外的安装打印驱动了,通过各种网站发现都是用同一种方法包括Android 开发官网也是使用PrintHelper 直接调用,当调用PrintHelper.printBitmap方法后,会出现用户选择界面(此处界面均为系统打印界面跟自己创建的无关),当然集成的只是打印功能的库,并无其它内容。经过查看PrintHelper类库,看到有个两个方法可以调用,一个是直接获取文件地址打.
2020-07-29 10:50:45 690 3
原创 Unity PlayClipAtPoint 背景音乐重复播放问题
using UnityEngine;public class PlayMusic: MonoBehaviour{ [SerializeField] private AudioClip _musicBG; private float _timer; void Start() { if (_musicBG!= null) { Au...
2018-03-21 09:09:11 1735 1
macOS High Sierra 10.13笔记本七代CPU 黑苹果
2019-01-12
Easy Leap Motion Gestures and Starter Kit v1.0
2019-01-12
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人