void Awake()
 {
     hover = GetComponent <HoverOnCard>();
     // for played cards
     if (hover == null)
     {
         hover = GetComponentInChildren <HoverOnCard>();
     }
     canvas = GetComponentInChildren <Canvas>();
 }
Esempio n. 2
0
    void PreviewThisObject()
    {
        // clone card
        // disable the previous preview if there is one
        StopAllPreviews();
        // Save this as current
        currentViewCard = this;
        // enable preview GO
        previewGameObject.SetActive(true);
        // disable if needed
        if (originalLayout != null)
        {
            originalLayout.SetActive(false);
        }
        // tween with tween addon
        previewGameObject.transform.localPosition = Vector3.zero;
        previewGameObject.transform.localScale    = Vector3.one;

        previewGameObject.transform.DOLocalMove(targetPosition, 1f).SetEase(Ease.OutQuint);
        previewGameObject.transform.DOScale(targetScale, 1f).SetEase(Ease.OutQuint);
    }