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


C# Exp.getExpbyCyadougu方法代码示例

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


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

示例1: Update


//.........这里部分代码省略.........
									bool gameClearFlg = true;
									for(int i=0; i<seiryokuList.Count; i++){
										if(i==0){
											newSeiryoku = seiryokuList[i];
										}else{
											newSeiryoku = newSeiryoku + "," + seiryokuList[i];
										}

										//game clear check
										if(gameClearFlg){
											if(seiryokuList[i] != myDaimyo.ToString()){
												gameClearFlg = false;
											}
										}
									}
									PlayerPrefs.SetBool("gameClearFlg",gameClearFlg);
									PlayerPrefs.SetString("seiryoku",newSeiryoku);


									//Cyouhou Delete
									string cyouhouTmp = "cyouhou" + activeKuniId;
									if (PlayerPrefs.HasKey (cyouhouTmp)) {
										PlayerPrefs.DeleteKey(cyouhouTmp);

										string cyouhou = PlayerPrefs.GetString("cyouhou");
										List<string> cyouhouList = new List<string> ();
										if (cyouhou != null && cyouhou != "") {
											if(cyouhou.Contains(",")){
												cyouhouList = new List<string> (cyouhou.Split (delimiterChars));
											}else{
												cyouhouList.Add(cyouhou);
											}
										}

										cyouhouList.Remove (activeKuniId.ToString());
										string newCyouhou = "";
										for(int j=0;j<cyouhouList.Count;j++){
											if (j == 0) {
												newCyouhou = cyouhouList[j];
											} else {
												newCyouhou = newCyouhou + "," + cyouhouList[j];
											}
										}
										PlayerPrefs.SetString ("cyouhou",newCyouhou);

									}
								}
							}
						}else{
							//1st time
							clearedStageString = activeStageId.ToString();
						}
						PlayerPrefs.SetString(temp,clearedStageString);

						PlayerPrefs.SetInt("kuniLv",newKuniLv);
						PlayerPrefs.SetInt("kuniExp",currentKuniExp);
						PlayerPrefs.Flush();
					}

					//Button List
					string nextbtnPath = "Prefabs/PostKassen/bttnList";
					GameObject bttnListObj = Instantiate(Resources.Load (nextbtnPath)) as GameObject;
					bttnListObj.transform.SetParent (canvas.transform);
					bttnListObj.transform.localScale = new Vector2(1,1);
					bttnListObj.transform.localPosition = new Vector2 (0,0);

					//Time Stop
					GameObject.Find ("timer").GetComponent<Timer>().enabled = false;


					//Get Exp
					SenkouButton senkou = new SenkouButton();
					List<BusyoSenkou> senkouList = new List<BusyoSenkou>();
					senkouList=senkou.getSenkou ();
					for(int i=0;i<senkouList.Count;i++){

						int busyoId = senkouList[i].id;
						int senkouAmt = senkouList[i].senkou;
						Exp exp = new Exp();

						//Modify by Cyadougu Kahou
						senkouAmt = exp.getExpbyCyadougu(busyoId,senkouAmt);

						//Busyo Exp
						string tempExp = "exp" + busyoId;
						int nowExp = PlayerPrefs.GetInt(tempExp);
						int newExp = nowExp + senkouAmt;
						PlayerPrefs.SetInt(tempExp, newExp);

						//Busyo Lv
						int nowLv = PlayerPrefs.GetInt(busyoId.ToString());
						int newLv = exp.getLvbyTotalExp(nowLv,newExp);
						PlayerPrefs.SetInt(busyoId.ToString(), newLv);

						PlayerPrefs.Flush();
					}
				}
			}
		}
	}
开发者ID:zeimoter,项目名称:sengoku2d,代码行数:101,代码来源:HPCounter.cs

示例2: Update


//.........这里部分代码省略.........

                    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();
                                }else{
                                    clearedKuni = activeKuniId.ToString();
                                }
                                PlayerPrefs.SetString("clearedKuni",clearedKuni);
                                //Give 1st cleared revenue
                                PlayerPrefs.SetBool("kuniClearedFlg",true);

                                //Open Kuni
                                KuniInfo kuni = new KuniInfo();
                                kuni.registerOpenKuni(activeKuniId);

                                //Seiryoku Change
                                string seiryoku = PlayerPrefs.GetString ("seiryoku");
                                List<string> seiryokuList = new List<string>();
                                seiryokuList = new List<string> (seiryoku.Split (delimiterChars));

                                int myDaimyo = PlayerPrefs.GetInt ("myDaimyo");
                                seiryokuList[activeKuniId-1] = myDaimyo.ToString();
                                string newSeiryoku = "";
                                for(int i=0; i<seiryokuList.Count; i++){
                                    if(i==0){
                                        newSeiryoku = seiryokuList[i];
                                    }else{
                                        newSeiryoku = newSeiryoku + "," + seiryokuList[i];
                                    }
                                }
                                PlayerPrefs.SetString("seiryoku",newSeiryoku);

                            }
                        }
                    }else{
                        //1st time
                        clearedStageString = activeKuniId.ToString();
                    }
                    PlayerPrefs.SetString(temp,clearedStageString);

                    PlayerPrefs.SetInt("kuniLv",newKuniLv);
                    PlayerPrefs.SetInt("kuniExp",currentKuniExp);

                    PlayerPrefs.Flush();

                    //Button List
                    string nextbtnPath = "Prefabs/PostKassen/bttnList";
                    GameObject bttnListObj = Instantiate(Resources.Load (nextbtnPath)) as GameObject;
                    bttnListObj.transform.parent = GameObject.Find ("Canvas").transform;
                    bttnListObj.transform.localScale = new Vector2(1,1);

                    //Time Stop
                    GameObject.Find ("timer").GetComponent<Timer>().enabled = false;

                    //Get Exp
                    SenkouButton senkou = new SenkouButton();
                    List<BusyoSenkou> senkouList = new List<BusyoSenkou>();
                    senkouList=senkou.getSenkou ();
                    for(int i=0;i<senkouList.Count;i++){

                        int busyoId = senkouList[i].id;
                        int senkouAmt = senkouList[i].senkou;
                        Exp exp = new Exp();

                        //Modify by Cyadougu Kahou
                        senkouAmt = exp.getExpbyCyadougu(busyoId,senkouAmt);

                        //Busyo Exp
                        string tempExp = "exp" + busyoId;
                        int nowExp = PlayerPrefs.GetInt(tempExp);
                        int newExp = nowExp + senkouAmt;
                        PlayerPrefs.SetInt(tempExp, newExp);

                        //Busyo Lv
                        int nowLv = PlayerPrefs.GetInt(busyoId.ToString());
                        int newLv = exp.getLvbyTotalExp(nowLv,newExp);
                        PlayerPrefs.SetInt(busyoId.ToString(), newLv);

                        PlayerPrefs.Flush();
                    }
                }
            }
        }
    }
开发者ID:zeimoter,项目名称:zeimoter,代码行数:101,代码来源:HPCounter.cs


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