public override void Start() { IResourceContainer container = Player.Player.Resources; foreach (Multiplier multiplier in GetMultipliers()) { Resource resource = Resource.GetResource(multiplier.ResourceIdentifier); container.SetResource(resource, Mathf.RoundToInt(container.GetResource(resource) * multiplier.Value)); } }
public static bool HasEnough(this IResourceContainer container, IResourceCost cost) => cost.GetCost().All(x => container.GetResource(x.Key) >= x.Value);
public static void ChangeResource(this IResourceContainer container, Resource resource, int value) { SetResource(container, resource, container.GetResource(resource) + value); }
private void Start() { OnResourceChanged(Resource, _container.GetResource(Resource), _container.GetResource(Resource)); }