// temp until database implementation
    private EnemyDataSaver ForceGeoPoint(GeoPoint playersgeo, float radius)
    {
        var lat = playersgeo.lat_d;
        var lon = playersgeo.lon_d;

        var temp  = Random.Range(-(radius * 2), (radius * 2));
        var temp2 = Random.Range(-(radius * 2), (radius * 2));

        return(new EnemyDataSaver(EnemyNames.GetRandomName(), StylesEnum.GetRandomType(), lat + temp, lon + temp2,
                                  Sprites.Instance.GetRandomEnemySprite(), (Random.Range(1, 4) == 1)));
    }
Ejemplo n.º 2
0
    private List <GameObject> MakeFoundEnemiesIntoGameObjects(List <QRCode> list)
    {
        // Find the enemy holder to store the enemy in
        Destroy(GameObject.Find("Enemy Holder"));
        GameObject enemyHolder = new GameObject("Enemy Holder");

        List <GameObject> objList = new List <GameObject>();

        foreach (QRCode code in list)
        {
            var obj = CreateGameObjectForPlayerOrEnemy.CreateEnemyFromQRCode(code, StylesEnum.GetRandomType(), Sprites.Instance.GetRandomEnemySprite(), false);
            obj.GetComponent <Transform>().parent = enemyHolder.GetComponent <Transform>();
            objList.Add(obj);
        }

        return(objList);
    }