Exemplo n.º 1
0
 public override void _Ready()
 {
     _owner = Owner as Node2D;
     _aiMovementComponent     = GetNodeOrNull <AIMovementComponent>(_aiMovementComponentPath ?? string.Empty);
     _damageReceiverComponent = GetNodeOrNull <DamageReceiverComponent>(_damageReceiverComponentPath ?? string.Empty);
     _damageReceiverComponent?.Connect(nameof(DamageReceiverComponent.DamageReceived), this, nameof(OnDamageReceived));
 }
Exemplo n.º 2
0
        public override void _Ready()
        {
            _velocityComponent = _velocityComponentPath != null?GetNode <VelocityComponent>(_velocityComponentPath) : null;

            _damageReceiverComponent = _damageReceiverComponentPath != null?GetNode <DamageReceiverComponent>(_damageReceiverComponentPath) : null;

            _damageReceiverComponent?.Connect(nameof(DamageReceiverComponent.DamageReceived), this, nameof(OnDamageReceived));
        }
Exemplo n.º 3
0
        public override void _Ready()
        {
            _shadedNode = GetNodeOrNull <Node2D>(_shadedNodePath ?? string.Empty);
            if (_shadedNode != null)
            {
                _shadedNode.Material = _shaderMaterial;
            }

            _tween = GetNode <Tween>("Tween");
            _damageReceiverComponent = GetNodeOrNull <DamageReceiverComponent>(_damageReceiverComponentPath ?? string.Empty);
            _damageReceiverComponent?.Connect(nameof(DamageReceiverComponent.DamageReceived), this, nameof(OnDamageReceived));
        }