protected void OnEvent(EventVo evt) { ClientTimer.Instance.DelayCall( () => { SendMessage(new Message(MessageConst.CMD_STORY_ON_EVENT, Message.MessageReciverType.DEFAULT, evt.EventType, evt.EventId, _isAutoPlay)); _isAutoPlay = false; }, 0.5f); }
public EventVo Clone() { EventVo vo = new EventVo(); vo.EventType = EventType; vo.EventId = EventId; vo.SelectionIds = SelectionIds; vo.SelectionContents = SelectionContents; vo.SelectionTypes = SelectionTypes; return(vo); }
protected void CreateSelection(EventVo eventVo) { if (_dialogSelection == null) { GameObject go = InstantiatePrefab("Story/Prefabs/DialogSelection"); go.name = "DialogSelection"; go.transform.SetParent(transform, false); _dialogSelection = go.GetComponent <DialogSelection>(); go.transform.SetSiblingIndex(transform.childCount - 2); } RectTransform rect = _dialogSelection.gameObject.GetComponent <RectTransform>(); rect.anchoredPosition = new Vector2(0, 227 - _offsetY); _dialogSelection.SetData(eventVo, OnSelected); _dialogSelection.gameObject.Show(); _hasSelection = true; }
public void SetData(EventVo eventVo, Action <EventType, string> callback) { _eventVo = eventVo; _callback = callback; _selection1.text = eventVo.SelectionContents[0]; _selection2.text = eventVo.SelectionContents[1]; if (eventVo.SelectionContents.Count == 3) { _selection3.text = eventVo.SelectionContents[2]; _selection3.transform.parent.gameObject.Show(); GetComponent <VerticalLayoutGroup>().spacing = 50; } else { _selection3.transform.parent.gameObject.Hide(); GetComponent <VerticalLayoutGroup>().spacing = 68; } }