Ejemplo n.º 1
0
    private void FixedUpdate()
    {
        lastNode = nodeManager.CalculateVelocity(pathFollower.NodePosition, turning, speed * Time.fixedDeltaTime, lastNode);
        Node modulatedNode = nodeNoise.ModulateNode(lastNode);

        nodeManager.nodesMiddle[nodeManager.NodeCount - 1] = modulatedNode;

        nodeManager.UpdateMiddleTail();
        nodeManager.UpdateSides();
        nodeManager.UpdateCollider(polygonCollider);
        head.transform.localPosition = modulatedNode.position;
        head.transform.localRotation = Quaternion.FromToRotation(Vector3.right, modulatedNode.velocity);
    }