// Use this for initialization void Start() { var playerSettingRepository = new PlayerSettingRepository(); var playerSettingModel = playerSettingRepository.Get(0); var characterRepository = new CharacterRepository(); var characterModel = characterRepository.Get(playerSettingModel.CharacterID); if (characterModel != null) { var prefab = ResourceLoader.LoadCharacterSelectPrefab(characterModel.iconPath); var characterObject = Instantiate(prefab); characterObject.transform.position = new Vector3(0, 0.225f, 0); characterObject.transform.rotation = Quaternion.Euler(29.6f, 0, 0); characterObject.transform.localScale = Vector3.one * 0.2f; characterObject.transform.SetParent(showArea.transform, false); var animator = characterObject.GetComponent <Animator>(); animator.runtimeAnimatorController = controller[characterModel.ID]; } if (GameObject.Find(soundManager.name) == null && soundManager != null) { GameObject sound = Instantiate(soundManager); sound.name = soundManager.name; } }
public override void InitializeCell(CharacterCellView view, CharacterModel model) { view.UpdateView( ResourceLoader.LoadCharacterSelectPrefab(model.iconPath), model.Name, model.Description ); view.OnSelectCharacter.AddListener(() => { var playerSettingRepository = new PlayerSettingRepository(); var playerSettingModel = playerSettingRepository.Get(0); playerSettingModel.CharacterID = model.ID; playerSettingRepository.Set(0, playerSettingModel); SceneMoveManager.Instance.BackScene(); }); }
private void MoveBattleScene(Button button, QuestGroupModel questGroup, QuestModel quest) { if (button == null) { return; } button.onClick.AddListener(() => { var playerSettingPresenter = new PlayerSettingRepository(); var playerSettingModel = playerSettingPresenter.Get(0); // parameter var parameter = new InGameSceneParameter( new CharacterRepository().Get(playerSettingModel.CharacterID), questGroup, quest ); SceneMoveManager.Instance.MoveScene("InGame", parameter); }); }