private void InputDoneCallback(WaveVR_IMEManagerWrapper.InputResult results) { Log.d(LOG_TAG, "inputDoneCallback:" + results.GetContent()); mInputContent = results.GetContent(); // Note: directly update input field text will exception // use LastUpdate to update Input field text }
private void InputDoneCallback(WaveVR_IMEManagerWrapper.InputResult results) { PrintInfoLog("inputDoneCallback:" + results.GetContent()); string content = results.GetContent(); if (content == null) { return; } int data = int.Parse(content); switch (mCurSelInput) { case 0: // "Yaw": case 1: // "Pitch": case 2: // "Roll": if (data > 360 || data < -360) { PrintWarningLog("invalid degree."); return; } mConfEuler[mCurSelInput] = data; Text txt = mEulers[mCurSelInput].GetComponentInChildren <Text>(); string name = txt.text; string[] strings = name.Split(new char[2] { '(', ')' }); if (strings.Length == 3) { txt.text = strings[0] + "(" + mConfEuler[mCurSelInput].ToString() + ")" + strings[2]; } break; case 3: // "XP": case 4: // "YP": case 5: // "ZP": mConfPos[mCurSelInput - 3] = data; txt = mPos[mCurSelInput - 3].GetComponentInChildren <Text>(); name = txt.text; strings = name.Split(new char[2] { '(', ')' }); if (strings.Length == 3) { txt.text = strings[0] + "(" + mConfPos[mCurSelInput - 3].ToString() + ")" + strings[2]; } break; } //update Action1 & Action2 int action = (int)ActionType.ActionType_2; if (mCurSelInput < 3) { action = (int)ActionType.ActionType_1; } Text text = mActions[action].GetComponentInChildren <Text>(); string str = text.text; if ((int)ActionType.ActionType_1 == action) { string[] strings = str.Split(new char[2] { '(', ')' }); str = strings[0] + "(" + "Yaw=" + mConfEuler[0] + " Pitch=" + mConfEuler[1] + " Roll=" + mConfEuler[2] + ")"; } if ((int)ActionType.ActionType_2 == action) { string[] strings = str.Split(new char[2] { '(', ')' }); str = strings[0] + "(" + "X=" + mConfPos[0] + " Y=" + mConfPos[1] + " Z=" + mConfPos[2] + ")"; } text.text = str; // Note: directly update input field text will exception // use LastUpdate to update Input field text }