void MoveToDiscard(CardGolf cd) { cd.state = eCardStateGolf.discard; discardPile.Add(cd); cd.transform.parent = layoutAnchor; cd.transform.localPosition = new Vector3( layout.multiplier.x * layout.discardPile.x, layout.multiplier.y * layout.discardPile.y, -layout.discardPile.layerID + 0.5f); cd.faceUp = true; cd.SetSortingLayerName(layout.discardPile.layerName); cd.SetSortOrder(-100 + discardPile.Count); }
void MoveToTarget(CardGolf cd) { if (target != null) { MoveToDiscard(target); } target = cd; cd.state = eCardStateGolf.target; cd.transform.parent = layoutAnchor; cd.transform.localPosition = new Vector3( layout.multiplier.x * layout.discardPile.x, layout.multiplier.y * layout.discardPile.y, -layout.discardPile.layerID ); cd.faceUp = true; cd.SetSortingLayerName(layout.discardPile.layerName); cd.SetSortOrder(0); }