Cositas (~ ̄▽ ̄)~
This commit is contained in:
parent
db7b5af053
commit
55b18c6def
28 changed files with 4095 additions and 123 deletions
38
Assets/Scripts/WinScreen.cs
Normal file
38
Assets/Scripts/WinScreen.cs
Normal file
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using MyBox;
|
||||
using SimpleTools.DialogueSystem;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class WinScreen : MonoBehaviour {
|
||||
|
||||
[SerializeField] GameObject[] orbs;
|
||||
[SerializeField] Dialogue dialogue;
|
||||
|
||||
[SerializeField] float fadeDuration;
|
||||
|
||||
[SerializeField] Image occluder;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Awake(){
|
||||
for (int i = 0; i < orbs.Length; i++) orbs[i].SetActive(i + 1 <= PlayerPrefs.GetInt("OrbsFound"));
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
IEnumerator Start() {
|
||||
yield return new WaitForSeconds(fadeDuration);
|
||||
DialogueManager.instance.Dialogue(dialogue);
|
||||
}
|
||||
|
||||
float _start;
|
||||
void Update() {
|
||||
float alpha = Mathf.Lerp(1, 0, (Time.time - _start) / fadeDuration);
|
||||
|
||||
alpha = Mathf.Round(alpha * 5);
|
||||
alpha /= 5f;
|
||||
|
||||
occluder.SetAlpha(alpha);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue