2using System.Collections;
3using System.Collections.Generic;
8public class Remove : MonoBehaviour
18 collector = GetComponentInParent<CollectorAction>().gameObject;
19 rt = (RectTransform)collector.transform;
25 width = rt.rect.width;
26 height = rt.rect.height;
29 rs.transform.localScale =
new Vector3(0, 0, 0);
30 rs.
Reference.transform.localScale =
new Vector3(0, 0, 0);
31 StartCoroutine(RemoveGameObject(
new Vector2(width, height),
new Vector2(width, height - 350)));
36 StartCoroutine(PreviewGameObject(1, 0));
41 StartCoroutine(PreviewGameObject(0, 1));
43 IEnumerator RemoveGameObject(Vector2 startSize, Vector2 endSize)
46 float duration = 0.75f;
48 while (time <= duration)
50 time += Time.deltaTime;
51 rt.sizeDelta = Vector2.Lerp(startSize, endSize, time / duration);
59 IEnumerator PreviewGameObject(
float startAlpha,
float endAlpha)
62 float duration = 0.75f;
64 CanvasGroup cggo = gameObject.transform.Find(
"Remove").gameObject.GetComponent<CanvasGroup>();
65 while (time <= duration)
67 time += Time.deltaTime;
68 cggo.alpha = Mathf.Lerp(startAlpha, endAlpha, time / duration);
static Controller Instance
void RemoveAction(string id)