Example #1
0
        public override bool Play()
        {
            if (mPlayTime > mSpeedTime)
            {
                return(false);
            }

            mColor.a = 1 - mPlayTime / mSpeedTime;
            float nn = mPlayTime / mSpeedTime;

            if (!mIsDir)
            {
                mColor.a = 1 - mColor.a;
                nn       = 1 - nn;
            }

            mColor.a *= mColor.a;
            for (int y = 0; y < mFms.maxY; y++)
            {
                FMySubSprite fms = mFms.getFMySunSprite(0, y);
                for (int x = 0; x < mFms.maxX; x++)
                {
                    fms.TransRelativePos(x, y, mDirList[x * mFms.maxY + y] * nn, new Vector3(mColor.a, mColor.a, 1));
                    fms.TransRelativeColor(x, y, mColor);
                }
            }

            mFms.UpdateMesh();
            return(true);
        }
Example #2
0
        public FMySubSprite TransColor(int x, int y, Color c)
        {
            FMySubSprite fms = getFMySunSprite(x, y);

            fms.TransRelativeColor(x, y, c);
            return(fms);
        }
Example #3
0
        public override bool Play()
        {
            if (mPlayTime > mSpeedTime)
            {
                return(false);
            }

            int curPlayId = (int)(mFms.maxY * mPlayTime / (mSpeedTime - mFlyTime));

            int yy = mFms.maxY;
            int xx = mFms.maxX;

            for (int y = 0; y < yy; y++)
            {
                if (mIsDir)
                {
                    if (curPlayId < y)
                    {
                        break;
                    }
                }
                else
                {
                    if (curPlayId < mFms.maxY - y)
                    {
                        continue;
                    }
                }
                float tt = mCurTimes[y] + Time.deltaTime;
                mCurTimes[y] = tt;
                FMySubSprite fms = mFms.getFMySunSprite(0, y);

                if (tt > mFlyTime + 0.1f)
                {
                    continue;
                }
                if (tt > mFlyTime)
                {
                    tt = mFlyTime;
                }
                mColor.a = 1 - tt / mFlyTime;
                float nn = tt / mFlyTime;
                if (!mIsDir)
                {
                    mColor.a = 1 - mColor.a;
                    nn       = 1 - nn;
                }

                mColor.a *= mColor.a;

                for (int x = 0; x < xx; x++)
                {
                    fms.TransRelativePos(x, y, mDirList[x * mFms.maxY + y] * nn, new Vector3(mColor.a, mColor.a, 1));
                    fms.TransRelativeColor(x, y, mColor);
                }
            }
            mFms.UpdateMesh();
            return(true);
        }