public void InitResultPair(List <DailyReflection> drPair)
    {
        int index = 0;

        resultPair = drPair;
        foreach (DailyReflection dr in resultPair)
        {
            GameObject resultObj = null;
            //if (index % 2 == 0)
            resultObj = Instantiate(DRSearchResultItem1Prefab) as GameObject;
            //else
            //	resultObj = Instantiate (DRSearchResultItem2Prefab) as GameObject;
            DRSearchResultItemController controller = resultObj.GetComponent <DRSearchResultItemController> ();
            resultObj.transform.parent     = resultPairObj.transform;
            resultObj.transform.localScale = Vector3.one;
            //controller.InitResultPair (dr);
        }
    }
Exemplo n.º 2
0
 public void InitScrollView(List <DailyReflection> _searchResults)
 {
     scrollRect    = GetComponent <ScrollRect>();
     searchResults = _searchResults;
     for (int i = 0; i < searchResults.Count; i += 2)
     {
         DailyReflection dr1 = searchResults [i];
         DailyReflection dr2 = null;
         if (i + 1 < searchResults.Count)
         {
             dr2 = searchResults [i + 1];
         }
         GameObject resultPairObj = Instantiate(DRSearchResultPrefab) as GameObject;
         DRSearchResultItemController controller = resultPairObj.GetComponent <DRSearchResultItemController> ();
         controller.InitResultPair(dr1, dr2);
         resultPairObj.transform.parent     = ContentPanel.transform;
         resultPairObj.transform.localScale = Vector3.one;
     }
 }