1
This commit is contained in:
@@ -12,27 +12,28 @@ using UnityEngine.UIElements;
|
||||
|
||||
namespace BITKit.HttpNet
|
||||
{
|
||||
[Obsolete]
|
||||
public class NetworkRequest : BITBehavior, IAction
|
||||
{
|
||||
[SubclassSelector, SerializeReference] public References _url;
|
||||
public Provider onException;
|
||||
public Provider provider;
|
||||
public Provider onPing;
|
||||
public IntervalUpdate updater = new();
|
||||
[SerializeField] private Provider onException;
|
||||
[SerializeField] private Provider provider;
|
||||
[SerializeField] private Provider onPing;
|
||||
[SerializeField] private IntervalUpdate updater = new();
|
||||
[SubclassSelector, SerializeReference] public WebProvider webProvider;
|
||||
public Counter counter = new();
|
||||
public string result;
|
||||
public int requestCount;
|
||||
public int responsedCount;
|
||||
public float deltaTick;
|
||||
public double requestTime;
|
||||
[SerializeField] private Counter counter = new();
|
||||
[SerializeField] private string result;
|
||||
[SerializeField] private int requestCount;
|
||||
[SerializeField] private int responsedCount;
|
||||
[SerializeField] private float deltaTick;
|
||||
[SerializeField] private double requestTime;
|
||||
public LimitTimes limit = new(64);
|
||||
System.Timers.Timer timer = new();
|
||||
CompletionRate completionRate = new();
|
||||
ValidHandle isActive = new();
|
||||
float internalTime;
|
||||
CancellationToken cancellationToken;
|
||||
void Awake()
|
||||
protected readonly System.Timers.Timer timer = new();
|
||||
private readonly CompletionRate completionRate = new();
|
||||
private readonly ValidHandle isActive = new();
|
||||
private float internalTime;
|
||||
protected CancellationToken cancellationToken;
|
||||
private void Awake()
|
||||
{
|
||||
cancellationToken = gameObject.GetCancellationTokenOnDestroy();
|
||||
timer.Elapsed += (x, y) => OnUpdate();
|
||||
@@ -40,31 +41,31 @@ namespace BITKit.HttpNet
|
||||
isActive.AddListener(Set);
|
||||
isActive.AddDisableElements(this);
|
||||
}
|
||||
void OnEnable()
|
||||
private void OnEnable()
|
||||
{
|
||||
isActive.AddElement(this);
|
||||
}
|
||||
void Start()
|
||||
private void Start()
|
||||
{
|
||||
isActive.RemoveDisableElements(this);
|
||||
}
|
||||
void OnDisable()
|
||||
private void OnDisable()
|
||||
{
|
||||
isActive.RemoveElement(this);
|
||||
}
|
||||
void OnDestroy()
|
||||
private void OnDestroy()
|
||||
{
|
||||
timer.Dispose();
|
||||
}
|
||||
void SetIntervalUpdateActive(bool active)
|
||||
private void SetIntervalUpdateActive(bool active)
|
||||
{
|
||||
isActive.SetDisableElements(internalTime, active is false);
|
||||
}
|
||||
void Update()
|
||||
private void Update()
|
||||
{
|
||||
deltaTick = completionRate;
|
||||
}
|
||||
void Set(bool active)
|
||||
private void Set(bool active)
|
||||
{
|
||||
if (timer.Enabled != active)
|
||||
{
|
||||
@@ -81,7 +82,7 @@ namespace BITKit.HttpNet
|
||||
}
|
||||
}
|
||||
}
|
||||
protected virtual void OnUpdate()
|
||||
private void OnUpdate()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
Reference in New Issue
Block a user