//------------------------------------------------------------------------- public void update(float elapsed_tm) { if (mIsNeedAutoDestroy) { mTimeCounter += elapsed_tm; if (mTimeCounter >= mFunDelayTime) { remove(this); } else if (mNeedFadeout) { mAlpha -= elapsed_tm / mFadeoutFunDelayTime; mCSpriteNumber.setAlpha(mAlpha); } else { mMassEntity.update(elapsed_tm); mCSpriteNumber.setPosition(mMassEntity.Position, 0); if (mMassEntity.IsEndRoute) { mNeedFadeout = true; } } } }
//--------------------------------------------------------------------- void _updateDieAnimation(float elapsed_tm) { if (mIsDieAnimation) { mCount -= elapsed_tm; if (mCount <= 0) { _signDestroy(); } return; } if (mMassEntity == null) { mIsDieAnimation = true; return; } mMassEntity.update(elapsed_tm); setPosition(mMassEntity.Position, mRenderFish.getFishAngle()); if (mMassEntity.IsEndRoute && !mIsDieAnimation) { setScale(mScale * (float)mVibFishData.FishHeight / (float)mVibFishData.FishPixelHeight); playAnimation(mVibFishData.FishAnimDie); mIsDieAnimation = true; } }
//------------------------------------------------------------------------- public void update(float elapsed_tm) { if (mMassEntity == null) { return; } mMassEntity.update(elapsed_tm); setPosition(mMassEntity.Position); setDirection(mMassEntity.Angle); if (mMassEntity.IsOutScreen || mMassEntity.IsEndRoute) { mCanDestroy = true; } }
//------------------------------------------------------------------------- public void update(float elapsed_tm) { mMassEntity.update(elapsed_tm); if (mFishCollider != null) { mFishCollider.setPosition(mMassEntity.Position); mFishCollider.setDirection(mMassEntity.Angle); } if (mMassEntity.IsOutScreen || mMassEntity.IsEndRoute) { signDestroy(); } }
//------------------------------------------------------------------------- void _updateFireAnimation(float elapsed_tm) { if (mIsFireAnimation) { mMassEntity.update(elapsed_tm); mTurretBarrelSprite.setPosition(mMassEntity.Position); mTurretBarrelSprite.setDirection(mMassEntity.Angle); if (!mMassEntity.IsEndRoute) { return; } mIsFireAnimation = false; mTurretBlazeSprite.setActive(false); } }
//------------------------------------------------------------------------- void moveHeaps(float elapsed_tm) { if (mMassEntity == null) { return; } mOldPositon = mMassEntity.Position; mMassEntity.update(elapsed_tm); mCSpriteHeapGroup.translate(mMassEntity.Position - mOldPositon); if (mMassEntity.IsEndRoute) { mCSpriteHeapGroup.swapHeaps(); mCounterState = _eCounterState.Adding; mMassEntity = null; } }
//------------------------------------------------------------------------- public void update(float elapsed_tm) { if (mISpriteFish == null) { return; } if (mIsDestroy) { return; } float update_delta_time = mSpriteFreeFromTimeFactor ? Time.deltaTime : elapsed_tm; mISpriteFish.update(update_delta_time); if (mMassEntity.IsOutScreen || mMassEntity.IsEndRoute) { mNotNeedDestroyParticle = true; signDestroy(); return; } if (mIsSurvivalTime) { mSurvivalTime -= update_delta_time; if (mSurvivalTime < 0) { signDestroy(); return; } } if (mFishStopMove) { return; } mMassEntity.update(update_delta_time); mISpriteFish.setPosition(mMassEntity.Position, mMassEntity.Angle); }