TH1/Unity/Assets/Scripts/TH1_Anim/Fragments/FragmentCityExpUp.cs
2025-10-04 01:57:38 +08:00

67 lines
1.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* @Author: 白哉
* @Description:
* @Date: 2025年07月01日 星期二 14:07:05
* @Modify:
*/
using JetBrains.Annotations;
using RuntimeData;
using TH1_Anim.UnitAtomAnim;
using TH1_DataAssetsScript;
using TH1_Logic.Core;
using TH1_Renderer;
using TH1_Renderer.UnitAtomAnim;
using TH1Renderer;
using UnityEngine;
namespace TH1_Anim.Fragments
{
public class FragmentCityExpUp : FragmentBase
{
public GridRenderer GridRenderer;
public CityInfoRenderer CityInfoRenderer;
public int Level;
public int LevelExp;
private float _step1_time;
private bool _step1_bounce;
public FragmentCityExpUp(FragmentCityExpUpData data) : base()
{
GridRenderer = data.GridRenderer;
CityInfoRenderer = data.CityInfoRenderer;
Level = data.Level;
LevelExp = data.LevelExp;
_step1_time = 0f;
_step1_bounce = false;
Duration = 0.5f;
}
public override bool CheckDone(float progressTime)
{
if (!_step1_bounce) return false;
if (progressTime <= Duration)
return false;
return true;
}
public override void OnUpdate(float progressTime)
{
//Step #1执行第一步,弹动并且更新cityInfo
if (progressTime >= _step1_time && !_step1_bounce)
{
_step1_bounce = true;
GridRenderer.SetBounceAnim();
CityInfoRenderer.UpdateLevelShow(Level,LevelExp);
return;
}
}
}
}