gizmos
gizmos copied to clipboard
Duration as parameter
Change how long a gizmo can be visible See: https://docs.unity3d.com/ScriptReference/Debug.DrawLine.html
You could do it with a Coroutine like this.
using System.Collections; using UnityEngine;
public class NewBehaviourScript : MonoBehaviour { private void Start() { StartCoroutine(WaitCoroutine(5f)); }
private IEnumerator WaitCoroutine(float duration)
{
float elapsedTime = 0;
while (elapsedTime < Mathf.Abs(duration))
{
elapsedTime += Time.deltaTime;
Popcron.Gizmos.Sphere(Vector2.one, 5, Color.white);
yield return null;
}
}
}
Woopsey, I just opened pr with this feature, is this bad?