当前位置: 首页>>代码示例>>C#>>正文


C# Exp.getJinkeiLimit方法代码示例

本文整理汇总了C#中Exp.getJinkeiLimit方法的典型用法代码示例。如果您正苦于以下问题:C# Exp.getJinkeiLimit方法的具体用法?C# Exp.getJinkeiLimit怎么用?C# Exp.getJinkeiLimit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Exp的用法示例。


在下文中一共展示了Exp.getJinkeiLimit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update


//.........这里部分代码省略.........
							string itemQtyPath = "Prefabs/PostKassen/itemQty";
							GameObject itemQtyObj = Instantiate (Resources.Load (itemQtyPath)) as GameObject;
							itemQtyObj.transform.SetParent (itemListObj.transform);
							itemQtyObj.transform.localScale = new Vector2 (0.09f, 0.09f);
							itemQtyObj.transform.localPosition = new Vector2 (290, 35);
							itemQtyObj.GetComponent<Text> ().text = "x " + activeItemQty.ToString ();

							
							PlayerPrefs.Flush ();
						}

					} else {
						itemListObj.transform.FindChild ("stageName").transform.FindChild("stageNameValue").GetComponent<Text> ().text = stageName + "成功";
					}
					
					//Money
					int activeStageMoney = PlayerPrefs.GetInt("activeStageMoney",0);
					GameObject.Find ("moneyAmt").GetComponent<Text>().text = activeStageMoney.ToString();
					int currentMoney = PlayerPrefs.GetInt("money");
					currentMoney = currentMoney + activeStageMoney;
					PlayerPrefs.SetInt("money",currentMoney);

					//kuniExp
					int activeStageExp = PlayerPrefs.GetInt("activeStageExp",0);
					GameObject.Find ("expAmt").GetComponent<Text>().text = activeStageExp.ToString();
					int currentKuniExp = PlayerPrefs.GetInt ("kuniExp");
					currentKuniExp = currentKuniExp + activeStageExp;
					int kuniLv = PlayerPrefs.GetInt ("kuniLv");
					Exp kuniExp = new Exp();
					int newKuniLv = kuniExp.getKuniLv(kuniLv,currentKuniExp);

					if(newKuniLv>kuniLv){
						//lv up
						int jinkeiLimit = kuniExp.getJinkeiLimit(newKuniLv);
						int stockLimit = kuniExp.getStockLimit(newKuniLv);
						PlayerPrefs.SetInt("jinkeiLimit",jinkeiLimit);
						PlayerPrefs.SetInt("stockLimit",stockLimit);


					}else{
						Debug.Log ("No level up");
					}

					/*Cleared Flag*/
					if(!isAttackedFlg){
						int activeKuniId  = PlayerPrefs.GetInt("activeKuniId");
						int activeStageId = PlayerPrefs.GetInt("activeStageId");
						string temp = "kuni" + activeKuniId.ToString();

						List<string> clearedStageList = new List<string>();
						string clearedStageString  = PlayerPrefs.GetString(temp);

						if(clearedStageString !=null && clearedStageString !=""){
							//after 1st time
							char[] delimiterChars = {','};
							clearedStageList = new List<string>(clearedStageString.Split (delimiterChars));
							if(clearedStageList.Contains(activeStageId.ToString()) == false){
								clearedStageString = clearedStageString + "," + activeStageId.ToString();

								//1st Kuni Clear Check
								string[] commaCounter = clearedStageString.Split(delimiterChars);
								int counter = commaCounter.Length;

								if(counter == 10){
									//1st time
									string clearedKuni = PlayerPrefs.GetString("clearedKuni");
开发者ID:zeimoter,项目名称:sengoku2d,代码行数:67,代码来源:HPCounter.cs

示例2: Update


//.........这里部分代码省略.........
                        item.transform.localPosition = new Vector2(80,-105);
                        item.GetComponent<Button>().enabled = false;

                        //Qty
                        string itemQtyPath = "Prefabs/PostKassen/itemQty";
                        GameObject itemQtyObj = Instantiate(Resources.Load (itemQtyPath)) as GameObject;
                        itemQtyObj.transform.SetParent(itemListObj.transform);
                        itemQtyObj.transform.localScale = new Vector2(0.09f,0.09f);
                        itemQtyObj.transform.localPosition = new Vector2(130,-105);
                        itemQtyObj.GetComponent<Text>().text = "x " + activeItemQty.ToString();

                        //
                        PlayerPrefs.Flush();
                    }

                    //Money
                    int activeStageMoney = PlayerPrefs.GetInt("activeStageMoney",0);
                    GameObject.Find ("moneyAmt").GetComponent<TextMesh>().text = activeStageMoney.ToString();
                    int currentMoney = PlayerPrefs.GetInt("money");
                    currentMoney = currentMoney + activeStageMoney;
                    PlayerPrefs.SetInt("money",currentMoney);

                    //kuniExp
                    int activeStageExp = PlayerPrefs.GetInt("activeStageExp",0);
                    GameObject.Find ("expAmt").GetComponent<TextMesh>().text = activeStageExp.ToString();
                    int currentKuniExp = PlayerPrefs.GetInt ("kuniExp");
                    currentKuniExp = currentKuniExp + activeStageExp;
                    int kuniLv = PlayerPrefs.GetInt ("kuniLv");
                    Exp kuniExp = new Exp();
                    int newKuniLv = kuniExp.getKuniLv(kuniLv,currentKuniExp);

                    if(newKuniLv>kuniLv){
                        //lv up
                        int jinkeiLimit = kuniExp.getJinkeiLimit(newKuniLv);
                        int stockLimit = kuniExp.getStockLimit(newKuniLv);
                        PlayerPrefs.SetInt("jinkeiLimit",jinkeiLimit);
                        PlayerPrefs.SetInt("stockLimit",stockLimit);

                    }else{
                        Debug.Log ("No level up");
                    }

                    /*Cleared Flag*/
                    int activeKuniId  = PlayerPrefs.GetInt("activeKuniId");
                    int activeStageId = PlayerPrefs.GetInt("activeStageId");
                    string temp = "kuni" + activeKuniId.ToString();

                    List<string> clearedStageList = new List<string>();
                    string clearedStageString  = PlayerPrefs.GetString(temp);

                    if(clearedStageString !=null && clearedStageString !=""){
                        //after 1st time
                        char[] delimiterChars = {','};
                        clearedStageList = new List<string>(clearedStageString.Split (delimiterChars));
                        if(clearedStageList.Contains(activeStageId.ToString()) == false){
                            clearedStageString = clearedStageString + "," + activeStageId.ToString();

                            //1st Kuni Clear Check
                            string[] commaCounter = clearedStageString.Split(delimiterChars);
                            int counter = commaCounter.Length;

                            if(counter == 10){
                                //1st time
                                string clearedKuni = PlayerPrefs.GetString("clearedKuni");
                                if(clearedKuni !=null && clearedKuni !=""){
                                    clearedKuni = clearedKuni + "," + activeKuniId.ToString();
开发者ID:zeimoter,项目名称:zeimoter,代码行数:67,代码来源:HPCounter.cs


注:本文中的Exp.getJinkeiLimit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。