//------------------------------------------------------------------------- protected FishStillSprite _loadFishStillSpriteByFishId(TbDataFish.FishIdAndScaleStruct fish_id_scale) { TbDataFish fish_data = EbDataMgr.Instance.getData <TbDataFish>(fish_id_scale.FishId); FishStillSprite fish_sprite = _loadFishStillSprite(fish_data.FishAnimMove); fish_sprite.setScale(((float)fish_id_scale.Scale / 100f) * mFixFishScale * (float)fish_data.FishHeight / (float)fish_data.FishPixelHeight); return(fish_sprite); }
//------------------------------------------------------------------------- public override void load(EbPropSet prop_set) { Name = prop_set.getPropString("T_Name").get(); var prop_state = prop_set.getPropInt("I_State"); State = prop_state == null ? DataState.Default : (DataState)prop_state.get(); ListFishIdAndScale = new List <TbDataFish.FishIdAndScaleStruct>(); for (int i = 1; i <= 5; ++i) { string strFishIdAndScales = prop_set.getPropString("T_FishIdAndScale" + i.ToString()).get(); string[] arrayStrFishIdAndScales = strFishIdAndScales.Split(';'); TbDataFish.FishIdAndScaleStruct fishIdAndScaleStruct = new TbDataFish.FishIdAndScaleStruct(); fishIdAndScaleStruct.FishId = int.Parse(arrayStrFishIdAndScales[0]); fishIdAndScaleStruct.Scale = int.Parse(arrayStrFishIdAndScales[1]); ListFishIdAndScale.Add(fishIdAndScaleStruct); } }
//------------------------------------------------------------------------- protected void _newSpriteAndOffset(string layer0animation, string layer1animation, TbDataFish.FishIdAndScaleStruct fish_id_scale, EbVector3 position, float layer_offset, float angle_speed) { mBackground.Add(new SpriteAndOffset(_loadFishStillSprite(layer0animation), position, -angle_speed, mFishCycleGap * 2 + layer_offset)); mBackground.Add(new SpriteAndOffset(_loadFishStillSprite(layer1animation), position, angle_speed, mFishCycleGap + layer_offset)); mFishs.Add(new SpriteAndOffset(_loadFishStillSpriteByFishId(fish_id_scale), position, 0, 0, EbDataMgr.Instance.getData <TbDataFish>(fish_id_scale.FishId).FishAnimDie)); }