private void moveCursor(int axis) { switch (currentContent) { case MenuContents.INDEX: try { indexSelectView.moveTo(indexSelectView.getIndex() + axis); }catch { Debug.Log("there are no indexes"); } break; case MenuContents.ITEM: try { var item = itemSelectView.moveTo(itemSelectView.getIndex() + axis); inputItemView(item); }catch { Debug.Log("there are no items"); } break; case MenuContents.SKILL: try { var skill = skillSelectView.moveTo(skillSelectView.getIndex() + axis); inputSkillView(skill); }catch { Debug.Log("there are no skills"); } break; case MenuContents.STATUS: try { var character = characterSelectView.moveTo(characterSelectView.getIndex() + axis); inputCharacterStateView(character); }catch { Debug.Log("there are no characters in this party"); } break; case MenuContents.QUEST: try{ var quest = questSelectView.moveTo(questSelectView.getIndex() + axis); inputQuestView(quest); }catch { Debug.Log("there are no quests"); } break; } }
private void Update() { if (Input.GetKeyDown(KeyCode.DownArrow) || Input.GetKeyDown(KeyCode.UpArrow)) { int axis = getAxis(); selectView.moveTo(selectView.getIndex() + axis); } if (Input.GetKey(KeyCode.Return)) { title.loadWorldSelected(selectView.getElement()); Destroy(gameObject); } }
/// <summary> /// カーソルの移動移動 /// </summary> private void moveCursor() { int axis = 0; float rawAxis = Input.GetAxisRaw("Vertical"); if (rawAxis > 0) { axis = -1; } else if (rawAxis < 0) { axis = 1; } if (axis != 0) { switch (state) { case CharaMakeState.JOB: int index = jobSelectView.getIndex() + axis; Job job = jobSelectView.moveTo(index); jobView.printText(job); break; case CharaMakeState.HUMANITY: Humanity humanity = humanitySelectView.moveTo(humanitySelectView.getIndex() + axis); parameterView.printText(humanity.getName(), humanity.getDescription(), humanity.getFlavorText()); break; case CharaMakeState.IDENTITY: Identity identity = identitySelectView.moveTo(identitySelectView.getIndex() + axis); parameterView.printText(identity.getName(), identity.getDescription(), identity.getFlavorText()); break; case CharaMakeState.MISSION: IMissionBuilder mission = missionSelectView.moveTo(missionSelectView.getIndex() + axis); parameterView.printText(mission.getName(), mission.getDescription(), mission.getFlavorText()); break; } } }