void Start() { int activeCards = 8; IDL = GameObject.Find("Camera").GetComponent <ItemDataLoader>(); int noItems = IDL.GetNoItems(); // CREATE ALL THE INSTANCES OF CARDS TO ADD TO THE SCROLL VIEW addCardsToView(noItems); // DEACTIVATES CARDS IF ITEMS IN LIST IS < 50 deactivateCards(activeCards); // BUG FIX: Scroll view for some reason defaults to starting halfway down the scroll space... // ... the below code fixes this by setting the scroll view to start at the top instead. GameObject.Find("Scroll View").GetComponent <ScrollRect>().normalizedPosition = new Vector2(0, 1); }
void Awake() { insatnce = this; }