public bool CreateFragmentListFromSaveData(HomographyEditor editor) { FragmentSaveFormat[] fsfList = FragmentsData; foreach (FragmentSaveFormat fsf in fsfList) { HomographyFragment hf = editor.CreateFragment().GetComponent <HomographyFragment> (); if (!fsf.GetFragment(ref hf)) { return(false); } } editor.ScaleHomography = ScaleHomography; return(true); }
public override void Update() { HomographyFragment hf = mHomographyEditor.CreateFragment().GetComponent <HomographyFragment> (); Vector3 mousePos = Input.mousePosition; Vector2 stdPos = mHomographyEditor.ConvertPosToUv(new Vector2(mousePos.x, mousePos.y)); FragmentVertex fv = new FragmentVertex(stdPos); hf.FragmentVertices.Add(fv); List <FragmentPoint> selectedList = mHomographyEditor.SelectedPointList; selectedList.RemoveRange(0, selectedList.Count); selectedList.Add(fv); mHomographyEditor.ManipulationMode = mHomographyEditor.EditTarget | HomographyEditor.ManipulationKind.Add; Controller.ReplaceManipulation(new MoveVertex()); }