public FloatingText SpawnText(string str, Vector3 pos, Color color, int?fontSize = null, float?lifetime = null, Transform parent = null) { FloatingText newText = Instantiate(textPrefab, pos.SetY(yDistance), Quaternion.Euler(eulers)); if (lifetime.HasValue) { newText.lifeTime = lifetime.Value; } if (fontSize.HasValue) { newText.SetSize(fontSize.Value); } if (parent != null) { newText.SetParent(parent); } newText.SetString(str); newText.SetColor(color); return(newText); }