public bool Init() { UTestPrototypes.Init(); m_quadtree = new UQuadtree(Bound); m_instRoot = GameObject.Find("Instances"); if (m_instRoot == null) { return(false); } for (int i = 0; i < 5000; i++) { UTestQtUserData ud = UTestPrototypes.NewRandom(); if (ud != null) { ud.gameObject.transform.localPosition = NewRandomPoint(); ud.gameObject.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f); ud.gameObject.transform.localRotation = Quaternion.Euler(0.0f, Random.Range(0.0f, 360.0f), 0.0f); ud.gameObject.transform.parent = m_instRoot.transform; ud.SwapOut(); m_quadtree.Receive(ud); } } return(true); }
public bool Init() { UTestPrototypes.Init(); m_quadtree = new UQuadtree(Bound); m_instRoot = GameObject.Find("Instances"); if (m_instRoot == null) return false; for (int i = 0; i < 5000; i++) { UTestQtUserData ud = UTestPrototypes.NewRandom(); if (ud != null) { ud.gameObject.transform.localPosition = NewRandomPoint(); ud.gameObject.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f); ud.gameObject.transform.localRotation = Quaternion.Euler(0.0f, Random.Range(0.0f, 360.0f), 0.0f); ud.gameObject.transform.parent = m_instRoot.transform; ud.SwapOut(); m_quadtree.Receive(ud); } } return true; }