Beispiel #1
0
        public void AssignGo(UnityObject unityObj, CullingHandler handler, StreamingGoKey key,
                             Vector3 position, Vector3 size, IStreamingResourceHandler resHandler)
        {
            if (_height > 0 && FitInOneChild(size))
            {
                var index = GetChildIndex(position);
                _children[index].AssignGo(unityObj, handler, key, position, size, resHandler);
            }
            else
            {
                var streamingGo = _streamingGoMap[key];
                if (streamingGo.SetGo(unityObj))
                {
                    while (handler != null)
                    {
                        handler.StateChanged(_cullingState[(int)handler.Category] != CullState.Culled);
                        var sibling = handler.Sibling;
                        handler.Sibling = null;

                        streamingGo.AddHandler(handler);
                        ChangeCullingCount(handler.Category, 1);

                        handler = sibling;
                    }
                }
                else
                {
                    resHandler.UnloadGo(unityObj, key.SceneIndex);
                    while (handler != null)
                    {
                        var sibling = handler.Sibling;
                        handler.Free();
                        handler = sibling;
                    }
                }
            }
        }
Beispiel #2
0
 public bool Equals(StreamingGoKey obj)
 {
     return(SceneIndex == obj.SceneIndex && GoIndex == obj.GoIndex);
 }