// Update is called once per frame void Update() { setbound(transform.position); /* * leafNode = tree_bark.GrabZone(gameObject); * * if (!leafNode.GetComponent<catagorize>().CheckID(idcode)) * { * if (List != null) * { * List.Remove_Test(gameObject); * } * List = leafNode.GetComponent<catagorize>(); * List.Add_Test(gameObject); * idcode = List.getID(); * }*/ headingTo = (x * (total_box * total_box)) + (y * total_box) + z; if (headingTo != currentZone) { currentZone = headingTo; if (!gameObject.CompareTag("Moot")) { remove_Object(); } if (List != tree_bark.get_object(x, y, z)) { List = tree_bark.get_object(x, y, z); if (!gameObject.CompareTag("Moot")) { List.Add_Test(gameObject); } } } }
// Use this for initialization void Start() { if (gameObject.CompareTag("Moot")) { } else { id_numb = Id_Assign.GetComponent <ID_Assigner>().getID(transform); } tree_bark = tree.GetComponent <octree_07>(); bounds = tree_bark.giveDim(); segments = tree_bark.giveLim(); total_box = (int)Mathf.Pow(2, (segments + 1)); branch = new GameObject[segments + 1]; idcode = new int[segments + 1]; setbound(transform.position); headingTo = (x * (total_box * total_box)) + (y * total_box) + z; currentZone = (x * (total_box * total_box)) + (y * total_box) + z;; List = tree_bark.get_object(x, y, z); List.Add_Test(gameObject); }