1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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;
}
}
|