Graphics Reference
In-Depth Information
// lock all the players on the spot until we're ready to go
SetPlayerLocks( true );
// start the game in 3 seconds from now
Invoke( "StartGame", 4 );
// initialize a timer, but we won't start it right away. It
// gets started in the FinishedCount() function after the
// count-in
theTimer = ScriptableObject.CreateInstance<TimerClass>();
// update positions throughout the battle, but we don't need
// to do this every frame, so just do it every half a second instead
InvokeRepeating( "UpdatePositions", 0f, 0.5f );
// hide our count-in numbers
HideCount();
// schedule count-in messages
Invoke( "ShowCount3", 1 );
Invoke( "ShowCount2", 2 );
Invoke( "ShowCount1", 3 );
Invoke( "FinishedCount", 4 );
// hide final position text
finalPositionText.gameObject.SetActive( false );
doneFinalMessage = false;
didInit=true;
}
void StartGame ()
{
// the SetPlayerLocks function tells all players to unlock
SetPlayerLocks( false );
// tell battle manager to start the battle!
GlobalBattleManager.Instance.StartBattle();
}
void UpdatePositions()
{
// update the display
UpdateBattlePositionText();
}
void UpdateBattlePositionText ()
{
// get a string back from the timer to display on screen
timerText.text = theTimer.GetFormattedTime();
// get the current player position scoreboard from the
// battle manager and show it via posText.text
posText.text = GlobalBattleManager.Instance.
GetPositionListString();
Search WWH ::




Custom Search