Exemplo n.º 1
0
    };                                                                   //arrival / home / shop / work / departure

    /// <summary>
    /// The method is responsible for initiating the street
    /// </summary>
    /// <param name="From">Junction "from"</param>
    /// <param name="To">Junction "to"</param>
    /// <param name="fromCount">Number of paths "from-to"</param>
    /// <param name="toCount">Number of paths "to-from"</param>
    public void Init(Junction From, Junction To, int fromCount = 1, int toCount = 1)
    {
        iFrom     = fromCount; iTo = toCount;
        this.from = From; this.to = To;
        From.AddJoint(new Joint(this, false));
        To.AddJoint(new Joint(this, true));
        Vector3 centerPos = (To.transform.position + From.transform.position) / 2;

        this.center = new Node(centerPos);
        nodes.Add(this.center);
        Calculate();
    }