Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButton(0) && IsMousePressed)
        {
            Potato++;
            timer.fillAmount = Potato / 50f;
            if (Potato > 50)
            {
                gameObject.SetActive(false);
                timer.gameObject.SetActive(false);
                TExt.transform.position = transform.position;
                TExt.gameObject.SetActive(true);
                double MONEYS = (StaticObject.CookieCount.GetComponent <BPSManager>().TotalBPSStore + 1) * UnityEngine.Random.Range(30, 60);
                TExt.GetComponent <MoveUp>().Cash = MONEYS;
                TExt.text = NumFormat.NumtoString(MONEYS);

                TotalCratesCollected++;
            }
        }
        else
        {
            IsMousePressed = false;
            timer.gameObject.SetActive(false);
            DeathCounter++;
            if (DeathCounter == 600)
            {
                gameObject.SetActive(true);
            }
        }
    }
Exemple #2
0
 public void Click()
 {
     if (StaticObject.CookieCount.BloonCount > Thistower.Cost)
     {
         //StaticObject.CookieCount.GetComponent<TowerManager>().activatetower(Tower);
         StaticObject.CookieCount.GetComponent <TowerManager>().PlaceTower(Tower);
         StaticObject.CookieCount.BloonCount -= Thistower.Cost;
         Thistower.Count++;
         Thistower.Cost *= 1.15f;
         costText.text   = NumFormat.NumtoString(Thistower.Cost);
     }
 }
Exemple #3
0
 // Use this for initialization
 void Start()
 {
     Towers = StaticObject.Coookie.GetComponent <TowerManager>().Towers;
     foreach (var Towered in Towers.Towers)
     {
         if (Towered.Type == Tower)
         {
             Thistower = Towered;
         }
     }
     costText.text = NumFormat.NumtoString(Thistower.Cost);
 }
Exemple #4
0
        public static int GetCatalog(string S, int iRow, ref string iCatalog, ref string StrCatalog)
        {
            int ret = 0;

            //string sqianyan = "前言";
            //string sxiezi = "楔子";
            if (string.IsNullOrEmpty(S))
            {
                return(0);
            }
            if (iRow < 15 && iRow != 0)
            {
                return(0);
            }
            int iMaxLength = PublicConst.iMaxCaptionLength;

            string StratChar  = "第";
            string EndChar    = "章";
            int    iStartChar = S.IndexOf(StratChar);
            int    iEndChar   = S.IndexOf(EndChar);
            int    iChnLength = iEndChar - iStartChar - 1;

            if (iStartChar > -1 && iEndChar > 1 && iChnLength > 0 && S.Length < iMaxLength)
            {
                //bool blnCatalog = true;
                string   strNum = "";
                string[] arrNum = null;

                strNum = S.Substring(iStartChar + 1, iChnLength);
                foreach (char cc in strNum)
                {
                    if (AuthorKey.Core.NumFormat.IndexChn(cc) < 0 && NumFormat.IndexNum(cc) < 0 && NumFormat.IdexChnUpper(cc) < 0)
                    {
                        return(0);
                    }
                }
                if (PublicConst.blnChn)
                {
                    iCatalog = strNum;
                }
                if (S.Length > iEndChar + 1)
                {
                    StrCatalog = S.Substring(iEndChar + 1).Trim();
                }
                ret = 1;
            }
            return(ret);
        }
Exemple #5
0
 public void OnMouseEnter()
 {
     UpgradeTexts[0].text = UpgradeData.Name;
     UpgradeTexts[1].text = NumFormat.NumtoString(UpgradeData.Cost);
     UpgradeTexts[2].text = UpgradeData.Description;
     UpgradeTexts[3].text = UpgradeData.Quote;
     if (UpgradeData.Cost >= Cookie.BloonCount)
     {
         UpgradePopup.transform.GetChild(0).GetComponent <Image>().color = Color.grey;
         UpgradeTexts[1].color = Color.grey;
     }
     else
     {
         UpgradePopup.transform.GetChild(0).GetComponent <Image>().color = Color.white;
         UpgradeTexts[1].color = Color.white;
     }
     UpgradePopup.SetActive(true);
 }
Exemple #6
0
        private int GetPrecision(NumFormat format)
        {
            int num;

            switch (format)
            {
            case NumFormat.Ten:
                num = 1;
                break;

            case NumFormat.Hundreds:
                num = 2;
                break;

            case NumFormat.Thousands:
                num = 3;
                break;

            default:
                num = 0;
                break;
            }
            return(num);
        }
Exemple #7
0
 public void setNumFormat(NumFormat numFormat)
 {
     xlFormatSetNumFormat(handle, (int)numFormat);
 }
Exemple #8
0
 public void setNumFormat(NumFormat numFormat)
 {
     xlFormatSetNumFormat(handle, (int)numFormat);
 }
Exemple #9
0
        private Element2D CreateTextBox(Frame vertLayout, XMLSettingsItem settings, ref int ID_Builder)
        {
            var       slicerSettingsItem = settings.SlicerSettingsItem as IReportFormat;
            NumFormat numFormat          = NumFormat.Thousands;

            if (slicerSettingsItem != null)
            {
                numFormat = slicerSettingsItem.Format;
            }

            var horzonalFrame = new Frame(ID_Builder++, vertLayout)
            {
                RelativeWidth = 1f,
                Height        = 28
            };

            CreateSettingsTitleElement(horzonalFrame, ID_Builder++, settings.Text);
            var editBoxWidget = new EditBoxWidget(ID_Builder++, horzonalFrame);

            editBoxWidget.Init(host, "guicontrols", 898f, 104f, 941f, 135f);
            editBoxWidget.Height           = 25;
            editBoxWidget.Width            = 75;
            editBoxWidget.MAX_CHARS        = 7;
            editBoxWidget.X                = 245;
            editBoxWidget.Size             = FontSize.Medium;
            editBoxWidget.HexColor         = "#FF808080";
            editBoxWidget.ToolTipMessage   = settings.Tooltip;
            editBoxWidget.FadeWhenDisabled = true;
            editBoxWidget.Text             = settings.SlicerSettingsItem.TranslateToUserValue();
            editBoxWidget.tag              = settings.Name;
            editBoxWidget.NumFormat        = numFormat;
            editBoxWidget.SetCallbackOnTextAdded(new EditBoxWidget.EditBoxCallback(EditBoxCallback));
            editBoxWidget.SetCallbackOnBackspace(new EditBoxWidget.EditBoxCallback(EditBoxCallback));
            horzonalFrame.AddChildElement(editBoxWidget);
            var textWidget1 = new TextWidget(ID_Builder++, horzonalFrame)
            {
                Width     = 65,
                Height    = 35,
                X         = 325,
                Size      = FontSize.Medium,
                HexColor  = "#FF7f7f7f",
                Alignment = QFontAlignment.Left,
                Text      = settings.Suffix
            };

            horzonalFrame.AddChildElement(textWidget1);
            var textWidget2 = new TextWidget(ID_Builder++, horzonalFrame)
            {
                Width     = 500,
                Height    = 35,
                X         = 395,
                Size      = FontSize.Medium,
                HexColor  = "#FF7f7f7f",
                Alignment = QFontAlignment.Left,
                Visible   = true,
                tag       = GetRangeText(settings.Name)
            };

            horzonalFrame.AddChildElement(textWidget2);
            vertLayout.AddChildElement(horzonalFrame);
            return(editBoxWidget);
        }
Exemple #10
0
 // Update is called once per frame
 void Update()
 {
     BloonCounterText.text = NumFormat.NumtoString(BloonCount);
 }