Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class NavMeshBuildSourcePositionUpdater : MonoBehaviour {
- public NavMeshBuildSource mySource;
- public Transform myTransform;
- public Mesh myMesh;
- public int index;
- public void UpdatePosition()
- {
- mySource.transform = myTransform.localToWorldMatrix;
- }
- public NavMeshBuildSource CloneSource()
- {
- NavMeshBuildSource newSource = new NavMeshBuildSource();
- newSource.area = mySource.area;
- newSource.shape = mySource.shape;
- if(mySource.shape == NavMeshBuildSourceShape.Mesh)
- {
- newSource.sourceObject = myMesh;
- } else {
- newSource.size = mySource.size;
- }
- newSource.transform = myTransform.localToWorldMatrix;
- mySource = newSource;
- return newSource;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement