using System; using Framework; using Gameplay; using PhxhSDK; using TMPro; using UnityEngine; using UnityEngine.UI; public class UIHeadItemNodeLogic : UINode { protected uint uid; protected UIHeadInfo uiheadInfo; public GameObject root; public Image imgBg; public Image imgTeamProBg; public Image imgTeamProName; public Image imgHead; public Image imgPro; public Image imgMorale; public Image imgMoraleFill; public Image imgStateInBattle; public TMP_Text txtLevel; public Image imgRarity; public TMP_Text txtName; public Image imgSelect; public Button buttonHead; public TMP_Text txtLeadership; public UIButtonLongPress buttonLongPress; public GameObject contentFight; public GameObject GoPro; public GameObject CostLeadershipGo; public TMP_Text txtLevelForEditTeam; public GameObject LevelGoForEditTeam; public ButtonUpDrag buttonUpDrag; protected GameObject _debugContent; protected TMP_Text _debugRoleID; private void Awake() { OnAwake(); EventManager.Instance.Register(EventManager.EventName.DebugHeadRoleID, _OnDebugRoleID); } // Start is called before the first frame update void Start() { } private void OnDestroy() { EventManager.Instance.Unregister(EventManager.EventName.DebugHeadRoleID, _OnDebugRoleID); base.OnRelease(); } public override void OnAwake() { //base.OnAwake(); _GetComponents(); } public override void OnStart() { base.OnStart(); _GetComponents(); } public override void SetData(object data) { uiheadInfo = data as UIHeadInfo; if (uiheadInfo == null) { DebugUtil.LogError($"{name} SetData data is null!!! "); return; } uid = uiheadInfo.Uid; } private void _GetComponents() { root = gameObject; var uiHeadNode = root.GetComponent(); imgBg = _GetComponent("Content/ImageBg"); imgTeamProBg = _GetComponent("Content/ImageJob"); imgTeamProName = _GetComponent("Content/ImageJob/ImageName"); imgHead = _GetComponent("Content/ImageHead"); imgPro = _GetComponent("Content/ImageProfession/Image_Job"); imgMorale = _GetComponent("Content/FightContent/ImageMoraleStatusBar"); imgStateInBattle = _GetComponent("Content/FightContent/ImageState"); imgMoraleFill = _GetComponent("Content/FightContent/ImageMoraleStatusBar/ImageBattleMorale"); imgRarity = _GetComponent("Content/ImageRarity"); txtLevel = _GetComponent("Content/TextLevel"); txtName = _GetComponent("Content/TextName"); imgSelect = _GetComponent("Content/ImageSelected"); GoPro = _FindObj("Content/ImageProfession"); txtLeadership = _GetComponent("Content/Image_CostBg/Text_CommandCost"); if (uiHeadNode) { buttonHead = uiHeadNode.buttonHead; } if (!buttonHead) { buttonHead = _GetComponent