Exemplo n.º 1
0
    IEnumerator Play(string trigger)
    {
        UISpriteAnimation uas = curPlayer.GetComponent <UISpriteAnimation>();

        uas.enabled = true;
        uas.ResetToBeginning();

        Destroy(curPlayer.transform.FindChild("tag").gameObject);

        Vector3 targetPosition = targetSoccer.transform.localPosition;
        Vector3 startPosition  = curPlayer.transform.localPosition;

        while (Vector3.Distance(curPlayer.transform.localPosition, targetPosition) > 5f)
        {
            Debug.Log(Vector3.Distance(curPlayer.transform.localPosition, targetPosition));
            curPlayer.transform.localPosition = Vector3.MoveTowards(curPlayer.transform.localPosition, targetPosition, 200 * Time.deltaTime);
            yield return(null);
        }
        aso.PlayOneShot(tapClip);
        yield return(new WaitForSeconds(0.3f));

        uas.namePrefix = "ti";
        uas.loop       = false;
        uas.ResetToBeginning();
        targetSoccer.GetComponent <Animator>().SetTrigger(trigger);
        yield return(new WaitForSeconds(1));

        Destroy(curPlayer);
        if (string.Equals(trigger, "fail"))
        {
            PlacePeople();
        }
        waitTag = true;
    }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 public void EndPlay(IEvent ievent)
 {
     SoundManager.Instance.VoicePlaying = false;
     if (null != IcoAnimation)
     {
         IcoAnimation.ResetToBeginning();
         IcoAnimation.Pause();
         mLastTime = 0;
     }
 }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
    IEnumerator MoveToTargetPos(int curLevel, bool success)
    {
        UISpriteAnimation suUA = squirrel.GetComponent <UISpriteAnimation>();

        suUA.enabled = true;
        suUA.ResetToBeginning();
        suUA.loop       = true;
        suUA.namePrefix = "cemian";
        Vector3 startPos  = squirrel.transform.localPosition;
        float   timeCount = 0;

        while (Vector3.Distance(squirrel.transform.localPosition, targetPosition[int.Parse(hole.name)]) > 5f)
        {
            timeCount += Time.deltaTime;
            yield return(null);

            squirrel.transform.localPosition = Vector3.MoveTowards(startPos, targetPosition[int.Parse(hole.name)], 150 * timeCount);
        }
        if (success)
        {
            suUA.loop       = false;
            suUA.namePrefix = "xiao";
            suUA.ResetToBeginning();
            nuts[curIndex].SetActive(true);
            nuts[curIndex].GetComponent <ParticleSystem>().Emit(5);
            aso.PlayOneShot(bigPrizeClip);
            yield return(new WaitForSeconds(1f));

            nuts[curIndex].SetActive(false);

            StartCoroutine(SucMethod(curLevel));
        }
        else
        {
            suUA.loop       = false;
            suUA.namePrefix = "ku";
            suUA.ResetToBeginning();
            stones[curIndex].SetActive(true);
            stones[curIndex].GetComponent <ParticleSystem>().Emit(5);
            aso.PlayOneShot(smallPrizeClip);
            yield return(new WaitForSeconds(1f));

            stones[curIndex].SetActive(false);

            StartCoroutine(FailMethod());
        }
        suUA.name = "S2";
    }
Exemplo n.º 6
0
    //不会展示连击的数量
    public IEnumerator pressOnce()
    {
        //play animation
        hitBtnAnim.ResetToBeginning();
        // set Active
        leftLight.gameObject.SetActive(true);
        RightLight.gameObject.SetActive(true);

        //reset Pos
        leftLight.transform.localPosition  = LeftFadeInPos;
        RightLight.transform.localPosition = RightFadeInPos;
        //reset Color
        Color FadeInColor = new Color(1.0f, 1.0f, 1.0f, 1.0f);

        leftLight.color  = FadeInColor;
        RightLight.color = FadeInColor;

        //Change Position
        TweenPosition.Begin(leftLight.gameObject, FadeOutTime, LeftFadeOutPos);
        TweenPosition.Begin(RightLight.gameObject, FadeOutTime, RigthFadeOutPos);

        //Change Color
        TweenColor.Begin(leftLight.gameObject, FadeOutTime, FadeOutColor);
        TweenColor.Begin(RightLight.gameObject, FadeOutTime, FadeOutColor);

        //Large scale
        TweenScale.Begin(leftLight.gameObject, FadeOutTime, FadeOutScale);
        TweenScale.Begin(RightLight.gameObject, FadeOutTime, FadeOutScale);

        yield return(new WaitForSeconds(FadeOutTime + 0.1f));
    }
Exemplo n.º 7
0
 void GetReward_OnClick()
 {
     GetRewardSucUI.OpenUI(FinalTrialMgr.GetInstance()._NewFinalTrialFightResponse.data.rushResult.award, Core.Data.stringManager.getString(5047));
     PlayPointanimat();
     _openbox.ResetToBeginning();
     DBUIController.mDBUIInstance.RefreshUserInfo();
 }
Exemplo n.º 8
0
        /// <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);
        }
Exemplo n.º 9
0
 public void SetBox()
 {
     if (SlotManager.slotState != SlotManager.State.freeGame)
     {
         iconUI.spriteName   = boxType [0] + "1";
         iconAnim.namePrefix = boxType [0];
         iconAnim.loop       = true;
     }
     else
     {
         iconUI.spriteName   = boxType [1] + "18";
         iconAnim.namePrefix = boxType [1];
         iconAnim.loop       = false;
     }
     iconAnim.ResetToBeginning();
 }
Exemplo n.º 10
0
    static int ResetToBeginning(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        UISpriteAnimation obj = (UISpriteAnimation)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UISpriteAnimation");

        obj.ResetToBeginning();
        return(0);
    }
Exemplo n.º 11
0
 private void StopAudioAnimation(UISpriteAnimation spriteAnimation)
 {
     spriteAnimation.ResetToBeginning();
     spriteAnimation.Pause();
     if (_microPhoneInput != null)
     {
         _microPhoneInput.ResetAudio();
     }
 }
Exemplo n.º 12
0
 public static void PlayForward(this UISpriteAnimation mUISpriteAnimation, string namePrefix, int framesPerSecond, int frameIndex = 0, bool loop = false)
 {
     mUISpriteAnimation.namePrefix      = namePrefix;
     mUISpriteAnimation.framesPerSecond = framesPerSecond;
     mUISpriteAnimation.frameIndex      = frameIndex;
     mUISpriteAnimation.loop            = loop;
     mUISpriteAnimation.enabled         = true;
     mUISpriteAnimation.ResetToBeginning();
 }
Exemplo n.º 13
0
    public void Show(bool show)
    {
        offsetObj.gameObject.SetActive(show);

        if (show)
        {
            loadAnim.ResetToBeginning();
        }
    }
Exemplo n.º 14
0
    public void TurnOn()
    {
        sprite.spriteName = spriteName;
        gameObject.SetActive(true);

        Title.gameObject.SetActive(true);
        Title.enabled = true;
        Title.ResetToBeginning();
    }
Exemplo n.º 15
0
    public void ResetToBeginning()
    {
        this.gameObject.SetActive(true);
        mUISprite.spriteName          = string.Format("{0}_{1}", mOperationEffectType, "0000");
        mUISpriteAnimation.namePrefix = string.Format("{0}_", mOperationEffectType);
        mUISpriteAnimation.ResetToBeginning();
        mUISpriteAnimation.enabled = true;

        TimerMgr.instance.Subscribe(1.2f, false, TimeEventType.IngoreTimeScale).OnComplete(() => this.gameObject.SetActive(false));
    }
	protected override void OnCalledActionEvent()
	{
		if (!mSpriteAnimation_Kouhyoteki.isPlaying)
		{
			mSpriteAnimation_Kouhyoteki.framesPerSecond = 6;
			mSpriteAnimation_Kouhyoteki.enabled = true;
			mSpriteAnimation_Kouhyoteki.ResetToBeginning();
			mSpriteAnimation_Kouhyoteki.Play();
		}
	}
Exemplo n.º 17
0
        private IEnumerator DestroyLevelUpObj()
        {
            yield return(new WaitForSeconds(WaitSeconds));

            if (SpriteAnim != null)
            {
                SpriteAnim.ResetToBeginning();
            }
            myLoadObj.SetActive(false);
        }
Exemplo n.º 18
0
    void Update()
    {
        if (mUISprite.spriteName == "effect-16f")
        {
            gameObject.SetActive(false);

            mUISprite.spriteName = "effect-16a";

            mUISpriteAnimation.ResetToBeginning();
        }
    }
Exemplo n.º 19
0
 static public int ResetToBeginning(IntPtr l)
 {
     try {
         UISpriteAnimation self = (UISpriteAnimation)checkSelf(l);
         self.ResetToBeginning();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 20
0
 public void ShowEffectText(byte EffectTextID)
 {                                                                          //顯示特效文字
     SicBoGameMain.Inst.RouletteTurnControl.EffectHasPlayer = true;
     EffectText.enabled    = true;                                          //顯示特效文字
     MessageText.enabled   = false;                                         //關閉訊息文字
     EffectText.atlas      = EffectTextData[(int)(EffectTextID - 1)].atlas; //指定Atlas
     EffectText.spriteName = "doubleEffect_01";                             //特效文字
     EffectText.MakePixelPerfect();                                         //適應圖片大小
     EffectTextAnim.ResetToBeginning();                                     //特效文字動畫
     EffectTextAnim.enabled = true;
     MessageSound.clip      = EffectTextClip[(int)(EffectTextID - 1)].clip; //指定音效
     MessageSound.Play();                                                   //播放音效
 }
Exemplo n.º 21
0
 static int ResetToBeginning(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UISpriteAnimation obj = (UISpriteAnimation)ToLua.CheckObject <UISpriteAnimation>(L, 1);
         obj.ResetToBeginning();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 22
0
        //public RebornDataModel dataModel=new RebornDataModel ();

        private IEnumerator AnimationCoroutine()
        {
            if (ReboronAnimation != null)
            {
                while (ReboronAnimation.isPlaying)
                {
                    yield return(new WaitForSeconds(0.1f));
                }
            }
            yield return(new WaitForSeconds(1.0f));

            ReboronAnimation.ResetToBeginning();
            ReboronAnimation.gameObject.SetActive(false);
            ReboronAnimation.enabled = false;
            PlayAnimationFinished();
        }
Exemplo n.º 23
0
        public void OnClickGift()
        {
            //if(_spriteAnim.isPlaying)
            //    return;
            if (App.GameData.GetPlayerInfo().CoinA < 100)
            {
                YxMessageBox.DynamicShow(new YxMessageBoxData {
                    Msg = "金币不够,不能打赏.",
                });
                return;
            }

            //App.GetRServer<GameServer>().Reward();
            _spriteAnim.namePrefix = AnimReward;
            _spriteAnim.ResetToBeginning();
            _spriteAnim.Play();
        }
Exemplo n.º 24
0
    private static int ResetToBeginning(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 1);
            UISpriteAnimation uISpriteAnimation = (UISpriteAnimation)ToLua.CheckObject(L, 1, typeof(UISpriteAnimation));
            uISpriteAnimation.ResetToBeginning();
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
Exemplo n.º 25
0
        /// <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;
            }
        }
Exemplo n.º 26
0
    IEnumerator FireMethod(GameObject obj)
    {
        UISprite us = obj.transform.FindChild("GameObject").GetComponent <UISprite>();

        while (us.fillAmount < 1)
        {
            yield return(null);

            us.fillAmount += 0.03f;
        }
        us.fillAmount = 0;
        obj.GetComponent <BoxCollider>().enabled   = false;
        obj.GetComponent <TweenPosition>().enabled = false;
        UISpriteAnimation usa = obj.GetComponent <UISpriteAnimation>();
        UISprite          us2 = obj.GetComponent <UISprite>();

        us2.spriteName = "explode01";
        usa.enabled    = true;
        usa.ResetToBeginning();
        us2.width  = 600;
        us2.height = 600;
        yield return(null);
    }
Exemplo n.º 27
0
 public override void ResetItem()
 {
     destroy_ani.ResetToBeginning();
     SetSelect(false);
     animal_type = eAnimalType.None;
 }
Exemplo n.º 28
0
    // 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;
            }
        }
    }
Exemplo n.º 29
0
    // Use this for initialization


    public void JackPot()
    {
        Jackpot.SetActive(true);
        JPanim.ResetToBeginning();
        JPanim.Play();
    }
Exemplo n.º 30
0
	private void StopAudioAnimation(UISpriteAnimation spriteAnimation) {
		spriteAnimation.ResetToBeginning();
		spriteAnimation.Pause();
		_microPhoneInput.ResetAudio();
	}
Exemplo n.º 31
0
    //进入小游戏
    IEnumerator SmallGameEffect(int index)
    {
        if (int.Parse(smallGameTimesLabel.text) > 0)
        {
            //挥舞锤子效果
            GameObject Amin_Hammer = Instantiate(hammmerObj) as GameObject;
            Amin_Hammer.transform.parent        = sycee.transform.parent;
            Amin_Hammer.transform.localScale    = Vector3.one;
            Amin_Hammer.transform.eulerAngles   = Vector3.zero;
            Amin_Hammer.transform.localPosition = new Vector3(31f, 105f, 0);

            Animator ham_anim = Amin_Hammer.GetComponent <Animator>();
            ham_anim.SetBool("HammerStart", true);
            yield return(new WaitForSeconds(1f));

            aso.PlayOneShot(tapClip);
            yield return(new WaitForSeconds(0.5f));

            ham_anim.SetBool("HammerStart", false);
            Destroy(Amin_Hammer);
            //中奖
            if (tag_small == 1)
            {
                aso.PlayOneShot(bigPrizeClip);
                manAnim.SetTrigger("laugh");
                TweenAlpha.Begin(sycee.transform.FindChild("light").gameObject, 0.3f, 1);
                smallPrizeLabel.text = (double.Parse(smallPrizeLabel.text) + money_small).ToString();
                AddMoney(money_small);
                yield return(new WaitForSeconds(2f));

                count++;
            }
            //nothing
            else if (tag_small == 2)
            {
                //可用次数降低,金额增加
                smallGameTimesLabel.text = (int.Parse(smallGameTimesLabel.text) - 1).ToString();
                smallGameTimesLabel.GetComponentInParent <Animator>().SetTrigger("timeLose");
                smallGameTimesLabel.GetComponentInParent <UIPlaySound>().Play();

                smallPrizeLabel.text = (double.Parse(smallPrizeLabel.text) + money_small).ToString();

                aso.PlayOneShot(smallPrizeClip);
                GameObject        amin_Broken = sycee;
                UISpriteAnimation ua          = amin_Broken.GetComponent <UISpriteAnimation>();
                ua.enabled = true;
                ua.ResetToBeginning();
                yield return(new WaitForSeconds(2f));

                if (int.Parse(smallGameTimesLabel.text) != 0)
                {
                    ua.enabled = false;
                    amin_Broken.GetComponent <UISprite>().spriteName = "sycee";
                    count = 0;
                    for (int i = 0; i < fiveSycees.Length; i++)
                    {
                        Destroy(fiveSycees [i]);
                    }
                    InstaniateSycees();
                }
            }
            if (count >= 5)
            {
                GameObject bigPrizeEffect = Instantiate(bigPrizeEffectObj) as GameObject;
                bigPrizeEffect.transform.parent           = this.transform;
                bigPrizeEffect.transform.localScale       = Vector3.one;
                bigPrizeEffect.transform.localEulerAngles = Vector3.zero;
                bigPrizeEffect.transform.localPosition    = new Vector3(-327, 833, 0);
                count = 0;
                //可用次数降低,金额增加
                smallGameTimesLabel.text = (int.Parse(smallGameTimesLabel.text) - 1).ToString();
                smallGameTimesLabel.GetComponentInParent <Animator>().SetTrigger("timeLose");
                smallGameTimesLabel.GetComponentInParent <UIPlaySound>().Play();

                if (int.Parse(smallGameTimesLabel.text) != 0)
                {
                    for (int i = 0; i < fiveSycees.Length; i++)
                    {
                        Destroy(fiveSycees [i]);
                    }
                    InstaniateSycees();
                }
            }
        }
        if (int.Parse(smallGameTimesLabel.text) == 0)
        {
            yield return(new WaitForSeconds(1.5f));

            StartCoroutine(Small_Over(double.Parse(smallPrizeLabel.text)));
        }
        else
        {
            SmallGame.canSelect = true;
        }
    }