public void SnapToGrid() { SnapParentFirst(); snapToGrid_ = new SnapToGrid(this.gameObject, GetGrid()); Undo.RegisterCompleteObjectUndo(this.transform, "Snap"); snapToGrid_.SnapGameObjectToGrid(); }
void Start() { if(grid == null && PixelGrid.instance != null) grid = PixelGrid.instance; snapToGrid_ = new SnapToGrid(this.gameObject, grid); }
void Start() { if (grid == null && PixelGrid.instance != null) { grid = PixelGrid.instance; } snapToGrid_ = new SnapToGrid(this.gameObject, grid); }