// 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)));
    }
Esempio 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);
    }
        void AddMapStyle(StylesEnum mapType)
        {
            var assembly = typeof(MapsStylingPage).GetTypeInfo().Assembly;

            System.IO.Stream stream;

            switch (mapType)
            {
            case StylesEnum.DARK:
                stream = assembly.GetManifestResourceStream($"MonkeyFestLatam.MasterXFmaps.MapStyles.MapStyleDark.json");
                break;

            case StylesEnum.UBER:
                stream = assembly.GetManifestResourceStream($"MonkeyFestLatam.MasterXFmaps.MapStyles.MapStyleUber.json");
                break;

            case StylesEnum.RETRO:
                stream = assembly.GetManifestResourceStream($"MonkeyFestLatam.MasterXFmaps.MapStyles.MapStyleRetro.json");
                break;

            case StylesEnum.AUBERGINE:
                stream = assembly.GetManifestResourceStream($"MonkeyFestLatam.MasterXFmaps.MapStyles.MapStyleAubergine.json");
                break;

            default:
                stream = assembly.GetManifestResourceStream($"MonkeyFestLatam.MasterXFmaps.MapStyles.MapStyleNight.json");
                break;
            }

            string styleFile;

            using (var reader = new System.IO.StreamReader(stream))
            {
                styleFile = reader.ReadToEnd();
            }

            map.MapStyle = MapStyle.FromJson(styleFile);
        }