void Start() { _pivot = transform.Find("Card_Pivot").gameObject; _pivotSmoothAnimations = _pivot.GetComponent <SmoothAnimations>(); _topSpriteRenderer = _pivot.transform.Find("Sprite_Top").gameObject.GetComponent <SpriteRenderer>(); _bottomSpriteRenderer = _pivot.transform.Find("Sprite_Bottom").gameObject.GetComponent <SpriteRenderer>(); }
private void ApplyDeckStyleTransformToCard(int index, TransformData t) { // Call the smooth transformations component SmoothAnimations smoothAnimations = _spots[index].card.GetComponent <SmoothAnimations>(); if (smoothAnimations != null) { smoothAnimations.SmoothTranslate(transform.position + t.position + _spots[index].scatterData.position); smoothAnimations.SmoothRotate(transform.rotation * (t.rotation * _spots[index].scatterData.rotation)); } else { Debug.LogError("Card is missing SmoothAnimations component."); } }