private void JumpFont(JumpFontData data) { GameObject tempGO = BaseGlobal.GRMgr.UI.Get(data.Prefab); if (tempGO != null) { var temp = JumpHUDView.JumpText(tempGO, SelfBaseUnit, data.Text); temp.Color = data.Color; temp.InputOffset = JumpOffset; temp.SetFollowObj(GetNode(temp.NodeType)); } }
//创建临时性的HUDItem public void SpawnTempHUD <THUD>(string prefab, ref THUD hud) where THUD : UHUDItem { if (prefab.IsInv()) { return; } var newPrefab = hud; newPrefab?.DoDestroy(0.01f); GameObject tempGO = BaseGlobal.GRMgr.UI.Get(prefab); if (tempGO != null) { hud = JumpHUDView.Jump(tempGO, SelfBaseUnit) as THUD; if (hud == null) { return; } hud.SetFollowObj(GetNode(hud.NodeType)); return; } }