Esempio n. 1
0
    private void DoPickupAnimation()
    {
        pickupAnimation = playerInstance.GetComponentInChildren <PickupAnimation>();

        sprite = GetComponentInChildren <SpriteRenderer>().sprite;
        pickupAnimation.DoAnimation(sprite, proportion);
    }
Esempio n. 2
0
    private void Start()
    {
        playerInstance  = PlayerInstant.Instance;
        pickupAnimation = playerInstance.GetComponentInChildren <PickupAnimation>();

        gameObject.name = item.ToString();
        proportion      = GetComponentInChildren <SpriteRenderer>().transform.localScale.x;
    }
Esempio n. 3
0
    protected void DoPickupAnimation()
    {
        pickupAnimation = PlayerInstant.Instance.gameObject.GetComponentInChildren <PickupAnimation>();

        sprite = GetComponentInChildren <SpriteRenderer>().sprite;

        pickupAnimation.DoAnimation(sprite, proportion);
        Destroy(gameObject);
    }
Esempio n. 4
0
    protected void DoCancelPickupAnimation()
    {
        pickupAnimation = PlayerInstant.Instance.gameObject.GetComponentInChildren <PickupAnimation>();

        GameObject Object = Resources.Load("CancelPickup") as GameObject;

        sprite = (Object.transform.GetComponentInChildren <SpriteRenderer>()).sprite;

        pickupAnimation.DoAnimation(sprite, 0.5f);
    }
Esempio n. 5
0
    private void DoCancelPickupAnimation()
    {
        pickupAnimation = playerInstance.GetComponentInChildren <PickupAnimation>();

        GameObject Object = Resources.Load <GameObject>("CancelPickup");

        sprite = (Object.transform.GetComponentInChildren <SpriteRenderer>()).sprite;

        pickupAnimation.DoAnimation(sprite, 1f);
    }
Esempio n. 6
0
    public void SpawnExplosiveFirePickup(Vector3 newPosition)
    {
        if (pickupAnimation == null)
        {
            pickupAnimation = GetComponent <PickupAnimation>();
        }

        pickupAnimation.SetBouncePositions(newPosition);
        transform.position = new Vector3(newPosition.x, newPosition.y, newPosition.z);

        if (source != null && ExplosiveFireSpawnSFX != null)
        {
            source.clip = ExplosiveFireSpawnSFX;
            source.Play();
        }
        SetVisibility(true);
        isCollected = false;
    }
    protected void StartAnimation()
    {
        PickupAnimation clonePickupAnimation = cloneObject.GetComponent <PickupAnimation>();

        StartCoroutine(clonePickupAnimation.Animate());
    }