Пример #1
0
    void FixedUpdate()
    {
        Path newPath = treeRoot.Evaluate(this);

        currentPath = newPath ?? currentPath;

        behaviour.ApplyInput(stateMachine.Update());
    }
Пример #2
0
    void Update()
    {
        // every frame, grab user input and apply it to this obj's carbehaviour
        float acceleration = Input.GetAxisRaw("Vertical");
        float turn         = Input.GetAxisRaw("Horizontal");

        cb.ApplyInput(new CarInput
        {
            acceleration = acceleration,
            turn         = turn
        });
    }