private void MapReset() { { var button = GameObject.Find("StartButton").GetComponent <Button>(); var clickedEvent = new Button.ButtonClickedEvent(); clickedEvent.AddListener(() => { MapStart(); }); button.onClick = clickedEvent; var image = GameObject.Find("StartButton").GetComponent <Image>(); image.color = Color.blue; var text = GameObject.Find("StartButton").GetComponentInChildren <Text>(); text.text = "START"; text.color = Color.white; } { var button = GameObject.Find("ExitButton").GetComponent <Button>(); var clickedEvent = new Button.ButtonClickedEvent(); clickedEvent.AddListener(() => { SceneManager.LoadSceneAsync(TitleStart.DefineScene[TitleStart.Scene.TITLE], LoadSceneMode.Single); }); button.onClick = clickedEvent; } _selectActionButtonScript = GameObject.Find("SelectActionButton").GetComponent <SelectActionButtonScript>(); _selectActionButtonScript.OnEditStart(); _selectActionButtonScript.Callback = GetSelectActionButtonEvent; _map2d = GameObject.Find("Map2d").GetComponent <Map2dStart>(); _map2d.SetMapData(MapDatabase.LoadMapDataByStageId(_stageId)); current = State.Edit; }
private void MapStart() { { var button = GameObject.Find("StartButton").GetComponent <Button>(); var clickedEvent = new Button.ButtonClickedEvent(); clickedEvent.AddListener(() => { MapReset(); }); button.onClick = clickedEvent; var image = GameObject.Find("StartButton").GetComponent <Image>(); image.color = Color.red; var text = GameObject.Find("StartButton").GetComponentInChildren <Text>(); text.text = "RETRY"; text.color = Color.white; } { var button = GameObject.Find("ExitButton").GetComponent <Button>(); var clickedEvent = new Button.ButtonClickedEvent(); clickedEvent.AddListener(() => { SceneManager.LoadSceneAsync(TitleStart.DefineScene[TitleStart.Scene.TITLE], LoadSceneMode.Single); }); button.onClick = clickedEvent; } _selectActionButtonScript = GameObject.Find("SelectActionButton").GetComponent <SelectActionButtonScript>(); _selectActionButtonScript.OnPlayStart(); _map2d = GameObject.Find("Map2d").GetComponent <Map2dStart>(); _map2d.SetMapData(MapDatabase.LoadMapDataByStageId(_stageId)); _map2d.PlayStart(_algorithmList.Select((id => _hashList[id])).ToList()); current = State.Play; }