private void Start() { // Instantiate arrow in holograms holograms = GameObject.FindGameObjectWithTag("Holograms").transform; Instantiate(arrow, holograms); gridReference = GetComponent <NavigationGrid>(); }
// Use this for initialization void Start() { map = new NavigationGrid(X, Y); /* GameObject cube; * cube = GameObject.CreatePrimitive (PrimitiveType.Cube); * cube.transform.position = new Vector3 (0, 0, 0);*/ }
// Start is called before the first frame update void Awake() { sGameRule = this; BoxCollider = GetComponent <BoxCollider2D>(); NavigationGrid = GetComponent <NavigationGrid>(); UIController = FindObjectOfType <UIController>(); audioSource = GetComponent <AudioSource>(); RuntimeTimer = Timer; cameraBehaviour = FindObjectOfType <CameraBehaviour>(); }
public static JobHandle Schedule(NavigationGrid grid, ulong flags, BurstBoxCollider box) { return(new SetFlagsInBox { Flags = flags, Array = grid.InnerGrid, ViewData = grid.Data, ToGridLocalMatrix = grid.Transform.ToLocalMatrix, ToGridWorldMatrix = grid.Transform.ToWorldMatrix, Box = box, }.Schedule()); }
void Start() { grid = new NavigationGrid(30, 30); TotalUnusedError = grid.X * grid.Z * maxDepth; createMap(grid.X, grid.Z); RemoveAirFromUnused(); obo = GameObject.CreatePrimitive(PrimitiveType.Cube); obo1 = GameObject.CreatePrimitive(PrimitiveType.Cube); obo2 = GameObject.CreatePrimitive(PrimitiveType.Cube); obo3 = GameObject.CreatePrimitive(PrimitiveType.Cube); }
public void BuildGrid() { Debug.Log("GridManager.BuildGrid"); if (BoxSize < 0.1f) { BoxSize = 1; } Grid?.Dispose(); Grid = NavigationGrid.Create((int)Size.x, (int)Size.y, (int)Size.z, transform.position, transform.rotation, transform.localScale, BoxSize); UpdateWalkableAreas(); }
private void Start() { try { MiniMapCamera = GameObject.FindGameObjectWithTag("MiniMapCamera").GetComponent <Camera>(); } catch (UnityException) { throw new UnityException("Failed to get MiniMapCamera"); } try { mainCamera = Camera.main; } catch (UnityException) { throw new UnityException("Failed to get MainCamera"); } navigationGrid = GameObject.FindGameObjectWithTag("Navigation").GetComponent <NavigationGrid>(); }
public static int[] Run(NavigationGrid grid, ulong flags, BurstBoxCollider boxCollider, int[] trackedIndices) { if (trackedIndices == null) { trackedIndices = new int[0]; } using (var previousIndices = new NativeArray <int>(trackedIndices, Allocator.TempJob)) using (var resultIndices = new NativeIndexList <GridNode>(grid.InnerGrid.Internal, Allocator.TempJob)) { new SetFlagsInBoxDiff { Flags = flags, SourceGrid = grid.InnerGrid, ViewData = grid.Data, ToGridLocalMatrix = grid.Transform.ToLocalMatrix, ToGridWorldMatrix = grid.Transform.ToWorldMatrix, Box = boxCollider, PreviouslyTrackedIndices = previousIndices, TrackedIndicesResult = resultIndices, }.Schedule().Complete(); return(resultIndices.IndicesToArray()); } }
private void Awake() { gridReference = GetComponent <NavigationGrid>(); path = GetComponent <Path>(); }
public BurstAStarPathFinder(NavigationGrid grid) { Grid = grid; }
public void DrawGrid(Graphics g) { NavigationGrid nG = new NavigationGrid(this); nG.Create(g); }
public void setGrid(NavigationGrid Grid) { grid = Grid; }
void Awake() { m_PathRequestHandler = GetComponent <PathRequestSingleton>(); m_Grid = GetComponent <NavigationGrid>(); }