private void finishBattle() { var uniqueIds = joinedManager.Keys; foreach (long id in uniqueIds) { joinedManager [id].win(); joinedManager [id].finished(); } joinedManager.Clear(); this.expSum = 0; var fieldPositions = System.Enum.GetValues(typeof(FieldPosition)); foreach (FieldPosition pos in fieldPositions) { joinedCharacter [pos].Clear(); } isBattleing = false; BattleResultView view = MonoBehaviour.Instantiate(battleResultViewPrefab).GetComponent <BattleResultView>(); view.setExp(expSum); view.transform.SetParent(CanvasGetter.getCanvasElement().transform); view.transform.position = new Vector3(Screen.width / 2, Screen.height / 2); }
private ResultView inputResultView() { var resultView = MonoBehaviour.Instantiate(resultViewPrefab); resultView.transform.SetParent(CanvasGetter.getCanvasElement().transform); resultView.transform.position = new Vector3(Screen.width / 2, Screen.height / 2); return(resultView.GetComponent <ResultView>()); }
private void inputQuestView(IQuest quest) { if (questView == null) { questView = Instantiate(menuQuestViewPrefab, new Vector3(312, 384, 0), new Quaternion(0, 0, 0, 0)).GetComponent <MenuQuestView>(); questView.transform.SetParent(CanvasGetter.getCanvasElement().transform); } questView.printQuest(quest); }
/// <summary> /// アイテムビューにアイテムを表示させます /// </summary> private void inputItemView(IItem item) { if (itemView == null) { itemView = Instantiate(menuItemViewPrefab, new Vector3(312, 384, 0), new Quaternion(0, 0, 0, 0)).GetComponent <MenuItemView>(); itemView.transform.SetParent(CanvasGetter.getCanvasElement().transform); } itemView.setItem(item, party, this); }
private void inputBackWindow() { var window = Instantiate(menuBackWindowPrefab); window.transform.position = new Vector3(Screen.width / 2, Screen.height / 2); window.transform.SetParent(CanvasGetter.getCanvasElement().transform); window.GetComponent <BackWindow>().setState(this); deleteCursors(); }
/// <summary> /// 使うが選ばれた時の処理 /// </summary> public void useChose() { Vector3 windowPos = new Vector3(Screen.width / 2, Screen.height / 2, 0); MenuUseWindow useWindow = Instantiate(menuUseWindowPrefab, windowPos, new Quaternion(0, 0, 0, 0)).GetComponent <MenuUseWindow>(); useWindow.transform.SetParent(CanvasGetter.getCanvasElement().transform); useWindow.setState(this, item, party); menu.setIsWindowInputing(true); }
/// <summary> /// スキル選択時の処理 /// </summary> /// <param name="skill">選択されたスキル</param> private void inputSkillView(ISkill skill) { if (skillView == null) { skillView = Instantiate(menuSkillViewPrefab, new Vector3(312, 384, 0), new Quaternion(0, 0, 0, 0)).GetComponent <MenuSkillView>(); skillView.transform.SetParent(CanvasGetter.getCanvasElement().transform); } skillView.printSkill(skill); }
/// <summary> /// キャラクターが選ばれた時の処理 /// </summary> private void inputCharacterStateView(IPlayable character) { if (stateView == null) { GameObject viewObject = Instantiate(menuCharacterViewPrefab, new Vector3(312, 384, 0), new Quaternion(0, 0, 0, 0)); stateView = viewObject.GetComponent <MenuCharacterStateView>(); stateView.transform.SetParent(CanvasGetter.getCanvasElement().transform); } stateView.setCharacter(character); }
/// <summary> /// 新たにバトルを開始します /// </summary> public void startNewBattle() { field = new BattleField(new Vector3(500, 100, 500)); isBattleing = true; fieldKeeper.SetActive(false); SceneManager.LoadScene("BattleScene"); var button = MonoBehaviour.Instantiate(progressButtonPrefab, new Vector3(Screen.width - 100, Screen.height - 100), new Quaternion(0, 0, 0, 0)); button.transform.SetParent(CanvasGetter.getCanvasElement().transform); }
/// <summary> /// メッセージを画面に表示します /// </summary> /// <param name="massages">表示したいメッセージ</param> public void talk(List <string> massages) { if (!isTalking) { GameObject massageWindow = MonoBehaviour.Instantiate(massageWindowPrefab); massageWindow.transform.SetParent(CanvasGetter.getCanvasElement().transform); massageWindow.GetComponent <MassageWindow>().setMassageList(massages); isTalking = true; } }
/// <summary> /// 取引を開始します /// </summary> /// <param name="massages">表示するメッセージのリスト</param> /// <param name="startTradeIndex">取引開始のインデックス</param> /// <param name="goods">商品のリスト</param> /// <param name="player">取引に参加するプレイヤー</param> /// <param name="trader">取引に参加するIFriendlyキャラクター</param> public void trade(List <string> massages, string failMassage, int startTradeIndex, List <IItem> goods, Player player, IFriendly trader) { if (!isTalking) { GameObject massageWindow = MonoBehaviour.Instantiate(massageWindowPrefab); massageWindow.transform.SetParent(CanvasGetter.getCanvasElement().transform); massageWindow.GetComponent <MassageWindow>().setMassageList(massages, failMassage, startTradeIndex, goods, player, trader); isTalking = true; } }
public void loadWorldTop() { CanvasGetter.detachCanvasElement(); WorldCreatFlugHelper.getInstance().setIsLoad(true); WorldTop top = Instantiate(worldTopPrefab).GetComponent <WorldTop>(); top.setState(WorldCreatFlugHelper.getInstance().getLoadWorldId(), this); top.transform.SetParent(CanvasGetter.getCanvasElement().transform); top.transform.position = new Vector3(Screen.width / 2, Screen.height / 2); }
/// <summary> /// 結果画面を表示させます /// </summary> private void inputResult() { Vector3 viewPos = new Vector3(Screen.width / 2, Screen.height / 2); CharaMakeResultView resultView = Instantiate(resultViewPrefab, viewPos, new Quaternion(0, 0, 0, 0)).GetComponent <CharaMakeResultView>(); Destroy(selectView.gameObject); resultView.transform.SetParent(CanvasGetter.getCanvasElement().transform); resultView.setParameters(choseJob, choseHumanity, choseIdentities, choseMission, this); state = CharaMakeState.RESULT; }
/// <summary> /// データを設定します /// </summary> /// <param name="level">世界のレベル</param> public void setDatas(int level) { this.jobs = JobMasterManager.getInstance().getJobsFromLevel(level); this.humanities = HumanityMasterManager.getInstance().getHumanitiesFromLevel(level); this.identities = IdentityMasterManager.getInstance().getIdentitiesFromLevel(level); Vector3 viewPos = new Vector3(200, Screen.height / 2); selectView = Instantiate(selectViewPrefab, viewPos, new Quaternion(0, 0, 0, 0)).GetComponent <SelectViewContainer>(); Debug.Log(CanvasGetter.getCanvasElement().transform); selectView.transform.SetParent(CanvasGetter.getCanvasElement().transform); inputJob(); }
public void loadWorldSelected(int id) { foreach (var compornent in titleCompornents) { compornent.SetActive(false); } WorldCreatFlugHelper.getInstance().setIsLoad(true); WorldCreatFlugHelper.getInstance().setLoadWorldId(id); WorldTop top = Instantiate(worldTopPrefab).GetComponent <WorldTop>(); top.setState(id, this); top.transform.SetParent(CanvasGetter.getCanvasElement().transform); top.transform.position = new Vector3(Screen.width / 2, Screen.height / 2); }
public void act() { bonusKeeper.advanceLimit(); if (!Menu.getIsDisplaying() && !TalkManager.getInstance().getIsTalking()) { if (Input.GetKeyDown(KeyCode.E)) { GameObject menuObject = MonoBehaviour.Instantiate(menuPrefab, new Vector3(874f, 384f, 0f), new Quaternion(0, 0, 0, 0)); Menu menu = menuObject.GetComponent <Menu>(); menu.transform.SetParent(CanvasGetter.getCanvasElement().transform); menu.setState(this, party); } else if (Input.GetKeyDown(KeyCode.Mouse0) && !TalkManager.getInstance().getIsTalking()) { searchFront(); } } }
/// <summary> /// 職業選択画面を表示させます /// </summary> private void inputJob() { List <JobNode> jobNodes = new List <JobNode>(); foreach (Job job in jobs) { JobNode jobNode = Instantiate(jobNodePrefab).GetComponent <JobNode>(); jobNode.setJob(job); jobNodes.Add(jobNode); } jobSelectView = selectView.creatSelectView <JobNode, Job>(jobNodes); Vector3 viewPos = new Vector3(712f, Screen.height / 2); this.jobView = Instantiate(jobViewPrefab, viewPos, new Quaternion(0, 0, 0, 0)).GetComponent <CharaMakeJobView>(); jobView.printText(jobSelectView.getElement()); jobView.transform.SetParent(CanvasGetter.getCanvasElement().transform); state = CharaMakeState.JOB; }
/// <summary> /// 人間性選択画面を表示させます /// </summary> private void inputHumanity() { List <HumanityNode> humanityNodes = new List <HumanityNode>(); foreach (Humanity humanity in humanities) { HumanityNode humanityNode = Instantiate(humanityNodePrefab).GetComponent <HumanityNode>(); humanityNode.setHumanity(humanity); humanityNodes.Add(humanityNode); } humanitySelectView = selectView.creatSelectView <HumanityNode, Humanity>(humanityNodes); Vector3 viewPos = new Vector3(712f, Screen.height / 2); this.parameterView = Instantiate(parameterViewPrefab, viewPos, new Quaternion(0, 0, 0, 0)).GetComponent <CharaMakeParameterView>(); parameterView.transform.SetParent(CanvasGetter.getCanvasElement().transform); var printHumanity = humanitySelectView.getElement(); parameterView.printText(printHumanity.getName(), printHumanity.getDescription(), printHumanity.getFlavorText()); state = CharaMakeState.HUMANITY; }
private bool massagePrinting = false; /// <summary> /// massageListに対応するフラグ /// printingMassageの一つ先を示す /// </summary> private int massageIndex = 0;