Graphics Reference
In-Depth Information
// scale time here
public float gameSpeed = 1;
private bool didInit;
private TimerClass theTimer;
public GameController_TB ()
{
Instance = this;
}
void Start ()
{
Init();
}
void Init ()
{
SpawnController.Instance.Restart();
// in case we need to change the timescale, it gets set here
Time.timeScale = gameSpeed;
// tell battle manager to prepare for the battle
GlobalBattleManager.Instance.InitNewBattle ();
// initialize some temporary arrays we can use to set up the
// players
Vector3 [] playerStarts = new Vector3 [numberOfBattlers];
Quaternion [] playerRotations = new Quaternion [numberOfBattlers];
// we are going to use the array full of start positions that must
// be set in the editor, which means we always need to make sure
// that there are enough start positions for the number of players
for ( int i = 0; i < numberOfBattlers; i++ )
{
// grab position and rotation values from start position
// transforms set in the inspector
playerStarts [i] = (Vector3) startPoints [i].position;
playerRotations [i] = ( Quaternion ) startPoints [i].rotation;
}
SpawnController.Instance.SetUpPlayers( playerPrefabList,
playerStarts, playerRotations, playerParent, numberOfBattlers );
playerTransforms=new ArrayList();
// now let's grab references to each player's controller
// script
playerTransforms = SpawnController.Instance.
GetAllSpawnedPlayers();
playerList=new ArrayList();
for ( int i = 0; i < numberOfBattlers; i++ )
{
Search WWH ::




Custom Search