void Start() { animator = GetComponent <Animator>(); input = GetComponent <InputManager>(); playerShield = GetComponent <Shield>(); playerCryon = GetComponent <Cryon>(); }
private void Start() { int padCount = Input.GetJoystickNames().Length; for (int i = 0; i < padCount; i++) { Vector2 position = spawnPoints[Random.Range(0, spawnPoints.Length)].position; GameObject player = Instantiate(playerPrefab, position, Quaternion.identity); player.GetComponent <InputManager>().playerId = i + 1; Camera.main.GetComponent <MultiCameraController>().targets.Add(player.transform); Shield shield = player.GetComponent <Shield>(); shield.shieldColor = (BubbleSpawner.Color)i; shield.playerShield.sprite = shield.shieldSprites[i]; Cryon cryon = player.GetComponent <Cryon>(); cryon.cryonColor = (BubbleSpawner.Color)i; cryon.playerCryon.sprite = cryon.cryonSprites[i]; } }