public GuiAnchorMain GetAnchors(GuiAnchorID id) { for (int i = 0; i < anchors.Length; i++) { if (anchors[i].id == id) { return anchors[i]; } } return new GuiAnchorMain( centerCam.transform,GuiAnchorID.Center); }
private GuiAnchorMain SetAnchor(GuiAnchorMain anchor, Vector3 newPos, GuiAnchorID id) { if (anchor == null || anchor.transform == null) { //Debug.Log("new as"); GameObject newGameobject = new GameObject(id.ToString()); newGameobject.transform.parent = centerCam.transform; return new GuiAnchorMain(newGameobject.transform, id); }else{ anchor.transform.localPosition = newPos; anchor.transform.parent = centerCam.transform; return anchor; } }
public GuiAnchorMain(Transform _transform, GuiAnchorID _id) { transform = _transform; id = _id; }