/// <summary>
        /// Must be called from OnSceneGUI in order to perform any necessary updates.
        /// </summary>
        public void OnSceneGUI()
        {
            // If there are no objects registered, it means the scripts may have been recompiled
            // or this is a new Editor session. So we need to register the scene objects.
            if (_gameObjectToNode.Count == 0)
            {
                RegisterUnregisteredObjects();
            }

            _sphereTree.PerformPendingUpdates();
        }
Esempio n. 2
0
        /// <summary>
        /// Builds the mesh tree if it hasn't already been built.
        /// </summary>
        public void Build()
        {
            if (_wasBuilt)
            {
                return;
            }

            // Loop through all trianlges and register them with the tree
            for (int triangleIndex = 0; triangleIndex < _octave3DMesh.NumberOfTriangles; ++triangleIndex)
            {
                RegisterTriangle(triangleIndex);
            }

            // Finish any pending updates.
            // Note: This assumes that mesh data will never be modified during editing. Otherwise, we
            //       might need to call this from 'OnSceneGUI' to ensure that any pending updates are
            //       performed accordingly.
            _sphereTree.PerformPendingUpdates();

            // The tree was built
            _wasBuilt = true;
        }
 /// <summary>
 /// Must be called from OnSceneGUI in order to perform any necessary updates.
 /// </summary>
 public void OnSceneGUI()
 {
     _sphereTree.PerformPendingUpdates();
 }