Ejemplo n.º 1
0
 public void BuySatellite()
 {
     if (OnBuySattelite != null)
     {
         var satelite = SateliteFactory.From(gameManager.lastSatelliteChoice.satelliteType);
         OnBuySattelite(satelite.gameObject);
     }
 }
Ejemplo n.º 2
0
    void SpawnSatallite()
    {
        const int      enemyTeamId    = 2;
        var            satellite      = SateliteFactory.From(SateliteFactory.SatelliteType.Attack, enemyTeamId);
        GameObject     go             = satellite.gameObject;
        Vector3        startPosition  = Quaternion.Euler(0, 0, (Random.value * 360)) * (Vector3.up * 2.85f);
        Vector3        endPosition    = startPosition + (startPosition.normalized * (0.3f + Random.value * 4));
        List <Vector3> trajectoryList = new List <Vector3>();

        trajectoryList.Add(startPosition);
        trajectoryList.Add(endPosition);
        go.GetComponent <Satelite>().Spawn(trajectoryList);
    }