//------------------------------------------------------------------------- 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); }
//------------------------------------------------------------------------- public CSpriteCounter(CRenderScene scene, EbVector3 origin_position, float up_angle) { mScene = scene; mCounterScruct.MovingSpeed = 100f; mCounterScruct.OriginPosition = origin_position; mCounterScruct.UpAngle = up_angle; mCounterScruct.GapBetweenHeaps = mScene.getRenderConfigure().ChipHSpace; mCounterScruct.RightAngle = CLogicUtility.getRightAngle(up_angle); mCounterScruct.RightDistance = CLogicUtility.getDirection(mCounterScruct.RightAngle) * mCounterScruct.GapBetweenHeaps; mCounterState = _eCounterState.Adding; mCSpriteHeapGroup = new CSpriteHeapGroup(4); mScoreCounterMap.create(mScene.getRenderConfigure().ScoreGap); }
void _newChip() { StillSprite still_sprite = mScene.getRenderObjectPool().newStillSprite(); still_sprite.playAnimation("chip"); still_sprite.setScale(mScene.getRenderConfigure().ChipSacle); still_sprite.setLayer(mHeapLayer); mStackChips.Add(still_sprite); #if UNITY_EDITOR still_sprite.gameObject.name = "TkSpriteChips_chip"; #endif _updateChipsView(mHeapScruct.Position, mHeapScruct.UpAngle); }