private void DoPickupAnimation() { pickupAnimation = playerInstance.GetComponentInChildren <PickupAnimation>(); sprite = GetComponentInChildren <SpriteRenderer>().sprite; pickupAnimation.DoAnimation(sprite, proportion); }
private void Start() { playerInstance = PlayerInstant.Instance; pickupAnimation = playerInstance.GetComponentInChildren <PickupAnimation>(); gameObject.name = item.ToString(); proportion = GetComponentInChildren <SpriteRenderer>().transform.localScale.x; }
protected void DoPickupAnimation() { pickupAnimation = PlayerInstant.Instance.gameObject.GetComponentInChildren <PickupAnimation>(); sprite = GetComponentInChildren <SpriteRenderer>().sprite; pickupAnimation.DoAnimation(sprite, proportion); Destroy(gameObject); }
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); }
private void DoCancelPickupAnimation() { pickupAnimation = playerInstance.GetComponentInChildren <PickupAnimation>(); GameObject Object = Resources.Load <GameObject>("CancelPickup"); sprite = (Object.transform.GetComponentInChildren <SpriteRenderer>()).sprite; pickupAnimation.DoAnimation(sprite, 1f); }
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()); }