// Start is called before the first frame update
    void Start()
    {
        _TArray       = GetComponent <TransformArray_Linear>();
        _LineRenderer = GetComponent <LineRenderer>();

        _LineRenderer.positionCount = _TArray._GameObjects.Length;

        print("Initialized with count of: " + _LineRenderer.positionCount);
    }
Beispiel #2
0
    // Start is called before the first frame update
    void Awake()
    {
        _FollowArray = GetComponent <TransformArray_Linear>();

        // Spawn transforms
        _FollowArray.Spawn();

        // Parent first transform the the transform array
        _FollowArray._GameObjects[0].transform.SetParent(_FollowArray.transform);
        _FollowArray._GameObjects[0].transform.localRotation = Quaternion.identity;


        for (int i = 1; i < _FollowArray._GameObjects.Length; i++)
        {
            FollowOffset follow = _FollowArray._GameObjects[i].AddComponent <FollowOffset>();
            follow.Init(_FollowArray._GameObjects[i - 1].transform, _Smoothing);
        }
    }