private void PressDown(GameObject go, Vector2 delta) { if (!m_tips) { return; } if (0 != m_item_id) { Vector2 screenPoint2 = RectTransformUtility.WorldToScreenPoint(CameraManager.Instance.UICamera, this.Widget.position); int address_count = ConfProp.Get(m_item_id).address.Length; ToolTipsData data = new ToolTipsData() { ItemID = m_item_id, CurCount = Num, MaxCount = 0, ScreenPos = screenPoint2 - new Vector2(ToolTipsView.C_WIDTH * 0.5f + m_offset.x /* - this.Widget.sizeDelta.x * 0.5f*/, -10.0f * address_count + m_offset.y), }; FrameMgr.OpenUIParams ui_data = new FrameMgr.OpenUIParams(UIDefine.UI_TOOL_TIPS) { Param = data, }; EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(ui_data); } }
public override void OnShow(object param) { base.OnShow(param); EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.sencond_pop.ToString()); if (null != param) { ToolTipsData data = param as ToolTipsData; m_view.Refresh(data.ItemID, data.CurCount, data.MaxCount); Vector2 tip_pos; RectTransformUtility.ScreenPointToLocalPointInRectangle(m_root.Widget, data.ScreenPos, CameraManager.Instance.UICamera, out tip_pos); m_view.Widget.anchoredPosition = tip_pos; m_view.Visible = true; } }
public static void ShowPropTips(long prop_id, int prop_num_, Vector3 ui_world_pos, Vector2 m_offset) { Vector2 screenPoint2 = RectTransformUtility.WorldToScreenPoint(CameraManager.Instance.UICamera, ui_world_pos); int address_count = ConfProp.Get(prop_id).address.Length; ToolTipsData data = new ToolTipsData() { ItemID = prop_id, CurCount = prop_num_, MaxCount = 0, ScreenPos = screenPoint2 - new Vector2(ToolTipsView.C_WIDTH * 0.5f + m_offset.x /* - this.Widget.sizeDelta.x * 0.5f*/, -10.0f * address_count + m_offset.y), }; FrameMgr.OpenUIParams ui_data = new FrameMgr.OpenUIParams(UIDefine.UI_TOOL_TIPS) { Param = data, }; EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(ui_data); }