public void ApplyCurve(LKCurveInfo lkCurveInfo, float normalizedTime) { float deltaCurveValue = lkCurveInfo.GetDeltaCurveValue(normalizedTime) * lkCurveInfo.scaleValue; Vector3 positionTransform = Vector3.zero; if (lkCurveInfo.xAxis) { positionTransform.x += deltaCurveValue; } if (lkCurveInfo.yAxis) { positionTransform.y += deltaCurveValue; } if (lkCurveInfo.zAxis) { positionTransform.z += deltaCurveValue; } if (lkCurveInfo.isWorld) { Transform expr_7D = this.mTransform; expr_7D.position = expr_7D.position + positionTransform; } else { Transform expr_97 = this.mTransform; expr_97.localPosition = expr_97.localPosition + positionTransform; } }
public void ApplyCurve(LKCurveInfo lkCurveInfo, float normalizedTime) { float deltaCurveValue = lkCurveInfo.GetDeltaCurveValue(normalizedTime) * lkCurveInfo.scaleValue; Vector3 rotationTransform = Vector3.zero; if (lkCurveInfo.xAxis) { rotationTransform.x += deltaCurveValue; } if (lkCurveInfo.yAxis) { rotationTransform.y += deltaCurveValue; } if (lkCurveInfo.zAxis) { rotationTransform.z += deltaCurveValue; } if (lkCurveInfo.isWorld) { //this.mTransform.Rotate(rotationTransform, 0); this.mTransform.Rotate(rotationTransform, Space.World); } else { //this.mTransform.Rotate(rotationTransform, 1); this.mTransform.Rotate(rotationTransform, Space.Self); } }
public void ApplyCurve(LKCurveInfo lkCurveInfo, float normalizedTime) { if (this.isEnable) { float deltaCurveValue = lkCurveInfo.GetDeltaCurveValue(normalizedTime); Color colorDelta = lkCurveInfo.toColor - this.mOriginalColor; /* * Color currColor = this.mUIWidget.color; * if (lkCurveInfo.rApply) * { * currColor.r += colorDelta.r * deltaCurveValue; * } * if (lkCurveInfo.gApply) * { * currColor.g += colorDelta.g * deltaCurveValue; * } * if (lkCurveInfo.bApply) * { * currColor.b += colorDelta.b * deltaCurveValue; * } * if (lkCurveInfo.aApply) * { * currColor.a += colorDelta.a * deltaCurveValue; * } * this.mUIWidget.color = currColor; */ } }
public void Reset() { this.mnLoopDelta = 0; this.mDurationDelta = 0f; this.mDelayDelta = 0f; base.gameObject.SetActive(true); if (null == this.mLKCurveAnimationImpArr) { this.mLKCurveAnimationImpArr = new ILKCurveAnimationImp[8]; } int i = 0; int max = this.mLKCurveInfoList.Count; while (i < max) { int impIndex = (int)this.mLKCurveInfoList[i].curveType; if (null == this.mLKCurveAnimationImpArr[impIndex]) { this.mLKCurveAnimationImpArr[impIndex] = this.CreateLKCurveAnimationImp(this.mLKCurveInfoList[i].curveType); } i++; } i = 0; max = this.mLKCurveInfoList.Count; while (i < max) { this.mLKCurveInfoList[i].Reset(); i++; } i = 0; max = this.mLKCurveInfoList.Count; while (i < max) { LKCurveInfo lkCurveInfo = this.mLKCurveInfoList[i]; if (lkCurveInfo.enable) { int impIndex = (int)lkCurveInfo.curveType; ILKCurveAnimationImp imp = this.mLKCurveAnimationImpArr[impIndex]; if (null != imp) { imp.Init(lkCurveInfo); imp.Reset(); } } i++; } i = 0; max = this.mLKCurveInfoList.Count; while (i < max) { int impIndex = (int)this.mLKCurveInfoList[i].curveType; ILKCurveAnimationImp imp = this.mLKCurveAnimationImpArr[impIndex]; if (null != imp) { imp.ApplyCurve(this.mLKCurveInfoList[i], 0f); } i++; } }
public void Init(LKCurveInfo lkCurveInfo) { if (this.mLKUVAnimation == null) { if (this.mLKUVAnimation = this.mGameObject.GetComponent <LKUVAnimation>()) { this.mOriginalScrollSpeed = new Vector2(this.mLKUVAnimation.scrollSpeedX, this.mLKUVAnimation.scrollSpeedY); } else { Debug.LogError("Texture UV Animation, LKUVAnimation is missing!"); } } }
public void ApplyCurve(LKCurveInfo lkCurveInfo, float normalizedTime) { if (this.mLKUVAnimation) { float deltaCurveValue = lkCurveInfo.GetDeltaCurveValue(normalizedTime) * lkCurveInfo.scaleValue; if (lkCurveInfo.xApply) { this.mLKUVAnimation.scrollSpeedX += deltaCurveValue; } if (lkCurveInfo.yApply) { this.mLKUVAnimation.scrollSpeedY += deltaCurveValue; } } }
public void ApplyCurve(LKCurveInfo lkCurveInfo, float normalizedTime) { float deltaCurveValue = lkCurveInfo.Evaluate(normalizedTime); Color tarColor = lkCurveInfo.fromColor; if (lkCurveInfo.rApply) { tarColor.r = Mathf.Lerp(lkCurveInfo.fromColor.r, lkCurveInfo.toColor.r, deltaCurveValue); } if (lkCurveInfo.gApply) { tarColor.g = Mathf.Lerp(lkCurveInfo.fromColor.g, lkCurveInfo.toColor.g, deltaCurveValue); } if (lkCurveInfo.bApply) { tarColor.b = Mathf.Lerp(lkCurveInfo.fromColor.b, lkCurveInfo.toColor.b, deltaCurveValue); } if (lkCurveInfo.aApply) { tarColor.a = Mathf.Lerp(lkCurveInfo.fromColor.a, lkCurveInfo.toColor.a, deltaCurveValue); } if (lkCurveInfo.bRecursive) { if (this.mChildColorNames != null && this.mChildColorNames.Length > 0) { int i = 0; int max = this.mChildColorNames.Length; while (i < max) { if (this.mChildColorNames[i] != null && this.mChildMaterials[i] != null) { this.mChildMaterials[i].SetColor(this.mChildColorNames[i], tarColor); } i++; } } } else { if (this.mColorName != null && this.mMaterial != null) { this.mMaterial.SetColor(this.mColorName, tarColor); } } }
public void ApplyCurve(LKCurveInfo lkCurveInfo, float normalizedTime) { float deltaCurveValue = lkCurveInfo.GetDeltaCurveValue(normalizedTime) * lkCurveInfo.scaleValue; Vector3 scaleTransform = Vector3.zero; if (lkCurveInfo.xAxis) { scaleTransform.x += deltaCurveValue; } if (lkCurveInfo.yAxis) { scaleTransform.y += deltaCurveValue; } if (lkCurveInfo.zAxis) { scaleTransform.z += deltaCurveValue; } Transform expr_70 = this.mTransform; expr_70.localScale = expr_70.localScale + scaleTransform; }
public void Init(LKCurveInfo lkCurveInfo) { if (lkCurveInfo.bRecursive) { if (this.mChildColorNames == null) { Renderer[] renderers = this.mGameObject.GetComponentsInChildren <Renderer>(true); this.mChildColorNames = new string[renderers.Length]; this.mChildMaterials = new Material[renderers.Length]; this.mChildOriginalColors = new Color[renderers.Length]; int i = 0; int nmax = renderers.Length; while (i < nmax) { Renderer ren = renderers[i]; this.mChildMaterials[i] = ren.material; this.mChildColorNames[i] = LKMaterialUtils.GetMaterialColorName(this.mChildMaterials[i]); this.mChildOriginalColors[i] = this.mChildMaterials[i].GetColor(this.mChildColorNames[i]); i++; } } } else { if (this.mMaterial == null) { Renderer renderer = this.mGameObject.GetComponent <Renderer>(); if (renderer != null) { this.mMaterial = renderer.material; this.mColorName = LKMaterialUtils.GetMaterialColorName(this.mMaterial); this.mOriginalColor = this.mMaterial.GetColor(this.mColorName); } else { Debug.LogError("Material Color Animation, Renderer or Material is missing!"); } } } }
private void Evaluate(float time) { if (this.mLKCurveInfoList != null) { float normalizedTime = time / this.mDuration; int i = 0; int max = this.mLKCurveInfoList.Count; while (i < max) { LKCurveInfo lkCurveInfo = this.mLKCurveInfoList[i]; if (lkCurveInfo.enable) { int impIndex = (int)lkCurveInfo.curveType; ILKCurveAnimationImp imp = this.mLKCurveAnimationImpArr[impIndex]; if (null != imp) { imp.ApplyCurve(lkCurveInfo, normalizedTime); } } i++; } } }
public void RemoveCurveInfo(LKCurveInfo lkCurveInfo) { this.mLKCurveInfoList.Remove(lkCurveInfo); }
public void AddCurveInfo(LKCurveInfo lkCurveInfo) { this.mLKCurveInfoList.Add(lkCurveInfo); }
public void Init(LKCurveInfo lkCurveInfo) { this.mLKCurveInfo = lkCurveInfo; }
public void ApplyCurve(LKCurveInfo lkCurveInfo, float normalizedTime) { float deltaCurveValue = lkCurveInfo.GetDeltaCurveValue(normalizedTime); if (lkCurveInfo.bRecursive) { if (this.mChildColorNames != null && this.mChildColorNames.Length > 0) { int i = 0; int max = this.mChildColorNames.Length; while (i < max) { if (this.mChildColorNames[i] != null && this.mChildMaterials[i] != null) { Color colorDelta = lkCurveInfo.toColor - this.mChildOriginalColors[i]; Color currColor = this.mChildMaterials[i].GetColor(this.mChildColorNames[i]); if (lkCurveInfo.rApply) { currColor.r += colorDelta.r * deltaCurveValue; } if (lkCurveInfo.gApply) { currColor.g += colorDelta.g * deltaCurveValue; } if (lkCurveInfo.bApply) { currColor.b += colorDelta.b * deltaCurveValue; } if (lkCurveInfo.aApply) { currColor.a += colorDelta.a * deltaCurveValue; } this.mChildMaterials[i].SetColor(this.mChildColorNames[i], currColor); } i++; } } } else { if (this.mColorName != null && this.mMaterial != null) { Color colorDelta = lkCurveInfo.toColor - this.mOriginalColor; Color currColor = this.mMaterial.GetColor(this.mColorName); if (lkCurveInfo.rApply) { currColor.r += colorDelta.r * deltaCurveValue; } if (lkCurveInfo.gApply) { currColor.g += colorDelta.g * deltaCurveValue; } if (lkCurveInfo.bApply) { currColor.b += colorDelta.b * deltaCurveValue; } if (lkCurveInfo.aApply) { currColor.a += colorDelta.a * deltaCurveValue; } this.mMaterial.SetColor(this.mColorName, currColor); } } }
public void Init(LKCurveInfo lkCurveInfo) { }