public MonsterHead(string text, BILLBOARDTYPE type) { AssetCacheMgr.GetUIInstance("BattleBillboard.prefab", (prefab, guid, go) => { m_billboard = (GameObject)go; m_billboard.AddComponent<BattleBillboardAnim>(); }); if (m_billboard == null) { LoggerHelper.Error("No Prefab Can Find!"); return; } UILabel _lbl = m_billboard.transform.GetChild(0).GetComponentsInChildren<UILabel>(true)[0]; switch (type) { case BILLBOARDTYPE.BiggerRed: _lbl.color = new Color(1, 0, 0, 1); m_billboard.transform.localScale *= 1.2f; break; case BILLBOARDTYPE.NormalGreen: _lbl.color = new Color(0, 1, 0, 1); break; } _lbl.text = text; }
public MonsterHead(string text, BILLBOARDTYPE type) { AssetCacheMgr.GetUIInstance("BattleBillboard.prefab", (prefab, guid, go) => { m_billboard = (GameObject)go; m_billboard.AddComponent <BattleBillboardAnim>(); }); if (m_billboard == null) { LoggerHelper.Error("No Prefab Can Find!"); return; } UILabel _lbl = m_billboard.transform.GetChild(0).GetComponentsInChildren <UILabel>(true)[0]; switch (type) { case BILLBOARDTYPE.BiggerRed: _lbl.color = new Color(1, 0, 0, 1); m_billboard.transform.localScale *= 1.2f; break; case BILLBOARDTYPE.NormalGreen: _lbl.color = new Color(0, 1, 0, 1); break; } _lbl.text = text; }