Exemplo n.º 1
0
        //---------------------------------------------------------------------
        bool _createFishCrowd()
        {
            int fish_vib_id = mFishGroupRouteAlloter.getRandomRoute();

            if (null == EbDataMgr.Instance.getData <TbDataFish>(fish_vib_id))
            {
                return(false);
            }
            int fish_self_max_count  = EbDataMgr.Instance.getData <TbDataFish>(fish_vib_id).OutFishUpperBound;
            int fish_group_max_count = EbDataMgr.Instance.getData <TbDataFish>(fish_vib_id).dataOutFishGroup.FishCount;

            int current_fish_self_count  = mBaseFishLordMgr.getEntityCount(fish_vib_id);
            int current_fish_group_count = _getOutGroupFishCount(fish_vib_id);

            bool can_out_fish = false;

            if (fish_self_max_count == 0 && fish_group_max_count == 0)
            {
                can_out_fish = true;
            }
            else if (fish_self_max_count == 0)
            {
                if (fish_group_max_count > current_fish_group_count)
                {
                    can_out_fish = true;
                }
            }
            else if (fish_group_max_count == 0)
            {
                if (fish_self_max_count > current_fish_self_count)
                {
                    can_out_fish = true;
                }
            }
            else
            {
                if (fish_self_max_count > current_fish_self_count &&
                    fish_group_max_count > current_fish_group_count)
                {
                    can_out_fish = true;
                }
            }

            if (can_out_fish)
            {
                createEntityParticleSystem(fish_vib_id);
            }

            return(can_out_fish);
        }