Exemple #1
0
        private void UpdateTarget(GraphStack stack)
        {
            var data = stack.GetElementData <Data>(this);

            var wasListening = data.isListening;

            var newTarget = Flow.FetchValue <GameObject>(target, stack.ToReference());

            if (newTarget != data.target)
            {
                if (wasListening)
                {
                    StopListening(stack);
                }

                data.target = newTarget;

                if (wasListening)
                {
                    StartListening(stack, false);
                }
            }
        }