public void CreatePanel() { if (a > spawndecrease && b > spawndecrease) { a -= spawndecrease; b -= spawndecrease; } GameObject newpop = Instantiate(MinigamePrefab) as GameObject; newpop.transform.SetParent(GameObject.FindGameObjectWithTag("WallPanel").transform, false); LinkedComponent lc = newpop.GetComponent <LinkedComponent>(); lc.monA = moneya; lc.monB = moneyb; lc.timeA = a; lc.timeB = b; lc.item = this; panelcreated = true; }
private void Start() { lc = GetComponentInParent <LinkedComponent>(); }