Exemplo n.º 1
0
 void Start()
 {
     player                 = Player.instance;
     gameManager            = OilManager.instance;
     currentBarPosition     = fullBarPosition;
     bar.transform.position = currentBarPosition;
 }
Exemplo n.º 2
0
    private void Awake()
    {
        if (instance != null)
        {
            Debug.LogError("More than one Game Manager!");
        }

        instance = this;
    }
Exemplo n.º 3
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
    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;
    }
Exemplo n.º 7
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;
        }
Exemplo n.º 8
0
        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);
        }