protected override void OnOpen(object userData) { base.OnOpen(userData); m_Data = userData as BoardFormData; if (m_Data == null) { Log.Error("Open Board fail"); return; } SetTarget(m_Data.CacheTransform); m_Height = m_Data.Height + 0.3f; if (m_Data.ActorType == ActorType.Player) { m_Name.color = Color.green; m_HpBar.visible = false; } else if (m_Data.ActorType == ActorType.Monster) { m_Name.color = Color.red; m_HpBar.visible = true; } else { m_Name.color = Color.blue; m_HpBar.visible = false; } m_Name.text = GlobalTools.Format("Lv.{0} {1}", m_Data.Level, m_Data.Name); }
protected override void CreateBoard() { BoardFormData data = new BoardFormData { OwnerId = EntityId, ActorType = ActorType, CacheTransform = CachedTransform, Name = m_PlayerData.Name, Level = m_PlayerData.Level, Height = Height }; BoardFormManager.Instance.Create(data); }
protected virtual void CreateBoard() { BoardFormData data = new BoardFormData { OwnerId = EntityId, ActorType = ActorType, CacheTransform = CachedTransform, Name = m_ActorData.Name, Level = m_ActorData.Level, Height = Height }; BoardFormManager.Instance.Create(data); UpdateHealth(); }
public void Create(BoardFormData data) { if (data == null || data.OwnerId == 0) { return; } if (m_BoardForms.ContainsKey(data.OwnerId)) { Log.Error("Board is exit.Id:{0}", data.OwnerId); return; } int?serialId = GameEntry.UI.OpenUIForm(UIFormId.RoleBoardForm, data); if (!serialId.HasValue) { Log.Error("Open form fail."); return; } m_BoardForms.Add(data.OwnerId, serialId.Value); }