| | |
| | | using System.Collections; |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | |
| | | Coroutine m_RotateCoroutine = null;
|
| | |
|
| | | float m_DeltaAngle { get { return 360f / 8; } }
|
| | |
|
| | | public event Action onRotateComplete;
|
| | |
|
| | | public void SetDefault()
|
| | | {
|
| | |
| | | return new Vector3(_x, _y, _z);
|
| | | }
|
| | |
|
| | | void StartRotate()
|
| | | public void StartRotate()
|
| | | {
|
| | | if (m_RotateCoroutine != null)
|
| | | {
|
| | |
| | | m_RotateCoroutine = StartCoroutine(Co_Rotate());
|
| | | }
|
| | |
|
| | | public void StopRotate()
|
| | | {
|
| | | if (m_RotateCoroutine != null)
|
| | | {
|
| | | StopCoroutine(m_RotateCoroutine);
|
| | | }
|
| | | }
|
| | |
|
| | | IEnumerator Co_Rotate()
|
| | | {
|
| | | var timer = 0f;
|
| | | m_ContainerLine.gameObject.SetActive(true);
|
| | |
|
| | | bool rotate30 = false;
|
| | |
|
| | | while (timer < m_Duration)
|
| | | {
|
| | | timer += Time.deltaTime;
|
| | |
| | | var t = Mathf.Clamp01(timer / m_Duration);
|
| | | var value = m_TweenCurve.Evaluate(t);
|
| | | var angle = Mathf.LerpUnclamped(0, 180, value);
|
| | |
|
| | | if (angle >= 30 && !rotate30)
|
| | | {
|
| | | foreach (var realmStage in m_RealmStages)
|
| | | {
|
| | | if (realmStage.animIndex == 0)
|
| | | {
|
| | | realmStage.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | realmStage.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | | rotate30 = true;
|
| | | }
|
| | |
|
| | | for (int i = 0; i < m_RealmStages.Length; i++)
|
| | | {
|
| | | var cacheAngle = GetPointAngle(m_RealmStages[i].animIndex);
|
| | |
| | | m_ContainerLine.gameObject.SetActive(false);
|
| | | foreach (var realmStage in m_RealmStages)
|
| | | {
|
| | | realmStage.animIndex = (realmStage.animIndex + 4) % 8;
|
| | | realmStage.animIndex = (realmStage.animIndex + 5) % 9;
|
| | | }
|
| | |
|
| | | if (onRotateComplete != null)
|
| | | {
|
| | | onRotateComplete();
|
| | | }
|
| | | }
|
| | |
|