Exemplo n.º 1
0
        private void ChangeCullingCount(DistCullingCat cat, int step)
        {
            var index = (int)cat;

            _cullingCount[index]        += step;
            _cullingCountOverall[index] += step;

            if (_cullingCountOverall[index] == 0)
            {
                _cullingState[index] = CullState.Culled;
            }

            var itor = _parent;

            while (itor != null)
            {
                itor._cullingCountOverall[index] += step;
                if (itor._cullingCountOverall[index] == 0)
                {
                    itor._cullingState[index] = CullState.Culled;
                }

                itor = itor._parent;
            }
        }
Exemplo n.º 2
0
 public static void SetCullingDistance(DistCullingCat cat, float value)
 {
     for (int i = 0; i < DistCullingCats.Length; i++)
     {
         if (DistCullingCats[i].Cat == cat)
         {
             DistCullingCats[i].Dist = value * value;
         }
     }
 }
Exemplo n.º 3
0
        public bool SetGoActivatiton(DistCullingCat cat, bool isActivated, IStreamingResourceHandler handler)
        {
            bool ret = false;

            if (cat == Cat)
            {
                switch (Status)
                {
                case StreamingGoStatus.NotLoaded:
                    if (isActivated)
                    {
                        handler.LoadGo(Key.SceneIndex, Key.GoIndex);
                        Status = StreamingGoStatus.Loading;
                    }

                    break;

                case StreamingGoStatus.Loading:
                    if (!isActivated)
                    {
                        Status = StreamingGoStatus.NotLoaded;
                    }

                    break;

                case StreamingGoStatus.Loaded:
                    if (!isActivated)
                    {
                        handler.UnloadGo(Go, Key.SceneIndex);

                        Status = StreamingGoStatus.NotLoaded;
                        RemoveHandlers();
                        Go  = null;
                        ret = true;
                    }

                    break;
                }
            }

            return(ret);
        }