예제 #1
0
 public void OnListItemSelect(SDKJob job)
 {
     if (OnItemSelected != null)
     {
         OnItemSelected(job);
     }
 }
예제 #2
0
        public void PopulateData(SDKJob data, bool isActive)
        {
            this.data = data;

            m_ToggleLock = true;
            toggle.isOn  = isActive;
            m_ToggleLock = false;
        }
예제 #3
0
        public void LoadMap(SDKJob job)
        {
            JobLoadMapBinaryAsync j = new JobLoadMapBinaryAsync();

            j.id        = job.id;
            j.OnResult += (SDKMapResult result) =>
            {
                Debug.Log(string.Format("Load map {0} ({1} bytes)", job.id, result.mapData.Length));

                Color            pointCloudColor = ARMap.pointCloudColors[UnityEngine.Random.Range(0, ARMap.pointCloudColors.Length)];
                ARMap.RenderMode renderMode      = m_ARMap?.renderMode ?? ARMap.RenderMode.EditorAndRuntime;

                ARSpace.LoadAndInstantiateARMap(null, result, renderMode, pointCloudColor);
            };

            m_Jobs.Add(j);
        }
        public void GenerateItems(int from, int to, bool append = false, bool newDataAvailable = false)
        {
            to = Mathf.Clamp(to, 1, m_Data.Length);

            if (to == items.Count && !newDataAvailable)
            {
                //update exising items
                for (int i = 0; i < items.Count; i++)
                {
                    ScrollListItem scrollListItem = items[i].GetComponent <ScrollListItem>();
                    scrollListItem.data = m_Data[i];
                }
                return;
            }

            if (items.Count > 0 && !append)
            {
                DestroyItems();
            }

            if (m_Data != null && m_Data.Length > 0)
            {
                for (int i = from; i < to; i++)
                {
                    SDKJob     job  = m_Data[i];
                    GameObject item = Instantiate(itemTemplate);
                    items.Add(item);
                    item.name = item.name + "_" + i;
                    item.SetActive(true);
                    item.transform.SetParent(contentParent, false);

                    ScrollListItem scrollListItem = item.GetComponent <ScrollListItem>();
                    scrollListItem.PopulateData(job, IsActive(job.id));
                }
            }

            if (newDataAvailable)
            {
                ScrollToTop();
            }

            loadMoreButton.SetActive(m_Data.Length > to);
            loadMoreButton.transform.SetAsLastSibling();
        }
예제 #5
0
        public void OnValueChanged(TMP_Dropdown dropdown)
        {
            int value = dropdown.value - 1;

            // use embedded map
            if (m_EmbeddedMap != null && value == -1)
            {
                m_ARMap.mapFile = m_EmbeddedMap;
                m_ARMap.LoadMap();
            }
            else
            {
                if (value >= 0)
                {
                    SDKJob map = m_Maps[value];
                    LoadMap(map);
                }
            }
        }
예제 #6
0
        public void GenerateItems()
        {
            int  newDataLen = m_Data == null ? 0 : m_Data.Length;
            bool scroll     = items.Count != newDataLen;

            if (!scroll)
            {
                for (int i = 0; i < items.Count; i++)
                {
                    ScrollListItem scrollListItem = items[i].GetComponent <ScrollListItem>();
                    scrollListItem.data = m_Data[i];
                }
                return;
            }

            if (items.Count > 0)
            {
                DestroyItems();
            }

            if (m_Data != null && m_Data.Length > 0)
            {
                for (int i = 0; i < m_Data.Length; i++)
                {
                    SDKJob     job  = m_Data[i];
                    GameObject item = Instantiate(itemTemplate);
                    items.Add(item);
                    item.SetActive(true);
                    item.transform.SetParent(contentParent, false);

                    ScrollListItem scrollListItem = item.GetComponent <ScrollListItem>();
                    scrollListItem.PopulateData(job, IsActive(job.id));
                }
            }

            if (scroll)
            {
                ScrollToTop();
            }
        }
        public void PopulateData(SDKJob data, bool isActive)
        {
            this.data = data;

            toggle.SetIsOnWithoutNotify(isActive);
        }
예제 #8
0
 public void OnListItemSelect(SDKJob job)
 {
     OnItemSelected?.Invoke(job);
 }
예제 #9
0
 private void OnItemRestored(SDKJob job)
 {
     RestoreMapImages(job.id);
 }
예제 #10
0
 private void OnItemDeleted(SDKJob job)
 {
     DeleteMap(job.id);
 }
예제 #11
0
 private void OnItemSelected(SDKJob job)
 {
     LoadMap(job.id);
 }