void EvaluateOrderWorth(Bubble b) { int worth = 0; foreach (PuppetModificationBase pmb in b.GetPuppet()) { if (pmb != null) { worth += PriceConstants.GetCost(pmb.Category); } } _OrderWorth = Mathf.FloorToInt(worth * 2.25f); }
protected virtual void Start() { amount = 2; int i = 0; foreach (string s in System.Enum.GetNames(typeof(ModificationType))) { if (s != Modification.ToString() && gameObject.name.Replace(" ", "") == s) { Debug.LogWarning($"The PuppetModification {gameObject.name} was modified to fit its Modification enum with its name. Please, make the proper change to the prefab."); Modification = (ModificationType)i; } i++; } cost = PriceConstants.GetCost(Category); GameManager.levelManager.RegisterNewModification(this); CheckIfModificationIsAvailableAndActivateOrDesactivate(); }