예제 #1
0
        public override void _Ready()
        {
            GetNodeOrNull <SelectableComponent>(_selectableComponentPath ?? string.Empty)?.Connect(nameof(SelectableComponent.Selected), this, nameof(OnSelected));
            _entityDataComponent = GetNodeOrNull <EntityDataComponent>(_entityDataComponentPath ?? string.Empty);
            _animationPlayer     = GetNode <AnimationPlayer>("Sprite/AnimationPlayer");
            _sprite = GetNode <Sprite>("Sprite");
            UpdateQuestIndicators();

            QuestTracker.Instance.Connect(nameof(QuestTracker.PreQuestStarted), this, nameof(OnPreQuestStarted));
        }
예제 #2
0
        public override void _Ready()
        {
            MetaPathfindComponent   = GetNodeOrNull <PathfindComponent>(_pathfindComponentPath ?? string.Empty);
            MetaEntityDataComponent = GetOwner().GetFirstNodeOfType <EntityDataComponent>();
            if (MetaPathfindComponent == null)
            {
                Logger.Error("No pathfind component set in " + GetOwner().Filename);
                QueueFree();
                return;
            }

            if (GetChildCount() > 0)
            {
                var first = GetChildren() [0] as IStateExector;
                StateMachine.ChangeState(first);
            }
        }