private void Missed(MissType type, float pointsPercentage) { if (pointsPercentage > 0f && pointsPercentage <= 1) { StartCoroutine(ChangeToPct(pointsPercentage)); } else { bar.fillAmount = pointsPercentage; } }
public void Missed(MissType type) { if (type == MissType.NoObject) { TotalPoints -= 5; } else if (type == MissType.WrongDirection) { TotalPoints -= 10; } OnPointsChanged?.Invoke(TotalPoints); OnMissed?.Invoke(type, PointsPercentage); OnMissfeedback?.Play(Vector3.zero); }
private void MakeText(MissType type) { GameObject ins = Instantiate(textPrefab, transform); if (type == MissType.NoObject) { int index = UnityEngine.Random.Range(0, missNoObj.Length); ins.GetComponent <PopUp>().Setup(missNoObj[index]); } else { int index = UnityEngine.Random.Range(0, missDir.Length); ins.GetComponent <PopUp>().Setup(missDir[index]); } }
public MissedInfo(MissType type, int amount) { TypeMiss = type; AmountMissed = amount; }
public MissedInfo(MissType type) { TypeMiss = type; }
private void OnMiss(MissType type, float points) { MakeText(type); }