public UpgradesIdentifier GetUpgradeEnum(UpgradeMenu.Upgrade type, int level) { UpgradesIdentifier ret = UpgradesIdentifier.None; foreach (var record in Records) { UpgradesRecord rec = record as UpgradesRecord; if (rec.UpgradeType == type.ToString() && rec.Upgradelevel == level) { ret = rec.Identifier; } } return(ret); }
// Justin's Code // public int GetTotalUpgrades(UpgradeMenu.Upgrade type) { int total = 0; foreach (var record in Records) { UpgradesRecord rec = record as UpgradesRecord; if (rec.UpgradeType == type.ToString()) { total++; } } return(total); }
public override void CreateEditableCopy() { #if UNITY_EDITOR if (runtimeEditingEnabled) { return; } UpgradesRecord editableCopy = new UpgradesRecord(); editableCopy.Identifier = Identifier; editableCopy.originalRecord = this; CopyData(editableCopy); model.SetEditableCopy(editableCopy); #else Debug.LogError("SheetCodes: Creating an editable record does not work in buolds. See documentation 'Editing your data at runtime' for more information."); #endif }
private void CopyData(UpgradesRecord record) { /*COPY_PROPERTIES*/ }