initial reload
This commit is contained in:
parent
3d9f0f7423
commit
fda3ca433b
5 changed files with 9 additions and 2 deletions
|
|
@ -25,6 +25,7 @@ public class HotbarPregameHandler : SeedpacketHandler, ISeedpacketPress
|
|||
if (state == RuntimeLevelData.LevelStates.Game)
|
||||
{
|
||||
_owner.SetHandler(new HotbarHandler(_owner));
|
||||
_owner.StartWithResourceOffset();
|
||||
}
|
||||
else if (state != RuntimeLevelData.LevelStates.ChooseYourSeeds)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ public class PrepickedHandler : SeedpacketHandler
|
|||
if (state == RuntimeLevelData.LevelStates.Game)
|
||||
{
|
||||
_owner.SetHandler(new HotbarHandler(_owner));
|
||||
_owner.StartWithResourceOffset();
|
||||
}
|
||||
else if (state != RuntimeLevelData.LevelStates.ChooseYourSeeds)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -81,6 +81,11 @@ public partial class Seedpacket : TextureButton
|
|||
{
|
||||
_timer.Start();
|
||||
}
|
||||
public void StartWithResourceOffset()
|
||||
{
|
||||
_timer.Start(_resource.ReloadTime * (1.0 - _resource.ReloadProgress)+0.05);
|
||||
Callable.From(()=>{ _timer.WaitTime = _resource.ReloadTime; }).CallDeferred();
|
||||
}
|
||||
|
||||
public void OnUnfocused()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue