public static void PlayForward(this UI2DSpriteAnimation mUI2DSpriteAnimation, int framesPerSecond, int frameIndex = 0, bool ignoreTimeScale = true, bool loop = false) { mUI2DSpriteAnimation.framesPerSecond = framesPerSecond; mUI2DSpriteAnimation.frameIndex = frameIndex; mUI2DSpriteAnimation.loop = loop; mUI2DSpriteAnimation.ignoreTimeScale = ignoreTimeScale; mUI2DSpriteAnimation.enabled = true; mUI2DSpriteAnimation.ResetToBeginning(); }
static public int ResetToBeginning(IntPtr l) { try { UI2DSpriteAnimation self = (UI2DSpriteAnimation)checkSelf(l); self.ResetToBeginning(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
//进入小游戏 IEnumerator SmallGameEffect() { if (int.Parse(smallGameTimesLabel.text) > 0) { //可用次数降低,金额增加 smallGameTimesLabel.text = (int.Parse(smallGameTimesLabel.text) - 1).ToString(); smallGameTimesLabel.GetComponentInParent <Animator>().SetTrigger("timeLose"); smallGameTimesLabel.GetComponentInParent <UIPlaySound>().Play(); // GetComponent<AudioSource>().volume = 0.1f; aso.clip = bigPrizeClip; aso.Play(); palmBG.GetComponent <UISprite>().alpha = 1; GameObject palmGameObject = Instantiate(palm) as GameObject; palmGameObject.transform.parent = ui2s.transform; palmGameObject.transform.localScale = Vector3.one; palmGameObject.transform.localEulerAngles = Vector3.zero; palmGameObject.GetComponent <UISprite>().spriteName = curPalmImage.GetComponent <UISprite>().spriteName; palmGameObject.SetActive(true); curPalmImage.SetActive(false); yield return(new WaitForSeconds(0.75f)); ui2s.enabled = true; ui2s.ResetToBeginning(); AddMoney(money_small); TweenAlpha.Begin(palmBG, 1f, 0); yield return(new WaitForSeconds(1.0f)); smallPrizeLabel.text = (double.Parse(smallPrizeLabel.text) + money_small).ToString(); } if (int.Parse(smallGameTimesLabel.text) == 0) { yield return(new WaitForSeconds(2f)); StartCoroutine(Small_Over(double.Parse(smallPrizeLabel.text))); } else { SmallGame.canSelect = true; } }