public override void CloseHUD(UIHUD hud) { switch (hud) { case UIHUD.InGame_Normal: NormalHUD.SetActive(false); break; case UIHUD.InGame_Battle: BattleHUD.SetActive(false); break; } }
void TestHUD() { //准备数据 StructUIHUD data = new StructUIHUD(); data.ActorName = "骷髅弓箭手"; data.FollowObject = gameObject; data.CurHP = 10; data.MaxHP = 10; UIHUD uihud = UIHUD.Create(data, transform); //监听事件 OnHPChangeEvent += uihud.OnEventHPChange; OnDeadEvent += uihud.OnEventActorDie; OnPlaySkill += uihud.OnEventActorPlaySkill; }
void Awake() { instance = this; uiHUD = gameObject.GetComponent <UIHUD>(); uiOverlay = gameObject.GetComponent <UIOverlay>(); uiAbility = gameObject.GetComponent <UIAbilityButtons>(); uiPerkMenu = gameObject.GetComponent <UIPerkMenu>(); uiGameOver = gameObject.GetComponent <UIGameOver>(); uiUnitPlacement = gameObject.GetComponent <UIUnitPlacement>(); //uiHUD.enabled=false; uiOverlay.enabled = false; //uiAbility.enabled=false; uiGameOver.enabled = false; uiUnitPlacement.enabled = false; colorH = new Color(1f, .6f, 0f, 1f); colorN = new Color(1f, .85f, .75f, 1f); texBar = Resources.Load("Textures/Bar", typeof(Texture)) as Texture; }
void Awake(){ instance=this; uiHUD=gameObject.GetComponent<UIHUD>(); uiOverlay=gameObject.GetComponent<UIOverlay>(); uiAbility=gameObject.GetComponent<UIAbilityButtons>(); uiPerkMenu=gameObject.GetComponent<UIPerkMenu>(); uiGameOver=gameObject.GetComponent<UIGameOver>(); uiUnitPlacement=gameObject.GetComponent<UIUnitPlacement>(); //uiHUD.enabled=false; uiOverlay.enabled=false; //uiAbility.enabled=false; uiGameOver.enabled=false; uiUnitPlacement.enabled=false; colorH=new Color(1f, .6f, 0f, 1f); colorN=new Color(1f, .85f, .75f, 1f); texBar=Resources.Load("Textures/Bar", typeof(Texture)) as Texture; }
public virtual void CloseHUD(UIHUD hud) { }
public virtual void ShowHUD(UIHUD hud) { }
private void Start() { _uiHUD = UIManager.Instance.HUDPanel; }