protected void PlayTween(TweenPosition tween, Vector3 from, Vector3 to, float duration)
 {
     tween.ResetToBeginning();
     tween.from = from;
     tween.to = to;
     tween.PlayForward();
     tween.duration = duration;
 }
Example #2
0
    public void MoveTagByIdx(int idx)
    {
        TweenPosition tw = transform.GetChild(0).GetComponent <TweenPosition> ();

        tw.from = transform.GetChild(0).localPosition;
        tw.to   = new Vector2(-360f, 350f - (idx * 200));
        tw.ResetToBeginning();
        tw.PlayForward();
    }
Example #3
0
    //5.点击角色选择界面的"开始游戏"调用该方法
    public void OnGameStartClick()
    {
        //1.显示场景加载进度条
        LoadSceneTween.PlayForward();
        //2.切换到城镇场景
        AsyncOperation operation = Application.LoadLevelAsync(1);

        LoadSceneProgressBar._instance.Show(operation);
    }
	public void HeadToStartPosition(Vector3 startPosition)
	{
		tween = GetComponent<TweenPosition>();

		tween.from = transform.position;
		tween.to = startPosition;

		tween.PlayForward();
	}
Example #5
0
 private IEnumerator ChangePanelLeft(SmithManager.SmithGrowData data)
 {
     centerAnim.set_enabled(true);
     centerAnim.ResetToBeginning();
     centerAnim.duration = 0.1f;
     centerAnim.from     = defaultCenterPos;
     centerAnim.to       = new Vector3(defaultCenterPos.x + 200f, defaultCenterPos.y, defaultCenterPos.z);
     centerAnim.PlayForward();
     rightAnim.set_enabled(true);
     rightAnim.ResetToBeginning();
     rightAnim.duration = 0.1f;
     rightAnim.from     = defaultRightPos;
     rightAnim.to       = new Vector3(defaultRightPos.x + 200f, defaultRightPos.y, defaultRightPos.z);
     rightAnim.PlayForward();
     leftAnim.set_enabled(true);
     leftAnim.ResetToBeginning();
     leftAnim.duration = 0.1f;
     leftAnim.from     = defaultLeftPos;
     leftAnim.to       = new Vector3(defaultLeftPos.x + 200f, defaultLeftPos.y, defaultLeftPos.z);
     leftAnim.PlayForward();
     while (centerAnim.get_enabled())
     {
         yield return((object)null);
     }
     SetModifyPanel(data);
     centerAnim.set_enabled(true);
     centerAnim.ResetToBeginning();
     centerAnim.duration = 0.1f;
     centerAnim.from     = new Vector3(defaultCenterPos.x - 200f, defaultCenterPos.y, defaultCenterPos.z);
     centerAnim.to       = defaultCenterPos;
     centerAnim.PlayForward();
     rightAnim.set_enabled(true);
     rightAnim.ResetToBeginning();
     rightAnim.duration = 0.1f;
     rightAnim.from     = new Vector3(defaultRightPos.x - 200f, defaultRightPos.y, defaultRightPos.z);
     rightAnim.to       = defaultRightPos;
     rightAnim.PlayForward();
     leftAnim.set_enabled(true);
     leftAnim.ResetToBeginning();
     leftAnim.duration = 0.1f;
     leftAnim.from     = new Vector3(defaultLeftPos.x - 200f, defaultLeftPos.y, defaultLeftPos.z);
     leftAnim.to       = defaultLeftPos;
     leftAnim.PlayForward();
 }
Example #6
0
    public void startMove(Vector3 newLocation)
    {
        gameObject.AddComponent<TweenPosition>();
        TweenPosition tp = gameObject.GetComponent<TweenPosition>();

        tp.from = gameObject.transform.localPosition;
        tp.to = newLocation;
        tp.PlayForward();
        tp.duration = (float)RandomNumberBetween(4, 7);
    }
 public void Show()
 {
     isShow              = true;
     App.OnlyController  = key;
     CancelTouch.enabled = true;
     camera.SetActive(isActive: true);
     MenuBox.SetActive(isActive: true);
     TweenPos.onFinished.Clear();
     TweenPos.PlayForward();
 }
        private void OnPlayAnim(IEvent ievent)
        {
            var e = ievent as SmithyOnPlayTweenAnim;

            if (e.Index == Index)
            {
                TweenPos.ResetForPlay();
                TweenPos.PlayForward();
            }
        }
Example #9
0
    /// <summary>
    ///
    /// </summary>
    protected override IEnumerator ShowAnimation()
    {
        cmpt_.PlayForward();
        while (cmpt_.enabled)
        {
            yield return(1);
        }

        yield return(0);
    }
Example #10
0
    public void Show(List <string> talkNpc, GameObject player)
    {
        this.player  = player;
        this.talkNpc = talkNpc;

        if (talkNpc.Count == 1)
        {
            talkNpcLabel.text = this.talkNpc[0];
            tween.PlayForward();
        }
        else
        {
            EnableBtn();
            acceptBtn.gameObject.SetActive(false);
            talkNpcLabel.text = this.talkNpc[0];
            sign = 1;
            tween.PlayForward();
        }
    }
Example #11
0
 void PlayAttack()
 {
     if (IsMelee)
     {
         m_TweenMelee.enabled = true;
         m_TweenMelee.ResetToBeginning();
         m_TweenMelee.PlayForward();
     }
     m_Melee.gameObject.SetActive(true);
 }
    private void TweenPos(GameObject toTween, Vector3 to, Vector3 from)
    {
        TweenPosition tween = toTween.GetComponent <TweenPosition>();

        tween.from = from;

        tween.to = to;
        tween.ResetToBeginning();
        tween.PlayForward();
    }
Example #13
0
 /*
  * public void hoverIn(){
  *      if (pressed) {
  *
  *      } else {
  *              tweenWidth.PlayForward();
  *              tweenPosition.PlayForward();
  *              forward=true;
  *      }
  *
  * }
  * public void hoverout(){
  *      if (forward && !toggle.value) {
  *              tweenWidth.PlayReverse ();
  *              tweenPosition.PlayReverse ();
  *              reverse = true;
  *              forward = false;
  *      } else {
  *              isToggleSet=true;
  *              called=true;
  *      }
  * }
  */
 public void click()
 {
     for (int i = 0; i < levelButtons.Length; i++)
     {
         levelButtons[i].tw.PlayReverse();
         levelButtons[i].tp.PlayReverse();
     }
     tweenWidth.PlayForward();
     tweenPosition.PlayForward();
 }
Example #14
0
 public void Enter()
 {
     if (!isEnter)
     {
         isEnter = true;
         tp.onFinished.Clear();
         tp.PlayForward();
         Crane.StartAnimationNoReset();
     }
 }
Example #15
0
    public void Play(Vector3 from, Vector3 to, float dur, bool autoDestroy = true)
    {
        mAutoDestroy = autoDestroy;

        transform.position = from;
        TweenPosition tp = TweenPosition.Begin(gameObject, dur, to);

        tp.SetOnFinished(onFinish);
        tp.PlayForward();
    }
Example #16
0
 void ActiveFinishRankTPos()
 {
     EventDelegate.Add(FinishRankTPos.onFinished, delegate {
         Invoke("ActiveFinishRankTRot", 0.5f);
     });
     FinishRankTPos.ResetToBeginning();
     FinishRankTPos.enabled = true;
     FinishRankTPos.PlayForward();
     //AudioManager.Instance.PlaySFX(AudioRankTPos);
 }
Example #17
0
    // Update is called once per frame
    void Update()
    {
        if (PlayerPrefs.HasKey("isPlayerPrefSet") && !resetSetting)
        {
            speedOxygenmeterPos.PlayReverse();
            TimerPos.PlayReverse();
            HeatMeterPos.PlayReverse();
            speedOxygenMeterScale.PlayReverse();
            TimerScale.PlayReverse();
            HeatMeterScale.PlayReverse();
            speedOxygenMeterColor.PlayReverse();
            TimerColor.PlayReverse();
            HeatMeterColor.PlayReverse();
            OverlayColor.enabled = false;
            OverlaySprite.color  = new Color(255f, 255f, 255f);
            iTween.StopByName("shaker");
            OverlayPos.delay = 3f;
            EventDelegate.Set(OverlayPos.onFinished, TweenStats);
            OverlayPos.PlayReverse();
        }

        if ((SpeedOmeter.valueCurrent >= zoomSpeed) && !(playedOnceForward) && Overlay.activeSelf)
        {
            speedOxygenmeterPos.PlayForward();
            TimerPos.PlayForward();
            HeatMeterPos.PlayForward();
            speedOxygenMeterScale.PlayForward();
            TimerScale.PlayForward();
            HeatMeterScale.PlayForward();
            speedOxygenMeterColor.PlayForward();
            TimerColor.PlayForward();
            HeatMeterColor.PlayForward();
            OverlayColor.enabled = true;
            iTween.ShakePosition(CameraObject, iTween.Hash("name", "shaker", "x", Shakingfactor, "y", Shakingfactor, "time", .1f, "looptype", "loop"));
            playedOnceForward = true;
            playedOnceReverse = false;
        }
        if ((SpeedOmeter.valueCurrent <= zoomSpeed) && playedOnceForward && !playedOnceReverse)
        {
            speedOxygenmeterPos.PlayReverse();
            TimerPos.PlayReverse();
            HeatMeterPos.PlayReverse();
            speedOxygenMeterScale.PlayReverse();
            TimerScale.PlayReverse();
            HeatMeterScale.PlayReverse();
            speedOxygenMeterColor.PlayReverse();
            TimerColor.PlayReverse();
            HeatMeterColor.PlayReverse();
            OverlayColor.enabled = false;
            OverlaySprite.color  = new Color(255f, 255f, 255f);
            iTween.StopByName("shaker");
            playedOnceForward = false;
            playedOnceReverse = true;
        }
    }
Example #18
0
 // Update is called once per frame
 void Update()
 {
     if (StartPlay)
     {
         m_TwPos.ResetToBeginning();
         m_TwAlpha.ResetToBeginning();
         m_TwScale.ResetToBeginning();
         StartPlay           = false;
         m_WinWord.StartPlay = true;
         m_WinWord.Show      = true;
         string DataNumber = WinMoney.ToString();
         foreach (var item in DataNumber)
         {
             GameObject Data = Instantiate(m_NumberPrefeb);
             Data.transform.parent     = m_NumberParent.transform;
             Data.transform.localScale = new Vector3(1, 1, 1);
             IceAgeWinAnimNumber Data_cs = Data.GetComponent <IceAgeWinAnimNumber>();
             Data_cs.AnimDelay = DelayTimeIndex;
             DelayTimeIndex   += NumberDelayTime;
             Data_cs.Final     = int.Parse(item.ToString());
             m_Number.Add(Data);
         }
         m_FinalNumber = m_Number[m_Number.Count - 1].GetComponent <IceAgeWinAnimNumber>();
         PlayingCheck  = true;
         m_NumberCheck.repositionNow = true;
     }
     if (PlayingCheck)
     {
         if (m_FinalNumber.Over && m_WinWord.OneceOver)
         {
             PlayingCheck        = false;
             m_WinWord.OneceOver = false;
             m_TwPos.PlayForward();
             m_TwAlpha.PlayForward();
             m_TwScale.PlayForward();
         }
     }
     if (Reseat)
     {
         Reseat = false;
         m_WinWord.OneceOver = false;
         m_WinWord.Show      = false;
         IsPlaying           = false;
         PlayOver            = false;
         m_WinWord.Loop      = false;
         DelayTimeIndex      = 0.1f;
         int Data = m_Number.Count;
         for (int i = 0; i < Data; i++)
         {
             Destroy(m_Number[0]);
             m_Number.RemoveAt(0);
         }
         m_Number.Clear();
     }
 }
Example #19
0
    public void SetRank(int rank, int damage, float damage_percent, bool init = false)
    {
        label_description.text = Localization.Format("RaidPlayerDescription", damage, damage_percent);
        label_rank.text        = rank.ToString();

        if (IsPlayer == true)
        {
            if (rank < Rank || Rank == 0)
            {
                m_ScaleTween.ResetToBeginning();
                m_ScaleTween.PlayForward();
            }
            Rank = rank;
            return;
        }

        Vector3 to_position = Vector3.zero;

        to_position.y = move_gap * rank;

        if (init == true)
        {
            transform.localPosition = to_position;
        }
        else if (rank != Rank)
        {
            if (rank < Rank || Rank == 0)
            {
                m_Panel.depth = 2;
                m_ScaleTween.ResetToBeginning();
                m_ScaleTween.PlayForward();
            }
            else
            {
                m_Panel.depth = 1;
            }
            if (Rank == 0)
            {
                m_MoveTween.from.y = move_gap * 5.5f;
            }
            else
            {
                m_MoveTween.from = transform.localPosition;
            }
            m_MoveTween.to = to_position;
            m_MoveTween.ResetToBeginning();
            m_MoveTween.PlayForward();
        }
        else
        {
            m_Panel.depth = 1;
        }

        Rank = rank;
    }
Example #20
0
    public void Show(string hero1Name, string hero2Name)
    {
        BlackMask._instance.Show();

        hero1Tween.GetComponent <UISprite>().spriteName = hero1Name;
        hero2Tween.GetComponent <UISprite>().spriteName = hero2Name;

        vsTween.PlayForward();
        hero1Tween.PlayForward();
        hero2Tween.PlayForward();
    }
Example #21
0
    public static void ShowWndAni2(GameObject objWnd, string[] strBtn)
    {
        if (objWnd == null)
        {
            return;
        }
        mWndNow = objWnd;
        objWnd.SetActive(true);

        TweenAlpha ta = objWnd.GetComponent <TweenAlpha>();

        if (ta == null)
        {
            ta = objWnd.AddComponent <TweenAlpha>();
            EventDelegate.Add(ta.onFinished, onHideFinished2);
        }
        ta.animationCurve = mWndAni2;
        ta.duration       = 0.2f;
        ta.from           = 0;
        ta.to             = 1f;
        ta.tweenFactor    = 0;
        ta.PlayForward();

        for (int i = 0; i < strBtn.Length; i++)
        {
            if (strBtn[i] == "")
            {
                break;
            }
            Transform t = objWnd.transform.FindChild(strBtn[i]);
            if (t == null)
            {
                continue;
            }

            TweenPosition tp = t.GetComponent <TweenPosition>();
            if (tp == null)
            {
                tp = t.gameObject.AddComponent <TweenPosition>();
                if (i == (strBtn.Length - 1))
                {
                    EventDelegate.Add(tp.onFinished, onFinished2);
                }
            }
            tp.animationCurve = mWndAni2;
            tp.delay          = i * 0.2f;
            tp.duration       = 0.4f - i * 0.03f;
            tp.from           = new Vector3(t.localPosition.x + 1280f, t.localPosition.y, t.localPosition.z);
            tp.to             = t.localPosition;
            t.localPosition   = tp.from;
            tp.tweenFactor    = 0;
            tp.PlayForward();
        }
    }
Example #22
0
    private IEnumerator UIPosTweenForward(TweenPosition tween, GameObject go)
    {
        go.SetActive(true);
        tween.PlayForward();
        yield return(new WaitForSeconds(animTime));

        if (go.name == "StartMenu")
        {
            go.SetActive(false);
        }
    }
Example #23
0
 /// <summary>
 /// 开始移动
 /// </summary>
 public void BeginMove(Vector3 from, Vector3 to, float delay = 0, BetFinishedType fType = BetFinishedType.None, Action callback = null)
 {
     gameObject.SetActive(true);
     CurFinishedType = fType;
     Tp.from         = from;
     Tp.to           = to;
     Tp.delay        = delay;
     Finished        = callback;
     Tp.ResetToBeginning();
     Tp.PlayForward();
 }
Example #24
0
    public void getmenu()
    {
        TpositionGameMenu.enabled = true;

        if (!onthebackground)
        {
            Time.timeScale = 0.0f;
            TpositionGameMenu.PlayForward();
            onthebackground = true;
        }
    }
Example #25
0
 void PlayAttack()
 {
     if (IsMelee)
     {
         m_TweenMelee.enabled = true;
         m_TweenMelee.ResetToBeginning();
         m_TweenMelee.PlayForward();
     }
     m_Melee.gameObject.SetActive(true);
     BattleWorldboss.Instance.m_BossHP.Creature.SetDamage(-Attack, true);
 }
Example #26
0
 public void TransformState()
 {
     if (isShow)
     {
         tween.PlayReverse(); isShow = false;
     }
     else
     {
         tween.PlayForward(); isShow = true;
     }
 }
Example #27
0
 public virtual void onFlyOut()
 {
     if (this.transform != null)
     {
         TweenPosition component = this.transform.GetComponent <TweenPosition>();
         if (component != null)
         {
             component.PlayForward();
         }
     }
 }
 // Update is called once per frame
 void Update()
 {
     if (InfoButtonClickBool && InfoStaut == 0)
     {
         InfoTweenPosition.PlayForward();
     }
     else if (!InfoButtonClickBool && InfoStaut == 1)
     {
         InfoTweenPosition.PlayReverse();
     }
 }
Example #29
0
    private void GoToLevel(int level)
    {
        // Move the camera to the level
        cameraTween.src = cameraTween.dst;
        cameraTween.dst = new Vector3(0, levelUnitHeight * level, -2);
        cameraTween.ResetAtBeginning();
        cameraTween.PlayForward();

        // Init the level
        levelInstantied[level].StartLevel();
    }
 void Update()
 {
     if (firstTime == false)
     {
         firstTime = true;
         TweenPosition tween = this.GetComponent <TweenPosition> ();
         tween.from.x = transform.localPosition.x;
         tween.to.x   = transform.localPosition.x;
         tween.PlayForward();
     }
 }
Example #31
0
 public void StartShockEffect()
 {
     tp.enabled = true;
     tp.ResetToBeginning();
     tp.PlayForward();
     shockSpanTime = 0;
     shocking      = true;
     tp.SetOnFinished(ShockFinished);
     startShockPotY = transform.position.y;
     preShockPot    = transform.position;
 }
Example #32
0
 /// <summary>
 /// 打开隐藏面板
 /// </summary>
 /// <param name="show"></param>
 public void PackageShowOrHidden(bool show)
 {
     if (show)
     {
         tweenPosition.PlayForward();
     }
     else
     {
         tweenPosition.PlayReverse();
     }
 }