public static void Rotate(CardModel cardModel) { if (cardModel.ParentCardZone == null || !cardModel.ParentCardZone.allowsRotation) { Debug.LogWarning("Ignoring rotation request since the parent card zone does not support it."); return; } cardModel.transform.rotation *= Quaternion.Euler(0, 0, -CardGameManager.Current.GameCardRotationDegrees); if (cardModel.IsOnline) { cardModel.CmdUpdateRotation(cardModel.transform.rotation); } }
public static void Tap(CardModel cardModel) { if (cardModel.ParentCardZone == null || !cardModel.ParentCardZone.allowsRotation) { Debug.LogWarning("Ignoring rotation request since the parent card zone does not support it."); return; } var isVertical = cardModel.transform.rotation.Equals(Quaternion.identity); cardModel.transform.rotation = isVertical ? Quaternion.AngleAxis(CardGameManager.Current.GameCardRotationDegrees, Vector3.back) : Quaternion.identity; if (cardModel.IsOnline) { cardModel.CmdUpdateRotation(cardModel.transform.rotation); } }