You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
898 B
28 lines
898 B
using AX.MessageSystem; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
|
|
public class ArrivedPowerPanel : MonoBehaviour { |
|
public ButtonRecordByAC CloseButton; |
|
void Awake() |
|
{ |
|
MessageDispatcher.AddListener(FireInfoMessage.ArrivedForce.ToString(), OpenPanel); |
|
CloseButton = transform.Find("HeadTitleBG/CloseButton").GetComponent<ButtonRecordByAC>(); |
|
CloseButton.OutInterFaceButton = closeClick; |
|
gameObject.SetActive(false); |
|
} |
|
private void OnDestroy() |
|
{ |
|
MessageDispatcher.RemoveListener(FireInfoMessage.ArrivedForce.ToString(), OpenPanel); |
|
} |
|
private void closeClick() |
|
{ |
|
MessageDispatcher.SendMessage("CloseFireInfoPanel", (int)FireInfoMessage.ArrivedForce); |
|
} |
|
void OpenPanel(IMessage obj) |
|
{ |
|
var value = (bool)obj.Data; |
|
gameObject.SetActive(value); |
|
} |
|
}
|
|
|