- 博客(29)
- 收藏
- 关注
原创 vue浏览器进入后台与从后台返回执行的方法
visibilitychange 事件是一个标准的 DOM 事件,它在页面的可见性发生变化时被触发。你可以结合 document.hidden 属性来判断页面是否在后台运行。在 Vue 中,当浏览器进入后台(即当前标签页不可见)或切换到其他标签页时,你可以通过监听 visibilitychange 事件来触发相关方法。在页面进入后台时,你可能希望暂停定时器、停止动画、或保存用户的进度等。在页面恢复到前台时,你可以重新启动定时器、更新界面等。
2024-12-03 09:48:58
244
1
原创 本地服务器简单实现(Python本地服务器)
其中,localhost可以换成你的局域网IP地址,这样就可以在局域网内任何设备访问你的本地服务器了。2、打开终端,定位到你想要开启服务器的文件夹,输入如下命令。1、安装Python。
2024-01-10 15:09:31
714
原创 Unity 读取Excel
using UnityEngine;using System.Collections;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Text.RegularExpressions;using System.IO;using Excel;using System.Data;public struct DepenceTableData{ .
2021-03-08 23:28:26
175
原创 unity鼠标控制摄像机
using UnityEngine;public class CameraControlHandler : MonoBehaviour { private float rotateSpeed = 5; public Transform player; private bool isRotate; private Vector3 offsetPosition; private float distance;
2020-09-02 10:24:01
774
转载 在NavMeshComponents上寻找路径的各个点笔记
1、这个代码可以用在DOTS的实体寻路上,目前官方的DOTS寻路还没完成using System;using System.Collections;using System.Collections.Generic;using System.Linq;using Unity.Collections;using Unity.Mathematics;using UnityEditor;using UnityEngine;using UnityEngine.AI;using UnityEngin
2020-08-04 15:17:47
745
原创 Unity DOTS实体添加或者修改组件值笔记
1、把脚本挂在要转成实体的物体上using System.Collections;using System.Collections.Generic;using UnityEngine;using Unity.Entities;using Unity.Transforms;public class AppMoveObjectComponentManager : MonoBehaviour,IConvertGameObjectToEntity{ void IConvertGameObje
2020-08-04 15:11:16
653
原创 Unity DOTS job system burst笔记
1、创建一个job, [BurstCompile]加上此属性代表使用Burst编译,Execute方法在构建job时执行。2、EntityQuery ObjGroup; protected override void OnCreate() { ObjGroup = GetEntityQuery(typeof(Translation), typeof(NavAgentComponent), typeof(Rotation)); }上面所示代码是获取包含所示
2020-08-04 15:03:21
1039
原创 Unity DOTS System的使用笔记
1、创建System,System有类似MonoBehaviour的生命周期2、Entities .WithoutBurst() .ForEach((ref Translation trans,ref DataComponent data,in Entity entity)=> { trans.Value += math.normalize(data.target- trans.Value) * data.speed;
2020-08-04 12:26:59
755
原创 Unity DOTS创建一个组件笔记
DOTS创建组件时要引用Unity.Entities命名空间;[GenerateAuthoringComponent]加上此标记组件可以像MonoBehaviour一样挂在gameobject上。using Unity.Entities;[GenerateAuthoringComponent]public struct 你的组件名: IComponentData{}...
2020-08-04 11:58:14
262
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人