public void SetAxis(bool b, ConstrainedAxis a) { if (b) { selectedAxis = a; Debug.Log(a); RectGizmo rg = rectGizmo.GetComponent <RectGizmo>(); rg.transform.position = Vector3.zero; rg.SetSizedGizmo(bounds.size, selectedAxis); setSection(); } }
void setupGizmo() { rectGizmo = Resources.Load("rectGizmo") as GameObject; if (rectGizmo) { Debug.Log("rectGizmo"); } if (cs_setup) { Debug.Log("cs_setup"); } rectGizmo = Instantiate(rectGizmo, bounds.center + (-bounds.extents.y + (slider ? slider.value : 0) + zeroAlignmentVector.y) * transform.up, Quaternion.identity) as GameObject; RectGizmo rg = rectGizmo.GetComponent <RectGizmo>(); rg.SetSizedGizmo(bounds.size, selectedAxis); /* Set rectangular gizmo size here: inner width, inner height, border width. */ rectGizmo.SetActive(false); }