public void PlayGiftAnimation(int Gift)
    {
        GameObject giftanim;

        // giftanim = ObjectPooler.Instance.SpawnFromPool("GiftAnimation", Vector3.zero, transform.rotation) as GameObject;
        giftanim = Instantiate(GiftAnim, Vector3.zero, transform.rotation) as GameObject;
        giftanim.transform.SetParent(GameObject.FindGameObjectWithTag("GUISpawn").transform, false);
        GiftAnimation Anim = giftanim.GetComponent <GiftAnimation>();

        Anim.GiftValue = Gift;
    }
Example #2
0
        public ChildTransformAnimation(GiftAnimation animation, GameObject gameObject)
        {
            this.animation  = animation;
            this.gameObject = gameObject;

            targetPosition = gameObject.transform.position;
            targetRotation = gameObject.transform.rotation;
            startingScale  = gameObject.GetComponent <AnimationStartingScale>()?.StartingScale ?? Vector3.zero;
            targetScale    = gameObject.transform.localScale;
            pathDifference = targetPosition - animation.path.GetPosition(1f);

            Update(0, 0, 0, animation.transform.position);
        }