Example #1
0
    void Start()
    {
        stageBounds = GetComponent <BoxCollider2D>();
        //Spawn players
        ship1 = Instantiate(ShipPrefabs[SelectedShip.Ship1], Ship1Spawn, Quaternion.identity).GetComponent <Ship>();
        ship2 = Instantiate(ShipPrefabs[SelectedShip.Ship2], Ship2Spawn, Quaternion.identity).GetComponent <Ship>();

        //Spawn tether
        tether = Instantiate(ShipTetherPrefab).GetComponent <ShipTether>();

        tether.ship1 = ship1;
        tether.ship2 = ship2;
    }
Example #2
0
    void Start()
    {
        stageBounds = GetComponent <BoxCollider2D>();
        //Spawn players
        ship1 = Instantiate(ShipPrefabs[SelectedShip.Ship1], Ship1Spawn, Quaternion.identity).GetComponent <Ship>();
        ship2 = Instantiate(ShipPrefabs[SelectedShip.Ship2], Ship2Spawn, Quaternion.identity).GetComponent <Ship>();

        //Spawn tether
        tether = Instantiate(ShipTetherPrefab).GetComponent <ShipTether>();

        tether.ship1      = ship1;
        tether.ship2      = ship2;
        currentTeamHealth = maxTeamHealth;
        healthScale       = healthBar.sizeDelta.x / currentTeamHealth;

        Score = 0;
    }