public void AddTips(string content) { GameObject tipsObj = ResourceMgr.Instance.CreateGameObject("PanelTips", true); ViewMgr.Instance.SetLayer(tipsObj, LayerType.Tips); Vector3 originPos = Vector3.zero; if (LastTips != null) { float uiHigh = LastTips.transform.Find("TipsSprite").GetComponent <RectTransform>().sizeDelta.y; if (LastTips.transform.localPosition.y < uiHigh) { originPos = LastTips.transform.localPosition - new Vector3(0, uiHigh * 1.2f, 0); //Debug.Log(originPos + "===" + uiHigh * 2); //Debug.Log(tipsObj.transform.localPosition); } } tipsObj.transform.localPosition = originPos; tipsObj.transform.localScale = Vector3.one; tipsObj.transform.localEulerAngles = Vector3.zero; TweenPosition tp = tipsObj.GetComponent <TweenPosition>(); tp.from = originPos; TipsView tv = tipsObj.GetComponent <TipsView>(); tv.StartTips(content); LastTips = tipsObj; }
private void InitGui() { rootRect = UiCommon.UIManager.UIRoot.GetComponent <Canvas>().GetComponent <RectTransform>(); AView = new TipsView(_viewModel.subrootA); BView = new TipsView(_viewModel.subrootB); C4View = new TipsView(_viewModel.subrootC4); AView.InitAB(); BView.InitAB(); C4View.InitC4(); }
override public void SetTips(TipsModel model) { m_tipsModel = model; TipsView.Attach(m_TipsRoot).SetModel(m_tipsModel); }
public static void CreateTips(string tip) { TipsView tipsView = (TipsView)CreateView(new TipsController()); tipsView.Tips(tip); }