void DrawCollision()
 {
     Gizmos.color = Color.yellow;
     foreach (GameObject collider in QuadtreeObjectUpdate.CheckCollision(transform.position, _radius))
     {
         Gizmos.DrawLine(transform.position, collider.transform.position);
     }
 }
Esempio n. 2
0
 private void OnDisable()
 {
     QuadtreeObjectUpdate.RemoveLeaf(_leaf);
 }
Esempio n. 3
0
 private void OnEnable()
 {
     UpdateLeaf(); //存入叶子之前先更新一次叶子数据确保存入无误。实际上前两步也应该在存入前更新一次叶子数据,但前两步因为没有更新干脆把碰撞器当做固定的处理了
     QuadtreeObjectUpdate.SetLeaf(_leaf);
 }