- Horseshoe score text should now sync. - Score text on horseshoes will hopefully not slowly drift away any longer. - Chicken sounds now load in background.
39 lines
895 B
C#
39 lines
895 B
C#
|
|
using UdonSharp;
|
|
using UnityEngine;
|
|
using VRC.SDKBase;
|
|
using VRC.Udon;
|
|
|
|
|
|
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
|
|
public class HorseshoesGameManager : UdonSharpBehaviour
|
|
{
|
|
private const float IN_COUNT_DISTANCE = (0.0254f * 6);
|
|
|
|
private const int OUT_OF_PLAY_VALUE = 0;
|
|
private const int IN_COUNT_VALUE = 1;
|
|
private const int RINGER_POINT_VALUE = 3;
|
|
|
|
|
|
public void CalculatePoints(PlayerHorseshoe Shoe, float DistanceFromStake)
|
|
{
|
|
if (DistanceFromStake <= IN_COUNT_DISTANCE)
|
|
{
|
|
Shoe.SetScoreText("+" + IN_COUNT_VALUE);
|
|
Debug.Log("[HorseshoesGameManager] Horseshoe is in count");
|
|
}
|
|
else
|
|
{
|
|
Shoe.SetScoreText("+" + OUT_OF_PLAY_VALUE);
|
|
Debug.Log("[HorseshoesGameManager] Horseshoe is not in play");
|
|
}
|
|
}
|
|
|
|
|
|
public void CalculateRinger(PlayerHorseshoe Shoe)
|
|
{
|
|
Shoe.SetScoreText("+" + RINGER_POINT_VALUE);
|
|
Debug.Log("[HorseshoesGameManager] Ringer!");
|
|
}
|
|
}
|