提交
31
.idea/workspace.xml
generated
@ -7,8 +7,10 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="fec10672-acda-4616-894b-a4b6f93aea6f" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/2.笔记/三消 粒子特效.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/2.笔记/三消 粒子特效.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/2.笔记/瀑布 新项目 临时记录.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/2.笔记/瀑布 新项目 临时记录.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/2.笔记/震动插件 问题.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/2.笔记/震动插件 问题.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/日记/2025_04_15_星期二.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/日记/2025_04_15_星期二.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/笔记文件/日记/2025_04_16_星期三.md" beforeDir="false" afterPath="$PROJECT_DIR$/笔记文件/日记/2025_04_16_星期三.md" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@ -60,7 +62,7 @@
|
||||
<workItem from="1743923197347" duration="53000" />
|
||||
<workItem from="1743923256222" duration="1432000" />
|
||||
<workItem from="1744012644631" duration="8122000" />
|
||||
<workItem from="1744466976087" duration="1275000" />
|
||||
<workItem from="1744466976087" duration="9452000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="测试提交">
|
||||
<created>1742956649478</created>
|
||||
@ -202,7 +204,28 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1744280785157</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="21" />
|
||||
<task id="LOCAL-00021" summary="提交">
|
||||
<created>1744634237838</created>
|
||||
<option name="number" value="00021" />
|
||||
<option name="presentableId" value="LOCAL-00021" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1744634237838</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00022" summary="提交">
|
||||
<created>1744689602942</created>
|
||||
<option name="number" value="00022" />
|
||||
<option name="presentableId" value="LOCAL-00022" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1744689602942</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00023" summary="提交">
|
||||
<created>1744710005735</created>
|
||||
<option name="number" value="00023" />
|
||||
<option name="presentableId" value="LOCAL-00023" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1744710005735</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="24" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
|
95
笔记文件/2.笔记/协程管理器.md
Normal file
@ -0,0 +1,95 @@
|
||||
#unity/日常积累
|
||||
|
||||
首先是是抽象出来的接口
|
||||
|
||||
![[Pasted image 20250416142333.png]]
|
||||
|
||||
然后,是对于接口的,具体逻辑实现:
|
||||
先是单例的处理,然后用哈希表,去存储协程相关,参考[[HashSet]]
|
||||
|
||||
![[Pasted image 20250416142501.png]]
|
||||
|
||||
再然后,就是管理相关协程的,具体实现了;
|
||||
|
||||
## CoroutineManager
|
||||
|
||||
``` cs
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 协程管理器
|
||||
/// </summary>
|
||||
public interface ICoroutineManager
|
||||
{
|
||||
/// <summary>
|
||||
/// 启动受管理的协程
|
||||
/// </summary>
|
||||
Coroutine StartManagedCoroutine(IEnumerator routine);
|
||||
|
||||
/// <summary>
|
||||
/// 停止指定协程
|
||||
/// </summary>
|
||||
void StopManagedCoroutine(Coroutine coroutine);
|
||||
|
||||
/// <summary>
|
||||
/// 停止所有协程
|
||||
/// </summary>
|
||||
void StopAllManagedCoroutines();
|
||||
}
|
||||
|
||||
public class CoroutineManager : MonoBehaviour, ICoroutineManager
|
||||
{
|
||||
private static CoroutineManager _instance;
|
||||
private readonly HashSet<Coroutine> _activeCoroutines = new HashSet<Coroutine>();
|
||||
|
||||
public static ICoroutineManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
var go = new GameObject("CoroutineManager");
|
||||
DontDestroyOnLoad(go);
|
||||
_instance = go.AddComponent<CoroutineManager>();
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
public Coroutine StartManagedCoroutine(IEnumerator routine)
|
||||
{
|
||||
var coroutine = StartCoroutine(WrappedCoroutine(routine));
|
||||
_activeCoroutines.Add(coroutine);
|
||||
return coroutine;
|
||||
}
|
||||
|
||||
public void StopManagedCoroutine(Coroutine coroutine)
|
||||
{
|
||||
if (coroutine != null && _activeCoroutines.Contains(coroutine))
|
||||
{
|
||||
StopCoroutine(coroutine);
|
||||
_activeCoroutines.Remove(coroutine);
|
||||
}
|
||||
}
|
||||
|
||||
public void StopAllManagedCoroutines()
|
||||
{
|
||||
foreach (var coroutine in _activeCoroutines)
|
||||
{
|
||||
if (coroutine != null)
|
||||
{
|
||||
StopCoroutine(coroutine);
|
||||
}
|
||||
}
|
||||
_activeCoroutines.Clear();
|
||||
}
|
||||
|
||||
private IEnumerator WrappedCoroutine(IEnumerator routine)
|
||||
{
|
||||
yield return routine;
|
||||
_activeCoroutines.Remove(StartCoroutine(routine));
|
||||
}
|
||||
}
|
||||
```
|
20
笔记文件/2.笔记/安卓aar生成后,导入Unity注意事项.md
Normal file
@ -0,0 +1,20 @@
|
||||
#unity/日常积累
|
||||
#安卓
|
||||
|
||||
例如,已经有一个安卓的aar,导入到unity了,它的package名字是`com.cgbu.api`
|
||||
|
||||
![[Pasted image 20250416135441.png]]
|
||||
|
||||
这时,如果有另一个aar也生成了,要导入到unity;
|
||||
如果还是使用相同的package名,打安卓包,就会报错提示,有重复冲突;
|
||||
|
||||
可以选中package文件夹后,直接重命名
|
||||
|
||||
![[Pasted image 20250416135734.png]]
|
||||
|
||||
![[Pasted image 20250416135717.png]]
|
||||
|
||||
再导入unity引用,就不会有报错相关了;
|
||||
需要稍微注意的是,引用相关的命名,也是要同步修改
|
||||
|
||||
![[Pasted image 20250416135925.png]]
|
@ -1,4 +1,5 @@
|
||||
#灵感
|
||||
|
||||
![[Pasted image 20250115163753.png]]
|
||||
|
||||
![[Pasted image 20250115163705.png]]
|
||||
|
@ -48,4 +48,6 @@ overlayJsonClip = JsonSerializer.SerializeToUtf8Bytes(currentHapticConfig, optio
|
||||
|
||||
震动 三消 项目组 外部调用:
|
||||
|
||||
![[Pasted image 20250327141412.png]]
|
||||
![[Pasted image 20250327141412.png]]
|
||||
|
||||
![[img_v3_02kg_f50ceda0-d544-42d9-ac26-66d94aeb69hu.jpg]]
|
@ -26,7 +26,6 @@
|
||||
- [x] 买一下鸡胸肉冻干
|
||||
- [x] 记得拍身份证照片 预约 护照办理
|
||||
- [x] 记得买沐浴露
|
||||
- [ ] 写一个灵动平台的测试用例,放到测试手机上跑
|
||||
- [ ] vue入门和进阶
|
||||
---
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
- [x] 记得今天要去拿 咖啡快递
|
||||
- [x] 申请一下 PerfSight 试用
|
||||
- [ ] 彻底解决,震动插件Unable to seek的问题
|
||||
- [x] 彻底解决,震动插件Unable to seek的问题
|
||||
- [x] 添加一下 Adjust的发包还有回包log打印,确定符合设计预期
|
||||
- [x] 重新生成一下,安卓aar相关,去掉多余的引用和代码逻辑
|
||||
- [x] 服务器逻辑,创建一个,新的数据库,存放新的表
|
||||
|
@ -22,6 +22,9 @@
|
||||
# 今日任务
|
||||
|
||||
- [ ] 买多一套 四件套 备用
|
||||
- [ ] 基于sqlite的机制和逻辑,添加结构,完善一下 临时id和真实id,匹配的机制
|
||||
- [ ] 写一个灵动平台的测试用例,放到测试手机上跑,需要包含发送基础消息的机制,登录和删号和重新登录的机制
|
||||
---
|
||||
|
||||
[[安卓aar生成后,导入Unity注意事项]]
|
||||
[[协程管理器]]
|
||||
# Journal
|
||||
|
BIN
笔记文件/附件/Pasted image 20250416135441.png
Normal file
After Width: | Height: | Size: 719 KiB |
BIN
笔记文件/附件/Pasted image 20250416135717.png
Normal file
After Width: | Height: | Size: 615 KiB |
BIN
笔记文件/附件/Pasted image 20250416135734.png
Normal file
After Width: | Height: | Size: 857 KiB |
BIN
笔记文件/附件/Pasted image 20250416135925.png
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
笔记文件/附件/Pasted image 20250416142333.png
Normal file
After Width: | Height: | Size: 350 KiB |
BIN
笔记文件/附件/Pasted image 20250416142501.png
Normal file
After Width: | Height: | Size: 622 KiB |
BIN
笔记文件/附件/img_v3_02kg_f50ceda0-d544-42d9-ac26-66d94aeb69hu.jpg
Normal file
After Width: | Height: | Size: 108 KiB |