private void UpdatePhotoIdList(ChatPanelConfigFile configFile) { if (m_photoIdList.Count != configFile.photoSpriteList.Count + 1) { m_photoIdList.Clear(); m_photoIdStringList.Clear(); m_photoIdList.Add(-1); m_photoIdStringList.Add("Null"); for (int i = 0; i < configFile.photoSpriteList.Count; i++) { m_photoIdList.Add(i); m_photoIdStringList.Add(i.ToString()); } } }
private void ScrollCellContent(object info) { ChatElementInfo chatElementInfo = (ChatElementInfo)info; m_configFile = chatElementInfo.configFile; if (m_configFile == null) { Debug.LogError("Null Config File"); return; } int photoId = chatElementInfo.photoId; if (photoId >= 0 && photoId < m_configFile.photoSpriteList.Count) { m_photoImage.sprite = m_configFile.photoSpriteList[photoId]; m_photoImage.color = Color.white; } else { m_photoImage.sprite = null; m_photoImage.color = chatElementInfo.left ? Color.red : Color.green; } m_textWidth = m_configFile.width; m_photoSize = m_configFile.photoSize; m_bornTime = chatElementInfo.bornTime; text.text = chatElementInfo.text; if (chatElementInfo.left) { m_horizontalLayoutGroup.childAlignment = TextAnchor.UpperLeft; photo.transform.SetSiblingIndex(0); backGround.sprite = m_configFile.youBallon; text.rectTransform.anchoredPosition = new Vector2(-14, -10); } else { m_horizontalLayoutGroup.childAlignment = TextAnchor.UpperRight; backGround.transform.SetSiblingIndex(0); backGround.sprite = m_configFile.iBallon; text.rectTransform.anchoredPosition = new Vector2(-25, -10); } UpdateLayout(); }
public override void Action(int instanceId, string pathName, string resourceFile) { ChatPanelConfigFile profile = ConfigFileFactory.CreateChatPanelConfigFileAtPath(pathName); ProjectWindowUtil.ShowCreatedAsset(profile); }