public void OnPlayerUpdateEvent()
 {
     int maxEnergy = Globals.Instance.Player.GetMaxEnergy();
     if (this.mOldStaminaNum != Globals.Instance.Player.Data.Energy || Globals.Instance.Player.Data.Energy == 0)
     {
         this.mKeysValue.text = string.Format("{0}/{1}", Globals.Instance.Player.Data.Energy, maxEnergy);
         if (this.mOldStaminaNum != 0)
         {
             Sequence sequence = new Sequence();
             sequence.Append(HOTween.To(this.mKeysValue.gameObject.transform, 0.15f, new TweenParms().Prop("localScale", new Vector3(1.5f, 1.5f, 1.5f))));
             sequence.Append(HOTween.To(this.mKeysValue.gameObject.transform, 0.15f, new TweenParms().Prop("localScale", Vector3.one)));
             sequence.Play();
         }
         this.mOldStaminaNum = Globals.Instance.Player.Data.Energy;
     }
     int maxStamina = Globals.Instance.Player.GetMaxStamina();
     if (this.mOldJingliNum != Globals.Instance.Player.Data.Stamina || Globals.Instance.Player.Data.Stamina == 0)
     {
         this.mJingliValue.text = string.Format("{0}/{1}", Globals.Instance.Player.Data.Stamina, maxStamina);
         if (this.mOldJingliNum != 0)
         {
             Sequence sequence2 = new Sequence();
             sequence2.Append(HOTween.To(this.mJingliValue.gameObject.transform, 0.15f, new TweenParms().Prop("localScale", new Vector3(1.5f, 1.5f, 1.5f))));
             sequence2.Append(HOTween.To(this.mJingliValue.gameObject.transform, 0.15f, new TweenParms().Prop("localScale", Vector3.one)));
             sequence2.Play();
         }
         this.mOldJingliNum = Globals.Instance.Player.Data.Stamina;
     }
     this.Refresh();
 }
Exemplo n.º 2
0
 protected override void OnPostLoadGUI()
 {
     if (GameUIPopupManager.GetInstance().GetCurrentPopup() != null)
     {
         GameUIPopupManager.GetInstance().PopState(true, null);
     }
     GUIChatWindowV2.TryCloseMe();
     GameUIManager.mInstance.DestroyGameUIOptionPopUp();
     this.mEffectGo = base.transform.Find("endBackground/ui04").gameObject;
     NGUITools.SetActive(this.mEffectGo, false);
     this.mBg = base.transform.Find("endBackground/BackGround").GetComponent<UISprite>();
     this.mVictorySp = base.transform.Find("endBackground/Sprite").GetComponent<UISprite>();
     this.mVictorySp.transform.localScale = new Vector3(6f, 6f, 6f);
     this.mVictorySp.color = new Color(this.mVictorySp.color.r, this.mVictorySp.color.g, this.mVictorySp.color.b, 0.3f);
     Sequence sequence = new Sequence(new SequenceParms().UpdateType(UpdateType.TimeScaleIndependentUpdate));
     sequence.Append(HOTween.To(this.mVictorySp.transform, 0.2f, new TweenParms().Prop("localScale", Vector3.one).Ease(EaseType.EaseOutSine)));
     sequence.Insert(0f, HOTween.To(this.mVictorySp, 0.2f, new TweenParms().Prop("color", new Color(this.mVictorySp.color.r, this.mVictorySp.color.g, this.mVictorySp.color.b, 1f))));
     sequence.AppendCallback(new TweenDelegate.TweenCallback(this.ShowEffectGo));
     sequence.AppendInterval(1.5f);
     sequence.Append(HOTween.To(this.mBg, 1f, new TweenParms().Prop("color", new Color(this.mBg.color.r, this.mBg.color.g, this.mBg.color.b, 0f))));
     sequence.Insert(2f, HOTween.To(this.mVictorySp, 1f, new TweenParms().Prop("color", new Color(this.mVictorySp.color.r, this.mVictorySp.color.g, this.mVictorySp.color.b, 0f))));
     sequence.Play();
     this.isPvp = GameUIManager.mInstance.uiState.IsPvp;
     if (!this.isPvp)
     {
         base.Invoke("ReservedReadyProcess", 1.5f);
     }
     Globals.Instance.BackgroundMusicMgr.PlayGameClearSound();
     Globals.Instance.BackgroundMusicMgr.StopWarmingSound();
     Globals.Instance.BackgroundMusicMgr.ClearGameBGM();
 }
 void buttonAnimation(int dir,string note)
 {
     Vector3 oScale = transform.localScale;
     Vector3 oPosition = transform.position;
     Sequence buttonSequence = new Sequence ();
     buttonSequence.Append(HOTween.To (transform, tweenDuration, new TweenParms ().Prop ("localScale", oScale * tweenScale)));
     buttonSequence.Append(HOTween.To (transform, tweenDuration, new TweenParms ().Prop ("localScale", oScale)));
     switch(dir){
     case 0:
         buttonSequence.Insert(0,HOTween.To (transform, tweenDuration, new TweenParms ().Prop ("position", new Vector3(oPosition.x+offset,oPosition.y,oPosition.z))));
         buttonSequence.Insert(tweenDuration,HOTween.To (transform, tweenDuration, new TweenParms ().Prop ("position", oPosition)));
         break;
     case 1:
         buttonSequence.Insert(0,HOTween.To (transform, tweenDuration, new TweenParms ().Prop ("position", new Vector3(oPosition.x-offset,oPosition.y,oPosition.z))));
         buttonSequence.Insert(tweenDuration,HOTween.To (transform, tweenDuration, new TweenParms ().Prop ("position", oPosition)));
         break;
     case 2:
         buttonSequence.Insert(0,HOTween.To (transform, tweenDuration, new TweenParms ().Prop ("position", new Vector3(oPosition.x,oPosition.y+offset,oPosition.z))));
         buttonSequence.Insert(tweenDuration,HOTween.To (transform, tweenDuration, new TweenParms ().Prop ("position", oPosition)));
         break;
     case 3:
         buttonSequence.Insert(0,HOTween.To (transform, tweenDuration, new TweenParms ().Prop ("position", new Vector3(oPosition.x,oPosition.y-offset,oPosition.z))));
         buttonSequence.Insert(tweenDuration,HOTween.To (transform, tweenDuration, new TweenParms ().Prop ("position", oPosition)));
         break;
     default:
         break;
     }
     buttonSequence.Play ();
 }
Exemplo n.º 4
0
 private void OnEmotionClick(GameObject go)
 {
     Globals.Instance.EffectSoundMgr.Play("ui/ui_001");
     Sequence sequence = new Sequence();
     sequence.Append(HOTween.To(base.transform, 0.1f, new TweenParms().Prop("localScale", new Vector3(0.9f, 0.9f, 0.9f))));
     sequence.Append(HOTween.To(base.transform, 0.1f, new TweenParms().Prop("localScale", Vector3.one)));
     sequence.Play();
     this.mBaseLayer.AppendChatMsg(this.EmotionTag);
 }
Exemplo n.º 5
0
    void gunAnimation()
    {
        if(sequence!=null)sequence.Kill();
        //transform.localRotation
        sequence = new Sequence(new SequenceParms());
        sequence.Append(HOTween.To(transform, pushBackTime, new TweenParms().Prop("localRotation", new Vector3(fireAngle, 0, 0),false).Ease(EaseType.EaseInQuart)));
        sequence.Append(HOTween.To(transform, recoveryTime, new TweenParms().Prop("localRotation", new Vector3(0, 0, 0),false).Ease(EaseType.EaseInQuart)));

        sequence.Play();
    }
Exemplo n.º 6
0
 public void ShowMe(int curLvl)
 {
     this.Refresh(curLvl);
     Sequence sequence = new Sequence(new SequenceParms().UpdateType(UpdateType.TimeScaleIndependentUpdate).OnComplete(new TweenDelegate.TweenCallback(this.OnAnimEnd)));
     sequence.Append(HOTween.To(this.mWinBgSp, 0.25f, new TweenParms().Prop("color", new Color(this.mWinBgSp.color.r, this.mWinBgSp.color.g, this.mWinBgSp.color.b, 1f))));
     sequence.Insert(0f, HOTween.To(this.mWinBg, 0.25f, new TweenParms().Prop("localScale", Vector3.one).Ease(EaseType.EaseOutBack)));
     sequence.AppendInterval(3f);
     sequence.Append(HOTween.To(this.mWinBgSp, 0.25f, new TweenParms().Prop("color", new Color(this.mWinBgSp.color.r, this.mWinBgSp.color.g, this.mWinBgSp.color.b, 0f))));
     sequence.Play();
 }
Exemplo n.º 7
0
	//摄像机初始时播放镜头推进放大动画
	void Start () {
		GuardBody = transform.parent.transform.parent.gameObject.transform;
		if (isPrefab == 0) {
			//一般情况下a型号警卫的运动方式
			Guard_a_Movement = new Sequence (new SequenceParms ().Loops (-1, LoopType.Restart));
			Guard_a_Movement.Prepend (HOTween.To (GuardBody, time, new TweenParms ().Prop ("position", new Vector3 (GuardBody.position [0] - x, GuardBody.position [1], GuardBody.position [2]))));
			Guard_a_Movement.Append (HOTween.To (transform.parent.gameObject.transform, 2, new TweenParms ().Prop ("rotation", new Vector3 (0, 0, 108)).Ease (EaseType.EaseOutQuart)));
			Guard_a_Movement.Append (HOTween.To (GuardBody, time, new TweenParms ().Prop ("position", new Vector3 (GuardBody.position [0], GuardBody.position [1], GuardBody.position [2]))));
			Guard_a_Movement.Append (HOTween.To (transform.parent.gameObject.transform, 2, new TweenParms ().Prop ("rotation", new Vector3 (0, 0, 0)).Ease (EaseType.EaseOutQuart)));
			Guard_a_Movement.Play ();
		}
        
	}
    void buttonMove(int dir)
    {
        theBoard.zoomIn = true;
        Sequence keySequence = new Sequence ();
        if (dir == 1) {
                        keySequence.Append (HOTween.To (theBoard.buttonList [dir].transform, animationDuration, new TweenParms ().Prop ("localScale", new Vector3 (4.0f, 3.0f, 1.0f))));
            keySequence.Insert(0,HOTween.To (theBoard.buttonList [dir].transform, animationDuration, new TweenParms ().Prop ("position", new Vector3 (-0.65f, -1.2f, -2.0f))));
        } else {
                        keySequence.Append (HOTween.To (theBoard.buttonList [dir].transform, animationDuration, new TweenParms ().Prop ("localScale", new Vector3 (5.3f, 3.0f, 1.0f))));
            keySequence.Insert(0,HOTween.To (theBoard.buttonList [dir].transform, animationDuration, new TweenParms ().Prop ("position", new Vector3 (0.0f, -1.2f, -2.0f))));
        }

        keySequence.Play ();
        transform.position = new Vector3 (transform.position.x, transform.position.y, 10);
    }
Exemplo n.º 9
0
 public void ChangeMusic(AudioClip audio)
 {
     currentSong = audio;
     Sequence sequence = new Sequence ();
     sequence.Append ( HOTween.To ( Camera.main.audio, 0.5f, new TweenParms ()
         .Prop ( "volume", 0f )
         .Ease ( EaseType.Linear )
         .OnComplete( SetMusic )
     ));
     sequence.Append ( HOTween.To ( Camera.main.audio, 0.5f, new TweenParms ()
         .Prop ( "volume", 1f )
         .Ease ( EaseType.Linear )
     ));
     sequence.Play ();
 }
Exemplo n.º 10
0
 public void Refresh(bool isInit)
 {
     GuildWarClient mGWEnterData = Globals.Instance.Player.GuildSystem.mGWEnterData;
     if (mGWEnterData != null)
     {
         EGuildWarTeamId selfTeamFlag = Globals.Instance.Player.GuildSystem.GetSelfTeamFlag();
         this.mRedName.text = mGWEnterData.Red.GuildName;
         if (selfTeamFlag == EGuildWarTeamId.EGWTI_Red)
         {
             this.mRedName.color = Color.green;
         }
         else
         {
             this.mRedName.color = Color.white;
         }
         string text = mGWEnterData.Red.Score.ToString();
         if (!isInit && !this.mRedScore.text.Equals(text))
         {
             Sequence sequence = new Sequence();
             sequence.Append(HOTween.To(this.mRedScore.gameObject.transform, 0.2f, new TweenParms().Prop("localScale", new Vector3(1.8f, 1.8f, 1.8f))));
             sequence.Append(HOTween.To(this.mRedScore.gameObject.transform, 0.2f, new TweenParms().Prop("localScale", Vector3.one)));
             sequence.Play();
         }
         this.mRedScore.text = text;
         this.mRedScore.color = this.GetScoreColor(mGWEnterData.Red.Score);
         this.mRedBgScore.text = string.Format("/{0}", GameConst.GetInt32(220));
         this.mBlueName.text = mGWEnterData.Blue.GuildName;
         if (selfTeamFlag == EGuildWarTeamId.EGWTI_Blue)
         {
             this.mBlueName.color = Color.green;
         }
         else
         {
             this.mBlueName.color = Color.white;
         }
         string text2 = mGWEnterData.Blue.Score.ToString();
         if (!isInit && !this.mBlueScore.text.Equals(text2))
         {
             Sequence sequence2 = new Sequence();
             sequence2.Append(HOTween.To(this.mBlueScore.gameObject.transform, 0.2f, new TweenParms().Prop("localScale", new Vector3(1.8f, 1.8f, 1.8f))));
             sequence2.Append(HOTween.To(this.mBlueScore.gameObject.transform, 0.2f, new TweenParms().Prop("localScale", Vector3.one)));
             sequence2.Play();
         }
         this.mBlueScore.text = text2;
         this.mBlueScore.color = this.GetScoreColor(mGWEnterData.Blue.Score);
         this.mBlueBgScore.text = string.Format("/{0}", GameConst.GetInt32(220));
     }
 }
Exemplo n.º 11
0
    void Start()
    {
        HOTween.Init(true, true, true);

        Sequence s = new Sequence(new SequenceParms().Loops(-1));

        s.Append(HOTween.To(transform, Duration/2, new TweenParms()
                            .Prop("position", new Vector3(4.3F, y_top, 0F), false)
                            .Ease(ease)));

        s.Append(HOTween.To(transform, Duration/2, new TweenParms()
                            .Prop("position", new Vector3(4.3F, y_bottom, 0F), false)
                            .Ease(ease)));

        s.Play();
    }
Exemplo n.º 12
0
	void AimAnim(){
		Vector3 v1 = new Vector3 (0,0,179);
		Vector3 v2 = new Vector3 (0,0,-179);
		Sequence AimAnim = new Sequence(new SequenceParms().Loops(-1,LoopType.Restart));
		AimAnim.Prepend(HOTween.To(WorkSpaceComponent [0].transform, 1, new TweenParms().Prop("rotation", v1)));
		AimAnim.Append(HOTween.To(WorkSpaceComponent [0].transform, 1, new TweenParms().Prop("rotation", v2)));
		AimAnim.Play ();//旋转瞄准镜动画
	}
Exemplo n.º 13
0
    void FadeInClip( AudioClip c )
    {
        if(_audSrc.isPlaying == false)
        {
            PlaySound(c);
            return;
        }

        Sequence fadeInSeq = new Sequence();

        //Pass the desired clip as a parameter
        object[] objParms = new object[1];
        objParms[0] = c;

        //Fade out current sound, switch clips and fade back in
        fadeInSeq.Append(HOTween.To(_audSrc, 1.0f, new TweenParms().Prop("volume", 0.0f).OnComplete(SwitchSounds, objParms)));
        fadeInSeq.Append(HOTween.To(_audSrc, 1.0f, new TweenParms().Prop("volume", 1.0f)));

        fadeInSeq.Play();
    }
Exemplo n.º 14
0
    void JumpMotion()
    {
        animator.SetTrigger("Jump");

        SequenceParms sparams = new SequenceParms(); //.OnComplete(gameObject, "OnCompleteJump");
        Sequence mySequence = new Sequence(sparams);
        TweenParms parms;

        tf.position = startPosition;

        parms = new TweenParms().Prop("position", startPosition).Ease(EaseType.EaseOutQuad).OnComplete(OnDoneTakeOff);
        mySequence.Append(HOTween.To(tf, 0.4f, parms));

        parms = new TweenParms().Prop("position", endPosition).Ease(EaseType.EaseOutQuad).OnComplete(OnDoneAir);
        mySequence.Append(HOTween.To(tf, 0.2f, parms));

        parms = new TweenParms().Prop("position", endPosition).Ease(EaseType.EaseOutQuad).OnComplete(OnDoneLanding);
        mySequence.Append(HOTween.To(tf, 0.6f, parms));

        mySequence.Play();
    }
Exemplo n.º 15
0
    void InitTweenSequence()
    {
        Sequence fadeSeq = new Sequence();

        for(int i = 0; i < screenList.Length; ++i)
        {
            object[] objParam = new object[2];
            objParam[0] = screenList[i].gameObject;

            Color tempColor = screenList[i].color;
            tempColor.a = 1.0f;
            fadeSeq.Append(HOTween.To(screenList[i], fadeInTime, new TweenParms().Prop("color", tempColor).OnUpdate(RevealChildren, objParam)));

            //Second tween to the same value to allow the screen to stall
            fadeSeq.Append(HOTween.To(screenList[i], sustainTime, new TweenParms().Prop("color", tempColor)));

            tempColor.a = 0.0f;
            fadeSeq.Append(HOTween.To(screenList[i], fadeOutTime, new TweenParms().Prop("color", tempColor).OnUpdate(FadeChildren, objParam)));
        }

        fadeSeq.Append(HOTween.To(this, 0.0f, new TweenParms().Prop("fadeInTime", 1.0f).OnComplete(Finished)));

        fadeSeq.Play();
    }
Exemplo n.º 16
0
 public void AddOneRecord(D2MData data)
 {
     this.mGUID2MRecordTable.AddData(new GUID2MRecordData(data));
     if (data.Crit > 1)
     {
         this.mD2MCriticalLayer.Refresh(data.Crit);
         this.mD2MCriticalLayer.PlayD2MCriticalAnim();
     }
     this.mGold.SetActive(true);
     this.mGoldTxt.text = data.Money.ToString();
     Sequence sequence = new Sequence();
     sequence.Append(HOTween.To(this.mGold.transform, 0f, new TweenParms().Prop("localPosition", Vector3.zero)));
     sequence.Insert(0f, HOTween.To(this.mGold.transform, 0.01f, new TweenParms().Prop("localScale", new Vector3(3f, 3f, 3f))));
     sequence.Append(HOTween.To(this.mGold.transform, 0.2f, new TweenParms().Prop("localScale", Vector3.one).Ease(EaseType.EaseInBack)));
     sequence.AppendInterval(0.5f);
     sequence.Append(HOTween.To(this.mGold.transform, 0.5f, new TweenParms().Prop("localPosition", new Vector3(0f, 120f, 0f)).Ease(EaseType.EaseOutQuad)));
     sequence.Append(HOTween.To(this.mGold.transform, 0f, new TweenParms().Prop("localScale", Vector3.zero)));
     sequence.Play();
     this.mGUID2MRecordTable.Reposition(true);
     if (this.mGUID2MRecordTable.mDatas.Count >= 3)
     {
         base.StartCoroutine(this.UpdateScrollBar());
     }
 }
 public void checkSwipe(int checkID)
 {
     if (start && waitSwipe) {
         //Debug.Log("checkID="+checkID+" inputID="+inputID);
         if(checkID == inputID){
             swipeNum+=1;
             correctSwipe+=1;
         }
         else{
             swipeNum += 1;
             Sequence warning = new Sequence();
             warning.Append(HOTween.To (watchBG,0.05f,new TweenParms().Prop("color",Color.red)));
             warning.Insert(0.05f,HOTween.To (watchBG,0.05f,new TweenParms().Prop("color",Color.white)));
             warning.Play();
         }
         swiper theSwiper = swiperList [swiperID];
         theSwiper.arrow [inputID - (swiperID * inputPerBut)].GetComponentInChildren<Renderer> ().material.color = regular;
         Vector3 tempPosition = theSwiper.arrow [inputID - (swiperID * inputPerBut)].GetComponentInChildren<Transform> ().position;
         tempPosition.z += 1;
         theSwiper.arrow [inputID - (swiperID * inputPerBut)].GetComponentInChildren<Transform> ().position = tempPosition;
     }
     waitSwipe = false;
 }
Exemplo n.º 18
0
 public void OnPlayerUpdateEvent()
 {
     if (this.CanUpdateGem && (!this.mInitFlag || this.mOldGemNum != Globals.Instance.Player.Data.Diamond))
     {
         this.gemTxt.text = Tools.FormatCurrency(Globals.Instance.Player.Data.Diamond);
         if (this.mOldGemNum != 0)
         {
             Sequence sequence = new Sequence();
             sequence.Append(HOTween.To(this.gemTxt.gameObject.transform, 0.15f, new TweenParms().Prop("localScale", new Vector3(1.5f, 1.5f, 1.5f))));
             sequence.Append(HOTween.To(this.gemTxt.gameObject.transform, 0.15f, new TweenParms().Prop("localScale", Vector3.one)));
             sequence.Play();
         }
         this.mOldGemNum = Globals.Instance.Player.Data.Diamond;
     }
     if (!this.mInitFlag || this.mOldGoldNum != Globals.Instance.Player.Data.Money)
     {
         this.goldTxt.text = Tools.FormatCurrency(Globals.Instance.Player.Data.Money);
         if (this.mOldGoldNum != 0)
         {
             Sequence sequence2 = new Sequence();
             sequence2.Append(HOTween.To(this.goldTxt.gameObject.transform, 0.15f, new TweenParms().Prop("localScale", new Vector3(1.5f, 1.5f, 1.5f))));
             sequence2.Append(HOTween.To(this.goldTxt.gameObject.transform, 0.15f, new TweenParms().Prop("localScale", Vector3.one)));
             sequence2.Play();
         }
         this.mOldGoldNum = Globals.Instance.Player.Data.Money;
     }
     int maxEnergy = Globals.Instance.Player.GetMaxEnergy();
     if (!this.mInitFlag || this.mOldStaminaNum != Globals.Instance.Player.Data.Energy || maxEnergy != this.mOldMaxEnergy)
     {
         this.staminaTxt.text = string.Format("{0}{1}[-]/{2}", (Globals.Instance.Player.Data.Energy <= maxEnergy) ? "[ffffff]" : "[00ff00]", Tools.FormatValue(Globals.Instance.Player.Data.Energy), maxEnergy);
         if (this.mOldStaminaNum != 0)
         {
             Sequence sequence3 = new Sequence();
             sequence3.Append(HOTween.To(this.staminaTxt.gameObject.transform, 0.15f, new TweenParms().Prop("localScale", new Vector3(1.5f, 1.5f, 1.5f))));
             sequence3.Append(HOTween.To(this.staminaTxt.gameObject.transform, 0.15f, new TweenParms().Prop("localScale", Vector3.one)));
             sequence3.Play();
         }
         this.mOldStaminaNum = Globals.Instance.Player.Data.Energy;
         this.mOldMaxEnergy = maxEnergy;
     }
     int maxStamina = Globals.Instance.Player.GetMaxStamina();
     if (!this.mInitFlag || this.mOldJingliNum != Globals.Instance.Player.Data.Stamina || maxStamina != this.mOldMaxJingli)
     {
         this.mJingliTxt.text = string.Format("{0}{1}[-]/{2}", (Globals.Instance.Player.Data.Stamina <= maxStamina) ? "[ffffff]" : "[00ff00]", Tools.FormatValue(Globals.Instance.Player.Data.Stamina), maxStamina);
         if (this.mOldJingliNum != 0)
         {
             Sequence sequence4 = new Sequence();
             sequence4.Append(HOTween.To(this.mJingliTxt.gameObject.transform, 0.15f, new TweenParms().Prop("localScale", new Vector3(1.5f, 1.5f, 1.5f))));
             sequence4.Append(HOTween.To(this.mJingliTxt.gameObject.transform, 0.15f, new TweenParms().Prop("localScale", Vector3.one)));
             sequence4.Play();
         }
         this.mOldJingliNum = Globals.Instance.Player.Data.Stamina;
         this.mOldMaxJingli = maxStamina;
     }
     int combatValue = Globals.Instance.Player.TeamSystem.GetCombatValue();
     if (!this.mInitFlag || this.mOldFighting != combatValue)
     {
         this.mOldFighting = combatValue;
         if (this.nameLb != null)
         {
             this.nameLb.text = Singleton<StringManager>.Instance.GetString("BillboardFighting") + "  " + this.mOldFighting;
         }
     }
     if (!this.mInitFlag || this.mOldVipLevel != Globals.Instance.Player.Data.VipLevel)
     {
         this.mOldVipLevel = Globals.Instance.Player.Data.VipLevel;
         if (this.mFrame != null)
         {
             this.mFrame.spriteName = Tools.GetItemQualityIcon(Globals.Instance.Player.GetQuality());
         }
         if (this.mVIPSingle != null && this.mVIPTens != null)
         {
             if (this.mOldVipLevel > 0u)
             {
                 this.mVIP.SetActive(true);
                 this.mVIPSingle.enabled = true;
                 if (this.mOldVipLevel >= 10u)
                 {
                     this.mVIPSingle.enabled = true;
                     this.mVIPSingle.spriteName = (this.mOldVipLevel % 10u).ToString();
                     this.mVIPTens.spriteName = (this.mOldVipLevel / 10u).ToString();
                 }
                 else
                 {
                     this.mVIPSingle.enabled = false;
                     this.mVIPTens.spriteName = this.mOldVipLevel.ToString();
                 }
             }
             else
             {
                 this.mVIP.SetActive(false);
             }
         }
     }
     if (!this.mInitFlag || this.mOldLevel != Globals.Instance.Player.Data.Level)
     {
         this.mOldLevel = Globals.Instance.Player.Data.Level;
         if (this.levelLb != null)
         {
             this.levelLb.text = string.Format("Lv{0}", this.mOldLevel);
         }
     }
 }
Exemplo n.º 19
0
 private void Ani()
 {
     for (int i = this.curIndex; i < 3; i++)
     {
         if (!string.IsNullOrEmpty(this.messageTxt[i].text))
         {
             this.messageBg[i].gameObject.SetActive(true);
             Sequence sequence = new Sequence();
             sequence.Append(HOTween.To(this.messageBg[i].gameObject.transform, 0f, new TweenParms().Prop("localScale", Vector3.zero)));
             sequence.Append(HOTween.To(this.messageBg[i].gameObject.transform, 0.15f, new TweenParms().Prop("localScale", Vector3.one)));
             sequence.Append(HOTween.To(this.messageBg[i].gameObject.transform, 3f, new TweenParms().Prop("localScale", Vector3.one)));
             sequence.Append(HOTween.To(this.messageBg[i].gameObject.transform, 0.15f, new TweenParms().Prop("localScale", Vector3.zero)));
             sequence.Append(HOTween.To(this.messageBg[i].gameObject.transform, 2f, new TweenParms().Prop("localScale", Vector3.zero)));
             sequence.Play();
             this.curIndex = i + 1;
             if (this.curIndex == 3)
             {
                 this.curIndex = 0;
             }
             break;
         }
         this.curIndex = 0;
         this.messageBg[i].gameObject.SetActive(false);
     }
 }
Exemplo n.º 20
0
 private void DoReward()
 {
     Sequence sequence = new Sequence(new SequenceParms().UpdateType(UpdateType.TimeScaleIndependentUpdate).OnComplete(new TweenDelegate.TweenCallback(this.OnItemAnimEnd)));
     float p_duration = 0.2f;
     if (this.mItemGo[4] != null)
     {
         sequence.Append(HOTween.To(this.mItemGo[4].transform, p_duration, new TweenParms().Prop("localPosition", new Vector3(160f, 0f, 0f)).Prop("localScale", Vector3.zero)));
     }
     if (this.mItemGo[3] != null)
     {
         sequence.Append(HOTween.To(this.mItemGo[3].transform, p_duration, new TweenParms().Prop("localPosition", new Vector3(250f, 0f, 0f)).Prop("localScale", Vector3.zero)));
     }
     if (this.mItemGo[2] != null)
     {
         sequence.Append(HOTween.To(this.mItemGo[2].transform, p_duration, new TweenParms().Prop("localPosition", new Vector3(330f, 0f, 0f)).Prop("localScale", Vector3.zero)));
     }
     if (this.mItemGo[1] != null)
     {
         sequence.Append(HOTween.To(this.mItemGo[1].transform, p_duration, new TweenParms().Prop("localPosition", new Vector3(420f, 0f, 0f)).Prop("localScale", Vector3.zero)));
     }
     if (this.mItemGo[0] != null)
     {
         sequence.Append(HOTween.To(this.mItemGo[0].transform, p_duration, new TweenParms().Prop("localPosition", new Vector3(510f, 0f, 0f)).Prop("localScale", Vector3.zero)));
     }
     this.IsAniming = true;
     sequence.Play();
 }
Exemplo n.º 21
0
 public void TxtChangeAni(int conLv)
 {
     int num = (conLv - 1) % 5 + 1;
     UILabel uILabel = null;
     if (num == 1)
     {
         uILabel = this.mAttackNum;
     }
     if (num == 2)
     {
         uILabel = this.mWufangNum;
     }
     if (num == 3)
     {
         uILabel = this.mFaFangNum;
     }
     if (num == 4)
     {
         uILabel = this.mHpNum;
     }
     if (num == 5)
     {
         return;
     }
     Sequence sequence = new Sequence();
     sequence.Append(HOTween.To(uILabel.gameObject.transform, 0.15f, new TweenParms().Prop("localScale", new Vector3(1.5f, 1.5f, 1.5f))));
     sequence.Append(HOTween.To(uILabel.gameObject.transform, 0.15f, new TweenParms().Prop("localScale", Vector3.one)));
     sequence.Play();
 }
Exemplo n.º 22
0
        public object CreateSequence(NTweenSequence sequence)
        {
            Sequence hoTweenSequence = new Sequence ();

            foreach (var tween in sequence.GetTweens()) {

                // yuck
                if (tween is SequenceTweenHolder) {
                    var nTween = (SequenceTweenHolder)tween;

                    var tweenParms = SetAttributes (nTween.attribute);

                    tweenParms.Prop (nTween.builder.GetProperty (), nTween.builder.GetTweenValueTo ());

                    var hoTween = HOTween.To (nTween.builder.GetObject (), nTween.builder.GetDuration (), tweenParms);

                    hoTweenSequence.Append (hoTween);
                } else if (tween is SequenceCallBack) {
                    hoTweenSequence.AppendCallback (((SequenceCallBack)tween).Callback.Invoke);
                } else if (tween is SequenceInterval) {
                    hoTweenSequence.AppendInterval (((SequenceInterval)tween).Duration);
                }
            }

            return hoTweenSequence;
        }
Exemplo n.º 23
0
    void Update()
    {
        switch (state)
        {
            case EnemyState.Idle:
                break;
            case EnemyState.Guard:
                timer -= Time.deltaTime;
                gameObject.renderer.material.mainTexture = gs.enemyDef;
                if ( timer <= 0.0f ) {
                    state = EnemyState.Idle;
                    gs.Enemy.width = 100f;
                    gs.Enemy.height = 160f;
                }
                break;

            case EnemyState.Prepare:
                timer -= Time.deltaTime;
                gameObject.renderer.material.mainTexture = gs.enemyPrepare;
                if (timer <= 0.0f)
                {
                    state = EnemyState.Attack;
                    timer = ATTACK_TIME;
                    gs.Enemy.width = 140f;
                    gs.Enemy.height = 140f;
                    HOTween.To ( gs.Enemy, ATTACK_TIME, "position", gs.Player.position );
                }
                break;

            case EnemyState.Attack:
                timer -= Time.deltaTime;
                gameObject.renderer.material.mainTexture = gs.enemyDash;
                if (timer <= 0.0f)
                {
                    state = EnemyState.Idle;
                    gs.Enemy.width = 100f;
                    gs.Enemy.height = 160f;
                    gs.Enemy.texture = gs.enemyJump;

                    Sequence sequence = new Sequence ();
                    sequence.Append ( HOTween.To ( gs.Enemy, 0.06f, new TweenParms ()
                        .Prop ( "position", gs.startEnemyPos + new Vector3 ( ( gs.Enemy.position.x - gs.startEnemyPos.x ) * 0.8f, -50f ) )
                        .Ease ( EaseType.EaseOutQuad ) )
                    );
                    sequence.Append ( HOTween.To ( gs.Enemy, 0.08f, new TweenParms ()
                        .Prop ( "position", gs.startEnemyPos + new Vector3 ( ( gs.Enemy.position.x - gs.startEnemyPos.x ) * 0.6f, -100f ) )
                        .Ease ( EaseType.Linear ) )
                    );
                    sequence.Append ( HOTween.To ( gs.Enemy, 0.1f, new TweenParms ()
                        .Prop ( "position", gs.startEnemyPos + new Vector3 ( ( gs.Enemy.position.x - gs.startEnemyPos.x ) * 0.4f, -100f ) )
                        .Ease ( EaseType.Linear ) )
                    );
                    sequence.Append ( HOTween.To ( gs.Enemy, 0.08f, new TweenParms ()
                        .Prop ( "position", gs.startEnemyPos + new Vector3 ( ( gs.Enemy.position.x - gs.startEnemyPos.x ) * 0.2f, -50f ) )
                        .Ease ( EaseType.Linear ) )
                    );
                    sequence.Append ( HOTween.To ( gs.Enemy, 0.06f, new TweenParms ()
                        .Prop ( "position", gs.startEnemyPos )
                        .Ease ( EaseType.EaseInQuad )
                        .OnComplete ( SetIdleTexture ) )
                    );
                    sequence.Play ();
                }
                break;

            case EnemyState.Dying:
                gameObject.renderer.material.mainTexture = gs.enemyDying;
                timer -= Time.deltaTime;
                if ( timer <= 0.0f ) {
                    state = EnemyState.Dead;
                    gs.Enemy.width = 200f;
                    gs.Enemy.height = 100f;
                }
                break;

            case EnemyState.Dead:
                gameObject.renderer.material.mainTexture = gs.enemyDead;
                break;
        }
    }
Exemplo n.º 24
0
 public void OnPlayerUpdateManual(int diamond)
 {
     if (this.mInitFlag)
     {
         this.gemTxt.text = Tools.FormatCurrency(diamond);
         if (this.mOldGemNum != 0)
         {
             Sequence sequence = new Sequence();
             sequence.Append(HOTween.To(this.gemTxt.gameObject.transform, 0.15f, new TweenParms().Prop("localScale", new Vector3(1.5f, 1.5f, 1.5f))));
             sequence.Append(HOTween.To(this.gemTxt.gameObject.transform, 0.15f, new TweenParms().Prop("localScale", Vector3.one)));
             sequence.Play();
         }
         this.mOldGemNum = diamond;
     }
 }
Exemplo n.º 25
0
 private void TxtChsngeAni(int index)
 {
     Sequence sequence = new Sequence();
     sequence.Append(HOTween.To(this.worshipCountLabel[index].gameObject.transform, 0.15f, new TweenParms().Prop("localScale", new Vector3(1.5f, 1.5f, 1.5f))));
     sequence.Append(HOTween.To(this.worshipCountLabel[index].gameObject.transform, 0.15f, new TweenParms().Prop("localScale", Vector3.one)));
     sequence.Play();
 }
Exemplo n.º 26
0
 private void Refresh()
 {
     int num = 0;
     int num2 = 0;
     int num3 = 0;
     if (GameUIManager.mInstance.uiState.TrailCurLvl < Globals.Instance.Player.Data.TrialWave)
     {
         for (int i = GameUIManager.mInstance.uiState.TrailCurLvl + 1; i <= Globals.Instance.Player.Data.TrialWave; i++)
         {
             TrialInfo info = Globals.Instance.AttDB.TrialDict.GetInfo(i);
             if (info != null)
             {
                 num += info.Value;
                 num2 += info.Money;
                 for (int j = 0; j < info.RewardType.Count; j++)
                 {
                     int num4 = info.RewardType[j];
                     if (num4 != 0)
                     {
                         if (num4 == 3)
                         {
                             if (j < info.RewardValue1.Count && j < info.RewardValue2.Count)
                             {
                                 int num5 = info.RewardValue1[j];
                                 if (num5 != 0)
                                 {
                                     ItemInfo info2 = Globals.Instance.AttDB.ItemDict.GetInfo(num5);
                                     if (info2 != null)
                                     {
                                         this.mGUITrialRewardItemTable.AddData(new GUITrialRewardItemData(ERewardType.EReward_Item, info2, info.RewardValue2[j], 0));
                                         num3++;
                                     }
                                 }
                             }
                         }
                         else if (num4 == 15)
                         {
                             if (j < info.RewardValue1.Count)
                             {
                                 this.mGUITrialRewardItemTable.AddData(new GUITrialRewardItemData(ERewardType.EReward_Item, null, 0, info.RewardValue1[j]));
                             }
                         }
                         else if (num4 == 17 && j < info.RewardValue1.Count)
                         {
                             this.mGUITrialRewardItemTable.AddData(new GUITrialRewardItemData(ERewardType.EReward_LopetSoul, null, 0, info.RewardValue1[j]));
                         }
                     }
                 }
             }
         }
     }
     ActivityValueData valueMod = Globals.Instance.Player.ActivitySystem.GetValueMod(4);
     if (valueMod != null)
     {
         num *= valueMod.Value1 / 100;
     }
     Sequence sequence = new Sequence(new SequenceParms().UpdateType(UpdateType.TimeScaleIndependentUpdate));
     sequence.Append(HOTween.To(this, 1f, new TweenParms().Prop("mMaxRecordNum", Globals.Instance.Player.Data.TrialMaxWave).OnUpdate(new TweenDelegate.TweenCallback(this.OnMaxRecordNumUpdate))));
     sequence.Insert(0f, HOTween.To(this, 1f, new TweenParms().Prop("mWaveNum", Globals.Instance.Player.Data.TrialWave).OnUpdate(new TweenDelegate.TweenCallback(this.OnWaveNumUpdate))));
     sequence.Insert(0f, HOTween.To(this, 1f, new TweenParms().Prop("mMoJingNum", num).OnUpdate(new TweenDelegate.TweenCallback(this.OnMoJingNumUpdate))));
     sequence.Insert(0f, HOTween.To(this, 1f, new TweenParms().Prop("mMoneyNum", num2).OnUpdate(new TweenDelegate.TweenCallback(this.OnMoneyNumUpdate))));
     Sequence sequence2 = new Sequence(new SequenceParms().UpdateType(UpdateType.TimeScaleIndependentUpdate));
     sequence2.AppendInterval(0.2f);
     sequence2.Append(HOTween.To(this.mTitle.transform, 0.2f, new TweenParms().Prop("localScale", Vector3.one).Ease(EaseType.EaseOutBack)));
     sequence2.AppendInterval(0.2f);
     sequence2.Append(HOTween.To(this.mMidBg.transform, 0.2f, new TweenParms().Prop("localScale", Vector3.one).Ease(EaseType.EaseOutBack)));
     sequence2.AppendInterval(0.2f);
     sequence2.Append(sequence);
     if (num3 > 0)
     {
         sequence2.AppendInterval(0.1f);
         sequence2.Append(HOTween.To(this.mGUITrialRewardItemTable.transform, 0.15f, new TweenParms().Prop("localScale", Vector3.one)));
     }
     if (Globals.Instance.Player.Data.TrialMaxWave > GameUIManager.mInstance.uiState.TrailMaxRecord)
     {
         sequence2.AppendInterval(0.2f);
         sequence2.Append(HOTween.To(this.mMaxRecord.transform, 0.001f, new TweenParms().Prop("localScale", new Vector3(8f, 8f, 8f))));
         sequence2.Append(HOTween.To(this.mMaxRecord.transform, 0.2f, new TweenParms().Prop("localScale", Vector3.one).Ease(EaseType.EaseInCubic)));
         sequence2.AppendCallback(new TweenDelegate.TweenCallback(this.ShowMaxRecordEffect));
     }
     sequence2.AppendInterval(0.2f);
     sequence2.Append(HOTween.To(this.mSureBtn.transform, 0.1f, new TweenParms().Prop("localScale", Vector3.one).Ease(EaseType.EaseOutBack)));
     sequence2.Play();
 }
Exemplo n.º 27
0
	private float originalCameraSize; //used for animating
	
	#endregion
	
	#region Init
	
	public void Initialize()
	{
		myPopup = this as IPopup;
		
		//parse out the clone name
		string newName = gameObject.name;
		gameObject.name = StringExtensions.ParseOutClone(ref newName);
		
		background.Start(); //resize it before we call preinit so we know we have correct size
		
		myPopup.PreInit();
		
		myCam = GetComponent(typeof(Camera)) as Camera;
		originalCameraSize = myCam.orthographicSize;
		
		//pause game
		if (shouldPauseGame == true)
			Time.timeScale = 0.0f;
		
		if (openSound != null)
			SoundManager.PlaySoundOnce(openSound);
		
		if (cancelButton != null)
		{
			cancelButton.ResizeAndReposition(cancelButton);cancelButton.Start();
			
			if (cancelButton.spriteText != null)
			{
				cancelButton.spriteText.multiline = false;
				cancelButton.spriteText.maxWidth = cancelButton.width - (cancelButton.width * GameValues.buttonTextPaddingPercentage);
			}
		}
		
		if (shouldAnimate)
			myCam.orthographicSize *= 5;
		
		popupManager = PopupManager.I;
		
		if (popupManager == null)
		{
			Kill();
			return;
		}
		
		uiManager = UIManager.instance;

		if (uiManager != null)
		{
			//save all old cameras then delete from UIManager. Otherwise objects behind will still detect input
			originalCameraSettings = uiManager.uiCameras;
			
			for (int x = uiManager.uiCameras.Length -1; x >= 0; x--)
			{
				uiManager.RemoveCamera(x);
			}
			
			uiManager.AddCamera(myCam, myCam.cullingMask, Mathf.Infinity, 0);
			
			originalRayCam = uiManager.rayCamera;
			uiManager.rayCamera = myCam;
		}
		else
		{
			Kill();
			return;
		}
		
		popupManager.activePopups.Add(myPopup);
        myCam.depth = popupManager.activePopups.Count + 1;

		if (shouldAnimate)
		{
			//called right before animation
			myPopup.PreAnimate();
			
			HOTween.defUpdateType = UpdateType.TimeScaleIndependentUpdate;
			
			Sequence s = new Sequence();
			//s.Append(HOTween.To(myCam, 1.2f, "orthographicSize", originalCameraSize));
			s.Append(HOTween.To(myCam, 0.3f, new TweenParms()
										.UpdateType(UpdateType.TimeScaleIndependentUpdate)
										.Prop("orthographicSize", originalCameraSize)
										.Ease(EaseType.EaseInBounce)
										));
			s.ApplyCallback(CallbackType.OnComplete, AnimationComplete);
			s.Play();
		}
		else
		{
			AddCancelButtonDelegate();
			myPopup.InitComplete();
		}
	}
Exemplo n.º 28
0
	//用于机器人作为操作对象时遇到类型1警卫的GameOver结算
	void Update(){
		//如果遇到类型1警卫且当前机器人不在工作
		if(RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().IsTriggered == true && GetComponent<RobotTrigger>().IsActive == true){
			if (RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().isGuard_b == true && isWork == false) {
				RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().isGuard_b = false;
				IsRobotWorks = RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().IsGameOver.gameObject;
				if(JudgeOnce == true){
					foreach (Transform child in RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().IsGameOver.transform.parent.transform.parent.transform) {
						LightComponent.Add (child.gameObject);
					}
					//如果当前机器人为玩家机器人
					if (gameObject.transform.parent.gameObject == GameController.GetInstance().CurrentPlayer && Application.loadedLevelName != "DemoTech") {
						JudgeOnce = false;
						isAvail = false;
						gameObject.transform.parent.gameObject.GetComponent<Rigidbody>().Sleep();
						WaitNow();
						//新建整体的HOTween补间动画
						TweenParms Gameover = new TweenParms ();
						//新建当前机器人的HOTween补间动画
						TweenParms DestoryRobotAnim = new TweenParms ();
						//颜色渐渐变黑
						DestoryRobotAnim.Prop ("color", new Color (0, 0, 0, 1));
						HOTween.To (gameObject.transform.parent.gameObject.GetComponent<tk2dSprite> (), 0.2f, DestoryRobotAnim);
						//颜色Aplaha通道渐变至255(即屏幕渐渐变黑)
						Gameover.Prop ("color", new Color (1, 1, 1, 1));
						//回调函数GameOverScene
						Gameover.OnComplete (GameOverScene);
						HOTween.To (GameObject.Find ("over").gameObject.GetComponent<tk2dSprite> (), 2, Gameover);
						LightComponent[0].GetComponent<tk2dSprite>().SetSprite("红灯");
						LightComponent[1].GetComponent<tk2dSprite>().SetSprite("红光");
						StartCoroutine(WaitLight(2.0f));
						//如果不是玩家机器人
					}else if(gameObject.transform.parent.gameObject == GameController.GetInstance().CurrentPlayer && Application.loadedLevelName == "DemoTech" && GameController.GetInstance ().FilmMode == false){
						JudgeOnce = true;
						BallRobot.SetActive(true);
						GameController.GetInstance ().FilmMode = true;
						ButtonPause.GetComponent<UIButton> ().isEnabled = false;
						ButtonViewer.GetComponent<UIButton> ().isEnabled = false;
						TextAim.GetComponent<UILabel>().text = "放轻松,我们再试一次。";
						for(Count = 0; Count < GameController.GetInstance ().WorkSpaceCollection.Count; Count++){
							if(GameObject.Find ("FollowedObject").GetComponent<PlayerChange> ().CurrentPlayerString == GameController.GetInstance ().WorkSpaceCollection[Count].gameObject.name.Substring (start - 1, length)){
								GameController.GetInstance ().WorkSpaceCollection[Count].GetComponent<AimCreater>().WorkSpaceComponent [0].SetActive (false);
							}
						}
						TweenParms Action03 = new TweenParms ();
						Action03.Prop ("position", new Vector3 (GameController.GetInstance().BallPosition [0], GameController.GetInstance().BallPosition [1], -21.3f));
						Action03.Ease (EaseType.EaseOutQuart);		
						HOTween.To (Camera01.transform, 2.0f, Action03);
						BallRobot.transform.position = GameController.GetInstance().BallPosition;
						Robot01.transform.position = GameController.GetInstance().Robot01Position;
						GameController.GetInstance().CurrentPlayer = BallRobot;
						GameController.GetInstance().CurrentPlayerTrigger = BallRobot;
						GameController.GetInstance().IsRobot = false;
						GameController.GetInstance().BallToRobot = true;
						StartCoroutine (Miss (1.5f));
					}else if(gameObject.transform.parent.gameObject != GameController.GetInstance().CurrentPlayer && isDeath == false){
						JudgeOnce = false;
						WaitNow();
						gameObject.transform.parent.gameObject.GetComponent<Rigidbody>().Sleep();
						//机器人失效,不能操作
						isAvail = false;
						//当前tag标签改为NoRobot
						gameObject.tag = "NoRobot";
						//新建当前机器人的HOTween补间动画
						TweenParms DestoryRobotAnim = new TweenParms ();
						//颜色渐渐变黑
						DestoryRobotAnim.Prop ("color", new Color (0, 0, 0, 1));
						HOTween.To (gameObject.transform.parent.gameObject.GetComponent<tk2dSprite> (), 0.2f, DestoryRobotAnim);
						LightComponent[1].GetComponent<tk2dSprite>().SetSprite("红灯");
						LightComponent[0].GetComponent<tk2dSprite>().SetSprite("红光");
						if(gameObject.transform.parent.gameObject.name == "Robot_a1-Body-3-SP"){
							GameController.GetInstance ().Robot02IsDie = true;
						}
						if(GameController.GetInstance ().FilmMode == true){
							
							for(Count = 0; Count < GameController.GetInstance ().WorkSpaceCollection.Count; Count++){
								if(MyName == GameController.GetInstance ().WorkSpaceCollection[Count].gameObject.name.Substring (start - 1, length)){
									GameController.GetInstance ().WorkSpaceCollection[Count].GetComponent<AimCreater>().WorkSpaceComponent [0].SetActive (false);
								}
							}
						}
						StartCoroutine(WaitLight(2.0f));
					}
				}
			}
			//如果遇到了警卫3并且还被控制状态
			if (RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().isGuard_c == true && gameObject.transform.parent.gameObject == GameController.GetInstance().CurrentPlayer && Application.loadedLevelName != "DemoTech"){
				RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().isGuard_c = false;
				if (JudgeOnce == true)
				{
					foreach (Transform child in RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().IsGameOver.transform.parent.transform.parent.transform)
					{
						//获得警卫的组件
						LightComponent.Add(child.gameObject);
					}
					JudgeOnce = false;
					//新建警卫的HOTween补间动画
					Sequence Guard02Alert = new Sequence(new SequenceParms().Loops(10, LoopType.Restart));
					//警卫颜色闪烁
					Guard02Alert.Prepend(HOTween.To(RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().IsGameOver.gameObject.GetComponent<tk2dSprite>(), 0.08f, new TweenParms().Prop("color", new Color(1f, 1f, 1f, 0.5f))));
					Guard02Alert.Append(HOTween.To(RobotGameOverTrigger.gameObject.GetComponent<RobotGameOverTrigger>().IsGameOver.gameObject.GetComponent<tk2dSprite>(), 0.08f, new TweenParms().Prop("color", new Color(1f, 1f, 1f, 1f))));
					Guard02Alert.Play();
					//计算粒子子弹发射角度
					float ShootAngle01 = Vector3.Angle(
						new Vector3(100f, 0f, 0f),
						transform.position * 100.0f - LightComponent[1].transform.position * 100.0f)
						* -Mathf.Sign(
							Vector3.Cross(
							new Vector3(100f, 0f, 0f), transform.position * 100.0f - LightComponent[1].transform.position * 100.0f)[2]);
					LightComponent[1].transform.rotation = Quaternion.Euler(ShootAngle01, 90, 0);
					LightComponent[1].GetComponent<ParticleSystem>().Play();
					//新建整体的HOTween补间动画
					TweenParms Gameover = new TweenParms();
					//新建当前机器人的HOTween补间动画
					TweenParms DestoryRobotAnim = new TweenParms();
					//颜色渐渐变黑
					DestoryRobotAnim.Prop("color", new Color(0, 0, 0, 1));
					HOTween.To(gameObject.transform.parent.gameObject.GetComponent<tk2dSprite>(), 0.2f, DestoryRobotAnim);
					//颜色Aplaha通道渐变至255(即屏幕渐渐变黑)
					Gameover.Prop("color", new Color(1, 1, 1, 1));
					//回调函数GameOverScene
					Gameover.OnComplete(GameOverScene);
					HOTween.To(GameObject.Find("over").gameObject.GetComponent<tk2dSprite>(), 2, Gameover);
				}
			}
		}
	}
Exemplo n.º 29
0
	//用于小球作为操作对象时遇到类型2警卫的GameOver结算
	void OnTriggerStay(Collider IsRobotWork){
		//如果遇到的警卫为类型2且当前操作对象为小球
		if (IsRobotWork.CompareTag("guard-2b") && GameController.GetInstance().IsRobot == false) {
			if(JudgeOnce == true){
				foreach (Transform child in IsRobotWork.transform.parent.transform.parent.transform) {
					//获得警卫的组件
					LightComponent.Add (child.gameObject);
				}
				JudgeOnce = false;
				//新建警卫的HOTween补间动画
				Sequence Guard02Alert = new Sequence (new SequenceParms().Loops(10,LoopType.Restart));
				//警卫颜色闪烁
				Guard02Alert.Prepend(HOTween.To (IsRobotWork.gameObject.GetComponent<tk2dSprite> (), 0.08f,new TweenParms().Prop("color", new Color (1f, 1f, 1f, 0.5f))));
				Guard02Alert.Append(HOTween.To (IsRobotWork.gameObject.GetComponent<tk2dSprite> (), 0.08f,new TweenParms().Prop("color", new Color (1f, 1f, 1f, 1f))));
				Guard02Alert.Play();
				//计算粒子子弹发射角度
				float ShootAngle01 = Vector3.Angle(
					new Vector3(100f,0f,0f),
					transform.position*100.0f-LightComponent[1].transform.position*100.0f)
					*-Mathf.Sign(
					Vector3.Cross(
					new Vector3(100f,0f,0f),transform.position*100.0f-LightComponent[1].transform.position*100.0f)[2]);
				LightComponent[1].transform.rotation = Quaternion.Euler(ShootAngle01,90,0);
				LightComponent[1].GetComponent<ParticleSystem>().Play();
				if(Application.loadedLevelName != "DemoTech"){
					gameObject.GetComponent<Rigidbody>().Sleep();
					GetComponent<PlayerControl>().isAvail = false;
					//新建整体的HOTween补间动画
					TweenParms Gameover = new TweenParms();
					//颜色Aplaha通道渐变至255(即屏幕渐渐变黑)
					Gameover.Prop("color",new Color(1,1,1,1));
					//回调函数GameOverScene
					Gameover.OnComplete(GameOverScene);
					HOTween.To(GameObject.Find("over").gameObject.GetComponent<tk2dSprite>(), 2f, Gameover);
				}else{
					if(gameObject.name == "BallRobot"){
						JudgeOnce = true;
						gameObject.GetComponent<Rigidbody>().Sleep();
						GetComponent<PlayerControl>().isAvail = false;
						GameController.GetInstance ().FilmMode = true;
						ButtonPause.GetComponent<UIButton> ().isEnabled = false;
						ButtonViewer.GetComponent<UIButton> ().isEnabled = false;
						TextAim.GetComponent<UILabel>().text = "放轻松,我们再试一次。";
						TweenParms Action03 = new TweenParms ();
						Action03.Prop ("position", new Vector3 (GameController.GetInstance().BallPosition [0], GameController.GetInstance().BallPosition [1], -21.3f));
						Action03.Ease (EaseType.EaseOutQuart);		
						HOTween.To (Camera01.transform, 2.0f, Action03);
						gameObject.transform.position = GameController.GetInstance().BallPosition;
						Robot01.transform.position = GameController.GetInstance().Robot01Position;
						StartCoroutine (Miss (1.5f));
					}
				}
			}
		}
        //如果遇到了警卫3并且还被控制状态
        if (IsRobotWork.CompareTag("guard-3") && GameController.GetInstance().IsRobot == false)
        {
            if (JudgeOnce == true)
            {
                foreach (Transform child in IsRobotWork.transform.parent.transform.parent.transform)
                {
                    //获得警卫的组件
                    LightComponent.Add(child.gameObject);
                }
                JudgeOnce = false;
                //新建警卫的HOTween补间动画
                Sequence Guard02Alert = new Sequence(new SequenceParms().Loops(10, LoopType.Restart));
                //警卫颜色闪烁
                Guard02Alert.Prepend(HOTween.To(IsRobotWork.gameObject.GetComponent<tk2dSprite>(), 0.08f, new TweenParms().Prop("color", new Color(1f, 1f, 1f, 0.5f))));
                Guard02Alert.Append(HOTween.To(IsRobotWork.gameObject.GetComponent<tk2dSprite>(), 0.08f, new TweenParms().Prop("color", new Color(1f, 1f, 1f, 1f))));
                Guard02Alert.Play();
                //计算粒子子弹发射角度
                float ShootAngle01 = Vector3.Angle(
                    new Vector3(100f, 0f, 0f),
                    transform.position * 100.0f - LightComponent[1].transform.position * 100.0f)
                    * -Mathf.Sign(
                    Vector3.Cross(
                    new Vector3(100f, 0f, 0f), transform.position * 100.0f - LightComponent[1].transform.position * 100.0f)[2]);
                LightComponent[1].transform.rotation = Quaternion.Euler(ShootAngle01, 90, 0);
                LightComponent[1].GetComponent<ParticleSystem>().Play();
                if (Application.loadedLevelName != "DemoTech")
                {
                    GetComponent<PlayerControl>().isAvail = false;
                    //新建整体的HOTween补间动画
                    TweenParms Gameover = new TweenParms();
                    //颜色Aplaha通道渐变至255(即屏幕渐渐变黑)
                    Gameover.Prop("color", new Color(1, 1, 1, 1));
                    //回调函数GameOverScene
                    Gameover.OnComplete(GameOverScene);
                    HOTween.To(GameObject.Find("over").gameObject.GetComponent<tk2dSprite>(), 2f, Gameover);
                }
                else
                {
                    if (gameObject.name == "BallRobot")
                    {
                        JudgeOnce = true;
                        gameObject.GetComponent<Rigidbody>().Sleep();
                        GetComponent<PlayerControl>().isAvail = false;
                        GameController.GetInstance().FilmMode = true;
                        ButtonPause.GetComponent<UIButton>().isEnabled = false;
                        ButtonViewer.GetComponent<UIButton>().isEnabled = false;
                        TextAim.GetComponent<UILabel>().text = "放轻松,我们再试一次。";
                        TweenParms Action03 = new TweenParms();
                        Action03.Prop("position", new Vector3(GameController.GetInstance().BallPosition[0], GameController.GetInstance().BallPosition[1], -21.3f));
                        Action03.Ease(EaseType.EaseOutQuart);
                        HOTween.To(Camera01.transform, 2.0f, Action03);
                        gameObject.transform.position = GameController.GetInstance().BallPosition;
                        Robot01.transform.position = GameController.GetInstance().Robot01Position;
                        StartCoroutine(Miss(1.5f));
                    }
                }
            }
        }
        //如果遇到了二号电梯并且还被控制状态
        if (IsRobotWork.CompareTag("elevator2") && GameController.GetInstance().IsRobot == false)
        {
            if (JudgeOnce == true)
            {
                if (Application.loadedLevelName != "DemoTech")
                {
					if(GameController.GetInstance().ShootOnce == true){
						GameController.GetInstance().ShootOnce = false;
						Pi = Instantiate(BallPlayerDes, transform.position, Quaternion.identity) as GameObject;                     
						gameObject.GetComponent<tk2dSprite> ().color = new Color (1,1,1,0);
						gameObject.GetComponent<Rigidbody>().Sleep();
						GameObject.Find("Camera01").transform.position = new Vector3(Pi.transform.position[0],Pi.transform.position[1],-23.1f);
						StartCoroutine(WaitDie(2.0f));
					}
                    GetComponent<PlayerControl>().isAvail = false;
                    //新建整体的HOTween补间动画
                    TweenParms Gameover = new TweenParms();
                    //颜色Aplaha通道渐变至255(即屏幕渐渐变黑)
                    Gameover.Prop("color", new Color(1, 1, 1, 1));
                    //回调函数GameOverScene
                    Gameover.OnComplete(GameOverScene);
                    HOTween.To(GameObject.Find("over").gameObject.GetComponent<tk2dSprite>(), 2f, Gameover);

                }
                else
                {
                    if (gameObject.name == "BallRobot")
                    {

						JudgeOnce = true;
                        gameObject.GetComponent<Rigidbody>().Sleep();
                        GetComponent<PlayerControl>().isAvail = false;
                        GameController.GetInstance().FilmMode = true;
                        ButtonPause.GetComponent<UIButton>().isEnabled = false;
                        ButtonViewer.GetComponent<UIButton>().isEnabled = false;
                        TextAim.GetComponent<UILabel>().text = "放轻松,我们再试一次。";
                        TweenParms Action03 = new TweenParms();
                        Action03.Prop("position", new Vector3(GameController.GetInstance().BallPosition[0], GameController.GetInstance().BallPosition[1], -21.3f));
                        Action03.Ease(EaseType.EaseOutQuart);
                        HOTween.To(Camera01.transform, 2.0f, Action03);
                        gameObject.transform.position = GameController.GetInstance().BallPosition;
                        Robot01.transform.position = GameController.GetInstance().Robot01Position;
                        StartCoroutine(Miss(1.5f));
                    }
                }
            }
        }
	}
Exemplo n.º 30
0
 void SetupTitleScreenTween()
 {
     titleScreenTween = new Sequence(new SequenceParms().AutoKill(false));
     titleScreenTween.Append(HOTween.To(titleScreen, 0.5f, new TweenParms()
         .Prop("color", new Color(titleScreen.color.r, titleScreen.color.g, titleScreen.color.b, 0))
         .Ease(EaseType.EaseOutCubic)
     ));
     titleScreenTween.AppendCallback(ShowWorldSelect);
 }