delayed sun animation
This commit is contained in:
parent
92ebb2868d
commit
64323290cc
2 changed files with 7 additions and 5 deletions
|
|
@ -46,7 +46,7 @@ public partial class Sun : Area2D
|
|||
_fade.Stop();
|
||||
scoring = true;
|
||||
|
||||
RuntimeLevelData.Instance.AddSun(amount);
|
||||
RuntimeLevelData.Instance.AddSun(amount,false);
|
||||
|
||||
GetNode<ChannelPlayer>("SunPlayer").Play();
|
||||
var tween = CreateTween();
|
||||
|
|
|
|||
|
|
@ -42,16 +42,18 @@ public partial class RuntimeLevelData : Node
|
|||
SetLevelState(LevelStates.ChooseYourSeeds);
|
||||
}
|
||||
#region Sun
|
||||
public void AddSun(int amount)
|
||||
public void AddSun(int amount, bool update = true)
|
||||
{
|
||||
SunCount += amount;
|
||||
SunCounter.Update();
|
||||
if (update)
|
||||
SunCounter.Update();
|
||||
}
|
||||
|
||||
public void SpendSun(int amount)
|
||||
public void SpendSun(int amount, bool update = true)
|
||||
{
|
||||
SunCount -= amount;
|
||||
SunCounter.Update();
|
||||
if (update)
|
||||
SunCounter.Update();
|
||||
}
|
||||
|
||||
public bool CheckSpendSun(int amount)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue