// ------------------------------------------------------------------------------- // OnEnable // ------------------------------------------------------------------------------- void OnEnable() { if (!targetName) { Debug.LogError("No targetName Pannel !"); return; } if (!targetHealthBar) { Debug.LogError("No healthBar Pannel !"); return; } if (!targetManaBar) { Debug.LogError("No manaBar Pannel !"); return; } if (!targetPannel) { Debug.LogError("Targeting Component: no UI Target Pannel !"); return; } targetPannel.SetActive(false); if (!targetButton) { Debug.LogError("No Target Button !"); return; } targetButton.onClick.SetListener(() => { if (targetPannel) { if (playerController) { playerController.onTargetButtonClicked(); } else { Debug.LogError("No targetingComponent !"); } } else { Debug.LogError("OnClick() - faild no goPanel"); } }); // BasicAttack.onClick.SetListener(() => // { // if (playerController) // { // playerController.onSkillClicked(); // } // else // { // Debug.LogError("No targetingComponent !"); // } // }); }