diff options
| author | chai <215380520@qq.com> | 2024-05-19 16:05:01 +0800 |
|---|---|---|
| committer | chai <215380520@qq.com> | 2024-05-19 16:05:01 +0800 |
| commit | c5f145786f4c6d2fe4bea831dfc16e52228920a5 (patch) | |
| tree | a6ead7ea8266c767d58ed0f816dcd7a1dd75bd65 /GameCode/Coinslot.cs | |
| parent | 48b64e573a1709dc923cb9162b55be0246b3ff63 (diff) | |
* move
Diffstat (limited to 'GameCode/Coinslot.cs')
| -rw-r--r-- | GameCode/Coinslot.cs | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/GameCode/Coinslot.cs b/GameCode/Coinslot.cs deleted file mode 100644 index 4a505f1..0000000 --- a/GameCode/Coinslot.cs +++ /dev/null @@ -1,76 +0,0 @@ -using MoreMountains.Feedbacks; -using UnityEngine; - -public class Coinslot : MonoBehaviour -{ - public Transform fillTarget; - - public AnimationCurve fillCurve; - - public MMF_Player fullFeedback; - - public MMF_Player deniedFeedback; - - public MMF_Player appearFeedback; - - public MMF_Player disappearFeedback; - - public MMF_Player fullCompleteFeedback; - - private float fill01; - - public bool isFull => fill01 >= 1f; - - public float CurrentFill01 => fill01; - - public bool AddFill(float percentage, bool isLastCoin) - { - fill01 += percentage; - fillTarget.localScale = Vector3.one * fillCurve.Evaluate(Mathf.Clamp01(fill01)); - if (isFull) - { - if (!isLastCoin) - { - fullFeedback.PlayFeedbacks(); - } - else - { - fullCompleteFeedback.PlayFeedbacks(); - } - return true; - } - return false; - } - - public void SetEmpty() - { - fill01 = 0f; - fillTarget.localScale = Vector3.zero; - } - - public void PlayDeny() - { - deniedFeedback.PlayFeedbacks(); - } - - public void Appear() - { - fullFeedback.StopFeedbacks(); - deniedFeedback.StopFeedbacks(); - appearFeedback.StopFeedbacks(); - disappearFeedback.StopFeedbacks(); - fill01 = 0f; - fillTarget.localScale = Vector3.zero; - base.transform.localScale = Vector3.zero; - appearFeedback.PlayFeedbacks(); - } - - public void Disappear() - { - fullFeedback.StopFeedbacks(); - deniedFeedback.StopFeedbacks(); - appearFeedback.StopFeedbacks(); - disappearFeedback.StopFeedbacks(); - disappearFeedback.PlayFeedbacks(); - } -} |
