//------------------------------------------------------------------------- public void create(CRenderScene scene, CRenderTurret render_turret) { mScene = scene; mCRenderTurret = render_turret; int turret_id = render_turret.getTurretId(); CTurretHelper turret_helper = mScene.getTurretHelper(); float base_angle = turret_helper.getBaseAngleByTurretId(turret_id); mCSpriteCounter = new CSpriteCounter(mScene, turret_helper.getPositionByOffset(turret_id, mScene.getRenderConfigure().ChipsOffset), turret_helper.getBaseAngleByTurretId(turret_id)); mScoreTurnplate = new CSpriteScoreTurnplate(mScene, turret_helper.getPositionByOffset(turret_id, mScene.getRenderConfigure().TurretTurnplateOffset), base_angle); //mCSpriteScore = new CSpriteScore(mScene, turret_helper.getPositionByOffset(turret_id, mScene.getRenderConfigure().ChipsOffset), 0, turret_id); if (turret_id == 0 || turret_id == 1) { EbVector3 offset = mScene.getRenderConfigure().TurretPanelScoreOffset; offset.x += mScene.getRenderConfigure().UpTurretPanelScoreOffset; //mCSpriteScore.setDigitPosition(turret_helper.getPositionByOffset(turret_id, offset), 0); } else { //mCSpriteScore.setDigitPosition(turret_helper.getPositionByOffset(turret_id, mScene.getRenderConfigure().TurretPanelScoreOffset), base_angle); } //mCSpriteScore.setBgPosition(turret_helper.getPositionByOffset(turret_id, mScene.getRenderConfigure().TurretPanelScoreBgOffset), base_angle); }
//------------------------------------------------------------------------- void _initTurretUnit(ref StillSprite still_sprite, string animation_name, float scale, _eLevelLayer layer) { still_sprite = mScene.getRenderObjectPool().newStillSprite(); still_sprite.playAnimation(animation_name); still_sprite.setScale(scale); still_sprite.setLayer(mScene.getLayerAlloter().getLayer(layer)); still_sprite.setPosition(mRenderTurret.getTurretPos()); still_sprite.setDirection(mScene.getTurretHelper().getBaseAngleByTurretId(mRenderTurret.getTurretId())); still_sprite.setTag("CSpriteTurret" + mRenderTurret.getTurretId()); }