Exemplo n.º 1
0
 void Start()
 {
     animator     = GetComponent <Animator>();
     input        = GetComponent <InputManager>();
     playerShield = GetComponent <Shield>();
     playerCryon  = GetComponent <Cryon>();
 }
Exemplo n.º 2
0
    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];
        }
    }