So my game now has 3 decks, Hand, Discard, Draw decks. And cards in game frequently move between these 3 decks.
What is good code to move one scrollview's contents to another scrollview?
I used this code, but I don't know this is proper and whether having redundant line or not.
And sometimes move many cards in once, some cards are missing and card's transform appear instantly on center of camera and then moved to another, this is also annoying thing.
-------------
public void MoveObjToNGUITransform(GameObject go, UIGrid grid)
{
if (go == null)
return;
go.transform.parent = grid.transform;
//go.transform.position = CardManager.Instance.Tf_UI_Root.transform.position;
go
.transform.localScale = new Vector3
(1f, 1f, 1f
); go.transform.rotation = Quaternion.identity;
grid.Reposition();
grid.repositionNow = true;
grid.transform.parent.GetComponent<UIScrollView>().ResetPosition();
NGUITools.MarkParentAsChanged(go);
SetCard.Instance.ShowDeckNum();
}