Z
Size: a a a
Z
В
A
A
В
void Update()
{
if (checktime == 0)
{
timeStart += Time.deltaTime;
textTimer.text = timeStart.ToString("F2");
Debug.Log(timeStart);
Debug.Log(checktime);
}
if (laps == null)
return;
if (checktime == 0)
{
if (laps.CurrentLap > laps.numof_laps)
{
checktime = 1;
}
checktime = 2;
}
}
В
A
В
В
В
S
private void OnTriggerStay(Collider other) {
if (isInsideCircle(other.bounds.center.x, other.bounds.center.z,
colliderPlayer.bounds.center.x, colliderPlayer.bounds.center.z,
colliderPlayer.radius)) {
Debug.Log("ASD");
}
}
Boolean isInsideCircle(float x, float y, float circleX, float circleY, float circleRadius) {
Double absX = Math.Pow(Math.Abs(x - circleX), circleRadius);
Double absY = Math.Pow(Math.Abs(y - circleY), circleRadius);
return Math.Sqrt(absX + absY) < circleRadius;
}
A
AP
private void OnTriggerStay(Collider other) {
if (isInsideCircle(other.bounds.center.x, other.bounds.center.z,
colliderPlayer.bounds.center.x, colliderPlayer.bounds.center.z,
colliderPlayer.radius)) {
Debug.Log("ASD");
}
}
Boolean isInsideCircle(float x, float y, float circleX, float circleY, float circleRadius) {
Double absX = Math.Pow(Math.Abs(x - circleX), circleRadius);
Double absY = Math.Pow(Math.Abs(y - circleY), circleRadius);
return Math.Sqrt(absX + absY) < circleRadius;
}
A
В
A
В
В
A
S