Example #1
0
    public void AddTail(FollowPredecessor newTailBit)
    {
        if (successor)
        {
            successor.AddTail(newTailBit);
            return;
        }

        Vector3 dir = Vector3.Normalize(location.Value - location.Previous.Value);

        ExtendPath(dir);

        successor                    = newTailBit;
        successor.location           = location.List.Last;
        successor.transform.position = successor.location.Value;
        successor.predecessor        = this;
        successor.SetColor(GetComponent <Renderer>().material.color);
    }