trade & sell UI added

This commit is contained in:
2022-05-17 11:36:24 +05:30
parent 58f7212434
commit a3aba776a5
25 changed files with 22513 additions and 635 deletions

View File

@@ -21,7 +21,7 @@ public class CollectBtn : MonoBehaviour
void Update()
{
collectableAmount=((DateTime.Now - lastCollected).TotalSeconds * productionRate);
collectableAmount=((DateTime.UtcNow - lastCollected).TotalSeconds * productionRate);
txt.text = ((int)collectableAmount).ToString();
btn.interactable = collectableAmount > 1;
@@ -34,9 +34,9 @@ public class CollectBtn : MonoBehaviour
resourceType = _resourceType;
}
void OnClick(){
async void OnClick(){
collectableAmount=((DateTime.Now - lastCollected).TotalSeconds * productionRate);
lastCollected = DBmanager.GetNetworkTime();
lastCollected = await DBmanager.GetNetworkTime();
switch (resourceType){
case CollectablesData.ResourceType.Metal:
DBmanager.SetMetal(DBmanager.Metal + (int)collectableAmount);