void DataInit() { Backgrond_Bool = false; FirstShow = false; Background_Color.ResetToBeginning(); NewGameState_Panel.clipRange = new Vector4(0, 0, 1, 500); AddNumber = 0; NewGameState_Bool = false; NewGameState_Sprite.enabled = false; NewGameState_Box.enabled = false; NewGameDelayTimer = 0; PleaseBet_Sprite.enabled = false; PleaseBetStateStart = false; PleaseBet_Animation.ResetToBeginning(); PleaseBetDelayTimer = 0; WaitNextRound.SetActive(false); PointNumber = 0; PointDelayTimer = 0; FirstCheck = false; Shuffle_Object.SetActive(false); ShuffleTimer = 0; WaitNewGame_Object.SetActive(false); WaitPointNumber = 0; WaitPointDelayTimer = 0; }
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); }
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); }
//StarCompletion void QuestCompletedAnimation() { myTweenColor.ResetToBeginning(); StarScaleTween.PlayForward(); StarAlphaTween.PlayForward(); CheckAlphaTween.PlayForward(); CheckScaleTween.PlayForward(); SoundStore.s.StopAlias("QuestSlateMove"); if (playingCompleted == false) { playingCompleted = true; SoundStore.s.PlaySoundByAlias("QuestSlateComplete", 0f, GameConfig.s.MuffledSoundVolume, false, 0f, false, 0f, () => { playingCompleted = false; }); } myTweenColor.PlayForward(); }
public void SetResult(int index, Color color) { GameObject obj = UIWrap[index].GetComponent <UICenterOnChild>().centeredObject.transform.FindChild("Label").gameObject; TweenColor tween = obj.GetComponent <TweenColor>(); tween.from = color; tween.ResetToBeginning(); tween.PlayForward(); }
public static TweenColor ResetTween(TweenColor twn) { #if USE_UI_NGUI_3 twn.ResetToBeginning(); #else twn.Reset(); #endif return(twn); }
public void OnCommit() { if (input.value != "") { int intValue = int.Parse(input.value); if (intValue < minAge) { ageInputBoxAnimator.ResetToBeginning(); ageInputBoxAnimator.PlayForward(); input.value = minAge.ToString(); } else if (intValue > maxAge) { ageInputBoxAnimator.ResetToBeginning(); ageInputBoxAnimator.PlayForward(); input.value = maxAge.ToString(); } } }
public void ClickButton(GameObject go) { TweenColor tc = target.GetComponent <TweenColor>(); if (target != null && tc != null) { tc.enabled = true; tc.ResetToBeginning(); tc.PlayForward(); } }
public void FlashScreen(Color l_color, float time = 0.05F) { flashSprite.color = l_color; flash.from = l_color; flash.to = new Color(l_color.r, l_color.g, l_color.b, 0); flash.duration = time; flash.ResetToBeginning(); flash.PlayForward(); }
// 获取 AI 的答案 private void AIAnswer(BaseEvent varData) { if (varData == null || mAIFinish) { return; } ExData <int> data = varData as ExData <int>; int answer = data.data; mAISelect = mAllAnswer[answer]; // 记录AI的选择 if (mPlayerFinish) // 玩家先答题, 显示右边的圈 { UIHelper.SetActive(mAllAnswer[answer], "Right", true); } mAIFinish = true; if (mRound == 1) { UIHelper.SetActive(mRedSlider, "Score", true); } // 判断正确与否 if (curQuestions[mRound - 1].real == ((char)(65 + answer)).ToString()) { // 正确 判断加多少分 mAIScore += 240 * time / 10f; UIHelper.SetSlider(mRedSlider, mAIScore / MaxScore); if (mPlayerFinish) // 玩家先答题才出答案 { UIHelper.SetColor(mAllAnswer[answer], Color.green); } } else { // 错误不加分 if (mPlayerFinish) // 玩家先答题才出答案 { UIHelper.SetColor(mAllAnswer[answer], Color.red); } else { // 玩家没答题, AI的进度条闪一下 TweenColor tc = mRedSlider.Find("Sprite").GetComponent <TweenColor>(); tc.ResetToBeginning(); tc.PlayForward(); } } UIHelper.SetLabel(mRedSlider, "Score", mAIScore.ToString("0")); // 判断游戏是否结束 OneEnd(); }
/// <summary> /// 按下返回键事件//这里断开服务器,将所有绿灯设置为红色,将红绿灯动画关闭//>>>>>>>>>>>>>>>>>>>>将hashtabel的这个IP去掉此功能随后添加>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /// </summary> public void BackButtonEvent() { MyServer._instance.DisconnectServer(); if (firstLight.enabled) { firstLight.ResetToBeginning(); firstLight.enabled = false; } if (secondLight.enabled) { secondLight.ResetToBeginning(); secondLight.enabled = false; } }
public void InitPunto(int i, Ruta r) { ruta = r; indicePunto = i; puntoVisitado = PlayerPrefs.GetInt("visitadoPunto" + indicePunto) == 1; expPunto = (tipo == Tipo.Principal ? ruta.expPrincipal : ruta.expSecundario); btn.defaultColor = r.color; btn.UpdateColor(true); tweenColor.from = btn.defaultColor; tweenColor.to = btn.pressed; tweenColor.ResetToBeginning(); if (puntoVisitado) { PuntoVisitado(); } }
private void SwitchToTutorial() { SetGameObjectsActive(TutorialObjects, true); if (TutorialObjects[0].name == "Tutorial Popup") { TweenColor tweenColor = TutorialObjects[0].GetComponentInChildren <TweenColor>(); if (tweenColor == null) { return; } tweenColor.ResetToBeginning(); tweenColor.enabled = true; tweenColor.PlayForward(); } }
/// <summary> /// 还原面板元素 /// </summary> private void ResetObjCondition() { isCheckSkin = false; Bg2.gameObject.CustomSetActive(false); TextureTween.ResetToBeginning(); BlockBg.ResetToBeginning(); AttrObj.CustomSetActive(false); LifeShowTween.gameObject.CustomSetActive(false); AttackShowTween.gameObject.CustomSetActive(false); SpeedShowTween.gameObject.CustomSetActive(false); DefShowTween.gameObject.CustomSetActive(false); SkillAwakeObj.CustomSetActive(false); AttriExtralAddObj.CustomSetActive(false); SkinObj.CustomSetActive(false); JumpTweenObj.CustomSetActive(false); OnClickTipObj.CustomSetActive(false); }
void InitRankSpriteInfo(int rankVal) { /*Debug.Log("test*******************InitRankSpriteInfo*********"); * for(int i = 0; i < RankingCtrl.MaxPlayerRankNum; i++) * { * if(RankingCtrl.mRankPlayer[i] != null) * { * Debug.Log("*******************name " + RankingCtrl.mRankPlayer[i].Name); * } * }*/ GameObject PlayerSpriteObj = null; if (rankVal != 1) { int wrankNum = GetWRankNum(); //Debug.Log("wrankNum******************* " + wrankNum); for (int i = 0; i < wrankNum; i++) { RankSpriteArray[i].spriteName = GetRankSpriteName(i + 1); RankSpriteArray[i].enabled = true; if (CheckIsHandlePlayer(i) && PlayerSpriteObj == null) { PlayerSpriteObj = RankSpriteArray[i].gameObject; } } for (int i = 0; i < RankingCtrl.MaxPlayerRankNum - wrankNum; i++) { WRankSpriteArray[i].spriteName = GetRankSpriteName(i + 1 + wrankNum); WRankSpriteArray[i].enabled = true; if (CheckIsHandlePlayer(i + wrankNum) && PlayerSpriteObj == null) { PlayerSpriteObj = WRankSpriteArray[i].gameObject; } } } else { for (int i = 0; i < RankingCtrl.MaxPlayerRankNum; i++) { RankSpriteArray[i].spriteName = GetRankSpriteName(i + 1); RankSpriteArray[i].enabled = true; if (CheckIsHandlePlayer(i) && PlayerSpriteObj == null) { PlayerSpriteObj = RankSpriteArray[i].gameObject; } } } if (PlayerSpriteObj != null) { TweenColor twCol = PlayerSpriteObj.AddComponent <TweenColor>(); twCol.enabled = false; twCol.to = Color.green; twCol.style = UITweener.Style.PingPong; twCol.ResetToBeginning(); twCol.enabled = true; twCol.PlayForward(); TweenScale twScl = PlayerSpriteObj.AddComponent <TweenScale>(); twScl.enabled = false; twScl.to = new Vector3(1.4f, 1.4f, 1f); twScl.style = UITweener.Style.PingPong; twScl.ResetToBeginning(); twScl.enabled = true; twScl.PlayForward(); } }
public void EndDamaged() { tweenColor.ResetToBeginning(); tweenColor.enabled = false; currentState = BehaviourState.IDLE; }
// Update is called once per frame void Update() { if (FourBidStart_Bool) { ShowGameObject.SetActive(true); if (ShowStart == 0) { Background.spriteName = "bg_fback1"; WhiteBackground.enabled = true; Writing.enabled = false; Light.enabled = false; Hammer_TP.ResetToBeginning(); Hammer_TP.PlayForward(); ShowStart = 1; } else if (ShowStart == 2) { Background.spriteName = "bg_fback2"; WhiteBackground.enabled = false; Writing.enabled = true; Light.enabled = true; Light_Scale.ResetToBeginning(); Light_Scale.PlayForward(); ShowStart = 3; } else if (ShowStart == 4) { Light_Color.ResetToBeginning(); Light_Color.PlayForward(); ShowStart = 5; } if (StateCheck_Bool) { if (MainGame_Control.NowGameState == (byte)ENUM_BACCARAT_TABLE_STATE.StartBid) { MainGame_Control.StopModeState = ENUM_STOPMODE_STATE.WaitFourCardTime; FourCard_Control.FourCardObjectOpen = true; FourCard_Control.FourCardStartShowBool = true; FourBidStart_Bool = false; } else if (MainGame_Control.NowGameState == (byte)ENUM_BACCARAT_TABLE_STATE.StopBid) { MainGame_Control.StopModeState = ENUM_STOPMODE_STATE.FourCardShow; GameSound.BetStop_Bool = true; FourCard_Control.FourCardObjectOpen = true; FourCard_Control.FourCardStartShowBool = true; FourBidStart_Bool = false; } } } else { ShowGameObject.SetActive(false); Background.spriteName = "bg_fback1"; WhiteBackground.enabled = true; Writing.enabled = false; Light.enabled = false; ShowStart = 0; StateCheck_Bool = false; } }
// Update is called once per frame void Update() { //新局開始 #region NewGame if (BJMainGame_Control.TableState[BJMainGame_Control.TableID].m_enumState == ENUM_BLACKJACK_TABLE_STATE.NewRound) { if (!NewGameState_Bool) { Background_Sprite.enabled = true; Background_Box.enabled = true; NewGameState_Sprite.enabled = true; NewGameState_Box.enabled = true; NewGameState_Panel.clipRange = new Vector4(0, 0, 1 + AddNumber, 500); NewGameState_Color.PlayForward(); if (AddNumber < 900) { AddNumber += (int)(Time.deltaTime * 1000); } else { AddNumber = 900; if (NewGameDelayTimer < 1) { NewGameDelayTimer += Time.deltaTime; } else { NewGameState_Color.ResetToBeginning(); NewGameDelayTimer = 0; AddNumber = 0; NewGameState_Sprite.enabled = false; NewGameState_Box.enabled = false; Background_Sprite.enabled = false; Background_Box.enabled = false; NewGameState_Bool = true; PleaseBetStateStart = true; EndShow = false; } } } } else { AddNumber = 0; NewGameDelayTimer = 0; NewGameState_Bool = false; NewGameState_Sprite.enabled = false; NewGameState_Box.enabled = false; NewGameState_Color.ResetToBeginning(); } #endregion //請下注 #region PleaseBet if (PleaseBetStateStart) { PleaseBetDelayTimer = 0; PleaseBet_Sprite.enabled = true; PleaseBet_Animation.ResetToBeginning(); PleaseBet_Animation.enabled = true; PleaseBetStateStart = false; Background_Sprite.enabled = false; Background_Box.enabled = false; } else if (PleaseBet_Sprite.spriteName == "AR_Bet_10") { if (PleaseBetDelayTimer < 1) { PleaseBetDelayTimer += Time.deltaTime; } else { PleaseBetDelayTimer = 0; PleaseBet_Sprite.enabled = false; PleaseBet_Animation.enabled = false; } } #endregion //等待下回新局開始 #region WaitNextRound if (BJMainGame_Control.TableState[BJMainGame_Control.TableID].m_enumState == ENUM_BLACKJACK_TABLE_STATE.Idle) { Background_Sprite.enabled = true; Background_Box.enabled = true; WaitNextRound.SetActive(true); if (PointNumber == 0) { for (int i = 0; i < 5; i++) { Point_Sprite[i].enabled = false; } } else if (PointNumber == 1) { for (int i = 0; i < 5; i++) { if (i < 1) { Point_Sprite[i].enabled = true; } else { Point_Sprite[i].enabled = false; } } } else if (PointNumber == 2) { for (int i = 0; i < 5; i++) { if (i < 2) { Point_Sprite[i].enabled = true; } else { Point_Sprite[i].enabled = false; } } } else if (PointNumber == 3) { for (int i = 0; i < 5; i++) { if (i < 3) { Point_Sprite[i].enabled = true; } else { Point_Sprite[i].enabled = false; } } } else if (PointNumber == 4) { for (int i = 0; i < 5; i++) { if (i < 4) { Point_Sprite[i].enabled = true; } else { Point_Sprite[i].enabled = false; } } } else if (PointNumber == 5) { for (int i = 0; i < 5; i++) { Point_Sprite[i].enabled = true; } } if (PointDelayTimer < 0.2f) { PointDelayTimer += Time.deltaTime; } else { if (PointNumber <= 5) { PointNumber++; } else { PointNumber = 0; } PointDelayTimer = 0; } } else { WaitNextRound.SetActive(false); } #endregion //等待新局開始 #region WaitNewGame if (WaitNewGame_Bool) { WaitNewGame_Object.SetActive(true); if (WaitPointNumber == 0) { for (int i = 0; i < 5; i++) { WaitPoint_Sprite[i].enabled = false; } } else if (WaitPointNumber == 1) { for (int i = 0; i < 5; i++) { if (i < 1) { WaitPoint_Sprite[i].enabled = true; } else { WaitPoint_Sprite[i].enabled = false; } } } else if (WaitPointNumber == 2) { for (int i = 0; i < 5; i++) { if (i < 2) { WaitPoint_Sprite[i].enabled = true; } else { WaitPoint_Sprite[i].enabled = false; } } } else if (WaitPointNumber == 3) { for (int i = 0; i < 5; i++) { if (i < 3) { WaitPoint_Sprite[i].enabled = true; } else { WaitPoint_Sprite[i].enabled = false; } } } else if (WaitPointNumber == 4) { for (int i = 0; i < 5; i++) { if (i < 4) { WaitPoint_Sprite[i].enabled = true; } else { WaitPoint_Sprite[i].enabled = false; } } } else if (WaitPointNumber == 5) { for (int i = 0; i < 5; i++) { WaitPoint_Sprite[i].enabled = true; } } if (WaitPointDelayTimer < 0.2f) { WaitPointDelayTimer += Time.deltaTime; } else { if (WaitPointNumber <= 5) { WaitPointNumber++; } else { WaitPointNumber = 0; } WaitPointDelayTimer = 0; } } else { WaitNewGame_Object.SetActive(false); } #endregion //洗牌中 #region Shuffle if (BJMainGame_Control.TableState[BJMainGame_Control.TableID].m_enumState == ENUM_BLACKJACK_TABLE_STATE.ShuffleNewRound) { Background_Sprite.enabled = true; Background_Box.enabled = true; Shuffle_Object.SetActive(true); if (ShuffleTimer < 2.0f) { ShuffleTimer += Time.deltaTime; } else { BJMainGame_Control.NowStateSave = ENUM_BLACKJACK_TABLE_STATE.NewRound; BJMainGame_Control.TableState[BJMainGame_Control.TableID].m_enumState = BJMainGame_Control.NowStateSave; } } else { Shuffle_Object.SetActive(false); ShuffleTimer = 0; } #endregion //END if (BJMainGame_Control.TableState[BJMainGame_Control.TableID].m_enumState == ENUM_BLACKJACK_TABLE_STATE.GameOver) { Background_Sprite.enabled = true; Background_Box.enabled = true; } if (Backgrond_Bool) { Background_Color.PlayForward(); Backgrond_Bool = false; } //if (FirstShow && (BJMainGame_Control.NowStateSave == ENUM_BLACKJACK_TABLE_STATE.NewRound // || BJMainGame_Control.NowStateSave == ENUM_BLACKJACK_TABLE_STATE.WaitBet || BJMainGame_Control.NowStateSave == ENUM_BLACKJACK_TABLE_STATE.ShuffleNewRound)) if (FirstShow) { BJMainGame_Control.MainInit_Bool = true; BJCard_Control.CardControlInit_Bool = true; Cash_Control.CashInit_Bool = true; Background_Color.PlayReverse(); FirstShow = false; SenceShow = true; DelayTime = 0; } if ((BJMainGame_Control.NowStateSave == ENUM_BLACKJACK_TABLE_STATE.NewRound || BJMainGame_Control.NowStateSave == ENUM_BLACKJACK_TABLE_STATE.WaitBet || BJMainGame_Control.NowStateSave == ENUM_BLACKJACK_TABLE_STATE.ShuffleNewRound) && EndShow) { if (DelayTime < 1) { DelayTime += Time.deltaTime; } else { BJMainGame_Control.TableState[BJMainGame_Control.TableID].m_enumState = BJMainGame_Control.NowStateSave; EndShow = false; FirstShow = false; WaitNewGame_Bool = false; SenceShow = false; DelayTime = 0; } } }
public void PlayColor() { HeadColor.enabled = true; HeadColor.ResetToBeginning(); HeadColor.PlayForward(); }