本文整理汇总了C#中Exp.getLvbyTotalExp方法的典型用法代码示例。如果您正苦于以下问题:C# Exp.getLvbyTotalExp方法的具体用法?C# Exp.getLvbyTotalExp怎么用?C# Exp.getLvbyTotalExp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exp
的用法示例。
在下文中一共展示了Exp.getLvbyTotalExp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
}
}
}
}
示例2: 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();
}
}
}
}
}
示例3: DoKanjyoOperation
public void DoKanjyoOperation(string kanjyoTyp){
GameObject ExpSliderObj = GameObject.Find ("ExpSlider");
string busyoId = GameObject.Find ("GameScene").GetComponent<NowOnBusyo>().OnBusyo;
string busyoName = GameObject.Find ("GameScene").GetComponent<NowOnBusyo>().OnBusyoName;
//Classification
string QtyValue = "";
string ExValue = "";
if (kanjyoTyp == "DoKakyuKanjyo") {
QtyValue = "KakyuKanjyoQtyValue";
ExValue = "KakyuKanjyoExpValue";
}else if(kanjyoTyp == "DoCyukyuKanjyo"){
QtyValue = "CyukyuKanjyoQtyValue";
ExValue = "CyukyuKanjyoExpValue";
}else if(kanjyoTyp == "DoJyokyuKanjyo"){
QtyValue = "JyokyuKanjyoQtyValue";
ExValue = "JyokyuKanjyoExpValue";
}
//Check exist or not
GameObject qty = GameObject.Find (QtyValue);
int kanjyoQty = int.Parse(qty.GetComponent<Text>().text);
if (kanjyoQty == 0) {
/*Error*/
string Text = "感状はありませぬぞ。";
Message msg = new Message();
msg.makeMessage (Text);
GameObject.Find ("DoKakyuKanjyo").GetComponent<Button> ().enabled = true;
GameObject.Find ("DoCyukyuKanjyo").GetComponent<Button> ().enabled = true;
GameObject.Find ("DoJyokyuKanjyo").GetComponent<Button> ().enabled = true;
GameObject.Find ("close").GetComponent<Button> ().enabled = true;
} else {
/*Correct Case*/
//reduce qty
qty.GetComponent<Text> ().text = (kanjyoQty - 1).ToString ();
//increase exp
int nowLv = PlayerPrefs.GetInt (busyoId);
string tempExp = "exp" + busyoId;
int nowExp = PlayerPrefs.GetInt (tempExp);
int newExp = nowExp + int.Parse (GameObject.Find (ExValue).GetComponent<Text> ().text);
Exp exp = new Exp ();
int targetLv = exp.getLvbyTotalExp (nowLv, newExp);
int targetMaxExp = 0;
List<float> maxExpList = new List<float> ();
if(targetLv != 100){
targetMaxExp = exp.getExpforNextLv (targetLv);
for (int k=nowLv; k<=targetLv; k++) {
maxExpList.Add (exp.getDifExpforNextLv (k));
}
}else{
maxExpList.Add((float)exp.getExpLv100());
}
ExpSliderObj.GetComponent<ExpSlider> ().maxExpArray = maxExpList; //Max Experience by Level
ExpSliderObj.GetComponent<ExpSlider> ().i = 0; //
ExpSliderObj.GetComponent<ExpSlider> ().startLv = nowLv; //
ExpSliderObj.GetComponent<ExpSlider> ().nowExp = float.Parse (GameObject.Find ("CurrentExpValue").GetComponent<Text> ().text); //
ExpSliderObj.GetComponent<ExpSlider> ().kanjyoExp = float.Parse (GameObject.Find (ExValue).GetComponent<Text> ().text);
ExpSliderObj.GetComponent<ExpSlider> ().newExp = newExp; //
ExpSliderObj.GetComponent<ExpSlider> ().targetMaxExp = targetMaxExp; //
ExpSliderObj.GetComponent<Slider> ().value = float.Parse (GameObject.Find ("CurrentExpValue").GetComponent<Text> ().text);
ExpSliderObj.GetComponent<Slider> ().maxValue = maxExpList [0];
//Set Qty of Kanjyo
string kanjyoQtyString = "";
if (kanjyoTyp == "DoKakyuKanjyo") {
kanjyoQtyString = (kanjyoQty - 1).ToString () + "," + kanjyoList [1] + "," + kanjyoList [2];
} else if (kanjyoTyp == "DoCyukyuKanjyo") {
kanjyoQtyString = kanjyoList [0] + "," + (kanjyoQty - 1).ToString () + "," + kanjyoList [2];
} else if (kanjyoTyp == "DoJyokyuKanjyo") {
kanjyoQtyString = kanjyoList [0] + "," + kanjyoList [1] + "," + (kanjyoQty - 1).ToString ();
}
PlayerPrefs.SetString ("kanjyo", kanjyoQtyString);
PlayerPrefs.SetInt (tempExp, newExp);
PlayerPrefs.SetInt (busyoId, targetLv);
PlayerPrefs.Flush();
string kanjyoText = busyoName + "に感状を与えました。";
Message msg = new Message();
msg.makeMessage (kanjyoText);
//Run
ExpSliderObj.GetComponent<ExpSlider> ().enabled = true;
}
}