public override void OnActive(object data) { base.OnActive(data); string pictureName = data as string; stagePicture.Setup(pictureName, false); stagePicture.OnCorrect(); }
void ContinueLoadLevel() { #if SQLITE4UNITY pictureData = GameDatabase.Service.GetPictureData(pictureName); #else PictureData pictureData = DatabaseSimpleSQL.Instance.GetPictureData(id); #endif //Check PictureData if (pictureData == null) { //if no pictureData exist, ask if user want to add new picture data Debug.LogError($"PictureData not found {pictureName}"); Manager.Add(PopupController.POPUP_SCENE_NAME, new PopupData(PopupType.YES_NO, "No PictureData's name match. Do you want to insert new PictureData?", () => { #if SQLITE4UNITY GameDatabase.Service.AddPictureData(pictureName); LoadLevel(pictureName); #else throw new System.NotImplementedException(); #endif } )); } else { stagePictureControl.Setup(pictureName, true); stageAnswerPictureControl.Setup(pictureName, true); stageAnswerPictureControl.OnCorrect(); levelNameInput.text = pictureName; gestureRecorder.Setup(pictureName); CheckSetupDrawDotV4(); drawBoundMaker.Setup(pictureData); foreach (var item in btnEnableAfterOpen) { item.interactable = true; } toggleDrawBtn.SetInteractable(true); toggleBoxUseV4.isOn = pictureData.use_v4; toggleBoxUseV4.onValueChanged.AddListener(ToggleUseV4); boundSizeInput.text = pictureData.bound_width.ToString(); if (pictureData.score_required > 0f) { scoreRequiredInput.text = pictureData.score_required.ToString(); } } }