public override void SetTarget(Actor target) { if (_abilitiable != null) { _abilitiable.AbilitiesChanged -= OnAbilitiesChanged; } _go = target; _abilitiable = _go != null?_go.GetModule <IAbilitiable>() : null; UpdatePanels(); if (_abilitiable != null) { _abilitiable.AbilitiesChanged += OnAbilitiesChanged; } }
private void Select(GameObject go) { _actor = go.GetComponent <Actor>(); if (_actor == null) { _commandable = null; _abilitiableHACK = null; if (_panel != null) { _panel.SetTarget(null); } return; } _commandable = _actor.GetModule <ICommandable>(); _abilitiableHACK = _actor.GetModule <IAbilitiable>(); if (_panel != null) { _panel.SetTarget(_actor); } }
private void Awake() { _abilitiable = GetComponent <IAbilitiable>(); _jobSystem = GetComponent <IJobSystem>(); }