void addMoneyEffect(UITexture texture, UILabel label, int money) { UILabel getLabel = texture.transform.Find("getLabel").GetComponent <UILabel>(); NGUITools.SetActive(getLabel.gameObject, true); TweenScale tweenScale = TweenScale.Begin(getLabel.gameObject, 0.8f, Vector3.one); tweenScale.from = new Vector3(1.5f, 1.5f, 1.5f); tweenScale.to = Vector3.one; EventDelegate.Add(tweenScale.onFinished, delegate { Globals.Instance.MGUIManager.ShowSimpleCenterTips(6006); TweenRotation tween1 = TweenRotation.Begin(texture.gameObject, 0.5f, Quaternion.Euler(new Vector3(0f, 90f, 0f))); tween1.from = new Vector3(0f, 0f, 0f); tween1.to = new Vector3(0f, 90f, 0f); tween1.duration = 0.5f; tween1.ResetToBeginning(); tween1.PlayForward(); tween1.onFinished.Clear(); EventDelegate.Add(tween1.onFinished, delegate() { texture.mainTexture = null; NGUITools.SetActive(getLabel.gameObject, false); UISprite sprite = texture.transform.Find("Sprite").GetComponent <UISprite>(); NGUITools.SetActive(sprite.gameObject, true); label.text = Globals.Instance.MDataTableManager.GetWordText(6007) + money.ToString(); tween1.from = new Vector3(0f, 90f, 0f); tween1.to = new Vector3(0f, 0f, 0f); tween1.duration = 0.5f; tween1.ResetToBeginning(); tween1.PlayForward(); tween1.onFinished.Clear(); }, true); }, true); }
public void Turn() { // Facade.Instance<MusicManager>().Play();//Play2DSound(10); _ro.ResetToBeginning(); _ro.from = new Vector3(0, 0, 0); _ro.to = new Vector3(0, -90, 0); _ro.AddOnFinished(ChangeFEvent); _ro.PlayForward(); }
private void Move() { TP.from = originalPoint.localPosition; TP.to = endPoint.localPosition; TP.ResetToBeginning(); TR.from = originalPoint.localRotation.eulerAngles; TR.to = endPoint.localRotation.eulerAngles; TR.ResetToBeginning(); TP.PlayForward(); TR.PlayForward(); sprite.spriteName = _originalSptName; Transform arrow = mDMono.transform.parent.Find("DragArrow"); if (arrow.gameObject.activeSelf) { arrow.localPosition = ArrowPoint; TweenWidth tWidth = arrow.GetComponent <TweenWidth>(); tWidth.duration = TP.duration; tWidth.ResetToBeginning(); tWidth.PlayForward(); tWidth.style = UITweener.Style.Once; TweenHeight tHeight = arrow.GetComponent <TweenHeight>(); tHeight.duration = TP.duration; tHeight.ResetToBeginning(); tHeight.PlayForward(); tHeight.style = UITweener.Style.Once; } }
void PlayBaoXiangAnimation(bool StartOrStop) { CancelInvoke("PlayBXAnimation"); if (StartOrStop) { FanZhuan = 0; PlayIndex = 0; TRotation.PlayForward(); Oldduration = TRotation.duration; Invoke("PlayBXAnimation", Oldduration); } else { TRotation.transform.localRotation = Quaternion.Euler(Vector3.zero); } }
/// <summary> /// 初始化指针 /// </summary> void InitPointer() { uint fishingUpFishId = DataManager.Manager <FishingManager>().FishingUpFishId; FishingDataBase fishingDb = GameTableManager.Instance.GetTableItem <FishingDataBase>(fishingUpFishId); //初始化指针 if (tr != null) { tr.ResetToBeginning(); tr.PlayForward(); if (fishingDb != null) { tr.duration = fishingDb.ArcTime; } } //初始化转盘区域 m_sprite_PointerBg2.transform.eulerAngles = new Vector3(0, -90, 0); if (fishingDb != null) { uint deg = fishingDb.pointerRange; //加成区域圆弧度数 float fillAmount = deg * 1f / 180f; m_sprite_PointerBg2.fillAmount = fillAmount; this.m_degOffset = GetDegOffset(); m_sprite_PointerBg2.transform.eulerAngles = new Vector3(0, 0, -90 + deg * 0.5f + this.m_degOffset); } else { m_sprite_PointerBg2.fillAmount = 0; } }
void OnCustomModeOn() { //Debug.Log(1); tweenRot.PlayForward(); CustomModeOn(); buttonEvent.methodName = "OnCustomModeOff"; }
private IEnumerator MoveDown() { float time = .5f; if (!mMing) { time = 0.7f; for (int i = 0; i < normalHandCards.Length; i++) { normalHandCards[i].GetComponent <BoxCollider>().enabled = false; TweenPosition position = normalHandCards[i].GetComponent <TweenPosition>(); if (position != null) { position.from = normalHandCards[i].transform.localPosition; position.PlayForward(); } TweenRotation rotation = normalHandCards[i].GetComponent <TweenRotation>(); if (rotation != null) { rotation.from = normalHandCards[i].transform.localRotation.eulerAngles; rotation.PlayForward(); } } } yield return(new WaitForSeconds(time)); if (mCallBack != null) { mCallBack(); } OnCloseClick(); }
public void OnPlayerTrun(double time, double pastTime, EventDelegate updataCallBack = null, EventDelegate timeFinish = null) { if (Math.Abs(pastTime) > 0) { PassTime += pastTime; } ToTalTime = time; if (PassTime < ToTalTime) { IsStart = true; TimerBg.SetActive(true); OnTimerFinish = timeFinish; OnUpdateTimeCall = updataCallBack; } TweenRotation rotation = HeadBg.GetComponent <TweenRotation>(); if (rotation != null) { rotation.ResetToBeginning(); rotation.enabled = true; rotation.PlayForward(); } }
public void MoveToPage(int page) { if (page > TotalPage || page < 1 || islock) { return; } islock = true; CurPage = page; Quaternion tem_qua; float sita = 2 * Mathf.Atan2(0.5f * Width, Radis); float degree = 180f * sita / Mathf.PI; tem_qua = Quaternion.Euler(0, -(DegreePerPage / 2 + (CurPage - 1) * DegreeClipPerPage), 0); FadeInPage(CurPage, true); TweenRotation tr = TweenRotation.Begin(gameObject, 0.6f, tem_qua); tr.AddOnFinished(() => { islock = false; FadeInPage(CurPage - 1, false); FadeInPage(CurPage + 1, false); }); tr.PlayForward(); }
public void ShowTips(System.Type classType, Vector3 pos, Vector2 size, bool Isopen, params object[] args) { TweenScale ts = _mRootTransform.Find("SimpleTips").GetComponent <TweenScale>(); TweenRotation tr = _mRootTransform.Find("SimpleTips").GetComponent <TweenRotation>(); ts.ResetToBeginning(); tr.ResetToBeginning(); ts.PlayForward(); tr.PlayForward(); this.gameObject.SetActiveRecursively(false); this.gameObject.active = true; _mActiveTime = Time.realtimeSinceStartup; _mTipsContentList.TryGetValue(classType.Name, out _mContent); if (null != _mContent) { _mContent.SetActiveBG(Isopen); _mContent.gameObject.SetActiveRecursively(true); _mContent.SetValue(args); _mContent.DoLayout(pos, size); } Debug.Log("[GUIToolTips:] Gui position " + this.transform.position); }
private void TurnCard() { rotationCompleted = false; rotation.enabled = true; Debug.Log("1 rotationCompleted for card " + GetCardName() + ": " + rotationCompleted); rotation.PlayForward(); Debug.Log("2 rotationCompleted for card " + GetCardName() + ": " + rotationCompleted); }
/// <summary> /// Triggers kick effect /// </summary> /// <param name="other"></param> void OnCollisionEnter(Collision other) { //Debug.Log("I kicked the football!"); footballPosition.PlayForward(); footballElevation.PlayForward(); footballRotation.PlayForward(); }
/// <summary> /// 发一张牌,有过程 /// </summary> /// <param name="from">起始位置</param> /// <param name="to">目标位置</param> /// <param name="index"></param> /// <param name="depth">牌层级</param> /// <param name="cardId"></param> /// <param name="onFinish">动画结束时的执行方法</param> /// <returns></returns> public GameObject DoDealOnePokerWithAnim(Transform from, Transform to, int index, int depth, int cardId, Action onFinish = null) { GameObject gob = Instantiate(PokerPrefab); PokerCard pCard = gob.GetComponent <PokerCard>(); pCard.SetCardDepth(100 + depth * 2); pCard.Index = index; gob.transform.parent = to; gob.transform.position = from.position; gob.transform.localScale = Vector3.one; SpringPosition sp = gob.GetComponent <SpringPosition>(); sp.target = to.position; sp.enabled = true; sp.onFinished = (() => { UIGrid grid = to.GetComponentInParent <UIGrid>(); if (grid != null) { grid.Reposition(); } if (onFinish != null) { onFinish(); } //当传入牌值为0时,是牌的背面,所以不翻牌 if (cardId != 0) { pCard.SetCardId(cardId); pCard.TurnCard(); } }); TweenAlpha ta = gob.GetComponent <TweenAlpha>(); ta.from = 0.5f; ta.to = 1; ta.duration = _runTime; ta.ResetToBeginning(); ta.PlayForward(); TweenRotation tr = gob.GetComponent <TweenRotation>(); tr.from = new Vector3(0, 0, -66); tr.to = Vector3.zero; tr.duration = _runTime; tr.ResetToBeginning(); tr.PlayForward(); return(gob); }
void ActiveFinishRankTRot() { EventDelegate.Add(FinishRankTRot.onFinished, delegate { Invoke("FlashPlayerRank", 0.1f); }); FinishRankTRot.ResetToBeginning(); FinishRankTRot.enabled = true; FinishRankTRot.PlayForward(); //AudioManager.Instance.PlaySFX(AudioRankTRot); }
void RotateCard(GameObject poker, Vector3 from, Vector3 to, float durtation = 0.3f) { TweenRotation tr = poker.GetComponent <TweenRotation>(); tr.from = from; tr.to = to; tr.duration = durtation; tr.ResetToBeginning(); tr.PlayForward(); }
public void TurnCard() { transform.localScale = new Vector3(0.9f, 0.9f, 1f); TweenRotation rightTweenR = GetComponent <TweenRotation>(); rightTweenR.from = new Vector3(0, 0, 0); rightTweenR.to = new Vector3(0, -90, 0); rightTweenR.AddOnFinished(_changeFEvent); rightTweenR.ResetToBeginning(); rightTweenR.PlayForward(); }
/// <summary> /// 隐藏牌,有过程 /// </summary> /// <param name="poker">要隐藏的牌</param> /// <param name="to">目标位置</param> /// <param name="onFinish">结束时回掉方法</param> public void HidePokerWithAnim(GameObject poker, Transform to = null, Action onFinish = null) { if (poker == null) { return; } PokerCard pCard = poker.GetComponent <PokerCard>(); pCard.SetCardId(0); pCard.SetCardFront(); if (to == null) { to = HideTran; } poker.transform.parent = to.transform; SpringPosition sp = poker.GetComponent <SpringPosition>(); sp.target = Vector3.zero; sp.enabled = true; TweenAlpha ta = poker.GetComponent <TweenAlpha>(); ta.from = 1; ta.to = 0; ta.duration = _runTime; ta.ResetToBeginning(); ta.PlayForward(); ta.AddOnFinished(onFinish != null ? new EventDelegate(() => { onFinish(); }) : new EventDelegate(() => { Destroy(poker); })); TweenRotation tr = poker.GetComponent <TweenRotation>(); tr.from = new Vector3(0, 0, -4); tr.to = Vector3.zero; tr.duration = _runTime; tr.ResetToBeginning(); tr.PlayForward(); TweenScale ts = poker.GetComponent <TweenScale>(); ts.from = poker.transform.localScale; ts.to = Vector3.one * 0.3f; ts.ResetToBeginning(); ts.PlayForward(); }
public void OpenCard(bool needAnim = true) { if (needAnim && null != m_openAnim) { m_openAnim.ResetToBeginning(); m_openAnim.PlayForward(); } else { SetOpenData(); } }
public void showSettingUI() { if (isHide) { tweenrotation.PlayForward(); isHide = false; } else { tweenrotation.PlayReverse(); isHide = true; } }
public void FireEffect() { tp_fireEffect1.ResetToBeginning(); tp_fireEffect1.PlayForward(); tr_fireEffect2.ResetToBeginning(); tr_fireEffect2.PlayForward(); tr_fireEffect3.ResetToBeginning(); tr_fireEffect3.PlayForward(); tr_fireEffect4.ResetToBeginning(); tr_fireEffect4.PlayForward(); }
public void Show() { if (gameObject.activeSelf) { return; } gameObject.SetActive(true); loadingTween.ResetToBeginning(); loadingTween.enabled = true; loadingTween.PlayForward(); loadingTween.duration = 3; StartCoroutine(LoadingOverTime(15)); }
public void TurnCard() { TweenRotation rightTweenR = GetComponent <TweenRotation>(); rightTweenR.from = new Vector3(0, 0, 0); rightTweenR.to = new Vector3(0, -90, 0); if (_changeFEvent == null) { _changeFEvent = new EventDelegate(Onfinish); } rightTweenR.AddOnFinished(_changeFEvent); rightTweenR.ResetToBeginning(); rightTweenR.PlayForward(); }
/// <summary> /// 播放翻牌动画 /// </summary> private void TurnCard() { TweenRotation rightTweenR = GetComponent <TweenRotation>(); if (rightTweenR == null) { return; } rightTweenR.from = new Vector3(0, 0, 0); rightTweenR.to = new Vector3(0, -90, 0); rightTweenR.AddOnFinished(_changeFEvent); rightTweenR.ResetToBeginning(); rightTweenR.PlayForward(); }
private void Onfinish() { TweenRotation rightTweenR = GetComponent <TweenRotation>(); SetCardFront(); rightTweenR.RemoveOnFinished(_changeFEvent); rightTweenR.from = new Vector3(0, -90, 0); rightTweenR.to = new Vector3(0, 0, 0); rightTweenR.AddOnFinished(_changeOEvent); rightTweenR.ResetToBeginning(); rightTweenR.PlayForward(); }
public void MakeFirePointRot() { TweenRotation twRot = gameObject.AddComponent <TweenRotation>(); //twRot.from = Vector3.zero; transform.localEulerAngles = RotAngStart; twRot.from = RotAngStart; twRot.to = RotAngEnd; twRot.duration = TimeRot; EventDelegate.Add(twRot.onFinished, delegate { MoveFirePointOver(); }); twRot.PlayForward(); }
void SelectMode() { switch (GlobalData.GetInstance().gameMode) { case GameMode.SoloMode: if (GameTextVal == GameTextType.Chinese) { soloModeUI.spriteName = "QuWeiMode"; onlineModeUI.spriteName = "LinkModeHui"; } else { soloModeUI.spriteName = "QuWeiMode_En"; onlineModeUI.spriteName = "LinkModeHui_En"; } if (!isnew) { //soloUnhover.ResetToBeginning(); soloHover.PlayForward(); //soloUnhover.enabled=false; onlineUnHover.PlayForward(); //onlineHover.enabled=false; } break; case GameMode.OnlineMode: if (GameTextVal == GameTextType.Chinese) { soloModeUI.spriteName = "QuWeiModeHui"; onlineModeUI.spriteName = "LinkMode"; } else { soloModeUI.spriteName = "QuWeiModeHui_En"; onlineModeUI.spriteName = "LinkMode_En"; } if (!isnew) { onlineHover.PlayForward(); //onlineHover.Play(); soloUnhover.PlayForward(); } break; } }
public void TurnCard() { if (Id == 0) { return; } TweenRotation rightTweenR = GetComponent <TweenRotation>(); rightTweenR.from = new Vector3(0, 0, 0); rightTweenR.to = new Vector3(0, -90, 0); rightTweenR.AddOnFinished(_changeFEvent); rightTweenR.ResetToBeginning(); rightTweenR.PlayForward(); }
public void moveCursol() { int num = (int)Util.LoopValue(this.keyContoroller.Index - this.myOffset, 0f, 6f); bool flag = this.keyContoroller.prevIndexChangeValue > 0; for (int i = 0; i < this.menuButton.Length; i++) { int num2 = i - num; if (num2 < 0) { num2 = this.menuButton.Length + num2; } TweenRotation component = this.menuButton[i].GetComponent <TweenRotation>(); Vector3 vector = new Vector3(0f, 0f, this.nowRotateZ[i]); if (num2 == 0 && this.MenuEnable[(int)Util.LoopValue(this.myOffset + i, 0f, 6f)]) { this.menuButton[i].GetComponent <UIButton>().isEnabled = true; this.menuButton[i].GetComponentInChildren <UISprite>().spriteName = this.MenuButtonName[(int)Util.LoopValue(this.myOffset + i, 0f, 6f)] + "on"; } else { this.menuButton[i].GetComponent <UIButton>().isEnabled = false; this.menuButton[i].GetComponentInChildren <UISprite>().spriteName = this.MenuButtonName[(int)Util.LoopValue(this.myOffset + i, 0f, 6f)] + "off"; } int num3 = 25; if (flag) { if (num2 == this.footerNo) { num3 = 210; } } else { num3 *= -1; if (num2 == this.upperNo) { num3 = -210; } } component.from = new Vector3(0f, 0f, this.nowRotateZ[i]); component.to = new Vector3(0f, 0f, this.nowRotateZ[i] + (float)num3); this.nowRotateZ[i] = this.nowRotateZ[i] + (float)num3; component.ResetToBeginning(); component.delay = 0f; component.PlayForward(); } }
/// <summary> 카드 이펙트 실행 함수 </summary> public void StartCardAction() { ActiveCollider(false); RewardGroup.SetActive(false); TweenRotation rot = GetComponentInParent <TweenRotation>();//시작은 로테이션 rot.ResetToBeginning(); rot.PlayForward(); TempCoroutine.instance.FrameDelay(rot.delay + (rot.duration * 0.5f), () => { Img.spriteName = "reward_pendant_01"; }); EventDelegate.Set(rot.onFinished, GroupOneTweenPos); }
public void Enter() { if (this.isEnter) { return; } this.isEnter = true; this.tp.onFinished.Clear(); this.tp.PlayForward(); TweenRotation[] array = this.tweenRots; for (int i = 0; i < array.Length; i++) { TweenRotation tweenRotation = array[i]; tweenRotation.PlayForward(); } }