// Start is called before the first frame update void Start() { playerHealth = GetComponent <PlayerHealth>(); crateSpawner = GameObject.Find("CrateSpawner").GetComponent <CrateSpawner>(); layBombPos = transform.Find("LayBomb").transform; ui_BombCount = GameObject.Find("BombCount").GetComponent <UI_BombCount>(); audioSource = GetComponent <AudioSource>(); }
private void SetupItemRoom(Room r) { GameObject spawnerObj = (GameObject)Instantiate(ObjectFactory.Instance.GetObjectPrefab(ObjectFactory.eObject.CrateSpawner), null); spawnerObj.transform.position = r.FloorCenter.position; CrateSpawner spawner = spawnerObj.GetComponent <CrateSpawner>(); if (spawner != null) { spawner.SetRoomID(r.RoomID); Vector2 boundaries = r.GetBoundaries(); spawner.SetRoomBoundaries(boundaries.x, boundaries.y); } }
void Start() { timer = GameObject.FindObjectOfType<Timer>(); magnet = GameObject.FindObjectOfType<MagnetComponent>(); crateSpawner = GameObject.FindObjectOfType<CrateSpawner>(); indicators = new Image[] { indicator0, indicator1, indicator2, indicator3, indicator4 }; opaqueColor = new Color(1, 1, 1, 1); transparentColor = new Color(1, 1, 1, 0.3f); foreach(Image image in indicators) image.color = transparentColor; }
/// <summary> /// Adds the crate spawner. /// </summary> /// <param name="newCrate">New crate.</param> public void AddCrateSpawner(CrateSpawner newCrate) { m_CrateSpawnerList.Add(newCrate); }
void Start() { c = GetComponent <CrateSpawner>(); }
void Start() { _createSpawner = GetComponent <CrateSpawner>(); _createSpawner.SpawnCrates(); }
// Use this for initialization void Start() { myCrateSpawner = GetComponentInParent <CrateSpawner> (); }