private void HidePlayer(DialogData.SpeakerPosition position) { switch (position) { case DialogData.SpeakerPosition.LEFT: { leftNameFrame.gameObject.SetActive(false); speakerLeftProfile.transform.SetAsFirstSibling(); iTween.ColorTo(speakerLeftProfile.gameObject, Color.grey, 0.7f); // speakerLeftProfile.color = Color.grey; speakerLeftName.gameObject.SetActive(false); speakerLeftText.gameObject.SetActive(false); } break; case DialogData.SpeakerPosition.RIGHT: { rightNameFrame.gameObject.SetActive(false); speakerRightProfile.transform.SetAsFirstSibling(); iTween.ColorTo(speakerRightProfile.gameObject, Color.grey, 0.7f); // speakerRightProfile.color = Color.grey; speakerRightName.gameObject.SetActive(false); speakerRightText.gameObject.SetActive(false); } break; } }
private void StartDialog(DialogData data) { currentPosition = data.position; switch (data.position) { case DialogData.SpeakerPosition.LEFT: { HidePlayer(DialogData.SpeakerPosition.RIGHT); leftNameFrame.gameObject.SetActive(true); speakerLeftText.gameObject.SetActive(true); speakerLeftText.text = data.message; speakerLeftName.gameObject.SetActive(true); if (data.speaker.Equals("주인공") == true) { speakerLeftName.text = PlayerPrefs.GetString(Constants.NickNameKey, "없음"); } else { speakerLeftName.text = data.speaker; } speakerLeftProfile.transform.SetAsLastSibling(); iTween.Stop(speakerLeftProfile.gameObject); speakerLeftProfile.color = Color.white; if (profiles.ContainsKey(data.speaker) == true) { speakerLeftProfile.gameObject.SetActive(true); speakerLeftProfile.sprite = profiles[data.speaker]; } else { //로드후 세팅 if (LoadCharacterSprite(data.filename, data.speaker) == true) { speakerLeftProfile.gameObject.SetActive(true); speakerLeftProfile.sprite = profiles[data.speaker]; } } } break; case DialogData.SpeakerPosition.RIGHT: { HidePlayer(DialogData.SpeakerPosition.LEFT); rightNameFrame.gameObject.SetActive(true); speakerRightText.gameObject.SetActive(true); speakerRightText.text = data.message; speakerRightName.gameObject.SetActive(true); if (data.speaker.Equals("주인공") == true) { speakerRightName.text = PlayerPrefs.GetString(Constants.NickNameKey, "없음"); } else { speakerRightName.text = data.speaker; } speakerRightProfile.transform.SetAsLastSibling(); iTween.Stop(speakerRightProfile.gameObject); speakerRightProfile.color = Color.white; if (profiles.ContainsKey(data.speaker) == true) { speakerRightProfile.gameObject.SetActive(true); speakerRightProfile.sprite = profiles[data.speaker]; } else { //로드후 세팅 if (LoadCharacterSprite(data.filename, data.speaker) == true) { speakerRightProfile.gameObject.SetActive(true); speakerRightProfile.sprite = profiles[data.speaker]; } } } break; } }