public FMySubSprite TransColor(int x, int y, Color c) { FMySubSprite fms = getFMySunSprite(x, y); fms.TransRelativeColor(x, y, c); return(fms); }
public FMySubSprite Transpos(int x, int y, Vector3 pos, Vector3 s) { FMySubSprite fms = getFMySunSprite(x, y); fms.TransRelativePos(x, y, pos, s); return(fms); }
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); }
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); }
public FMySubSprite getFMySunSprite(int x, int y) { int sSize = y * maxX + x; for (int i = 0; i < mMySubSprs.Count; i++) { FMySubSprite fss = mMySubSprs[i]; int curNum = fss.GetClipNum(); if (sSize < curNum) { return(fss); } else { sSize -= curNum; } } return(null); }
private FMySubSprite CreateFmySun(int x, int y, int cx, int cy, GameObject go) { GameObject cloneGo = new GameObject(); cloneGo.layer = this.gameObject.layer; cloneGo.name = "SubSprite"; cloneGo.transform.parent = this.transform; cloneGo.transform.localPosition = Vector3.zero; cloneGo.transform.localRotation = Quaternion.identity; cloneGo.transform.localScale = Vector3.one; FMySubSprite fms = SceneManager.instance.AddComponent <FMySubSprite>(cloneGo); fms.SetDefalueMaterial(mMatName); mMySubSprs.Add(fms); fms.SetMeshMat(mMeshMat); fms.CreateClip(x, y, cx, cy, maxX, maxY, go); mMeshMat = fms.GetMesh(); return(fms); }