| | |
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI {
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class DemonTreasureWin : Window
|
| | | {
|
| | |
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | DisplayLines();
|
| | | }
|
| | |
|
| | | private void TreasureStateChangeEvent(int id)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | #region 特效
|
| | | const string LINE_STATE_2 = "Effect_FaBao_Xian3_02";
|
| | | public const float LINE_NORMAL_LENGTH = 187f;
|
| | | public const float LINE_NORMAL_SCALE = 0.78f;
|
| | | private void DisplayLines()
|
| | | {
|
| | | TreasureDungeon treasureDungeon;
|
| | | var scriptable = ScriptableObjectLoader.LoadSoDemonDungeon(model.selectedTreasure);
|
| | | if (scriptable == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (model.TryGetTreasureDungeon(model.selectedTreasure, out treasureDungeon))
|
| | | {
|
| | | for (int i = 1; i <= treasureDungeon.maxLevel; i++)
|
| | | {
|
| | | var index = i - 1;
|
| | | if (index < m_DungeonBehaviours.Length)
|
| | | {
|
| | | var line = m_DungeonBehaviours[index].line;
|
| | | line.Stop();
|
| | | if (i < treasureDungeon.currentLevel)
|
| | | {
|
| | | line.Play();
|
| | | if (line.target != null)
|
| | | {
|
| | | var transform = line.target.transform;
|
| | | var animator = line.target.GetAnimator();
|
| | | var angle = VectorUtility.VectorAngle(scriptable.GetPosition(index + 1),
|
| | | scriptable.GetPosition(index));
|
| | | line.target.transform.localEulerAngles = Vector3.zero.SetZ(angle);
|
| | | if (animator != null)
|
| | | {
|
| | | animator.Play(LINE_STATE_2, 0, 0);
|
| | | animator.transform.localScale = Vector3.one.SetY(Vector2.Distance(scriptable.GetPosition(index),
|
| | | scriptable.GetPosition(index + 1)) / LINE_NORMAL_LENGTH * LINE_NORMAL_SCALE);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | enum AnimationStep
|
| | | {
|
| | | None,
|