コード例 #1
0
    public void Exit()
    {
        CalculatePosition();

        tweenE.from = transform.position;
        tweenE.to   = GameObjectTracker.instance.World.CurrentCamera.transform.position;

        tweenE.Reset();
        tweenE.Play(true);

        opened = false;
    }
コード例 #2
0
 void CardOn()
 {
     _cardTween.callWhenFinished = "";
     _cardTween.from.y           = 175;
     _cardTween.to.y             = 314;
     _cardTweenAlpha.from        = 0;
     _cardTweenAlpha.to          = 1;
     _cardTween.Reset();
     _cardTween.Play(true);
     _cardTweenAlpha.Reset();
     _cardTweenAlpha.Play(true);
 }
コード例 #3
0
    void InitLeftTabControl(int nControl)
    {
        m_TabTweenPos.Reset();
        m_ContentTweenPos.Reset();

        // 以折叠状态初始化
        if (nControl == 1)
        {
            m_TabsFold = true;

            m_TabTweenPos.from = new Vector3(-207, 152, 0);
            m_TabTweenPos.to   = new Vector3(65, 152, 0);

            m_ContentTweenPos.from = new Vector3(-144, -20, 0);
            m_ContentTweenPos.to   = new Vector3(133, -20, 0);
        }
        // 以展开状态初始化
        else
        {
            m_TabsFold = false;

            m_TabTweenPos.from = new Vector3(65, 152, 0);
            m_TabTweenPos.to   = new Vector3(-207, 152, 0);

            m_ContentTweenPos.from = new Vector3(133, -20, 0);
            m_ContentTweenPos.to   = new Vector3(-144, -20, 0);
        }

        m_TabTweenPos.gameObject.transform.localPosition     = m_TabTweenPos.from;
        m_ContentTweenPos.gameObject.transform.localPosition = m_ContentTweenPos.from;
    }
コード例 #4
0
    //显示飞的小星星
    void ShowFlyStars()
    {
        for (int nIndex = 0; nIndex < m_StarFLySpriteArray.Length; nIndex++)
        {
            m_StarFLySpriteArray[nIndex].gameObject.SetActive(true);

            TweenPosition StarFlyTweenPosition = m_StarFlyTweenPosition[nIndex];
            if (StarFlyTweenPosition)
            {
                if (nIndex == 0)
                {
                    //只增加一个结束处理函数
                    EventDelegate.Add(StarFlyTweenPosition.onFinished, StarFlyTweenFinish);
                }
                StarFlyTweenPosition.Reset();
                StarFlyTweenPosition.Play(true);
            }
            TweenScale StarFlyTweenScale = m_StarFlyTweenScale[nIndex];
            if (StarFlyTweenScale)
            {
                StarFlyTweenScale.Reset();
                StarFlyTweenScale.Play(true);
            }

            TweenAlpha StarFlyTweenAlhpa = m_StarFlyTweenAlpha[nIndex];
            if (StarFlyTweenAlhpa)
            {
                StarFlyTweenAlhpa.Reset();
                StarFlyTweenAlhpa.Play(true);
            }
        }
    }
コード例 #5
0
ファイル: PanelMgr.cs プロジェクト: windy-66/WFramework-ugui
    /// <summary> 上下往中 </summary>
    private void TopAndDownToSlide(PanelBase go, bool isTop, bool isOpen)
    {
        TweenPosition tp = go.gameObject.GetComponent <TweenPosition>();

        if (tp == null)
        {
            tp = go.gameObject.AddComponent <TweenPosition>();
        }
        //
        tp.from       = isTop == true ? new Vector3(0, 1000, 0) : new Vector3(0, -1000, 0);
        tp.to         = Vector3.zero;
        tp.duration   = go.OpenDuration;
        tp.ease       = Ease.InOutSine;
        tp.onFinished = () =>
        {
            if (isOpen)
            {
                go.OnShowed();
            }
            else
            {
                DestroyPanel(go.type);
            }
        };
        go.gameObject.SetActive(true);
        if (isOpen)
        {
            tp.Reset();
            tp.PlayForward();
        }
        else
        {
            tp.PlayReverse();
        }
    }
コード例 #6
0
    void OnPPS()
    {
        //Set active stats and pop screen.
        //ActivityManager.Instance.SelectedStats = GameObjectTracker.instance.RunStatistics;
        //ActivityManager.Instance.PushActivity(ActivityManager.ManagerActivities.Stats);

        //Toggle
        viewPPS = !viewPPS;

        if (viewPPS)
        {
            //Set the text.
            PPSLabel.text = PPSText;
        }
        else
        {
            //Set the text.
            PPSLabel.text = ScoreText;
        }

        //Play the animation.
        PPSButtonTween.Reset();
        PPSButtonTween.Play(true);

        //	ScoreButtonIntro.Reset();
        //	ScoreButtonIntro.Play(true);

        //TODO: Play sound.
        AudioPlayer.GetPlayer().PlayMenuSFX(AudioPlayer.MenuSFX.Select);
    }
コード例 #7
0
    void InitRadarControl(int nControl)
    {
        if (m_RadarTweenPos == null)
        {
            return;
        }

        m_RadarTweenPos.Reset();

        // 以折叠状态初始化
        if (nControl == 1)
        {
            m_RadarFold = true;

            m_RadarTweenPos.from = new Vector3(-16, -178, 0);
            m_RadarTweenPos.to   = new Vector3(-254, -178, 0);
        }
        // 以展开状态初始化
        else
        {
            m_RadarFold = false;

            m_RadarTweenPos.from = new Vector3(-254, -178, 0);
            m_RadarTweenPos.to   = new Vector3(-16, -178, 0);
        }

        m_RadarTweenPos.gameObject.transform.localPosition = m_RadarTweenPos.from;
    }
コード例 #8
0
    void OnPPS()
    {
        //Toggle
        viewPPS = !viewPPS;

        if (viewPPS)
        {
            //Set the text.
            PPSLabel.text = PPSText;
        }
        else
        {
            //Set the text.
            PPSLabel.text = ScoreText;
        }

        //Play the animation.
        PPSButtonTween.Reset();
        PPSButtonTween.Play(true);

        ScoreButtonIntro.Reset();
        ScoreButtonIntro.Play(true);

        //TODO: Play sound.
        AudioPlayer.GetPlayer().PlayMenuSFX(AudioPlayer.MenuSFX.Select);
    }
コード例 #9
0
 protected void MoveToTarget(Vector3 targetPos)
 {
     m_tp.from = m_myTransform.transform.localPosition;
     m_tp.to   = targetPos;
     m_tp.Reset();
     m_tp.enabled = true;
     m_tp.Play(true);
 }
コード例 #10
0
    public void MoveTo(int pageId)
    {
        m_tp.from = m_myTransform.localPosition;
        m_tp.to   = transformList[pageId].localPosition;

        m_tp.Reset();
        m_tp.Play(true);
    }
コード例 #11
0
 /// <summary>
 /// Ñ¡Ôñ·¨Ê¦
 /// </summary>
 public void SelectMaster()
 {
     listPlayerType[2].value = true;
     ctpPlayerInfo.CbkClick();
     objMaster.Reset();
     yuan.YuanClass.SwitchListOnlyOne(listPlayerInfo, 2, true, true);
     //objMaster.localPosition = new Vector3(objMaster.localPosition.x, -300, objMaster.localPosition.z);
     //objMaster.GetComponent<TweenPosition>().Play(true);
 }
コード例 #12
0
 public void PlayTween()
 {
     if (m_tweenPosComponent == null)
     {
         m_tweenPosComponent = this.GetComponent <TweenPosition>();
     }
     m_tweenPosComponent.Reset();
     m_tweenPosComponent.Play(true);
 }
コード例 #13
0
 public void EnableBillboard()
 {
     if (m_tp.enabled == false)
     {
         m_tp.Reset();
         m_tp.Play(true);
     }
     m_goBillboard.SetActive(true);
 }
コード例 #14
0
 public virtual void ShowAnim()
 {
     if (!IsShowing)
     {
         tween.Reset();
         tween.Play(true);
         IsShowing = true;
     }
 }
コード例 #15
0
    //

    public static TweenPosition ResetTween(TweenPosition twn)
    {
        #if USE_UI_NGUI_3
        twn.ResetToBeginning();
        #else
        twn.Reset();
        #endif

        return(twn);
    }
コード例 #16
0
ファイル: DragonUIViewManager.cs プロジェクト: mengtest/xxxxx
    public void ShowGoldWishAnim()
    {
        m_goGoldWishAnim.SetActive(true);

        m_taGoldWishAnim.Reset();
        m_tpGoldWishAnim.Reset();

        m_taGoldWishAnim.Play(true);
        m_tpGoldWishAnim.Play(true);
    }
コード例 #17
0
    IEnumerator CallWhenFinished()
    {
        yield return(new WaitForSeconds(alphaDuration));

        m_hostPosition = null;
        GameObjectPool.Instance.Release(gameObject);
        m_tweenAlpha.Reset();
        m_tweenPosition.Reset();
        m_tweenScale.Reset();
    }
コード例 #18
0
ファイル: DragonUIViewManager.cs プロジェクト: mengtest/xxxxx
    public void ShowDiamondWishAnim()
    {
        m_goDiamondWishAnim.SetActive(true);

        m_taDiamondWishAnim.Reset();
        m_tpDiamondWishAnim.Reset();

        m_taDiamondWishAnim.Play(true);
        m_tpDiamondWishAnim.Play(true);
    }
コード例 #19
0
    protected virtual void Present()
    {
        if (onAlertViewWillAppear != null)
        {
            onAlertViewWillAppear(this);
        }

        //remove disappear animation tweeners:
        UIMultiAlphaTween multiAlphaTweener = gameObject.GetComponentInChildren <UIMultiAlphaTween>();

        if (multiAlphaTweener != null)
        {
            multiAlphaTweener.Reset();
            multiAlphaTweener.enabled = false;
        }

        isDisappearAnimationPlaying = false;
        isAppearAnimationPlaying    = true;

        //setup appear animation tweeners:
        TweenPosition positionTweener = gameObject.GetComponentInChildren <TweenPosition>();

        if (positionTweener == null)
        {
            positionTweener = gameObject.AddComponent <TweenPosition>();
        }


        positionTweener.from     = transform.localPosition + Vector3.up * 200f;
        positionTweener.to       = transform.localPosition;
        positionTweener.duration = kAppearDuration * 0.5f;
        positionTweener.method   = UITweener.Method.EaseOut;

        TweenScale scaleTweener = gameObject.GetComponentInChildren <TweenScale>();

        if (scaleTweener == null)
        {
            scaleTweener = gameObject.AddComponent <TweenScale>();
        }

        scaleTweener.from             = new Vector3(0.1f, 0.1f, 1f);
        scaleTweener.to               = Vector3.one;
        scaleTweener.duration         = kAppearDuration;
        scaleTweener.method           = UITweener.Method.BounceIn;
        scaleTweener.callWhenFinished = "OnAppear";
        scaleTweener.eventReceiver    = gameObject;

        scaleTweener.Reset();
        scaleTweener.Play(true);
        positionTweener.Reset();
        positionTweener.Play(true);

        //play sfx
//!!!		AudioManager.PlaySfxClip(AudioManager.alert_appear_sfx);
    }
コード例 #20
0
        void OnFinishTweenMove()
        {
            finishCallTimes++;
            if (timer != null)
            {
                timer.Dispose();
            }

            if (finishCallTimes == 1)
            {
                getMoveToPos();
                transform.parent = null;
                Vector3 tmpv3 = transform.localPosition;
                tweener.from     = tmpv3;
                tweener.to       = moveToPos;
                tweener.method   = UITweener.Method.EaseIn;
                tweener.duration = 0.7f;
                tweener.Reset();
                tweener.Play(true);
            }
            else if (finishCallTimes == 2)
            {
                NGUITools.SetActive(childContent, false);
                if (moveToGo.GetComponent <TweenScale>() == null)
                {
                    moveToGo.AddComponent <TweenScale>();
                    TweenScale sc = moveToGo.GetComponent <TweenScale>();
                    sc.from = moveToGo.transform.localScale * (1 + 0.3f);
                    sc.to   = moveToGo.transform.localScale;
                }
                else
                {
                    TweenScale sc = moveToGo.GetComponent <TweenScale>();
                    sc.Reset();
                    sc.Play(true);
                }
                if (lbValus != null)
                {
                    lbValus.text = mValues;
                }
            }
        }
コード例 #21
0
    public void AddBillboardText(string text)
    {
        if (m_bIsLoaded)
        {
            if (m_goBillboard.GetComponentsInChildren <UILabel>(true).Length > 0)
            {
                UILabel lbl = m_goBillboard.GetComponentsInChildren <UILabel>(true)[0];

                lbl.name = "Text";
                lbl.font = m_font;
                lbl.text = text;
                lbl.transform.localPosition    = Vector3.zero;
                lbl.transform.localEulerAngles = Vector3.zero;
                lbl.transform.localScale       = new Vector3(m_font.size * 1.2f, m_font.size * 1.2f, 1);

                TweenAlpha    ta = m_goBillboard.GetComponentsInChildren <TweenAlpha>(true)[0];
                TweenPosition tp = m_goBillboard.GetComponentsInChildren <TweenPosition>(true)[0];

                ta.Reset();
                tp.Reset();

                ta.from             = 1;
                ta.to               = 0;
                ta.callWhenFinished = "FadeFinished";
                ta.eventReceiver    = m_goBillboard;
                ta.delay            = 0.1f;


                ta.Play(true);
                tp.Play(true);
            }
            else
            {
                UILabel lbl = NGUITools.AddWidget <UILabel>(m_goBillboard);
                lbl.name = "Text";
                lbl.font = m_font;
                lbl.text = text;
                lbl.transform.localPosition    = Vector3.zero;
                lbl.transform.localEulerAngles = Vector3.zero;
                lbl.transform.localScale       = new Vector3(m_font.size * 1.2f, m_font.size * 1.2f, 1);

                TweenAlpha ta = lbl.gameObject.AddComponent <TweenAlpha>();
                ta.from             = 1;
                ta.to               = 0;
                ta.callWhenFinished = "FadeFinished";
                ta.eventReceiver    = m_goBillboard;
                ta.delay            = 0.1f;
            }
        }
        else
        {
            m_text = text;
        }
    }
コード例 #22
0
        public void SetTabAnima(int index)
        {
            GameObject    go = m_tabList[index];
            TweenPosition tw = TweenPosition.Get(pos.gameObject);

            tw.from     = pos.transform.localPosition;
            tw.to       = go.transform.localPosition;
            tw.duration = 0.2f;
            tw.Play(true);
            tw.Reset();
        }
コード例 #23
0
    public void NextScreen()
    {
        ToggleBoundaries(false);

        Vector3 camPosition = transform.localPosition;

        cameraTween.from = camPosition;
        camPosition.x   += levelScreenWidth;
        cameraTween.to   = camPosition;
        cameraTween.Reset();
        cameraTween.Play(true);
    }
コード例 #24
0
    public void ShowSkeleton()
    {
        skeleton.gameObject.SetActive(true);

        TweenPosition tween_pos = skeleton.GetComponent <TweenPosition>();

        tween_pos.enabled = true;
        tween_pos.Reset();
        TweenAlpha tween_alpha = skeleton.GetComponent <TweenAlpha>();

        tween_alpha.enabled = true;
        tween_alpha.Reset();
    }
コード例 #25
0
    /// <summary>
    /// 播放奖励信息动画
    /// </summary>
    private void PlayOccupyTowerPassUIRewardAnim()
    {
        TweenPosition tp = m_goOccupyTowerPassUIReward.GetComponentsInChildren <TweenPosition>(true)[0];

        tp.Reset();
        tp.duration         = REWARD_DURATION;
        tp.from             = new Vector3(-5000, m_goOccupyTowerPassUIReward.transform.localPosition.y, 0);
        tp.to               = new Vector3(0, m_goOccupyTowerPassUIReward.transform.localPosition.y, 0);
        tp.eventReceiver    = gameObject;
        tp.callWhenFinished = "OnOccupyTowerPassUIRewardAnimEnd";
        m_goOccupyTowerPassUIReward.SetActive(true);
        tp.enabled = true;
        tp.Play(true);
    }
コード例 #26
0
    public void Show(string text, Vector3 pos, Color textColor, Color outlineColor, float duration = 1.5f)
    {
        TimerHeap.DelTimer(m_alphaTimerId);
        m_myTransform.localPosition = pos;
        m_lblText.text        = text;
        m_lblText.color       = textColor;
        m_lblText.effectColor = outlineColor;
        m_duration            = duration;

        m_tweenPosition.enabled = true;
        m_tweenPosition.Reset();

        m_tweenPosition.Play(true);
    }
コード例 #27
0
    public void PlayLineAnim()
    {
        m_goInstancePassReweardUIBottomLine.SetActive(true);
        m_goInstancePassReweardUITopLine.SetActive(true);

        TweenPosition tpBottom = m_goInstancePassReweardUIBottomLine.GetComponent<TweenPosition>();
        tpBottom.Reset();
        tpBottom.enabled = true;
        tpBottom.Play(true);

        TweenPosition tpTop = m_goInstancePassReweardUITopLine.GetComponent<TweenPosition>();
        tpTop.Reset();
        tpTop.enabled = true;
        tpTop.Play(true);
    }
コード例 #28
0
    public void Show(string text)
    {
        m_tweenAlpha.enabled    = true;
        m_tweenPosition.enabled = true;

        m_lblText.text = text;
        m_tweenAlpha.Reset();
        m_tweenPosition.Reset();

        m_tweenPosition.Play(true);
        m_tweenPosition.Play(true);

        //m_tweenPosition.eventReceiver = gameObject;
        //m_tweenPosition.callWhenFinished = "OnFinished";
    }
コード例 #29
0
ファイル: PanelMgr.cs プロジェクト: windy-66/WFramework-ugui
    /// <summary> 从某个点往中 </summary>
    private void SomeplaceToSlide(PanelBase go, bool isOpen)
    {
        TweenPosition tp = go.gameObject.GetComponent <TweenPosition>();
        TweenScale    ts = go.gameObject.GetComponent <TweenScale>();

        if (tp == null)
        {
            tp = go.gameObject.AddComponent <TweenPosition>();
        }
        if (ts == null)
        {
            ts = go.gameObject.AddComponent <TweenScale>();
        }
        AnimationCurve ac = new AnimationCurve();

        ac.AddKey(new Keyframe(0.05f, 0.01f));
        ac.AddKey(new Keyframe(0.4f, 0.03f));
        ac.AddKey(new Keyframe(0.7f, 1.1f));
        tp.from       = (Vector3)go.panelArgs[0];
        tp.to         = Vector3.zero;
        ts.from       = new Vector3(0.1f, 0.1f, 0.1f);
        ts.to         = new Vector3(1f, 1f, 1f);
        tp.duration   = go.OpenDuration;
        ts.duration   = go.OpenDuration;
        tp.ease       = Ease.Linear;
        tp.onFinished = () =>
        {
            if (isOpen)
            {
                go.OnShowed();
            }
            else
            {
                DestroyPanel(go.type);
            }
        };
        go.gameObject.SetActive(true);
        if (isOpen)
        {
            tp.Reset();
            tp.PlayForward();
        }
        else
        {
            tp.PlayReverse();
        }
    }
コード例 #30
0
ファイル: JoyStickLogic.cs プロジェクト: kimch2/PackageClient
    void JoyStickStartMove()
    {
        // 重置移动后事件
        Singleton <ObjManager> .GetInstance().MainPlayer.MoveOverEvent.Reset();

        // 拖动时重设精灵透明度
        m_JoyStickSprite.alpha = 1.0f;

        // 重置Tween动画
        TweenPosition nTween = gameObject.GetComponent <TweenPosition>();

        if (null != nTween)
        {
            nTween.from = gameObject.transform.localPosition;
            nTween.Reset();
        }
    }
コード例 #31
0
ファイル: MFUIDragCamera.cs プロジェクト: lbddk/ahzs-client
    public override void MFUIAwake()
    {
        if (m_myGameObject.GetComponentsInChildren<TweenPosition>(true).Length == 0)
        {
            Vector3 tmpPos = m_myTransform.localPosition;

            m_tp = m_myGameObject.AddComponent<TweenPosition>();
            m_tp.enabled = false;
            m_tp.Reset();
            m_tp.duration = 0.2f;

            m_myTransform.localPosition = tmpPos;
        }
        else
        {
            m_tp = m_myGameObject.GetComponentsInChildren<TweenPosition>(true)[0];
        }
    }
コード例 #32
0
    private void MoveDragonRandom(TweenPosition tp)
    {
        if (tp != null)
        {
            Vector3 fromPos = tp.transform.localPosition;
            tp.Reset();
            tp.style = UITweener.Style.PingPong;
            tp.method = UITweener.Method.EaseInOut;
            tp.duration = DragonMoveDuration;
            tp.eventReceiver = gameObject;
            tp.callWhenFinished = "MoveDragonRandom";
            tp.animationCurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.5f, 0.8f), new Keyframe(0.8f, 0.98f), new Keyframe(1f, 1f));

            DragonMatchUIDragonButton dragonButton = tp.transform.GetComponentsInChildren<DragonMatchUIDragonButton>(true)[0];
            if (dragonButton.Index < m_listDragonOrigPos.Count && dragonButton.Index < m_listDragonParent.Count)
            {
                Vector3 toPos = m_listDragonOrigPos[dragonButton.Index];
                float random_x = UnityEngine.Random.Range(-0.5f, 0.5f);
                float random_y = UnityEngine.Random.Range(-0.3f, 0.4f);
                toPos = toPos + new Vector3(random_x, random_y, 0);

                tp.from = fromPos;
                tp.to = toPos;
                tp.enabled = true;
                tp.Play(true);
            }
        }
    }