Пример #1
0
        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;
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
 private void Awake()
 {
     _abilitiable = GetComponent <IAbilitiable>();
     _jobSystem   = GetComponent <IJobSystem>();
 }