Essentials + extra crap
Loadings Startups Movement Camera
This commit is contained in:
1 parent
662f4a1d05
commit
5f5ace1b52
734 files changed
+107323
-1713
No files matched your search
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
|
||||
namespace Code.Infrastructure.Loadings
|
||||
{
|
||||
public class Loading
|
||||
{
|
||||
private int _progress;
|
||||
private Action _completed;
|
||||
private Action<Loading> _loadProgress;
|
||||
|
||||
public Loading(int maxProgress, Action completed, Action<Loading> loadProgress = null)
|
||||
{
|
||||
_progress = maxProgress;
|
||||
MaxProgress = maxProgress;
|
||||
|
||||
_completed = completed;
|
||||
_loadProgress = loadProgress;
|
||||
}
|
||||
public int CurrentProgress => _progress;
|
||||
public int MaxProgress { get; }
|
||||
|
||||
public void DoProgress()
|
||||
{
|
||||
_progress--;
|
||||
_loadProgress?.Invoke(this);
|
||||
if(_progress <= 0) _completed();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user