private void Awake() { mesh = GetComponent <MeshFilter>().mesh; navMeshGraph = NavMeshToGraph(); int C = 4; int R = 4; Vector2[] verts = new Vector2[R * C]; for (int i = 0; i < R; i++) { for (int j = 0; j < C; j++) { verts[C * i + j] = new Vector2(i, j); } } DelaunayMesh dm = new DelaunayMesh(verts, new List <Vector2[]> { new Vector2[] { new Vector2(0.5f, 0.5f), new Vector2(1.5f, 2.0f), new Vector2(2.2f, 0.8f) } }); /* * Vector2[] verts = new Vector2[] * { * new Vector2(0, 3), * new Vector2(0, 0), * new Vector2(3, 0), * new Vector2(3, 2), * new Vector2(3, 3), * new Vector2(1, 2), * new Vector2(2.2f, 0.8f), * * new Vector2(2, 2), * new Vector2(2, 3), * new Vector2(1, 0), * new Vector2(1.5f, 2.0f), * new Vector2(1, 1), * new Vector2(2, 1), * new Vector2(0, 1), * * new Vector2(0, 2), * new Vector2(1, 3), * * new Vector2(2, 0), * * //F***s up at this point * new Vector2(3, 1) * }; * DelaunayMesh dm = new DelaunayMesh(verts); */ }
private void Awake() { //waterMesh = GetComponent<WaterMesh>(); delaunayMesh = GetComponent <DelaunayMesh>(); wallPlacement = GetComponent <WallPlacement>(); entireCSVData = CSV_extended.ParseCsvFileUsingResources(pathToCSV); generateMeshButton.interactable = true; informationCanvas.enabled = false; settingsCanvas.enabled = false; aRTransformationManager = ARTransformationManager.Instance; aRLocationProvider = ARLocationProvider.Instance; DisableInformationText(); }
public void Start() { locationProvider = ARLocationProvider.Instance; arLocationManager = ARLocationManager.Instance; arLocationRoot = arLocationManager.gameObject.transform; mainCameraTransform = arLocationManager.MainCamera.transform; locationProvider.OnLocationUpdatedEvent(locationUpdatedHandler); locationProvider.OnProviderRestartEvent(ProviderRestarted); csv = GetComponent <CSV>(); delaunayMesh = GetComponent <DelaunayMesh>(); if (locationProvider == null) { Debug.LogError("[AR+GPS][PlaceAtLocation]: LocationProvider GameObject or Component not found."); return; } }
// Start is called before the first frame update void Start() { DelaunayMesh mesh = GetComponent <DelaunayMesh>(); mesh.Generate(-1); }
private void Awake() { csv = GetComponent <CSV>(); dMesh = GetComponent <DelaunayMesh>(); objLocManager = GetComponent <ObjectLocationManager>(); }