void SelectTextNumber() { if (m_eTextStateCur == TEXT_STATE.TEXT_STATE_1) { m_eTextStateCur = TEXT_STATE.TEXT_STATE_2; labelChatText = labelChatText2; m_EmotionRoot = m_EmotionRoot2; m_LinkRoot = m_LinkRoot2; if (m_Text2.gameObject.transform.localPosition == m_TextReadyPos) { m_ChangeText = true; } m_EmotionRoot2.transform.localPosition = Vector3.zero; m_LinkRoot2.transform.localPosition = Vector3.zero; return; } else if (m_eTextStateCur == TEXT_STATE.TEXT_STATE_2) { m_eTextStateCur = TEXT_STATE.TEXT_STATE_1; labelChatText = labelChatText1; m_EmotionRoot = m_EmotionRoot1; m_LinkRoot = m_LinkRoot1; if (m_Text1.gameObject.transform.localPosition == m_TextReadyPos) { m_ChangeText = true; } m_EmotionRoot1.transform.localPosition = Vector3.zero; m_LinkRoot1.transform.localPosition = Vector3.zero; return; } }
/// <summary> /// このフレーム、テキストがマウスによってどのような状態にあるか確認します。 /// またマウスが乗っているとき、マウスによってクリックされた時それぞれのイベントを返します。 /// </summary> /// <param name="mouseState">マウスの状態情報</param> public void txtUpdate(MouseState mouseState) { Vector2 stringSize, mousePos; stringSize = GetStateFont().MeasureString(txt); mousePos.X = mouseState.X - pos.X; mousePos.Y = mouseState.Y - pos.Y; if (mousePos.X < 0 || mousePos.X > stringSize.X) { state = TEXT_STATE.DEFAULT; return; } if (mousePos.Y < 0 || mousePos.Y > stringSize.Y) { state = TEXT_STATE.DEFAULT; return; } if (mouseState.LeftButton == ButtonState.Pressed) { txtClickedEvent(); state = TEXT_STATE.MOUSE_CLICK; } else { txtMouseOnEvent(); state = TEXT_STATE.MOUSE_ON; } return; }
void ClearData() { if (m_LoudSpeakerWindow != null) { m_LoudSpeakerWindow.SetActive(false); } if (m_LoudSpeakerInput != null) { m_LoudSpeakerInput.value = ""; } if (m_NumLabel != null) { m_NumLabel.text = "1"; } if (m_EmotionWindow != null) { m_EmotionWindow.SetActive(false); } if (m_TitleLabel != null) { m_TitleLabel.text = ""; } if (m_Text1 != null) { m_Text1.gameObject.transform.localPosition = m_TextReadyPos; } if (labelChatText1 != null) { labelChatText1.text = ""; } if (m_LinkRoot1 != null) { Utils.CleanGrid(m_LinkRoot1); } if (m_EmotionRoot1 != null) { Utils.CleanGrid(m_EmotionRoot1); } if (m_EmotionRoot1 != null) { m_EmotionRoot1.transform.localPosition = Vector3.zero; } if (m_LinkRoot1 != null) { m_LinkRoot1.transform.localPosition = Vector3.zero; } if (m_Text2 != null) { m_Text2.gameObject.transform.localPosition = m_TextShowPos; } if (labelChatText2 != null) { labelChatText2.text = ""; } if (m_LinkRoot2 != null) { Utils.CleanGrid(m_LinkRoot2); } if (m_EmotionRoot2 != null) { Utils.CleanGrid(m_EmotionRoot2); } if (m_EmotionRoot2 != null) { m_EmotionRoot2.transform.localPosition = Vector3.zero; } if (m_LinkRoot2 != null) { m_LinkRoot2.transform.localPosition = Vector3.zero; } m_eTextStateCur = TEXT_STATE.TEXT_STATE_2; m_ChangeText = false; m_LoudSpeakerNum = 1; ClearLinkBuffer(); }