赞
踩
拾取金币
- if (Input.GetMouseButtonDown(0))
- {
- ray = Camera.main.ScreenPointToRay(Input.mousePosition);
- if (Physics.Raycast(ray, out hit))
- {
- GameObject obj = hit.collider.gameObject;
- if (obj == null)
- return;
- }
- }
GoldFly goldFly = GoldFly.CreatGoldFly(obj, new Vector2(788, 500));
- Sequence mySequence = DOTween.Sequence();
- Tweener scale = rt.DOScale(Vector3.one, 0.1f).SetEase(Ease.Linear);
- Tweener move = DOTween.To(() => { return rt.anchoredPosition; }, v => { rt.anchoredPosition = v; }, m_TargetPos, 1.5f);
- Tweener alpha = _canvasGroup.DOFade(0, 0.2f);
- mySequence.Append(scale);
- // mySequence.AppendInterval(0.5f);
- mySequence.Append(move);
- mySequence.AppendInterval(0.2f);
数字滚动
主要是在Update每帧更新m_delta值累计的数值所得
- public int value
- {
- get
- {
- return m_newNum;
- }
- set
- {
- m_newNum = value;
-
- m_delta = 0.1f;// 数值跳动的大小 越小跳动的越慢
-
- ShowNum();
- }
- }
-
-
- void Update()
- {
- if (m_delta != 0)
- {
- m_num += m_delta;
-
- if (m_delta > 0)
- {
- if (m_num > m_newNum)
- {
- m_num = m_newNum;
- }
- }
- else
- {
- if (m_num <= m_newNum)
- m_num = m_newNum;
- }
- if (m_num == m_newNum)
- m_delta = 0;
- ShowNum();
- }
- }

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。