private void InitializeComponentsInChildren() { environmentTransforms = GetComponentsInChildren <Transform> (); SpriteRenderer groundSprite = environmentTransforms [environmentTransforms.Length - 2].GetComponent <SpriteRenderer> (); npcSpawner = GetComponentInChildren <NPCSpawner> (); npcSpawner.Initialize(3, groundSprite); List <Transform> npcTransforms = npcSpawner.GetNPCTransforms(); platformSpawner = GetComponentInChildren <PlatformSpawner> (); platformSpawner.Initialize(npcTransforms, groundSprite); playerData = SaveSystem.LoadPlayer(); player.Initialize(this, playerData); player.transform.position = platformSpawner.GetPlayerSpawnPoint(); meteorSpawner = GetComponentInChildren <MeteorSpawner> (); meteorSpawner.Initialize(); uiInGameHandler = GetComponentInChildren <UIInGameHandler> (); uiInGameHandler.Initialize(player, npcTransforms); NPCController [] npcControllers = FindObjectsOfType <NPCController> (); foreach (NPCController npc in npcControllers) { npc.Initialize(this, player.playerData.upgradeLevels[1]); } }
public MeteorSpawner CreateMeteorSpawner(float meteorStartPos, float meteorXTranslateAmount) { MeteorSpawner meteorSpawner = Instantiate(meteorSpawnerPrefab); meteorSpawner.hitPosX = meteorStartPos; meteorSpawner.xTranslationOnNextMeteor = meteorXTranslateAmount; return(meteorSpawner); }
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem) { var spawnMeteor = new MeteorSpawner { Prefab = conversionSystem.GetPrimaryEntity(Prefab) }; dstManager.AddComponentData(entity, spawnMeteor); }
private void Awake() { if (Instance != null) { Debug.LogError("Multiple instances of MeteorSpawner", this); Destroy(this); return; } Instance = this; meteorPool = new GameObjectPool(GameManager.Instance.MeteorPrefab, 100); currentDelay = 0; }
private void Awake() { coroutineRunner = Instantiate(CoroutineRunnerPrefab) .GetComponent <ICoroutineRunner>(); ObjectPoool objectPoool = new ObjectPoool(meteorPrefab, PoolRootTransform, optimumPoolCount); CreateShip(); MeteorSpawner meteorSpawner = new MeteorSpawner(meteorPrefab, spawnTime, minMeteoSpeed, maxMeteoSpeed, xMapConstraint, -xMapConstraint, yMapConstraint, -yMapConstraint, 0.01f, coroutineRunner, objectPoool); }
public void Begin() { meteorParent = new GameObject("Meteor Parent"); for (int i = 0; i < TownController.towns.Count; i++) { GameObject meteorObject = new GameObject("spawner [" + i + "]"); MeteorSpawner meteorSpawner = meteorObject.AddComponent <MeteorSpawner>(); meteorSpawner.SetTarget(TownController.towns[i]); meteorSpawner.transform.parent = TownController.towns[i].transform; spawners.Add(meteorSpawner); } StartCoroutine(MeteorShower()); }
void Start() { meteor = GetComponent <Meteor> (); mS = GameObject.Find("MeteorController").GetComponent <MeteorSpawner> (); }
private void Awake() { _spawner = FindObjectOfType <MeteorSpawner>(); }
// Start is called before the first frame update void Start() { player = FindObjectOfType <PlayerController>(); spawner = player.GetComponent <MeteorSpawner>(); }
void Awake () { Instance = this; }
private void Start() { meteorSpawner = GameObject.Find("World").GetComponent <MeteorSpawner>(); timer = gameTime; }
private void Awake() { instance = this; }
public void RegisterMeteorSpawner(MeteorSpawner spawner) { meteorSpawners.Add(spawner); }