Tree.cs 816 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class Tree : INode
  6. {
  7. public static int nodeInstanceId = 1;
  8. public Bounds bound { get; set; }
  9. private Node root;
  10. public int maxDepth { get; }
  11. public int maxChildCount { get; }
  12. public List<SceneObjData> ObjList { get { return root.ObjList; } }
  13. public Tree(Bounds bound)
  14. {
  15. this.bound = bound;
  16. this.maxDepth = 2;
  17. this.maxChildCount = 4;
  18. root = new Node(bound, 0, this);
  19. }
  20. public void InsertObj(SceneObjData obj)
  21. {
  22. root.InsertObj(obj);
  23. }
  24. public void TriggerMove(Camera camera,BaseBattleScene scene)
  25. {
  26. root.TriggerMove(camera,scene);
  27. }
  28. public void DrawBound()
  29. {
  30. root.DrawBound();
  31. }
  32. }