// Update is called once per frame void Update() { float percentage = Math3d.GetPolygonAreaSize(ShapeController.instance.GetAllVerticesPositions()) / referenceValue; percentage = (percentage - gameoverPercentage) / (1f - gameoverPercentage); ShapeStatusText.text = Mathf.RoundToInt(percentage * 100f) + "%"; ShapeStatusText.enabled = percentage > 0f; if (UIController.instance.GameInteractive && Mathf.RoundToInt(percentage * 100f) <= 0f) { UIController.instance.FireGameOver(); } }