//initialization void Start() { l = GameObject.FindWithTag("LevelManager").GetComponent <LevelManager>(); //Obtaining and saving the initial positions of the cursor and the coin CoinPosition = Coin.transform.position; playerPosition = playerButton.transform.position; ThisPlayerCar = 0; ThisControlScheme = PlayerData.ControlScheme.NotAssigned; ThisPlayerType = PlayerData.PlayerType.None; }
public static GameObject CreateShip(int uid, int type, PlayerData.PlayerType playerType) { GameObject go; switch (playerType) { case PlayerData.PlayerType.Offensive: go = Prefabs.Instance.GetNewSteelShip(); break; case PlayerData.PlayerType.Player: go = Prefabs.Instance.GetNewPapership(); break; default: go = Prefabs.Instance.GetNewPapership(); break; } Registry.Ships.Add(uid, go); return(go); }
//Updates the variables to be passed to the main game after the GUI selection screen void UpdatePlayerData() { if (ThisPlayerControl == ControlTypesHere.ArrowKeys) { ThisControlScheme = PlayerData.ControlScheme.Arrows; } else if (ThisPlayerControl == ControlTypesHere.WSDA) { ThisControlScheme = PlayerData.ControlScheme.WASD; } else if (ThisPlayerControl == ControlTypesHere.Joy1) { ThisControlScheme = PlayerData.ControlScheme.XboxController1; } else if (ThisPlayerControl == ControlTypesHere.Joy2) { ThisControlScheme = PlayerData.ControlScheme.XboxController2; } else { ThisControlScheme = PlayerData.ControlScheme.NotAssigned; } if (is_this_active) { if (!ThisPlayerSelector.is_CPU) { ThisPlayerType = PlayerData.PlayerType.Player; } else { ThisPlayerType = PlayerData.PlayerType.AI; } } else { ThisPlayerType = PlayerData.PlayerType.None; } }
//initialization void Start() { l = GameObject.FindWithTag("LevelManager").GetComponent<LevelManager>(); //Obtaining and saving the initial positions of the cursor and the coin CoinPosition = Coin.transform.position; playerPosition = playerButton.transform.position; ThisPlayerCar = 0; ThisControlScheme = PlayerData.ControlScheme.NotAssigned; ThisPlayerType = PlayerData.PlayerType.None; }