예제 #1
0
    private void UpdateRotateAgent()
    {
        var agentBody      = rotate.body;
        var agentPosition  = agentBody.transform.localPosition;
        var agentRotation  = agentBody.rotation;
        var agentVelocity  = agentBody.angularVelocity;
        var targetPosition = target.localPosition;
        var turnDirection  = CalculateTurnDirection(agentBody, targetPosition, agentPosition);

        rotate.model = RotateAgent.Update(rotate.model, agentRotation, targetPosition, agentVelocity, turnDirection);
    }
예제 #2
0
 void Start()
 {
     rotate.model  = RotateAgent.Create(Quaternion.identity, target.localPosition, 5f);
     forward.model = ForwardAgent.Create(transform.localPosition, target.localPosition, 1f);
 }