void Start() { previousPlace = -1; place = 0; numHumans = DataManager.instance.getNumActivePlayers(); humansFinish = 0; hm = FindObjectOfType <HypeManager>(); rm = hm.GetComponent <RaceManager>(); }
// Start is called before the first frame update void Start() { _raceManager = FindObjectOfType <RaceManager>(); aiMan = _raceManager.aiMan; if (_raceManager != null) { _carsInGame = _raceManager.cars.Length; } else { Debug.LogError("Race Manager not found!"); } _hypeManager = FindObjectOfType <HypeManager>(); if (_hypeManager == null) { Debug.LogError("Hype Manager not found!"); } }
// Start is called before the first frame update void Start() { arenaStatus.SetActive(false); if (GameObject.FindGameObjectWithTag("GameManager") != null) { _hypeManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <HypeManager>(); _rm = GameObject.FindGameObjectWithTag("GameManager").GetComponent <RaceManager>(); } else { Debug.LogWarning("Game Manager Can Not be Found"); } int numPlayers = 1; if (DataManager.instance != null) { numPlayers = DataManager.instance.getNumActivePlayers(); _dm = DataManager.instance; } else { Debug.LogWarning("Data Manager Can Not be Found"); } int playerNum = vehicleInputScript.getPlayerNum(); _chb = vehicleInputScript.GetComponent <CarHealthBehavior>(); _raycastCarHolder = vehicleInputScript.GetComponent <RaycastCar>(); _dm.playerUIDictionary.Add(_raycastCarHolder.playerID, this); //Old Attack Indicator Setup /* * if (numPlayers > 1) * { * _heightOffset = 0.057f; * for (int i = 0; i < attackIndicators.Count; i++) * { * attackIndicators[i].transform.localScale = multiplePlayerScale; * } * } * else * { * for (int i = 0; i < attackIndicators.Count; i++) * { * attackIndicators[i].transform.localScale = onePlayerScale; * } * } */ switch (playerNum) { case 1: //is player 1 if (numPlayers == 2) { offSetVector = new Vector3(0, localCam.pixelHeight, 0); } else if (numPlayers >= 3) { offSetVector = new Vector3(0, localCam.pixelHeight, 0); } break; case 2: //is player 2 if (numPlayers >= 3) { offSetVector = new Vector3(localCam.pixelWidth, localCam.pixelHeight, 0); } break; case 3: //is player 3 offSetVector = new Vector3(0, 0, 0); break; case 4: //is player 4 offSetVector = new Vector3(localCam.pixelWidth, 0, 0); break; } //Legacy Hype and Pole position Setters, Assigned per player //hypeText.color = Color.cyan; //hypeDisplay.sprite = hypeDisplayColors[playerNum - 1]; //poleBean.sprite = beanSprites[playerNum - 1]; }