public void UpdateLevel() { if (CScore.GetScore() >= Level[iLevel].iGoal) { if (isEnd) // 終了 { CSceneManager CSM = GameObject.Find("FadeCanvas").GetComponent <CSceneManager>(); CSM.OnChangeScene_Title(); } else { // 現在時間取得 float endtime = gTimer.GetComponent <CNumberManager>().Get_fTime(); // ステージクリア時間算出 float totaltime = endtime - fStartTime; int timelimit = Level[iLevel].iMinutes * 60 + Level[iLevel].iSeconds; Level[iLevel].fTotalTime = totaltime; if (totaltime > timelimit) // 制限時間内にクリアしなかったら次のステージで終了 { isEnd = true; } // スタート時間更新 fStartTime = endtime; iLevel++; gScore.GetComponent <CScore>().Set_iScoreParam(Level[iLevel].iGoal); CObjectManager.Instance.Create(Level[iLevel].iObjectNum - Level[iLevel - 1].iObjectNum); } } }
public void PrintResult() { m_txtResult.text = ""; m_txtResult.text += "[성적관리]\n"; m_txtResult.text += "===================================\n"; for (int i = 0; i < m_listScore.Count; i++) { CScore sr = m_listScore[i]; m_txtResult.text += string.Format("{0}등 : {1} {2} {3} {4} \t:합계={5}\t 평균={6:0.0} \n", i + 1, sr.m_Name, sr.m_Kor, sr.m_Eng, sr.m_Mat, sr.Total, sr.Average); } m_txtResult.text += "===================================\n"; int nCount = m_listScore.Count; int nSumKor = 0; int nSumEng = 0; int nSumMat = 0; CalculateSum(out nSumKor, out nSumEng, out nSumMat); m_txtResult.text += string.Format("과목별 합계 -- 국어:({0}, {1:0.0}), 영어:({2}, {3:0.0}), 수학({4}, {5:0.0})\n", nSumKor, (float)nSumKor / nCount, nSumEng, (float)nSumEng / nCount, nSumMat, (float)nSumMat / nCount); }
private void Awake() { if (!mInst) { mInst = this; } }
void Start() { // CNameManagerの取得 //gNameManagerObj = GameObject.Find("PFB_Words"); cnmScript = gNameManagerObj.GetComponent <CNameManager>(); Load(); if (CSceneManager.GetRecently() == "ResultScene") { OverwritePlayer.score = CScore.GetScore(); Debug.Log("スコア" + OverwritePlayer.score); //OverwritePlayer.name = cnmScript.GetName(); //Debug.Log(OverwritePlayer.name[0]); //Debug.Log(OverwritePlayer.name[1]); //Debug.Log(OverwritePlayer.name[2]); } // 情報上書き OverwriteRecord(); // 更新したデータをPlayerPrefs SaveScore(); // ランキング表示 ScoreDisplay(); NameDisplay(); stOldScene = CSceneManager.GetRecently(); }
public void Overwrite() { if (bNameInEnd) { if (!bDispName) { // 最新のword_PFBに更新 cnmScript = gNameManagerObj.GetComponent <CNameManager>(); Load(); if (CSceneManager.GetRecently() == "ResultScene") { OverwritePlayer.score = CScore.GetScore(); Debug.Log("スコア" + OverwritePlayer.score); OverwritePlayer.name = cnmScript.GetName(); Debug.Log(OverwritePlayer.name[0]); Debug.Log(OverwritePlayer.name[1]); Debug.Log(OverwritePlayer.name[2]); OverwriteRecord(); SaveScore(); } bDispName = true; ScoreDisplay(); NameDisplay(); } } }
public CScore AddItem(int nNo, string name, int kor, int eng, int mat) { CScore kItem = new CScore(nNo, name, kor, eng, mat); m_listScore.Add(kItem); return(kItem); }
public void RemoveItem(string name) { CScore kScore = m_listScore.Find((x) => { return(x.m_Name == name); }); if (kScore != null) { m_listScore.Remove(kScore); } }
public void PrintSubData() { m_txtSubRes.text = ""; for (int i = 0; i < m_listScore.Count; i++) { CScore sr = m_listScore[i]; m_txtSubRes.text += string.Format("{0}: {1}, {2}, {3}\n", sr.m_Name, sr.m_Kor, sr.m_Eng, sr.m_Mat); } }
void Start() { // 初期位置を設定 vStartPos = this.transform.position; // 頂点数を設定 iTotalPoints = iMiddlePoints + 2; // カウントを0に iCnt = 0; CScore = GameObject.Find("PFB_ScoreObj").GetComponent <CScore>(); }
public void OnClicked_Add() { string name = m_InputName.text; int kor = int.Parse(m_InputKor.text); int eng = int.Parse(m_InputEng.text); int mat = int.Parse(m_InputMath.text); CScore kScore = new CScore(name, kor, eng, mat); m_listScore.Add(kScore); PrintSubData(); }
public void OnClicked_OK() { m_txtResult.text = ""; m_txtResult.text += "[성적관리]\n"; m_txtResult.text += "===================================\n"; for (int i = 0; i < m_listScore.Count; i++) { CScore sr = m_listScore[i]; m_txtResult.text += string.Format("{0} : {1}, {2}, {3} : 합계={4}\t 평균={5:0.0} \n", sr.m_Name, sr.m_Kor, sr.m_Eng, sr.m_Mat, sr.Total(), sr.Average()); } }
public void CalculateSum(out int sumKor, out int sumEng, out int sumMat) { int nSumK = 0, nSumE = 0, nSumM = 0; for (int i = 0; i < m_listScore.Count; i++) { CScore kScore = m_listScore[i]; nSumK += kScore.m_Kor; nSumE += kScore.m_Eng; nSumM += kScore.m_Mat; } sumKor = nSumK; sumEng = nSumE; sumMat = nSumM; }
private void Start() { Load(); if (CSceneManager.GetRecently() == "ResultScene") { //========== 2021/5/09 // スコアを表示するのに必要なので = の後ろ書き換えました。 by佐々木 OverwriteScore.score = CScore.GetScore(); OverwriteRecord(); } SaveScore(); ScoreDisplay(); }
public void PrintResult2() { m_txtResult.text = ""; m_txtResult.text = " Name kor Eng Mat < 종합 >\n"; m_txtResult.text += "===================================\n"; for (int i = 0; i < m_listScore.Count; i++) { CScore sr = m_listScore[i]; string sKor = MakeGrade(sr.m_Kor); string sEng = MakeGrade(sr.m_Eng); string sMat = MakeGrade(sr.m_Mat); string sAvg = MakeGrade((int)sr.Average); m_txtResult.text += string.Format("{0} {1} {2} {3} < {4} > \n", sr.m_Name, sKor, sEng, sMat, sAvg); } }
public void SaveFile() { FileStream fs = new FileStream("Score.dat", FileMode.Create, FileAccess.Write); BinaryWriter bw = new BinaryWriter(fs); bw.Write(m_listScore.Count); for (int i = 0; i < m_listScore.Count; i++) { CScore kScore = m_listScore[i]; bw.Write(kScore.m_Name); bw.Write(kScore.m_Kor); bw.Write(kScore.m_Eng); bw.Write(kScore.m_Mat); } bw.Close(); fs.Close(); }
public void OnClicked_Add() { string name = m_InputName.text; int kor = int.Parse(m_InputKor.text); int eng = int.Parse(m_InputEng.text); int mat = int.Parse(m_InputMath.text); CScore kScore = new CScore(name, kor, eng, mat); m_listScore.Add(kScore); m_txtSubRes.text = ""; for (int i = 0; i < m_listScore.Count; i++) { CScore sr = m_listScore[i]; m_txtSubRes.text += string.Format("{0}: {1}, {2}, {3}\n", sr.m_Name, sr.m_Kor, sr.m_Eng, sr.m_Mat); } }
public CScore Repair(int nNo, string name, int kor, int eng, int mat) { CScore kScore = FindScore(nNo); if (kScore == null) { kScore = FindScore(name); } if (kScore != null) { kScore.m_No = nNo; kScore.m_Name = name; kScore.m_Kor = kor; kScore.m_Eng = eng; kScore.m_Mat = mat; return(kScore); } return(null); }
public override void Draw(float t, float dt) { if (shouldLeave) // TODO: When we parallelise this probably won't work. { CScore score = (CScore)Game1.Inst.Scene.GetComponentFromEntity <CScore>(player); SfxUtil.PlaySound("Sounds/Effects/horny_end"); Game1.Inst.LeaveScene(); Game1.Inst.EnterScene(new EndGameScene(passedTime, score.Score, won)); } var camera = (CCamera)GetComponentFromEntity <CCamera>(player); if (camera.Position.Y < configs.WaterHeight) { GfxUtil.SetRT(mRT); base.Draw(t, dt); GfxUtil.SetRT(null); mUnderWaterFx.Parameters["SrcTex"].SetValue(mRT); mUnderWaterFx.Parameters["Phase"].SetValue(t); GfxUtil.DrawFsQuad(mUnderWaterFx); } else if (configs.IsRaining) { GfxUtil.SetRT(mRT); base.Draw(t, dt); GfxUtil.SetRT(null); mPostProcessor.ApplyPostProcess(t, dt, mRT); } else { GfxUtil.SetRT(null); base.Draw(t, dt); } mHud.Update(); mHud.Draw(player); }
void OnTriggerEnter(Collider col) { // �ʉ߃I�u�W�F�N�g���� if (col.gameObject.tag == "RotateObject") { GetComponent <CCreateEffect>().CreateEffect(); OBJECT_SHAPE order = csOrderManager.Get_Order(iPassNum); // �w�߂ƈ�v if (order == col.gameObject.GetComponent <CRotateObject>().Get_Shape()) { iMatchNum++; CClearLampManager.Instance.Lighting(iPassNum, Color.green); } else { CClearLampManager.Instance.Lighting(iPassNum, Color.red); } // �ʉ߂����I�u�W�F�N�g��폜 CObjectManager.Instance.Remove(col.gameObject); Destroy(col.gameObject); //Debug.Log("hit"); iPassNum++; int ordernum = csOrderManager.Get_iOrderNum(); // �w�ߐ��̃I�u�W�F�N�g���ʉ߂����烊�Z�b�g if (iPassNum == ordernum) { if (iMatchNum == ordernum) { // �N���A�X�^���v���� //Instantiate(gClear, new Vector3(20, 0, -10 + iClearNum * 5), // Quaternion.Euler(0, 180, 0)); //========== 2021/5/09 // �X�R�A��L�^����̂ɕK�v�Ȃ̂ő����܂����@by���X�� CScore.AddScore(); CCreateTrail.Create(); //-- 2021.5.15�lj� sasaki gPanelGreen.SetActive(true); //Debug.Log("SE!!"); aAudioSourceGreen.PlayOneShot(aSEClear); CLevelManager.Instance.UpdateLevel(); // �w�ߐ��� csOrderManager.CreateOrder(CLevelManager.Instance.Get_iOrderNum()); CClearLampManager.Instance.CreateLamp(CLevelManager.Instance.Get_iOrderNum()); iClearNum++; } else { //-- 2021.5.15�lj� sasaki gPanelRed.SetActive(true); //Debug.Log("SE!!"); aAudioSourceRed.PlayOneShot(aSEMiss); } // �V�����I�u�W�F�N�g���� CObjectManager.Instance.Create(ordernum); CClearLampManager.Instance.LightingOff(); csGateTimerController.Reset(); gGateTimerController.transform.LookAt(new Vector3(0, 0, 10)); Destroy(this.gameObject); } } }
private void Update() { if (!Settings.isGameOver) { //pause key control if (Input.GetKeyDown(KeyCode.Escape)) { Time.timeScale = Time.timeScale.Equals(1) ? 0 : 1; } else if (Input.anyKeyDown) { Time.timeScale = 1; } } else { //filling in fields with information textHScore2.text = $"HIGH SCORE: {PlayerPrefs.GetInt("hScore")}"; textAllAsteroids.text = $"ALL ASTEROIDS: {PlayerPrefs.GetInt("allAsteroids")}"; textAllTime.text = $"ALL TIME: {PlayerPrefs.GetInt("allTime") / 60} min {PlayerPrefs.GetInt("allTime") % 60} sec"; //control keys in game over if (Input.GetKeyDown(KeyCode.E)) { Application.Quit(); } if (Input.GetKeyDown(KeyCode.R)) { SceneManager.LoadScene(0); Settings.isGameOver = false; gameOverPanel.SetActive(false); } } //animation of increasing and decreasing text var scale = Mathf.PingPong(Time.unscaledTime / 2, 0.3f) + 0.8f; text.localScale = new Vector3(scale, scale, 0); //UI control (enabling and disabling) if (Time.timeScale.Equals(0)) { if (!Settings.isGameOver) { pauseMenuPanel.SetActive(true); } else { gameOverPanel.SetActive(true); } whileGamePanel.SetActive(false); } else { if (!Settings.isGameOver) { pauseMenuPanel.SetActive(false); } whileGamePanel.SetActive(true); } if (Settings.isNewRecord) { newRecordText.SetActive(true); } //filling in fields with information textCScore.text = $"SCORE: {CScore.ConvertScore(1000)}"; textTime.text = $"TIME: {time} sec"; if (!asteroids.ToString().Equals(textAsteroids.text) && asteroids.ToString() != null) { textAsteroids.text = $"ASTEROIDS: {TestReflection(asteroids)}"; } textHScore.text = $"HIGH SCORE: {hScore}"; }