private void Update() { timer -= Time.deltaTime; if (timer <= 0) { timer += interval; player.ModifyResources(resourcesPerInterval); } }
private void CmdSpawnUnit() { if (queuedUnits == maxUnitQueue) { return; } RTSPlayer player = connectionToClient.identity.GetComponent <RTSPlayer>(); if (player.GetResources() < unitPrefab.GetResourceCost()) { return; } queuedUnits++; player.ModifyResources(-unitPrefab.GetResourceCost()); }