Ejemplo n.º 1
0
        //-------------------------------------------------------------------------
        void _initFishLayer()
        {
            mFishKind = EbDataMgr.Instance.getMapData <TbDataFish>().Count;
            if (mFishKind == 0)
            {
                EbLog.Error("RenderLayerAlloter init error.");
            }
            mEachTypeFishLayerGap = (layerAddOffset(mFishLayerEnd) - layerAddOffset(mFishLayerBegin)) / mFishKind;

            List <LayerPair> layer_pair_list = new List <LayerPair>();

            foreach (var it in EbDataMgr.Instance.getMapData <TbDataFish>())
            {
                LayerPair layer_pair = new LayerPair(((TbDataFish)it.Value).FishDepth);
                layer_pair_list.Add(layer_pair);
                mFishIdLayerMap.Add(it.Value.Id, layer_pair);
            }

            layer_pair_list.Sort();
            float layer_begin = 0;

            foreach (var it in layer_pair_list)
            {
                it.setLayer(layer_begin++);
            }
        }
 void Awake()
 {
     for (int i = 0; i < layerPairs.Length; ++i)
     {
         LayerPair layerPair = layerPairs[i];
         int       layer1    = LayerMask.NameToLayer(layerPair.layer1);
         int       layer2    = LayerMask.NameToLayer(layerPair.layer2);
         if (layer1 >= 0 && layer1 < 32 && layer2 >= 0 && layer2 < 32)
         {
             Physics.IgnoreLayerCollision(layer1, layer2, true);
         }
     }
 }
Ejemplo n.º 3
0
        //-------------------------------------------------------------------------
        void _initFishLayer()
        {
            mFishKind = EbDataMgr.Instance.getMapData<TbDataFish>().Count;
            if (mFishKind == 0)
            {
                EbLog.Error("RenderLayerAlloter init error.");
            }
            mEachTypeFishLayerGap = (layerAddOffset(mFishLayerEnd) - layerAddOffset(mFishLayerBegin)) / mFishKind;

            List<LayerPair> layer_pair_list = new List<LayerPair>();
            foreach (var it in EbDataMgr.Instance.getMapData<TbDataFish>())
            {
                LayerPair layer_pair = new LayerPair(((TbDataFish)it.Value).FishDepth);
                layer_pair_list.Add(layer_pair);
                mFishIdLayerMap.Add(it.Value.Id, layer_pair);
            }

            layer_pair_list.Sort();
            float layer_begin = 0;
            foreach (var it in layer_pair_list)
            {

                it.setLayer(layer_begin++);
            }
        }
Ejemplo n.º 4
0
            //-------------------------------------------------------------------------
            public int CompareTo(object obj)
            {
                LayerPair layer_pair = obj as LayerPair;

                return(mVibLayer.CompareTo(layer_pair.mVibLayer));
            }