public void SetHUD(eHUDType eType, string text, Vector3 pos) { UIHUD hud = m_hudList[(int)eType]; pos += Vector3.up * 10; hud.Add(text, pos); }
public void SetHud(Transform head, string str, eHUDType type, Vector3 offsetPos) { if (head == null) { return; } SetHUD(head, type, str); }
public void SetHUD(eHUDType type, string text, CCreature cc) { if (cc == null || cc.m_vCreature == null) { return; } VBase vObj = cc.m_vCreature; Vector3 pos = vObj.GetEnt().GetPos() + Vector3.up * vObj.m_baseInfo.m_headHeight; m_ui.SetHUD(type, text, GUIManager.GetUIPos(pos)); }
public void SetHUD(Transform head, eHUDType eType, string text) { Transform item = head.FindChild("hud_" + (int)eType); if (null == item) { item = (GameObject.Instantiate(m_hudList[(int)eType].gameObject)).GetComponent <RectTransform>(); item.gameObject.SetActiveNew(true); item.SetParent(head); item.name = "hud_" + (int)eType; switch (eType) { case eHUDType.FIGHT_ADDBLOOD: item.localPosition = new Vector3(50, -50); break; case eHUDType.FIGHT_CRIT: item.localPosition = new Vector3(0, 0); break; case eHUDType.FIGHT_EXP: item.localPosition = new Vector3(0, -50f); break; case eHUDType.FIGHT_BUFF: item.localPosition = new Vector3(0, 0); break; case eHUDType.FIGHT_BUFF_1: item.localPosition = new Vector3(0, 0); break; default: item.localPosition = new Vector3(0, -100f); break; } item.localRotation = Quaternion.identity; item.localScale = Vector3.one; } if (eType == eHUDType.FIGHT_EXP) { int x = UnityEngine.Random.Range(0, 50); int y = UnityEngine.Random.Range(0, 50); Vector2 randomPos = new Vector2(x, y); item.GetComponent <UIHUD>().Add(text, randomPos); } else { item.GetComponent <UIHUD>().Add(text, Vector2.zero); } }
public void UpdateUI_ShowHpHUD(CCreature target, int hitVal, bool bCrit = false) { eHUDType type = eHUDType.NONE; if (hitVal < 0) { if (bCrit) { type = eHUDType.FIGHT_CRIT; } else { if (target.IsMaster()) { type = eHUDType.FIGHT_SELFHARM; } else { type = eHUDType.FIGHT_HARM; } } } else { type = eHUDType.FIGHT_ADDBLOOD; } HudModule hud = (HudModule)LayoutMgr.Inst.GetLogicModule(LogicModuleIndex.eLM_PanelHud); hud.SetVisible(true); hud.SetHUD(type, hitVal.ToString(), target); return; if (target.m_vCreature == null) { return; } CmdUIHead cmd = new CmdUIHead(); cmd.type = 4; cmd.hudType = type; cmd.hudText = hitVal.ToString(); target.m_vCreature.PushCommand(cmd); }
public void SetHud(string text, eHUDType type) { head.m_uiHead.SetHud(m_headObj, text, type, m_hudPos); }