Example #1
0
        private void RandomPath(bool ori)
        {
            //确定速度方向
            int dir   = RandomHelper.Range(0, 10);
            int speed = (int)RandomHelper.Range(30, m_SpeedX);

            m_BaseY = m_OriPosition.y + RandomHelper.Range(10, 100);

            if (dir > 5)
            {
                if (!ori)
                {
                    transform.localPosition = new Vector3(m_Rect.xMax, m_BaseY, 0);
                }
                m_CurrentSpeed = -speed;
            }
            else
            {
                if (!ori)
                {
                    transform.localPosition = new Vector3(m_Rect.xMax, m_BaseY, 0);
                }
                m_CurrentSpeed = speed;
            }

            m_R = RandomHelper.Range(15, m_Rect.height);
        }
Example #2
0
 public void ShowOnce()
 {
     for (int i = 0; i < m_Stars.Length; ++i)
     {
         m_Stars[i].DOKill();
         DOTween.Sequence().Append(m_Stars[i].DOFade(1, RandomHelper.Range(0.2f, 0.5f)))
         .SetDelay(1)
         .Append(m_Stars[i].DOFade(0, RandomHelper.Range(0.5f, 1.0f)));
     }
 }
Example #3
0
        private IEnumerator ShowLoopInternal()
        {
            while (true)
            {
                for (int i = 0; i < m_Stars.Length; ++i)
                {
                    m_Stars[i].DOKill();
                    DOTween.Sequence().Append(m_Stars[i].DOFade(1, RandomHelper.Range(0.2f, 0.3f)))
                    .SetDelay(0.8f)
                    .Append(m_Stars[i].DOFade(0, RandomHelper.Range(0.5f, 0.6f)));
                }

                yield return(new WaitForSeconds(1.8f));
            }
        }
Example #4
0
        private void Awake()
        {
            if (m_Stars.Length == 0)
            {
                m_Stars = transform.GetComponentsInChildren <Image>();
            }

            if (m_IsAutoPlay)
            {
                for (int i = 0; i < m_Stars.Length; ++i)
                {
                    DOTween.Sequence().Append(m_Stars[i].DOFade(0, RandomHelper.Range(1.0f, 2.0f)))
                    .Append(m_Stars[i].DOFade(1, RandomHelper.Range(0.5f, 2.0f)))
                    .SetDelay(RandomHelper.Range(1.0f, 4.0f))
                    .SetLoops(-1);
                }
            }
        }
Example #5
0
        public void StartAction()
        {
            if (m_RandomDecalFactor)
            {
                m_CurrentDecalFactor = m_DecalFactor + RandomHelper.Range(-5, 5);
                m_CurrentDecalFactor = Mathf.Max(m_CurrentDecalFactor, 2);

                m_CurrentMaxOffsetAngle = m_MaxOffsetAngle + RandomHelper.Range(-10, 10);
                m_CurrentMaxOffsetAngle = Mathf.Max(m_CurrentMaxOffsetAngle, 5);
            }
            else
            {
                m_CurrentMaxOffsetAngle = m_MaxOffsetAngle;
                m_CurrentDecalFactor    = m_DecalFactor;
            }

            StopAllCoroutines();
            m_AnimDuration = 0;
            m_CurrentAngle = 0;
            StartCoroutine(UpdateAction());
        }
Example #6
0
 public AudioClip GetRandomClip()
 {
     return(m_AudioClips[RandomHelper.Range(0, m_AudioClips.Count)]);
 }