摘要: 要使用Prim算法来确保生成的 Cube 之间不会有孤岛,你需要按照以下步骤进行实现: 1. 创建一个数据结构来表示 Cube,包括位置信息和是否已经被连接的状态。2. 初始化一个空列表(或优先队列)来存储已连接的 Cube。3. 随机选择一个 Cube 作为起始点,将其添加到已连接列表中。4. 重 阅读全文
posted @ 2023-11-08 18:11 三页菌 阅读(105) 评论(0) 推荐(0) 编辑
摘要: using UnityEditor; using UnityEngine; public class CustomGridWindow3 : EditorWindow { private Texture2D customBackgroundTexture; private Vector2 gridS 阅读全文
posted @ 2023-11-08 16:19 三页菌 阅读(65) 评论(0) 推荐(0) 编辑
摘要: 用 rootVisualElement 方法绘制按钮和用 GUILayout.Button 绘制按钮混用的案例 using System.Collections; using System.Collections.Generic; using NUnit.Framework; using Unity 阅读全文
posted @ 2023-11-08 14:13 三页菌 阅读(14) 评论(0) 推荐(0) 编辑
摘要: private void OnEnable() { if (Application.isEditor) { SceneView.onSceneGUIDelegate += OnScene; } } private void OnScene(SceneView sceneview) { if (isB 阅读全文
posted @ 2023-11-08 14:09 三页菌 阅读(9) 评论(0) 推荐(0) 编辑