void AlienBattle(AlienType type) { string t = type.ToString(); PlayerPrefs.SetString("ALIEN_KEY", t); SceneManager.LoadScene("ARCombat"); }
void SpawnAlien() { AlienType type = (AlienType)(int)UnityEngine.Random.Range(0, Enum.GetValues(typeof(AlienType)).Length); float newLat = tileManager.getLat + UnityEngine.Random.Range(-0.0007f, 0.0007f); float newLon = tileManager.getLon + UnityEngine.Random.Range(-0.0007f, 0.0007f); Aliens prefab = Resources.Load("MapAlien/" + type.ToString(), typeof(Aliens)) as Aliens; Aliens alien = Instantiate(prefab, Vector3.zero, Quaternion.identity) as Aliens; alien.tileManager = tileManager; alien.Init(newLat, newLon); aliens.Add(alien); }