Fix and add popup.
This commit is contained in:
@@ -10,6 +10,11 @@ namespace Cryville.Common.Unity {
|
||||
|
||||
float timer = 0;
|
||||
|
||||
const float DURATION = 5.0f;
|
||||
const float DURIN = 0.4f;
|
||||
const float DUROUT = 0.4f;
|
||||
const float HEIGHT = 50f;
|
||||
|
||||
#pragma warning disable IDE0051
|
||||
void Start() {
|
||||
layout = GetComponent<LayoutElement>();
|
||||
@@ -19,9 +24,9 @@ namespace Cryville.Common.Unity {
|
||||
}
|
||||
|
||||
void Update() {
|
||||
if (timer <= 0.8f) layout.minHeight = timer * 50;
|
||||
else if (timer >= 5f) GameObject.Destroy(gameObject);
|
||||
else if (timer >= 4.2f) layout.minHeight = (300 - timer) * 50;
|
||||
if (timer <= DURIN) layout.minHeight = timer / DURIN * HEIGHT;
|
||||
else if (timer >= DURATION) GameObject.Destroy(gameObject);
|
||||
else if (timer >= DURATION - DUROUT) layout.minHeight = (DURATION - timer) / DUROUT * HEIGHT;
|
||||
timer += Time.deltaTime;
|
||||
}
|
||||
#pragma warning restore IDE0051
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user