public void buttonscene() { switch (transform.name) { case "TryBt": if (Maindirector.getSpan() <= 0f || Maindirector.getCyclespan() <= 0) { //defolt設定 Maindirector.setSpan(1.5f); Maindirector.setCyclespan(5); AdMob.bannerView.Hide(); } SceneManager.LoadScene("countdwon"); break; case "DataBt": SceneManager.LoadScene("histry"); AdMob.bannerView.Show(); break; case "OptionBt": SceneManager.LoadScene("optionscene"); AdMob.bannerView.Show(); break; case "exitBt": Application.Quit(); AdMob.bannerView.Destroy(); break; } }
private void Start() { this.speed = Maindirector.getSpan(); this.cyclespan = Maindirector.getCyclespan(); int value = 0; if (this.speed == 2.0) { value = 0; } else if (this.speed == 1.5) { value = 1; } else if (this.speed == 1.0) { value = 2; } else if (this.speed == 0.5) { value = 3; } else { value = 2; } int value2 = 0; if (this.cyclespan == 5) { value2 = 0; } else if (this.cyclespan == 10) { value2 = 1; } else if (this.cyclespan == 20) { value2 = 2; } else if (this.cyclespan == 30) { value2 = 3; } else { value2 = 0; } cycletimedd.GetComponentInChildren <Dropdown>().value = value; cyclecountdd.GetComponentInChildren <Dropdown>().value = value2; }
void Start() { this.cycle = 0; this.span = Maindirector.getSpan(); this.cyclespsn = Maindirector.getCyclespan(); this.delta = 0; Anser.Clear(); Anstime.Clear(); point.Clear(); key.Clear(); }
void Start() { this.Anserl = Director.Anser; this.Anstimel = Director.Anstime; this.Ansl = Director.point; this.keyl = Director.key; this.result.Clear(); //広告表示 AdMob.bannerView.Show(); //重複削除 this.afterkey = this.keyl.Distinct(); //設定時間外を削除 Debug.Log("回答数:" + this.Anserl.Count); Debug.Log("タイム:" + this.Anstimel.Count); Debug.Log("問題数" + this.Ansl.Count); xcount = 0; y = 0f; float sp = Maindirector.getSpan(); foreach (int i in this.afterkey) { if (this.Anserl[i] == this.Ansl[i]) { if (sp >= this.Anstimel[i]) { xcount += 1; y += this.Anstimel[i]; } } } try { if (xcount == 0 || y == 0) { percent.GetComponent <Text>().text = xcount + " / " + this.Ansl.Count; Speed.GetComponent <Text>().text = "False"; assess.GetComponent <Text>().text = "False"; //書出し用へ格納 this.day = DateTime.Now; this.result["per"] = 0; this.result["timeadv"] = 0; this.result["score"] = 0; } else { per = ((float)xcount / this.Ansl.Count); Debug.Log("%:" + per + " xcount:" + xcount + " 回答数:" + this.Ansl.Count); timeadv = y / xcount; ases = 0; asespoint = 0; //y0.2以下なら100 y0.7以下50 y1.0以上10 //× per if (timeadv <= 0.2) { ases = (100 * per) / timeadv; } else if (timeadv > 0.2 && timeadv <= 1.0) { ases = (50 * per) / timeadv; } else if (timeadv > 1.0 && timeadv <= 1.5) { ases = (30 * per) / timeadv; } else if (timeadv > 1.5) { ases = (10 * per) / timeadv; } asespoint = (int)(ases * 100); percent.GetComponent <Text>().text = xcount + " / " + this.Ansl.Count; Speed.GetComponent <Text>().text = timeadv.ToString("F3"); assess.GetComponent <Text>().text = asespoint.ToString("F0"); //書出し用へ格納 this.day = DateTime.Now; this.result["per"] = this.per; this.result["timeadv"] = this.timeadv; this.result["score"] = (float)this.asespoint; } } catch (Exception e) { Debug.Log(e); } for (int i = 1; i < this.Ansl.Count + 1; i++) { Debug.Log("Anser_cycle:" + i + "/" + this.Ansl.Count + " 答え:" + this.Ansl[i]); } }