public override void SetDestination(SpellNode newDestination)
    {
        if (newDestination != oldDestination)
        {
            selectedLinkableProperty  = null;
            linkedActivatableFunction = null;

            if (newDestination != null)
            {
                availableLinkableProperties = new List <string>(LinkableFinder.FindAllLinkableProperty(newDestination));
                activatableFunctions        = new List <string>(LinkableFinder.FindLinkableFunctions(newDestination, true));
                oldDestination = newDestination;
                destination    = newDestination;
            }
        }
    }
    public void UpdateSourceAndDestination()
    {
        oldSource      = source;
        oldDestination = destination;

        if (source != null)
        {
            availableProperties = new List <string>(LinkableFinder.FindLinkableFunctions(source));
        }

        if (destination != null)
        {
            availableLinkableProperties = new List <string>(LinkableFinder.FindAllLinkableProperty(destination));
            activatableFunctions        = new List <string>(LinkableFinder.FindLinkableFunctions(destination, true));
        }
    }
    public override void SetSource(SpellNode newSource)
    {
        if (newSource != oldSource)
        {
            selectedProperty          = null;
            boolLinkedFunction        = null;
            linkedActivatableFunction = null;

            if (newSource != null)
            {
                availableProperties = new List <string>(LinkableFinder.FindLinkableFunctions(newSource));
                oldSource           = newSource;
                source = newSource;
            }
        }
    }
    void Update()
    {
        if (source != oldSource)
        {
            selectedProperty          = null;
            boolLinkedFunction        = null;
            linkedActivatableFunction = null;

            if (source != null)
            {
                availableProperties = new List <string>(LinkableFinder.FindLinkableFunctions(source));
                oldSource           = source;
            }
        }

        if (destination != oldDestination)
        {
            selectedLinkableProperty  = null;
            linkedActivatableFunction = null;

            if (destination != null)
            {
                availableLinkableProperties = new List <string>(LinkableFinder.FindAllLinkableProperty(destination));
                activatableFunctions        = new List <string>(LinkableFinder.FindLinkableFunctions(destination, true));
                oldDestination = destination;
            }
        }


        if (link)
        {
            link = false;
            if (source != null && destination != null)
            {
                if (previousLinkedProperty != null && previousLinkedProperty != selectedLinkableProperty)
                {
                    ResetProperty(previousLinkedProperty);
                }
                if (selectedProperty != null)
                {
                    // Link properties
                    if (selectedLinkableProperty != null)
                    {
                        Type[] conversionTypes = GetConversion();
                        if (conversionTypes[0] != null)
                        {
                            PickConversionTypes(conversionTypes[0], conversionTypes[1]);
                        }
                        else
                        {
                            Debug.LogWarning("Failed to match one value with the destination or source");
                        }
                    }
                    // Link bool to activator function
                    if (selectedActivatableFunction != null)
                    {
                        LinkActivatorFunction();
                    }
                }
            }
        }

        DrawLink();
    }