|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[Header("Walk Direction")] public WalkDirectionMethod walkDirectionMethod; |
|
|
|
public Vector3 dirToLook = Vector3.right; |
|
|
|
public Vector3 dirToWalk = Vector3.right; |
|
|
|
public Transform target; //Target the agent will walk towards.
|
|
|
|
|
|
|
|
[Header("Body Parts")] public Transform hips; |
|
|
|
|
|
|
//Update OrientationCube and DirectionIndicator
|
|
|
|
void UpdateOrientationObjects() |
|
|
|
{ |
|
|
|
dirToLook = walkDirectionMethod == WalkDirectionMethod.UseTarget |
|
|
|
dirToWalk = walkDirectionMethod == WalkDirectionMethod.UseTarget |
|
|
|
: dirToLook; |
|
|
|
m_OrientationCube.UpdateOrientation(hips.position, dirToLook); |
|
|
|
: dirToWalk; |
|
|
|
m_OrientationCube.UpdateOrientation(hips.position, dirToWalk); |
|
|
|
m_DirectionIndicator.MatchOrientation(m_OrientationCube.transform); |
|
|
|
} |
|
|
|
|
|
|
|