自動調理受け取り後のUI修正
This commit is contained in:
parent
40e375639d
commit
45983e2b70
|
|
@ -21,6 +21,11 @@ namespace MyGame.Scenes.Main.Scripts
|
|||
private IDisposable timerDisposable;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
Ready();
|
||||
}
|
||||
|
||||
public void Ready()
|
||||
{
|
||||
cookAnimator.enabled = false;
|
||||
SetProgress(0f);
|
||||
|
|
@ -71,7 +76,7 @@ namespace MyGame.Scenes.Main.Scripts
|
|||
AutoCookProgressView.ShowDialog();
|
||||
break;
|
||||
case CookState.Complete:
|
||||
AutoCookCompleteView.ShowDialog();
|
||||
AutoCookCompleteView.ShowDialog(onClose);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
|
|
|
|||
|
|
@ -80,8 +80,7 @@ public class KitchenManager : MonoBehaviour
|
|||
{
|
||||
CookState state;
|
||||
var remainingTime = DateTime.FromBinary(gameData.AutoCookFinishTime).Subtract(DateTime.UtcNow);
|
||||
var isReady = gameData.AutoCookProducts.Length == 0;
|
||||
if (!isReady)
|
||||
if (gameData.AutoCookProducts.Length > 0)
|
||||
{
|
||||
autoCookView.ResetTimer((int)remainingTime.TotalSeconds, (int)TimeSpan.FromHours(autoCookData.duration).TotalSeconds);
|
||||
}
|
||||
|
|
@ -104,13 +103,11 @@ public class KitchenManager : MonoBehaviour
|
|||
}
|
||||
|
||||
remainingTime = DateTime.FromBinary(gameData.AutoCookFinishTime).Subtract(DateTime.UtcNow);
|
||||
isReady = gameData.AutoCookProducts.Length == 0;
|
||||
var isFinished = remainingTime.TotalSeconds <= 0;
|
||||
if (isReady)
|
||||
if (gameData.AutoCookProducts.Length == 0)
|
||||
{
|
||||
state = CookState.Ready;
|
||||
}
|
||||
else if (isFinished)
|
||||
else if (remainingTime.TotalSeconds <= 0)
|
||||
{
|
||||
state = CookState.Complete;
|
||||
}
|
||||
|
|
@ -121,8 +118,15 @@ public class KitchenManager : MonoBehaviour
|
|||
|
||||
autoCookView.ShowDialog(state, () =>
|
||||
{
|
||||
remainingTime = DateTime.FromBinary(gameData.AutoCookFinishTime).Subtract(DateTime.UtcNow);
|
||||
autoCookView.ResetTimer((int)remainingTime.TotalSeconds, (int)TimeSpan.FromHours(autoCookData.duration).TotalSeconds);
|
||||
if (gameData.AutoCookProducts.Length == 0)
|
||||
{
|
||||
autoCookView.Ready();
|
||||
}
|
||||
else
|
||||
{
|
||||
remainingTime = DateTime.FromBinary(gameData.AutoCookFinishTime).Subtract(DateTime.UtcNow);
|
||||
autoCookView.ResetTimer((int)remainingTime.TotalSeconds, (int)TimeSpan.FromHours(autoCookData.duration).TotalSeconds);
|
||||
}
|
||||
});
|
||||
}).AddTo(this);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue