public void PlaySymbolAnimation() { symbol.ForEach(x => x.enabled = false); animObj.enabled = true; AnimSprite.spriteName = SymNum [target - 1] + "01"; symbolAnim.namePrefix = SymNum[target - 1]; symbolAnim.ResetToBeginning(); symbolAnim.Play(); }
void Start() { animationcount = 0; if (monsteranimation == null) { monsteranimation = this.GetComponent <UISpriteAnimation> (); } //StartCoroutine (StartAttack()); monsteranimation.namePrefix = wait; monsteranimation.loop = true; monsteranimation.Play(); }
//드랍 버튼의 상태가 변할 때 void ChangeDropButtonState(bool On) { if (On) { dropBtn.interactable = true; fadeinDrop.Play(); } else { dropBtn.interactable = false; fadeoutDrop.Play(); } }
//발사 버튼의 상태가 변할 때 void ChangeFireButtonState(bool On) { if (On) { fireBtn.interactable = true; fadeinFire.Play(); } else { fireBtn.interactable = false; fadeinFire.Play(); } }
void OnPause(GameObject go) { GameCenter.chatMng.IsPausePlayVoice = !GameCenter.chatMng.IsPausePlayVoice; playX.gameObject.SetActive(GameCenter.chatMng.IsPausePlayVoice); if (GameCenter.chatMng.IsPausePlayVoice) { YvVoiceSdk.YvVoiceStopPlayVoice(); anim.Pause(); } else { anim.Play(); } }
public void ShowPhiz(int index) { Show(true); if (PhizWithAni) { UIAtlas atla = AtlasManager.Instance.GetAtlaByName(string.Format(AtlasFormat, index)); if (atla != null) { _phiz.atlas = atla; UISpriteAnimation ani = _phiz.gameObject.GetComponent <UISpriteAnimation>(); ani.namePrefix = index.ToString(); ani.Play(); int phizWidth = atla.spriteList[0].width; int phizHeight = atla.spriteList[0].height; _bgSprite.width = phizWidth > _phizBgWidth ? phizWidth : _phizBgWidth; _bgSprite.height = phizHeight > _phizBgHeight ? phizHeight : _phizBgHeight; _bgSprite.gameObject.TrySetComponentValue(true); } else { YxDebug.LogError(string.Format("There is not exist such atla,name is {0}", index)); } } else { _phiz.TrySetComponentValue(string.Format(StaticPhizFormat, index)); _phiz.MakePixelPerfect(); } _phiz.gameObject.SetActive(true); DoHide(); }
public void OnPlayRollDiceFinish() { RollDiceAni.Pause(); RollSrpite.TrySetComponentValue(string.Format(ConstantData.KeyRollDicePointFormat, _curData.ShowPoint)); RollSrpite.MakePixelPerfect(); if (!_curData.QuickModel) { ConstantData.PlaySoundBySex(_curData.Sex, string.Format(PointSoundFormat, _curData.ShowPoint)); CloudAni.Play(); if (_curData.OneMoreTime) { if (gameObject.activeInHierarchy) { if (_waitForOneMoreTimeCor != null) { StopCoroutine(_waitForOneMoreTimeCor); } _waitForOneMoreTimeCor = StartCoroutine(WaitShowOneMoreTime()); } } } else { CloudSprite.spriteName = ConstantData.KeyDefaultSpriteName; } }
/// <summary> /// 骰子移动 /// </summary> private void MoveDice() { RollTweenPos.@from = _curData.FromPos; RollTweenPos.to = _curData.ToPos; RollTweenPos.PlayForward(); RollDiceAni.Play(); }
/// <summary> /// 飞机爆炸 /// </summary> /// <returns></returns> IEnumerator PlaneBoom(List <MoveAndRotateData> moveData, bool widthLock) { yield return(new WaitForSeconds(widthLock?WaitShowBoomTime:ConstantData.IntValue)); LockObj.TrySetComponentValue(false); if (BoomAnimation) { BoomAnimation.enabled = true; BoomAnimation.Play(); } yield return(new WaitForSeconds(BoomAniTime)); var planeList = PlaneList.ToList(); for (int i = 0; i < moveData.Count; i++) { yield return(new WaitForSeconds(PlaneMoveCellTime)); var plane = planeList[i]; plane.Show(); plane.PlaneData.PlaneStateChange((int)EnumPlaneStatus.Home); plane.PlaneListReset(); plane.FreshPlaneNum(); plane.PlaneMovePathWithRotate(moveData[i], false); } }
/// <summary> /// 显示双倍 /// </summary> public void ShowDoubleMark() { _sprAnim.gameObject.SetActive(true); _sprAnim.ResetToBeginning(); _sprAnim.Play(); float spaceTime = 1 / (float)_sprAnim.framesPerSecond * spriteCount; float waitTime = spaceTime * times; _doubleMark.SetActive(true); _doubleMark.transform.localPosition = new Vector3(130, 56, 0); _doubleMark.GetComponent <UISprite>().alpha = 1; TweenAlpha.Begin(_doubleMark, waitTime, 0); TweenAlpha ta = GetComponent <TweenAlpha>() ?? gameObject.AddComponent <TweenAlpha>(); ta.from = 1; ta.to = 0; ta.delay = waitTime; ta.duration = waitTime / 1.5f; ta.ResetToBeginning(); ta.PlayForward(); TweenPosition tp = GetComponent <TweenPosition>() ?? gameObject.AddComponent <TweenPosition>(); tp.delay = waitTime; tp.duration = waitTime / 1.5f; tp.from = new Vector3(130, 56, 0); tp.to = _targetPos; tp.ResetToBeginning(); tp.PlayForward(); //TweenPosition.Begin(_doubleMark, waitTime ,_targetPos); Invoke("HideEffect", spaceTime); }
static int Play(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 1); UISpriteAnimation obj = (UISpriteAnimation)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UISpriteAnimation"); obj.Play(); return(0); }
protected virtual void SelectSuccess() { GameEntry.Sound.StopSound(s_SoundSerialId); GameEntry.Sound.PlayUISound(TouchSuccessUISoundId); if (m_UISpriteAnimation != null) { m_UISpriteAnimation.Play(); } }
IEnumerator DoNormal() { _spriteAnim.enabled = true; while (true) { yield return(new WaitForSeconds(8f)); if (_spriteAnim.isPlaying) { continue; } _spriteAnim.namePrefix = AnimNormal; _spriteAnim.Play(); } // ReSharper disable once FunctionNeverReturns }
public void PlayAnimation() { myLoadObj.SetActive(true); if (SpriteAnim != null) { SpriteAnim.Play(); } StartCoroutine(DestroyLevelUpObj()); }
protected override void OnCalledActionEvent() { if (!mSpriteAnimation_Kouhyoteki.isPlaying) { mSpriteAnimation_Kouhyoteki.framesPerSecond = 6; mSpriteAnimation_Kouhyoteki.enabled = true; mSpriteAnimation_Kouhyoteki.ResetToBeginning(); mSpriteAnimation_Kouhyoteki.Play(); } }
public void StartPlay() { SoundManager.Instance.VoicePlaying = true; IcoAnimation.Play(); if (mLastTime <= 0) { mLastTime = Seconds; ResourceManager.Instance.StartCoroutine(PlayFinished()); } mLastTime = Seconds; EventDispatcher.Instance.DispatchEvent(new ChatMainPlayVoice(SoundData)); }
public void SetVoiceAnimation(bool isVisible) { if (isVisible) { mVoiceAnimation.Play(); } else { mVoiceAnimation.Pause(); } mVoiceAnimation.gameObject.SetVisible(isVisible); }
protected override void OnCalledActionEvent() { if (!mSpriteAnimation_Cat.isPlaying && !mIsWaitingRelocation) { mSpriteAnimation_Cat.framesPerSecond = 12; mSpriteAnimation_Cat.enabled = true; mSpriteAnimation_Cat.ResetToBeginning(); mSpriteAnimation_Cat.Play(); IEnumerator routine = RelocationIntervalCoroutine(); StartCoroutine(routine); } }
static public int Play(IntPtr l) { try { UISpriteAnimation self = (UISpriteAnimation)checkSelf(l); self.Play(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static int Play(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); UISpriteAnimation obj = (UISpriteAnimation)ToLua.CheckObject <UISpriteAnimation>(L, 1); obj.Play(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void OnEvent_EquipSkillAnim(IEvent ievent) { var e = ievent as SkillEquipMainUiAnime; var skillId = e.SkillId; var index = e.Index; if (index < 0 || index >= 4) { Logger.Error("OnSkillEquipMainUiAnime Error Index = {0}", index); } learnSkillID = skillId; var tbSkill = Table.GetSkill(skillId); GameUtils.SetSpriteIcon(SkillMove, tbSkill.Icon); SkillMove.gameObject.SetActive(true); SkillName.text = tbSkill.Name; var tween = SkillMove.GetComponent <TweenPosition>(); tween.to = SkillList[index].transform.localPosition; tween.ResetToBeginning(); tween.PlayForward(); SkillNameTween.ResetToBeginning(); SkillNameTween.PlayForward(); if (GameSetting.Instance.EnableNewFunctionTip) { BlockMainScreen(true); } tween.onFinished.Clear(); tween.onFinished.Add(new EventDelegate(() => { learnSkillID = -1; PlayerDataManager.Instance.LearnSkill(skillId); SkillMove.gameObject.SetActive(false); BlockMainScreen(false); })); if (null != SkillEffectAni) { // var spr = SkillEffectAni.GetComponent<UISprite>(); // if(null!=spr) // { // spr.enabled = true; // } SkillEffectAni.Play(); } }
public void ShowLevel(int level) { if (level == 0) { return; } for (int i = 0; i < level; i++) { LineIcon [i].SetActive(true); Reels [i].PlaySymbolAnimation(); } lightAnimation.namePrefix = "linelight"; lightAnimation.Play(); line.SetActive(true); isShow = true; }
private static int Play(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 1); UISpriteAnimation uISpriteAnimation = (UISpriteAnimation)ToLua.CheckObject(L, 1, typeof(UISpriteAnimation)); uISpriteAnimation.Play(); result = 0; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }
/// <summary> /// 播放中奖特效 /// </summary> public void PlayLuckAnim() { //Winning.GetComponent<TweenAlpha>().value = Winning.GetComponent<TweenAlpha>().from; Winning.SetActive(true); switch (CurBetType) { case BetType.Bugatti: case BetType.Maybach: case BetType.Lamborghini: case BetType.Bentley: Anim.gameObject.SetActive(true); Anim.ResetToBeginning(); Anim.Play(); Invoke("CloseEffect", 1f); //Anim. //YxDebug.Log("播放动画"); break; } }
private void ShowLevelUpStar() { //새로운 별 animation. SetCharInfoContents(); GameObject charStarAnigo = charStarAni.gameObject; int openStar = (level - 1) % 6; //level 표 참고 - 해당 레벨과 별 획득수가 6 주기로 반복됨. openStar -= 1; //열리는 star가 몇번째인지 알고 난후, index로 변환(마이너스 1). //star animation. charStarAnigo.SetActive(true); charStarAnigo.transform.localPosition = charStar[openStar].transform.localPosition; charStarAni.Play(); //textbox animation. lvUpPrize.SetActive(true); lvUpPrize.transform.localScale = new Vector3(0f, 0f, 1f); StartCoroutine(WaitAndStarAniOff()); }
void OnGetAtlas(IUIAtlas cmatlas, object param1, object param2, object param3) { if (null == cmatlas) { return; } UIAtlas atlas = cmatlas.GetAtlas(); if (null == atlas) { return; } if (null != param1 && param1 is UISprite) { UISprite sprite = (UISprite)param1; UIAtlas atl = (null != atlas) ? cmatlas.GetAtlas() : null; sprite.atlas = atl; if (null != param2 && param2 is string) { sprite.spriteName = (string)param2; } if (null != param3 && param3 is bool) { bool makePerfect = (bool)param3; if (null != sprite && makePerfect) { sprite.MakePixelPerfect(); } } } if (ani != null) { ani.RebuildSpriteList(); ani.Play(); } }
public bool Select(PropType subProp) { if (!m_IsCanTouch) { return(false); } m_IsCanTouch = false; //true if (subProp == m_DrawerPropType) { GameEntry.Sound.StopSound(TopicTouchBase.s_SoundSerialId); GameEntry.Sound.PlayUISound((int)UISoundId.qipao_s); //transform.DOScale(Vector3.one * 1.2f, 0.3f).SetLoops(-1, LoopType.Yoyo).SetEase(Ease.Linear); m_AutoScale = true; //m_Mask.color = Color.yellow; //m_Icon.color = Color.yellow; m_IsShow = false; m_UISpriteAnimation.Play(); return(true); } // false else { //GameEntry.XFTTS.MultiSpeak("再仔细想想! "/*+ speek*/); //if (m_Sound_XX != -1) GameEntry.Sound.StopSound(TopicTouchBase.s_SoundSerialId); TopicTouchBase.s_SoundSerialId = (int)GameEntry.Sound.PlaySoundAndLength((int)SoundId.s1_xiangxiang, ref TopicOneForm.m_ClipMaxLength); GameEntry.Sound.PlayUISound((int)UISoundId.SelectErr); Debug.Log("选错了"); //m_Mask.color = Color.red; //m_Icon.color = Color.red; Shake(); m_IsShow = true; return(false); } }
//채굴 버튼의 상태가 변할 때 void ChangeMineButtonState(bool On) { if (PlayerMgr.Instance.item != PlayerItem.EMPTY) { return; } if (On) { mineBlue.interactable = true; fadeinBlue.Play(); mineRed.interactable = true; fadeinRed.Play(); } else { fadeoutBlue.Play(); fadeoutRed.Play(); mineBlue.interactable = false; mineRed.interactable = false; } }
private void PlayStarAnim() { starAnim.Play(); }
private void PlayIconAnim() { m_Active = true; iconAnim.Play(); Invoke("PlayStarAnim", animInterval); }