diff options
Diffstat (limited to 'Client/Assembly-CSharp/VendingSlot.cs')
-rw-r--r-- | Client/Assembly-CSharp/VendingSlot.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Client/Assembly-CSharp/VendingSlot.cs b/Client/Assembly-CSharp/VendingSlot.cs new file mode 100644 index 0000000..f2b43e6 --- /dev/null +++ b/Client/Assembly-CSharp/VendingSlot.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections; +using UnityEngine; + +public class VendingSlot : MonoBehaviour +{ + public SpriteRenderer DrinkImage; + + public SpriteRenderer GlassImage; + + public IEnumerator CoBuy() + { + yield return new WaitForLerp(0.75f, delegate(float v) + { + this.GlassImage.size = new Vector2(1f, Mathf.Lerp(1.7f, 0f, v)); + this.GlassImage.transform.localPosition = new Vector3(0f, Mathf.Lerp(0f, 0.85f, v), -1f); + }); + yield return Effects.Shake(this.DrinkImage.transform, 0.75f, 0.075f); + Vector3 localPosition = this.DrinkImage.transform.localPosition; + localPosition.z = -5f; + this.DrinkImage.transform.localPosition = localPosition; + Vector3 v2 = localPosition; + v2.y = -8f - localPosition.y; + yield return Effects.All(new IEnumerator[] + { + Effects.Slide2D(this.DrinkImage.transform, localPosition, v2, 0.75f), + Effects.Rotate2D(this.DrinkImage.transform, 0f, -FloatRange.Next(-45f, 45f), 0.75f) + }); + yield return new WaitForLerp(0.75f, delegate(float v) + { + this.GlassImage.size = new Vector2(1f, Mathf.Lerp(0f, 1.7f, v)); + this.GlassImage.transform.localPosition = new Vector3(0f, Mathf.Lerp(0.85f, 0f, v), -1f); + }); + this.DrinkImage.enabled = false; + yield break; + } +} |