private void Awake() { roomnet = GetComponentInParent <RoomNetwork>(); traverser = new RoomTraverser(this, roomnet); grid = GetComponent <SnapGrid>(); togglable = transform.Find("Togglable")?.gameObject; togglable?.SetActive(false); insideTransf = transform.Find("Inside"); insideColliders = insideTransf.GetComponentsInChildren <Collider>(); foreach (Collider collider in insideColliders) // Make sure every "inside collider" is trigger { collider.isTrigger = true; } }
public void UnregisterSnapGrid(SnapGrid grid) { grids.Remove(grid); ReleaseGridMaterialInstance(grid.gridMat); }
public void RegisterSnapGrid(SnapGrid grid) { grids.Add(grid); grid.gridMat = CreateGridMaterialInstance(); }