Beispiel #1
0
    /// <summary>
    /// The Initializer for the <seealso cref="BehaviourNode"/>
    /// </summary>
    /// <param name="parent"></param>
    /// <param name="typeNumber"></param>
    /// <param name="posx"></param>
    /// <param name="posy"></param>
    /// <param name="subElem"></param>
    public void InitBehaviourNode(ClickableElement parent, behaviourType type, float posx, float posy, ClickableElement subElem = null, string id = null)
    {
        InitBaseNode(parent, id);

        this.type = type;

        if (subElem != null)
        {
            this.subElem = subElem;
            nodeName     = this.subElem.elementName;
            windowRect   = new Rect(posx, posy, ClickableElement.width, ClickableElement.height);
        }
        else
        {
            nodeName   = parent.elementNamer.AddName(identificator, "New " + type + " Node ");
            windowRect = new Rect(posx, posy, width, height);
        }
    }
Beispiel #2
0
    /// <summary>
    /// The Initializer for the <seealso cref="BehaviourNode"/> when it is being loaded from an XML
    /// </summary>
    /// <param name="parent"></param>
    /// <param name="typeNumber"></param>
    /// <param name="posx"></param>
    /// <param name="posy"></param>
    /// <param name="subElem"></param>
    public void InitBehaviourNodeFromXML(ClickableElement parent, behaviourType type, float posx, float posy, string id, string name, float delayTime, int Nloops, bool isRandom, bool isInfinite, int index, ClickableElement subElem = null)
    {
        InitBaseNode(parent, id);

        this.type = type;

        if (subElem != null)
        {
            this.subElem = subElem;
            nodeName     = this.subElem.elementName;
            windowRect   = new Rect(posx, posy, ClickableElement.width, ClickableElement.height);
        }
        else
        {
            nodeName   = parent.elementNamer.AddName(id, name);
            windowRect = new Rect(posx, posy, width, height);
        }

        this.delayTime  = delayTime;
        this.Nloops     = Nloops;
        this.isRandom   = isRandom;
        this.isInfinite = isInfinite;
        this.index      = index;
    }