public void MoveTo(Vector2 vP, float time, Action <int> act, iTween.EaseType type = iTween.EaseType.linear, float delay = 0f) { if (0f >= time) { this.SetPosX(vP.x); this.SetPosY(vP.y); if (act != null) { act(0); } } else { this.movedAct = act; Hashtable hashtable = new Hashtable(); hashtable.Add("isLocal", true); hashtable.Add("x", vP.x); hashtable.Add("y", vP.y); hashtable.Add("time", EfcCont.GetFixedTime(time)); hashtable.Add("delay", delay); hashtable.Add("easetype", type); hashtable.Add("oncomplete", "MoveEnd"); hashtable.Add("oncompleteparams", 0); iTween.MoveTo(base.gameObject, hashtable); } }
public void InitEfc() { if (this.efcParam != null) { if (this.ecc == null) { this.ecc = base.gameObject.AddComponent <EfcCont>(); } float delayTime = this.GetDelayTime(true); if (delayTime >= -10f) { this.delayAdd_reserve = delayTime; Vector3 vector = base.gameObject.transform.localPosition; Vector3 vOffset = this.efcParam.vOffset; if (this.efcParam.isDoubleList && vector.x > this.DOUBLE_LIST_RIGHT_TRETHOLD) { vOffset.x = -vOffset.x; } vector += vOffset; base.gameObject.transform.localPosition = vector; if (this.efcParam.vLP_StartScale != Vector3.one) { this.ecc.SetScale(this.efcParam.vLP_StartScale); } this.efcIn = false; this.SetCT2Parent(1); } } }
private void Awake() { this.uiSafeArea = base.GetComponentInParent <UISafeArea>(); this.moveController = base.GetComponent <EfcCont>(); float x = this.uiSafeArea.GetWidgetSize().x; this.showPositionX = this.uiSafeArea.transform.localPosition.x - x * 0.5f + (float)this.frameWidget.width; this.closePositionX = this.uiSafeArea.transform.localPosition.x + x * 0.5f; }
private void InitFacilityBtn() { Vector3 zero = Vector3.zero; for (int i = 0; i < this.facilityChildButtonList.Count; i++) { GameObject gameObject = this.facilityChildButtonList[i]; zero.z = gameObject.transform.localPosition.z; gameObject.transform.localPosition = zero; zero.z = 1f; gameObject.transform.localScale = zero; EfcCont component = gameObject.GetComponent <EfcCont>(); component.SetColor(new Color(1f, 1f, 1f, 0f)); gameObject.GetComponent <GUICollider>().activeCollider = false; } this.isShowBtnFacility = false; }
private void EFC_FadeIn(bool isFadeIn, EfcCont ec, Vector3 vORG, EfcParam param) { if (null != ec) { this.actStartEfc(); if (isFadeIn) { Vector3 pos = vORG + param.vOffset; ec.SetPos(pos); Vector2 vP = new Vector2(vORG.x, vORG.y); ec.MoveTo(vP, param.time, new Action <int>(this.actEndEfc), param.type, param.delay); } else { Vector3 vector = vORG + param.vOffsetEnd; Vector2 vP2 = new Vector2(vector.x, vector.y); ec.MoveTo(vP2, param.time, new Action <int>(this.actEndEfc), param.typeEnd, param.delay); } } }
private void EFC_FadeInCol(bool isFadeIn, EfcCont ec) { if (null != ec) { this.actStartEfc(); if (isFadeIn) { this.tempCol = ec.GetColor(); this.tempCol.a = this.offCol.a; ec.SetColor(this.tempCol); this.tempCol.a = this.onCol.a; ec.ColorTo(this.tempCol, this.fadeInTime, new Action <int>(this.actEndEfc), iTween.EaseType.linear, 0f); } else { this.tempCol = ec.GetColor(); this.tempCol.a = this.offCol.a; ec.ColorTo(this.tempCol, this.fadeOutTime, new Action <int>(this.actEndEfc), iTween.EaseType.linear, 0f); } } }
public void ColorTo(Color c, float time, Action <int> act, iTween.EaseType type = iTween.EaseType.linear, float delay = 0f) { if (0f >= time) { this.SetColor(c); if (act != null) { act(0); } } else if (null == this.ngSpr && null == this.ngWdg) { if (act != null) { act(0); } } else { this.coloredAct = act; Hashtable hashtable = new Hashtable(); if (null != this.ngSpr) { hashtable.Add("from", this.ngSpr.color); } else if (null != this.ngWdg) { hashtable.Add("from", this.ngWdg.color); } hashtable.Add("to", c); hashtable.Add("time", EfcCont.GetFixedTime(time)); hashtable.Add("delay", delay); hashtable.Add("onupdate", "UpdateColor"); hashtable.Add("easetype", type); hashtable.Add("oncomplete", "colorEnd"); hashtable.Add("oncompleteparams", 0); iTween.ValueTo(base.gameObject, hashtable); } }
public void ScaleTo(Vector2 vS, float time, Action <int> act, iTween.EaseType type = iTween.EaseType.linear, float delay = 0f) { if (0f >= time) { this.SetScale(vS); if (act != null) { act(0); } } else { this.scaledAct = act; Hashtable hashtable = new Hashtable(); hashtable.Add("x", vS.x); hashtable.Add("y", vS.y); hashtable.Add("time", EfcCont.GetFixedTime(time)); hashtable.Add("delay", delay); hashtable.Add("easetype", type); hashtable.Add("oncomplete", "ScaleEnd"); hashtable.Add("oncompleteparams", 0); iTween.ScaleTo(base.gameObject, hashtable); } }
private void InitEFC() { if (null != this.goEFC_HEADER) { this.ecEFC_HEADER = this.goEFC_HEADER.GetComponent <EfcCont>(); if (null == this.ecEFC_HEADER) { this.ecEFC_HEADER = this.goEFC_HEADER.AddComponent <EfcCont>(); } this.vORG_HEADER = this.goEFC_HEADER.transform.localPosition; } if (null != this.goEFC_FOOTER) { this.ecEFC_FOOTER = this.goEFC_FOOTER.GetComponent <EfcCont>(); if (null == this.ecEFC_FOOTER) { this.ecEFC_FOOTER = this.goEFC_FOOTER.AddComponent <EfcCont>(); } this.vORG_FOOTER = this.goEFC_FOOTER.transform.localPosition; } if (null != this.goEFC_RIGHT) { this.ecEFC_RIGHT = this.goEFC_RIGHT.GetComponent <EfcCont>(); if (null == this.ecEFC_RIGHT) { this.ecEFC_RIGHT = this.goEFC_RIGHT.AddComponent <EfcCont>(); } this.vORG_RIGHT = this.goEFC_RIGHT.transform.localPosition; } if (null != this.goEFC_LEFT) { this.ecEFC_LEFT = this.goEFC_LEFT.GetComponent <EfcCont>(); if (null == this.ecEFC_LEFT) { this.ecEFC_LEFT = this.goEFC_LEFT.AddComponent <EfcCont>(); } this.vORG_LEFT = this.goEFC_LEFT.transform.localPosition; } if (null != this.goEFC_BG) { IEnumerator enumerator = this.goEFC_BG.transform.GetEnumerator(); try { while (enumerator.MoveNext()) { object obj = enumerator.Current; Transform transform = (Transform)obj; this.ecEFC_BG = transform.gameObject.GetComponent <EfcCont>(); if (null == this.ecEFC_BG) { this.ecEFC_BG = transform.gameObject.AddComponent <EfcCont>(); } } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } } if (null != this.goEFC_CTR) { IEnumerator enumerator2 = this.goEFC_CTR.transform.GetEnumerator(); try { while (enumerator2.MoveNext()) { object obj2 = enumerator2.Current; Transform transform2 = (Transform)obj2; this.ecEFC_CTR = transform2.gameObject.GetComponent <EfcCont>(); if (null == this.ecEFC_CTR) { this.ecEFC_CTR = transform2.gameObject.AddComponent <EfcCont>(); } } } finally { IDisposable disposable2; if ((disposable2 = (enumerator2 as IDisposable)) != null) { disposable2.Dispose(); } } } if (null != this.goEFC_PARAM_HEADER) { this.epEFC_PARAM_HEADER = this.goEFC_PARAM_HEADER.GetComponent <EfcParam>(); } if (null != this.goEFC_PARAM_FOOTER) { this.epEFC_PARAM_FOOTER = this.goEFC_PARAM_FOOTER.GetComponent <EfcParam>(); } if (null != this.goEFC_PARAM_RIGHT) { this.epEFC_PARAM_RIGHT = this.goEFC_PARAM_RIGHT.GetComponent <EfcParam>(); } if (null != this.goEFC_PARAM_LEFT) { this.epEFC_PARAM_LEFT = this.goEFC_PARAM_LEFT.GetComponent <EfcParam>(); } }
protected virtual void MakeAnimation(bool open, float atime, iTween.EaseType type = iTween.EaseType.linear) { float num; float num2; if (open) { num = 0f; num2 = 1f; } else { num = 1f; num2 = 0f; } this.isScaled = false; try { if (base.gameObject == null) { } } catch { this.ScaleEnd(0); return; } if (atime <= 0f) { base.gameObject.transform.localScale = new Vector3(num2, num2, 1f); this.ScaleEnd(0); this.Update(); } else { CommonDialog.MOVE_BEHAVIOUR move_BEHAVIOUR = this.moveBehavior; switch (move_BEHAVIOUR + 1) { case CommonDialog.MOVE_BEHAVIOUR.XY_SCALE: base.gameObject.transform.localScale = new Vector3(1f, 1f, 1f); this.isScaled = true; return; case CommonDialog.MOVE_BEHAVIOUR.X_SCALE: base.gameObject.transform.localScale = new Vector3(num, num, 1f); break; case CommonDialog.MOVE_BEHAVIOUR.Y_SCALE: base.gameObject.transform.localScale = new Vector3(num, 1f, 1f); break; case CommonDialog.MOVE_BEHAVIOUR.MOVE_FROM_LEFT: base.gameObject.transform.localScale = new Vector3(1f, num, 1f); break; case CommonDialog.MOVE_BEHAVIOUR.MOVE_FROM_RIGHT: { Vector3 localPosition = base.gameObject.transform.localPosition; localPosition.x = -this.moveLength; base.gameObject.transform.localPosition = localPosition; break; } case CommonDialog.MOVE_BEHAVIOUR.XY_SCALE_CLOSE: { Vector3 localPosition = base.gameObject.transform.localPosition; localPosition.x = this.moveLength; base.gameObject.transform.localPosition = localPosition; break; } case (CommonDialog.MOVE_BEHAVIOUR) 6: if (open) { base.gameObject.transform.localScale = new Vector3(1f, 1f, 1f); } else { base.gameObject.transform.localScale = new Vector3(num, num, 1f); } break; } Hashtable hashtable = new Hashtable(); hashtable.Add("from", num); hashtable.Add("to", num2); hashtable.Add("time", EfcCont.GetFixedTime(atime)); hashtable.Add("onupdate", "UpdateScale"); hashtable.Add("easetype", type); hashtable.Add("oncomplete", "ScaleEnd"); hashtable.Add("oncompleteparams", 0); iTween.ValueTo(base.gameObject, hashtable); } }
private void ShowHideFacilityBtn(bool isPlaySE) { Vector2 zero = Vector2.zero; Color c = new Color(1f, 1f, 1f, 0f); if (!this.isShowBtnFacility) { this.isShowBtnFacility = true; float time = 0.2f; c.a = 1f; for (int i = 0; i < this.facilityChildButtonList.Count; i++) { GameObject gameObject = this.facilityChildButtonList[i]; EfcCont component = gameObject.GetComponent <EfcCont>(); GUICollider component2 = gameObject.GetComponent <GUICollider>(); component2.activeCollider = true; zero.x = component2.GetOriginalPos().x; zero.y = component2.GetOriginalPos().y; component.MoveTo(zero, time, null, iTween.EaseType.spring, 0f); zero.x = (zero.y = 1f); component.ScaleTo(zero, time, null, iTween.EaseType.spring, 0f); component.ColorTo(c, time, null, iTween.EaseType.spring, 0f); Transform transform = gameObject.transform.Find("Campaign"); if (null != transform) { component = transform.GetComponent <EfcCont>(); component.ScaleTo(zero, time, null, iTween.EaseType.linear, 0f); } } if (isPlaySE) { SoundMng.Instance().TryPlaySE("SEInternal/Farm/se_205", 0f, false, true, null, -1); } this.ResetFarmWork(); } else { this.isShowBtnFacility = false; float time2 = 0.2f; c.a = 0f; for (int j = 0; j < this.facilityChildButtonList.Count; j++) { GameObject gameObject2 = this.facilityChildButtonList[j]; EfcCont component = gameObject2.GetComponent <EfcCont>(); component.MoveTo(zero, time2, null, iTween.EaseType.linear, 0f); GUICollider component2 = gameObject2.GetComponent <GUICollider>(); component2.activeCollider = false; component.ScaleTo(Vector2.one, time2, null, iTween.EaseType.linear, 0f); component.ColorTo(c, time2, null, iTween.EaseType.linear, 0f); Transform transform2 = gameObject2.transform.Find("Campaign"); if (null != transform2) { component = transform2.GetComponent <EfcCont>(); component.ScaleTo(zero, time2, null, iTween.EaseType.linear, 0f); } } if (isPlaySE) { SoundMng soundMng = SoundMng.Instance(); if (null != soundMng) { soundMng.TryPlaySE("SEInternal/Farm/se_206", 0f, false, true, null, -1); } } } this.SetAllAlertIcon(); }