コード例 #1
0
        //-------------------------------------------------------------------------
        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);
        }
コード例 #2
0
        //-------------------------------------------------------------------------
        public override void update(float elapsed_tm)
        {
            if (canDestroy())
            {
                return;
            }

            if (mSpriteFish != null)
            {
                mSpriteFish.update(elapsed_tm);
            }

            CRenderLevel level = mScene.getLevel();

            if (level == null)
            {
                signDestroy();
                return;
            }

            bool level_isrun = level.isNormal();

            if (!level_isrun)
            {
                signDestroy();
                return;
            }

            CRenderFish fish = mScene.getLevel().getFishByObjId(mLockFishObjId);

            if (fish == null || fish.IsDie || !_isInScene(fish.Position))
            {
                mLockFishObjId = -1;
                signDestroy();
                return;
            }

            mTurret.updateTurretAngle(fish.Position);
        }