Stateマシーン

「Stateマシーン」の編集履歴(バックアップ)一覧はこちら

Stateマシーン」(2015/06/21 (日) 10:12:08) の最新版変更点

追加された行は緑色になります。

削除された行は赤色になります。

void Update () { if (state==0) { clearFloor(); floorNo++; GameObject.Find("Status").GetComponent<TextMesh>().text = ""; GameObject.Find("Info").GetComponent<TextMesh>().text = " Floor "+(floorNo); GameObject.Find("Info2").GetComponent<TextMesh>().text = "Hit Any Key"; state=1; MapRoot.SetActive(false); } else if(state==1) { if( Input.anyKeyDown ) { newFloor(); GameObject.Find("Info").GetComponent<TextMesh>().text = ""; GameObject.Find("Info2").GetComponent<TextMesh>().text = ""; state=2; MapRoot.SetActive(true); } } else if (state==2) { timer--; string temp="Floor"+floorNo+" Hp"+hp+" Score"+score+" Timer"+timer+"\n\n\n\n"; GameObject.Find("Status").GetComponent<TextMesh>().text = temp; if(checkTresure()) { isTresure=true; Vector2 pos=new Vector2( 9*3-1.5f, 4*3+1.5f); dropSprite3(door[1],pos.x,pos.y,"Tresure"); } } else if (state==99) { myItems="";showItems(); clearFloor(); floorNo=1; GameObject.Find("Status").GetComponent<TextMesh>().text = ""; GameObject.Find("Info").GetComponent<TextMesh>().text = "GAME OVER"; GameObject.Find("Info2").GetComponent<TextMesh>().text = "Hit Any Key"; state=1; MapRoot.SetActive(false); } }
void Update () { if (state==0) { clearFloor(); floorNo++; GameObject.Find("Status").GetComponent<TextMesh>().text = ""; GameObject.Find("Info").GetComponent<TextMesh>().text = " Floor "+(floorNo); GameObject.Find("Info2").GetComponent<TextMesh>().text = "Hit Any Key"; state=1; MapRoot.SetActive(false); } else if(state==1) { if( Input.anyKeyDown ) { newFloor(); GameObject.Find("Info").GetComponent<TextMesh>().text = ""; GameObject.Find("Info2").GetComponent<TextMesh>().text = ""; state=2; MapRoot.SetActive(true); } } else if (state==2) { timer--; string temp="Floor"+floorNo+" Hp"+hp+" Score"+score+" Timer"+timer+"\n\n\n\n"; GameObject.Find("Status").GetComponent<TextMesh>().text = temp; if(checkTresure()) { isTresure=true; Vector2 pos=new Vector2( 9*3-1.5f, 4*3+1.5f); dropSprite3(door[1],pos.x,pos.y,"Tresure"); } } else if (state==99) { myItems="";showItems(); clearFloor(); floorNo=1; GameObject.Find("Status").GetComponent<TextMesh>().text = ""; GameObject.Find("Info").GetComponent<TextMesh>().text = "GAME OVER"; GameObject.Find("Info2").GetComponent<TextMesh>().text = "Hit Any Key"; state=1; MapRoot.SetActive(false); } }

表示オプション

横に並べて表示:
変化行の前後のみ表示: