void Start() { player = Player.instance; gameManager = OilManager.instance; currentBarPosition = fullBarPosition; bar.transform.position = currentBarPosition; }
private void Awake() { if (instance != null) { Debug.LogError("More than one Game Manager!"); } instance = this; }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
private bool tryPut(ref Model.Oil model, out string errMsg) { errMsg = ""; bool re = false; model.Modifier = this.auth.UserId; model.ModifiedDate = DateTime.Now; if (OilManager.ModifyOilById(ref model, out errMsg)) { re = true; } return(re); }
private bool tryDelete(string ids, out string errMsg) { errMsg = ""; bool re = false; if (ids != string.Empty) { if (OilManager.DeleteOilByIds(ids, out errMsg)) { re = true; } } return(re); }
public void Start() { InitializePoints(100); treeAmount = 0; treeCost = 10; RemoveAllTrees(); canGeneratePoints = false; gameManager = GameManager.instance; oilManager = OilManager.instance; pointGenerationRate = basePointGenerationRate; TRexUnlockButton.gameObject.SetActive(true); ETUnlockButton.gameObject.SetActive(true); TRexSpawnButton.gameObject.SetActive(false); ETSpawnButton.gameObject.SetActive(false); treeAmount = 0; }
public OilCard(Entity.Oil oil) { OilGuid = oil.OilGuid; FullLibel = $"{oil.Libel} ({oil.TypeOil.ToUpper()})"; Libel = oil.Libel; TypeOil = oil.TypeOil; LastPriceUpdate = oil.LastPriceUpdate.GetValueOrDefault().Humanize(); var curBalance = OilManager.StaticGetOilBalance(oil.OilGuid); if (oil.StockCapacity > 0) { CurrentStock = "bidon".ToQuantity(curBalance) + " en Stock"; //+ "bidon".ToQuantity(oil.StockCapacity); Pourcentage = ((curBalance * 100) / oil.StockCapacity).ToString("0.##\\%"); } else { CurrentStock = "bidon".ToQuantity(curBalance) + " en Stock"; } CurrentUnitPrice = oil.CurrentUnitPrice.ToString("0.##\\dhs/Bidon"); CurrentdoubleUnitPrice = oil.CurrentUnitPrice; }
private bool tryValidate(Model.Oil model, out string errMsg) { errMsg = ""; bool re = true; if (model.Name == null || model.Name.Length == 0 || model.Name.Length > 20 || model.Description.Length > 200) { errMsg = "输入数据不合法"; re = false; } if (re && OilManager.CheckRepeat(model)) { errMsg = "不能重复"; re = false; } if (re && model.Modifier != auth.UserId) { errMsg = "登录信息异常,请刷新浏览器以重启应用(APP请退出应用后重新打开)"; re = false; } return(re); }