void ShowTalk(TalkInfo info) { PlayerManager.Lock(); WillTool.GetChildInDepth <Text>("Name", transform).text = info.name; WillTool.GetChildInDepth <Text>("Content", transform).text = info.content; WillTool.GetChildInDepth <TypewriterEffect>("Content", transform).OnStart(); GameObject imageTarget = null; GameObject imageTarget1 = WillTool.GetChildInDepth("Image1", this.gameObject); GameObject imageTarget2 = WillTool.GetChildInDepth("Image2", this.gameObject); imageTarget1.SetActive(false); imageTarget2.SetActive(false); if (info.bShowLeft) { imageTarget = imageTarget1; } else { imageTarget = imageTarget2; } if (string.IsNullOrEmpty(info.imageSource)) { } else { imageTarget.SetActive(true); imageTarget.GetComponent <Image>().sprite = Resources.Load <Sprite>(info.imageSource); } }
public void ShowTalk(bool isShow) { if (!isShow) { if (this.showTalkGo != null) { showTalkGo.SetActive(false); } return; } GameObject go = showTalkGo; if (go == null) { go = Instantiate <GameObject>(Resources.Load <GameObject>("ShowTalk"), transform); this.showTalkGo = go; } this.showTalkGo.SetActive(true); go.transform.localPosition = this.showTalkOffset; go.transform.localEulerAngles = Vector3.zero; go.transform.localScale = Vector3.one * 2; WillTool.GetChildInDepth <SpriteRenderer>("Target", go.transform).sprite = Resources.Load <Sprite>(ShowTalkItem); }
private void ShowBlood() { for (int i = 1; i <= 10; i++) { if (i <= this.m_bloodNum) { WillTool.GetChildInDepth("Blood" + i, m_BloodRoot).SetActive(true); } else { WillTool.GetChildInDepth("Blood" + i, m_BloodRoot).SetActive(false); } } for (int i = 1; i <= 10; i++) { if (i <= Mathf.Abs(this.m_bloodNum)) { WillTool.GetChildInDepth("Blood" + i, m_BlackRoot).SetActive(true); } else { WillTool.GetChildInDepth("Blood" + i, m_BlackRoot).SetActive(false); } if (this.m_bloodNum < 0) { m_BloodRoot.SetActive(false); m_BlackRoot.SetActive(true); WillTool.GetChildInDepth("Blood" + i, m_BloodRoot).SetActive(false); } else { m_BloodRoot.SetActive(true); m_BlackRoot.SetActive(false); } } }
// Start is called before the first frame update void Start() { s_talkRoot = this; Typewriter = WillTool.GetChildInDepth <Text>("Content", transform).GetComponent <TypewriterEffect>(); FirtInit(); }