void Start() { spwanNumInput = gameObject.GetComponentInChildren <InputField>(); Button btn_sprawm = gameObject.GetComponentInChildren <Button>(); btn_sprawm.onClick.AddListener(OnBtnSpawn); poolsMgr = ObjectPoolsMgr.instance; Text tag = transform.Find("tag").GetComponent <Text>(); tag.text = refPool.prefab.name; }
void Start() { poolsMgr = ObjectPoolsMgr.instance; foreach (var pool in poolsMgr.pools) { GameObject listViewItem = Instantiate(listViewItemPrefab); listViewItem.transform.SetParent(transform); ListViewItem listItemCls = listViewItem.GetComponent <ListViewItem>(); listItemCls.refPool = pool; listItemCls.listview = this; } }
void Start() { poolsMgr = ObjectPoolsMgr.instance; transform.position = new Vector3(0, 0, 0); float xforce = Random.Range(-sideforce, sideforce); float yforce = Random.Range(upforce / 2f, upforce); float zforce = Random.Range(-sideforce, sideforce); Vector3 force = new Vector3(xforce, yforce, zforce); GetComponent <Rigidbody>().velocity = force; StartCoroutine(AutoDestory()); }