private void Die() { m_dieCanvas.SetActive(false); ResetPlayer(); m_player.GetComponent <CharController>().isDieCheck = false; LoadingSceneMng.LoadScene("Village"); }
// Update is called once per frame void Update() { if (Input.GetKey(KeyCode.B)) { LoadingSceneMng.LoadScene("Village"); GameObject g = GameObject.Find("Canvas/UI"); g.SetActive(false); GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterController>().enabled = false; GameObject.FindGameObjectWithTag("Player").GetComponent <NavMeshAgent>().enabled = false; } }
private void Out() { LoadingSceneMng.LoadScene("Field"); GameObject g = GameObject.Find("Canvas/UI"); m_camera.GetComponent <MainCamera>().isSceneMove = true; m_camera.transform.position = new Vector3(60, 5, 60); g.SetActive(false); GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterController>().enabled = false; GameObject.FindGameObjectWithTag("Player").GetComponent <NavMeshAgent>().enabled = false; }
// Update is called once per frame void Update() { if (Input.GetKey(KeyCode.L)) { GameObject.Find("Canvas").transform.Find("UI").gameObject.SetActive(true); GameObject.Find("Canvas").transform.Find("HpCanvas").gameObject.SetActive(true); player.SetActive(true); player.GetComponent <CharacterController>().enabled = false; player.GetComponent <NavMeshAgent>().enabled = false; LoadingSceneMng.LoadScene("Village"); } }
private void Yes() { LoadingSceneMng.LoadScene("Village"); //m_camera.SetActive(false); SceneMoveCheckObj.SetActive(false); GameObject g = GameObject.Find("Canvas/UI"); m_camera.GetComponent <MainCamera>().isSceneMove = true; m_camera.transform.position = new Vector3(58, 4, 30); g.SetActive(false); GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterController>().enabled = false; GameObject.FindGameObjectWithTag("Player").GetComponent <NavMeshAgent>().enabled = false; }
private void Yes() { if (m_player.GetComponent <CharController>().GetLevel >= m_dungeonLimitLevel) { LoadingSceneMng.LoadScene("Dungeon"); //m_camera.SetActive(false); SceneMoveCheckObj.SetActive(false); GameObject g = GameObject.Find("Canvas/UI"); m_camera.GetComponent <MainCamera>().isSceneMove = true; m_camera.transform.position = new Vector3(-14, 4, 5); g.SetActive(false); GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterController>().enabled = false; GameObject.FindGameObjectWithTag("Player").GetComponent <NavMeshAgent>().enabled = false; } else { } }
void Update() { if (start) { FileInfo fi = new FileInfo(Application.persistentDataPath + "/" + "CharState.txt"); if (fi.Exists) { LoadingSceneMng.LoadScene("Village"); } else { if (Input.touchCount > 0) { LoadingSceneMng.LoadScene("CharacterSelect"); } } } }
public void CreateCharacter() { if (m_inputField.text != string.Empty) { int i = 1; TextAsset txtFile = Resources.Load("Files/CharStateBasic") as TextAsset; string test = txtFile.text; string[] line2 = test.Split('\n'); string line = line2[1]; string[] info = line.Split(','); string level = info[0]; string str = info[1]; string def = info[2]; string cri = info[3]; string hp = info[4]; string SL1 = info[5]; string SL2 = info[6]; string SL3 = info[7]; string SL4 = info[8]; string SL5 = info[9]; string exp = info[10]; string sp = info[11]; FileStream fs = new FileStream(Application.persistentDataPath + "/" + "CharState.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite); StreamWriter sw = new StreamWriter(fs); //sw.WriteLine("CharID,CharName,CharLev,CharStr,CharDef,CharCri,CharHp,firstSL,secondSL,thirdSL,firthSL,fifthSL,Exp,SP,14"); line = i.ToString() + ',' + m_inputField.text + ',' + level + ',' + str + ',' + def + ',' + cri + ',' + hp + ',' + SL1 + ',' + SL2 + ',' + SL3 + ',' + SL4 + ',' + SL5 + ',' + exp + ',' + sp; sw.WriteLine(line); sw.Close(); FileStream fs2 = new FileStream(Application.persistentDataPath + "/" + "CharState.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite); StreamReader sr = new StreamReader(fs2); sr.Close(); //TextAsset txtFile = Resources.Load("Files/CharState") as TextAsset; //string test = txtFile.text; //string[] line2 = test.Split('\n'); //int i = 1; //for (int j = 1; j < line2.Length; j++) //{ // if (line2[j] == null) // break; // else // ++i; //} //FileStream fs = new FileStream(Application.persistentDataPath + "/" + "TestFileName.txt", FileMode.OpenOrCreate, FileAccess.Read); //string path = Application.dataPath + "/Resources/Files/CharState.txt"; //StreamReader sr = new StreamReader(fs); //sr.ReadLine(); //int i = 1; //while (true) //{ // string cline = sr.ReadLine(); // if (cline == null) // break; // else // ++i; //} //sr.Close(); //TextAsset txtFile = Resources.Load("Files/CharStateBasic") as TextAsset; //string test = txtFile.text; //string[] line2 = test.Split('\n'); //path = Application.dataPath + "/Resources/Files/CharStateBasic.txt"; //sr = new StreamReader(path); //sr.ReadLine(); //string line = line2[1]; //string[] info = line.Split(','); //string level = info[0]; //string str = info[1]; //string def = info[2]; //string cri = info[3]; //string hp = info[4]; //string SL1 = info[5]; //string SL2 = info[6]; //string SL3 = info[7]; //string SL4 = info[8]; //string SL5 = info[9]; //string exp = info[10]; //string sp = info[11]; //sr.Close(); //path = Application.dataPath + "/Resources/Files/CharState.txt"; //StreamWriter sw = new StreamWriter(path); //sw.WriteLine("CharID,CharName,CharLev,CharStr,CharDef,CharCri,CharHp,firstSL,secondSL,thirdSL,firthSL,fifthSL,Exp,SP,14"); //line = i.ToString() + ',' + m_inputField.text + ',' + level + ',' + str + ',' + def + ',' + cri + ',' + hp + ',' + SL1 + ',' + SL2 + ',' + SL3 + ',' + SL4 + ',' + SL5 + ',' + exp + ',' + sp; //sw.WriteLine(line); //sw.Close(); LoadingSceneMng.LoadScene("Village"); } }