void Start() { _extrudeSelectionObj = GameObject.Find("GizmoObject").GetComponent <PolyObjectController> (); _extrudeVoxelPool = new Dictionary <IntVector3, int> (new IntVector3.EqualityComparer()); _brushVoxelPoolAfter = new Dictionary <IntVector3, int> (new IntVector3.EqualityComparer()); _brushVoxelPoolBefore = new Dictionary <IntVector3, int> (new IntVector3.EqualityComparer()); _editorState = GameObject.Find("UICanvas").GetComponent <EditorState> (); cld_cube = goc_cube.GetComponent <MeshCollider> (); cld_cylinder = goc_cylinder.GetComponent <MeshCollider> (); cld_sphere = goc_sphere.GetComponent <MeshCollider> (); SetBrushShape(BrushShape.Cylinder); }
void DuplicateFromAst() { PolyObjectController other = _dupliOther; Debug.Assert(_editSpace != null); for (int x = 0; x < other._editSpace.GetLength(0); x++) { for (int y = 0; y < other._editSpace.GetLength(1); y++) { for (int z = 0; z < other._editSpace.GetLength(2); z++) { _editSpace [x, y, z] = other._editSpace [x, y, z]; } } } RefreshMesh(); }
public void SetTargetPolyObject(GameObject obj) { transform.SetParent(obj.transform); _targetPolyObject = obj.GetComponent <PolyObjectController> (); }
public void DuplicateFrom(PolyObjectController other) { // at this time, Start() may not be called! _dupliOther = other; Invoke("DuplicateFromAst", 0.1f); }