public void ShowChatBottom(string text, bool isShowBtNext, DownLineCompleteCallback callback) { initChatBottom(); _te.SetUp(text, _chatBottom.GetChild("next"), _chatBottom, callback, isShowBtNext); float posFrameLeft = (int)((_popUp.width - _chatBottom.width) / 2); float posFrameBot = _popUp.height - _chatBottom.height - 10; _chatBottom.SetXY(posFrameLeft, posFrameBot); }
public void SetUp(string text, GObject showNext, GObject clickNext, DownLineCompleteCallback onComplete, bool isShowBtNext) { _showNext = showNext; if (isShowBtNext) { // _clickNext = clickNext; _onComplete = (TypingEffectByLine ty) => { this.ShowNext(() => { onComplete(ty); }); }; } else { _onComplete = onComplete; } _clickNext = clickNext; _lineIndex = 0; if (_showNext != null) { _showNext.visible = false; } _containerDownline.x = _rectRaw.x; _containerDownline.y = _rectRaw.y; _containerDownline.width = _rectRaw.width; _textField.autoSize = AutoSizeType.Height; if (!string.IsNullOrEmpty(text)) { _textField.text = text; } _textField.xy = Vector2.zero; _containerDownline.height = _textField.height; _containerDownline.clipRect = new Rect(0, 0, _rectRaw.width, _rectRaw.height); base.Start(); if (Timers.inst.Exists(_printText)) { Timers.inst.Remove(_printText); } Timers.inst.Add(0.050f, 0, _printText); _gContainer.onRemovedFromStage.Add(() => { if (Timers.inst.Exists(_printText)) { Timers.inst.Remove(_printText); } }); }
public void ShowChatBottomWithArrow(GameObject objListener, GameObject objTalker, string text, DownLineCompleteCallback callback) { initChatBottom(); _te.SetUp(text, _chatBottom.GetChild("next"), _chatBottom, callback, true); float posFrameLeft = (int)((_popUp.width - _chatBottom.width) / 2); float posFrameRight = posFrameLeft; float posFrameTop = 10; float posFrameBot = _popUp.height - _chatBottom.height - 10; AddArrowTalker(objListener, objTalker, _chatBottom, posFrameTop, posFrameBot, posFrameLeft, posFrameRight); }