Ejemplo n.º 1
0
    protected override void Update()
    {
        steeringUpdate = new SteeringOutput();
        if (!avoidObstacles)
        {
            steeringUpdate = myBlendedSteering.GetSteering();
        }

        else
        {
            steeringUpdate = myPrioritySteering.GetSteering();
        }

        base.Update();
    }
    // Update is called once per frame
    void Update()
    {
        SteeringOutput movementSteering;

        transform.position += linearVelocity * Time.deltaTime;
        Vector3 angularIncrement = new Vector3(0, angularVelocity * Time.deltaTime, 0);

        transform.eulerAngles += angularIncrement;

        movementSteering = steering.GetSteering();
        if (movementSteering != null)
        {
            linearVelocity  += movementSteering.linear * Time.deltaTime;
            angularVelocity += movementSteering.angular * Time.deltaTime;
        }
        GetComponent <Kinematic>().GetData(movementSteering);
    }