//动画In public override void AnimIn(EventDelegate.Callback onComplete) { if (null == tp) { tp = m_widget_Content.GetComponent <TweenPosition>(); } if (null != tp) { tp.ResetToBeginning(); } EventDelegate.Callback animInAction = () => { m_bool_playAnim = false; }; if (null == onComplete) { onComplete = animInAction; } else { onComplete += animInAction; } tp.onFinished.Clear(); EventDelegate.Set(tp.onFinished, onComplete); tp.PlayForward(); tp.enabled = true; m_bool_playAnim = true; }
public void TweenRepeat_Scale_Position_Alpha() { if (mTweenScale) { mTweenScale.enabled = false; mTweenScale.ResetToBeginning(); mTweenScale.enabled = true; //Debug.Log("mTweenScale"); } if (mTweenPosition) { mTweenPosition.enabled = false; mTweenPosition.ResetToBeginning(); mTweenPosition.enabled = true; //Debug.Log("mTweenPosition"); } if (mTweenAlpha) { mTweenAlpha.enabled = false; mTweenAlpha.ResetToBeginning(); mTweenAlpha.enabled = true; //Debug.Log("mTweenAlpha"); } //Debug.Log("done TweenRepeat_Scale_Position_Alpha"); }
public void OnClickKingsGift() { m_KingsScript.gameObject.SetActive(true); KingsScriptStartTime = DateTime.Now; bool is_takeable = Network.PlayerInfo.kings_gift.takeable_at < Network.Instance.ServerTime; m_KingsScript.text = KingsGiftInfoManager.Instance.GetRandomScript(Network.PlayerInfo.kings_gift.kings_gift_idn, is_takeable); m_KingsScriptTween.enabled = true; m_KingsScriptTween.ResetToBeginning(); m_KingsScriptTween.PlayForward(); if (is_takeable == true) {//Complete m_Button.SetActive(false); m_KingsRewardTween.AddOnFinished(new EventDelegate(RequestKingsGift)); m_KingsRewardTween.enabled = true; m_KingsRewardTween.ResetToBeginning(); m_KingsRewardTween.PlayForward(); } else {//Show Script m_KingCharacter.Character.Stop(); m_KingCharacter.Character.Play(false, "touch"); } }
public void OnClick_SelectBet() { if (allow_Click) { bcirclemoving = true; allow_Click = false; if (state_open) { touch_panel.SetActive(false); //dark_panel.SetActive(false); tween_circle.from = new Vector3(75.0f, 0, 0); tween_circle.to = new Vector3(375.0f, 0, 0); tween_circle.duration = 0.2f; tween_circle.ResetToBeginning(); tween_circle.enabled = true; } else { touch_panel.SetActive(true); //dark_panel.SetActive(true); tween_circle.from = new Vector3(375.0f, 0, 0); tween_circle.to = new Vector3(75.0f, 0, 0); tween_circle.duration = 0.3f; tween_circle.ResetToBeginning(); tween_circle.enabled = true; } bcirclemoving = true; } }
public void MoveIn() { gameObject.SetActive(true); InitTween(true); moveTween.ResetToBeginning(); moveTween.onFinished.Clear(); moveTween.PlayForward(); }
/// <summary> /// 特写单个角色摄像机以及角色移动细节操作 /// </summary> /// <param name="mode"></param> /// <param name="featureCharacter"></param> private void OnOnlyOneCharacterFeatureFished(FeatureMode mode, GameObject featureCharacter) { Vector3 screenVec = Vector3.zero; if (mode == FeatureMode.left) { screenVec = new Vector3((Screen.width / 4), 0.4F * Screen.height, Mathf.Abs(main_Camera.transform.position.z)); } else if (mode == FeatureMode.right) { screenVec = new Vector3((Screen.width / 4) * 3, 0.4F * Screen.height, Mathf.Abs(main_Camera.transform.position.z)); } TweenPosition characterTP = featureCharacter.GetComponent <TweenPosition>(); TweenRotation cameraTR = main_Camera.GetComponent <TweenRotation>(); Vector3 targetVec = Camera.main.ScreenToWorldPoint(screenVec); targetVec = targetVec - curBG.transform.position; featureCharacter.transform.position = targetVec; cameraTR.enabled = true; Vector3 fromVec = new Vector3(0, main_Camera.transform.rotation.eulerAngles.y, 0); if (fromVec.y > 180) { fromVec.y = fromVec.y - 360; } cameraTR.from = fromVec; cameraTR.duration = 3; cameraTR.onFinished.Clear(); characterTP.enabled = true; characterTP.from = featureCharacter.transform.position; characterTP.duration = 3.0f; characterTP.onFinished.Clear(); if (mode == FeatureMode.left) { cameraTR.to = new Vector3(0, fromVec.y, 3); characterTP.to = new Vector3(featureCharacter.transform.position.x + 1, featureCharacter.transform.position.y, 0); cameraTR.ResetToBeginning(); characterTP.ResetToBeginning(); } else if (mode == FeatureMode.right) { cameraTR.to = new Vector3(0, fromVec.y, -3); characterTP.to = new Vector3(featureCharacter.transform.position.x - 1, featureCharacter.transform.position.y, 0); cameraTR.ResetToBeginning(); characterTP.ResetToBeginning(); } }
public void fromSend(Vector3 from) { tween.from = from; Vector3 to = new Vector3(Random.Range(-50f, 50f), Random.Range(-20f, 50f), 0); tween.to = to; tween.ResetToBeginning(); tween.enabled = true; bFinished = false; }
// Use this for initialization void Start() { CardOpen1_Sprite.spriteName = "CardOpen_01"; MoveCard_Sprite.spriteName = "01"; CardOpen1_Sprite.enabled = false; CardOpen2_Sprite.enabled = false; CardOpen3_Sprite.enabled = false; CardOpenBlack_Sprite.enabled = false; MoveCard_Sprite.enabled = false; FirstMoveCard.ResetToBeginning(); FirstMoveCard2.ResetToBeginning(); FirstMoveCard3.ResetToBeginning(); FirstMoveCard4.ResetToBeginning(); MoveCard_Position.ResetToBeginning(); MoveCard_Scale.ResetToBeginning(); Open1Number = 1; OpenTime = 0.0f; NextCardOpenBool = false; CardMoveBool = false; CardMoveTimeBool = false; ShowTwoBool = false; CardAnimationShow_Bool = false; FourCardWiner_Bool = false; for (int i = 0; i < 6; i++) { CardOpenSeat[i] = 0; } if (!VersionDef.BaccaratCardSize) { Banker1_V3 = new Vector3(361, 200, 0);//165 Banker2_V3 = new Vector3(418, 200, 0); Banker3_V3 = new Vector3(475, 200, 0); Player1_V3 = new Vector3(-361, 200, 0); Player2_V3 = new Vector3(-304, 200, 0); Player3_V3 = new Vector3(-247, 200, 0); MoveCard_Scale.from = new Vector3(1.02f, 1.05f, 1); MoveCard_Position.from = new Vector3(0, -2, 0); } else { Banker1_V3 = new Vector3(361, 200, 0);//165 Banker2_V3 = new Vector3(418, 200, 0); Banker3_V3 = new Vector3(475, 200, 0); Player1_V3 = new Vector3(-361, 200, 0); Player2_V3 = new Vector3(-304, 200, 0); Player3_V3 = new Vector3(-247, 200, 0); MoveCard_Scale.from = new Vector3(2.04f, 2.1f, 1); MoveCard_Position.from = new Vector3(0, 0, 1); } }
public void InitState(Vector3 pos, UILabel title, GameObject content) { title.color = colorHight; tpTitleBack.ResetToBeginning(); tpTitleBack.to = pos; tpTitleBack.PlayForward(); content.SetActive(true); curTitle = title; goCurView = content; curPostion = pos; }
public void BeginMove(Vector3 to, float duration = 0.5f, float delay = 0) { gameObject.SetActive(true); Tp.from = transform.localPosition; Tp.to = to; Tp.duration = duration; Tp.delay = delay; Tp.ResetToBeginning(); Tp.PlayForward(); Finished = /*MoveTo;/*/ Wait;//*/ }
/* * string suDuSpriteName = "1_01"; * string BaoguoSpriteName = "1_06"; * string BaoguoSpriteName_1 = "1_04"; * string DaojishiSpriteName = "1_05"; * string DiedaoSpriteName = "2_01"; * string JiashidianSpriteName = "1_02"; * string LuduanSpriteName = "2_01"; */ void ShowTishiEvent(TishiInfo tishi) { if (playing && tishi != TishiInfo.Jiashidian) { //ScreenLog.Log("ShowTishiEvent -> tishi " + tishi + ", this.tishi " + this.tishi); return; } //ScreenLog.Log ("ShowTishiEvent -> tiShi " + tishi.ToString()); if (tishi == TishiInfo.Diedao) { diedaoShijian = Time.timeSinceLevelLoad; //ScreenLog.Log("diedaoshijian"+diedaoShijian); } if (playing) { //ScreenLog.Log("is playing"+playing+this.tishi+tishi); if (this.tishi == TishiInfo.Diedao && tishi == TishiInfo.Sudu) { float detTime = Time.timeSinceLevelLoad - diedaoShijian; if (detTime < 0.5f) { return; } } StopAllCoroutines(); tween.enabled = false; tween.from = trans.localPosition; tween.to = from; tween.ResetToBeginning(); tween.PlayForward(); localDuation = -1; tween.onFinished.Clear(); playing = false; this.tishi = tishi; StartPlay(); //EventDelegate.Add(tween.onFinished, StartPlay); } else { this.tishi = tishi; StartPlay(); } }
void CardOpen() { byte ChangePoint = (byte)(((CardNumber - 1) % 13) + 1); DealerCard_Position.from = DealerCardFirstPointV3; DealerCard_Position.to = FinallDealerCardMove; if (DelayTime < 1) { DelayTime += Time.deltaTime; if (DelayTime > 0.4) { if (CardNumber == 0) { DealerCard_Sprite.spriteName = "bg_pokerback_1"; } else if (CardNumber > 0 && CardNumber < 14) { DealerCard_Sprite.spriteName = "bg_poker_d" + ChangePoint; } else if (CardNumber >= 14 && CardNumber < 27) { DealerCard_Sprite.spriteName = "bg_poker_c" + ChangePoint; } else if (CardNumber >= 27 && CardNumber < 40) { DealerCard_Sprite.spriteName = "bg_poker_b" + ChangePoint; } else if (CardNumber >= 40) { DealerCard_Sprite.spriteName = "bg_poker_a" + ChangePoint; } } } else { DelayTime = 0; SecneMove = true; DealerCard_Position.ResetToBeginning(); DealerCard_Position.PlayForward(); if (ThisCardList != CardTeamList.Card1Team1 && ThisCardList != CardTeamList.Card1Team2 && ThisCardList != CardTeamList.CardBanker) { DealerCard_Scale.PlayForward(); } FirstMoveEnd = false; FinallEnd = true; } }
public virtual void MoveItem() { TweenPosition tp = GetComponent <TweenPosition>(); tp.ResetToBeginning(); tp.PlayForward(); }
void Move(int index, float duration) { if (index == 0 || index >= _movePosList.Count) { effectObj.SetActive(false); return; } if (effectObj == null) { return; } TweenPosition tweenPosition = effectObj.GetComponent <TweenPosition>(); if (tweenPosition == null) { tweenPosition = effectObj.AddComponent <TweenPosition>(); } tweenPosition.ResetToBeginning(); effectObj.transform.localPosition = _movePosList[index - 1]; tweenPosition.enabled = true; tweenPosition.from = _movePosList[index - 1]; tweenPosition.to = _movePosList[index]; tweenPosition.PlayForward(); tweenPosition.duration = duration; }
private IEnumerator <float> ShowNewlyUnlockedSongs() { if (newSongs == null) { yield break; } //wait for popup animation to complete yield return(Timing.WaitForSeconds(1.5f)); //play explosion animation here //wait for animation to complete //yield return Timing.WaitForSeconds(1f); for (int i = 0; i < newSongs.newlyUnlockedSongs.Count; i++) { listSongItems[i].Model = newSongs.newlyUnlockedSongs[i]; listSongItems[i].gameObject.SetActive(true); listSongItems[i].RefreshItemView(); } yield return(0); songsGrid.enabled = true; float heightTweenContent = newSongs.newlyUnlockedSongs.Count * songsGrid.cellHeight * 0.5f + 100; contentTween.ResetToBeginning(); contentTween.to = new Vector3(0, heightTweenContent); contentTween.PlayForward(); yield return(Timing.WaitForSeconds(contentTween.duration)); buttonClose.SetActive(true); }
void AddPosTween() { tween.from = posFrom; tween.to = posTo; tween.ResetToBeginning(); tween.PlayForward(); }
void StartShowChooseBtn() { for (int i = 0; i < ChooseBtnContainer.childCount; i++) { GameObject go = ChooseBtnContainer.GetChild(i).gameObject; TweenPosition tp = go.GetComponent <TweenPosition>(); tp.enabled = true; tp.duration = 0.5f; tp.delay = 0.5f + 0.3f * i; tp.onFinished.Clear(); tp.from = go.transform.localPosition; tp.to = new Vector3(-8.0f + i * 3.0f, 0, 3.5f); tp.ResetToBeginning(); TweenRotation tr = go.GetComponent <TweenRotation>(); tr.enabled = true; tr.duration = 1.0f; tr.delay = i * 0.5f; tr.onFinished.Clear(); tr.from = go.transform.localRotation.eulerAngles; tr.to = new Vector3(0, 0, 0); tr.ResetToBeginning(); if (i >= ChooseBtnContainer.childCount - 1) { tr.onFinished.Add(new EventDelegate(AddComponentToCard)); } } }
void Update() { #if UNITY_STANDALONE_WIN if (Input.GetMouseButtonDown(1)) { SingleCanon _sc = singleCanonList[realCanonID]; _sc.C_S_GunPowerUp(); } #endif // 如果打开按钮面板,并且超时.就自动关闭按钮面板 if (m_bIsOpenButton && m_bTimeOut) { TweenPosition tp_LeftButton = m_gLeftButton.GetComponent <TweenPosition>(); tp_LeftButton.from = new Vector3(-35, 0, 0); tp_LeftButton.to = new Vector3(-160, 0, 0); tp_LeftButton.enabled = true; tp_LeftButton.ResetToBeginning(); TweenPosition tp_RightButton = m_gRightButton.GetComponent <TweenPosition>(); tp_RightButton.from = new Vector3(35, 0, 0); tp_RightButton.to = new Vector3(160, 0, 0); tp_RightButton.enabled = true; tp_RightButton.ResetToBeginning(); m_bIsOpenButton = false; m_gAllButtonBG.transform.localScale = new Vector3(1, 1, 1); } }
public void ClickLikeBtn(GameObject go) { string value = ToolsFacade.ServerCurrentTime.ToString("y-M-d"); string name = go.transform.parent.name; go.GetComponent <TweenScale>().PlayForward(); go.transform.Find("fly").gameObject.SetActive(true); TweenPosition component = go.transform.Find("fly").GetComponent <TweenPosition>(); component.ResetToBeginning(); TweenAlpha component2 = go.transform.Find("fly").GetComponent <TweenAlpha>(); component2.ResetToBeginning(); component.PlayForward(); component2.PlayForward(); go.transform.GetComponent <UISprite>().spriteName = "Settlement_praise_02"; UIEventListener.Get(go).onClick = null; if (SendMsgManager.Instance.SendMsg(MobaGameCode.SayGoodToSomeOne, null, new object[] { name })) { PlayerPrefs.SetString(name, value); PlayerPrefs.Save(); this.LikeCount.text = ToolsFacade.Instance.GetMillionsSuffix(ModelManager.Instance.Get_GetPlayerData_X().likeCount + 1); } }
public void OpenAllButton() { if (m_bIsOpenButton) { CloseAllButton(); } else { TweenPosition tp_LeftButton = m_gLeftButton.GetComponent <TweenPosition>(); tp_LeftButton.from = new Vector3(-160, 0, 0); tp_LeftButton.to = new Vector3(-35, 0, 0); tp_LeftButton.enabled = true; tp_LeftButton.ResetToBeginning(); TweenPosition tp_RightButton = m_gRightButton.GetComponent <TweenPosition>(); tp_RightButton.from = new Vector3(160, 0, 0); tp_RightButton.to = new Vector3(35, 0, 0); tp_RightButton.enabled = true; tp_RightButton.ResetToBeginning(); m_gAllButtonBG.transform.localScale = new Vector3(-1, 1, 1); m_bIsOpenButton = true; } }
float PlayForward0_1(float dt = 0) { if (dt > 0) { InvokeBlock(dt, () => { tpChangeEffect0_1.ResetToBeginning(); tpChangeEffect0_1.PlayForward(); }); } else { tpChangeEffect0_1.ResetToBeginning(); tpChangeEffect0_1.PlayForward(); } return(tpChangeEffect0_1.duration); }
public void ArenaLoadingRrev(Transform lTf, Transform rTf, Transform title) { //잠시 TweenPosition Ltp = lTf.GetComponent <TweenPosition>(); if (Ltp != null) { Ltp.ResetToBeginning(); Ltp.PlayForward(); } TweenPosition Rtp = rTf.GetComponent <TweenPosition>(); if (Rtp != null) { Rtp.ResetToBeginning(); Rtp.PlayForward(); } prevLoadingTime += Ltp.duration; TweenScale ts = title.GetComponent <TweenScale>(); prevLoadingTime += ts.duration; TempCoroutine.instance.FrameDelay(0.1f, () => { if (ts != null) { ts.ResetToBeginning(); ts.PlayForward(); } }); }
private void OnOnlyOneCharacterFeatureFished() { GameObject player = GameObject.FindWithTag("Player"); Vector3 screenVec = new Vector3((Screen.width / 5) * 2, 0.4F * Screen.height, Mathf.Abs(main_Camera.transform.position.z)); TweenPosition characterTP = player.GetComponent <TweenPosition>(); TweenRotation cameraTR = main_Camera.GetComponent <TweenRotation>(); Vector3 targetVec = Camera.main.ScreenToWorldPoint(screenVec); player.transform.position = targetVec; cameraTR.enabled = true; Vector3 fromVec = new Vector3(0, main_Camera.transform.rotation.eulerAngles.y, 0); if (fromVec.y > 180) { fromVec.y = fromVec.y - 360; } cameraTR.from = fromVec; cameraTR.to = new Vector3(0, fromVec.y, 3); cameraTR.duration = 3; cameraTR.onFinished.Clear(); cameraTR.ResetToBeginning(); characterTP.enabled = true; characterTP.from = player.transform.position; characterTP.duration = 3.0f; characterTP.onFinished.Clear(); characterTP.to = new Vector3(player.transform.position.x + 1, player.transform.position.y, 0); characterTP.ResetToBeginning(); }
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 FlashTrainCountAction(int newCount) { Duan_1.text = Duan_0.text; Duan_0.text = newCount.ToString(); TweenPosition tween_p0 = Duan_0.gameObject.GetComponent <TweenPosition>(); TweenColor tween_c0 = Duan_0.gameObject.GetComponent <TweenColor>(); tween_p0.ResetToBeginning(); tween_p0.enabled = true; tween_p0.Play(true); tween_c0.ResetToBeginning(); tween_c0.enabled = true; tween_c0.Play(true); TweenPosition tween_p1 = Duan_1.gameObject.GetComponent <TweenPosition>(); TweenColor tween_c1 = Duan_1.gameObject.GetComponent <TweenColor>(); tween_p1.ResetToBeginning(); tween_p1.enabled = true; tween_p1.Play(true); tween_c1.ResetToBeginning(); tween_c1.enabled = true; tween_c1.Play(true); }
public void OnceEnd() { try { if (TweenLabel != null) { CheckAndDeleteStr(); TweenPosition tp = TweenLabel.GetComponent <TweenPosition>(); if (tp != null) { tp.ResetToBeginning(); tp.from = m_TweenPosFrom; tp.to = new UnityEngine.Vector3(GetOffsetWidth(), m_TweenPosFrom.y, tp.to.z); tp.duration = DelayTime + strcount * 0.3f; tp.enabled = true; } } if (tipStrDic.Count == 0) { NGUITools.SetActive(TweenLabel, false); } } catch (Exception ex) { ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
void FlashTrainStarAction(int newStar) { Ji_1.text = Ji_0.text; Ji_0.text = newStar.ToString(); TweenPosition tween_p0 = Ji_0.gameObject.GetComponent <TweenPosition>(); TweenColor tween_c0 = Ji_0.gameObject.GetComponent <TweenColor>(); tween_p0.ResetToBeginning(); tween_p0.enabled = true; tween_p0.Play(true); tween_c0.ResetToBeginning(); tween_c0.enabled = true; tween_c0.Play(true); TweenPosition tween_p1 = Ji_1.gameObject.GetComponent <TweenPosition>(); TweenColor tween_c1 = Ji_1.gameObject.GetComponent <TweenColor>(); tween_p1.ResetToBeginning(); tween_p1.enabled = true; tween_p1.Play(true); tween_c1.ResetToBeginning(); tween_c1.enabled = true; tween_c1.Play(true); }
public void ClearS() { Destroy(sp.gameObject.GetComponent <MiniItween>()); CancelInvoke("loopAnimation"); if (ts != null) { ts.onFinished.Clear(); ts.ResetToBeginning(); ts.enabled = false; } if (ts1 != null) { ts1.onFinished.Clear(); ts1.ResetToBeginning(); ts1.enabled = false; } if (tp != null) { tp.onFinished.Clear(); tp.ResetToBeginning(); tp.enabled = false; } }
/// <summary> /// 小盲注的位置索引 /// </summary> //private int _smallD = 0; #region 发手牌 /// <summary> /// 发一张牌 有过程 /// </summary> private GameObject DealOnes(Transform from, Transform to, int cardValue = 0, int index = 0) { GameObject gob = Instantiate(PokerPrefab); gob.transform.parent = from; gob.transform.localPosition = Vector3.zero; PokerCard pCard = gob.GetComponent <PokerCard>(); pCard.SetCardDepth(100 + index * 2); gob.transform.parent = to; gob.GetComponent <PokerCard>().SetCardId(cardValue); TweenPosition tp = gob.GetComponent <TweenPosition>(); tp.duration = 0.15f;//0.25f; tp.from = gob.transform.localPosition; tp.to = Vector3.zero; tp.ResetToBeginning(); tp.PlayForward(); TweenScale ts = gob.GetComponent <TweenScale>(); ts.duration = 0.15f; ts.from = Vector3.one * 0.3f; ts.to = Vector3.one * 0.76f; ts.ResetToBeginning(); ts.PlayForward(); return(gob); }
public void ShowNotice(NoticeInfo info) { if (m_BaseWndObject == null) { Init(); } string strX = info.TextColor.ToString("X6"); string colorStr = "[" + strX + "]"; if (info.StrNotic.Contains("/lb")) { info.StrNotic = info.StrNotic.Replace("/lb", ""); m_spriteIcon.gameObject.SetActive(true); } m_NoticeLable.text = colorStr + info.StrNotic + "[-]"; Vector2 size = m_NoticeLable.localSize; float Duration = (size.x + 800) / m_RollSpeed; Vector3 ToPos = m_TweenAnim.to; ToPos.x = -(size.x + 400); m_TweenAnim.to = ToPos; m_TweenAnim.duration = Duration; m_TweenAnim.ResetToBeginning(); m_TweenAnim.PlayForward(); m_LifeTime = Duration; }
protected void PlayTween(TweenPosition tween, Vector3 from, Vector3 to, float duration) { tween.ResetToBeginning(); tween.from = from; tween.to = to; tween.PlayForward(); tween.duration = duration; }