예제 #1
0
        private void Show()
        {
            foreach (Transform tf in _contents)
            {
                Destroy(tf.gameObject);
            }
            var url = NetworkManager.Instance.GetMethod(MethodType.GetRanking);

            StartCoroutine(NetworkManager.Instance.WebRequest.Get <RankingLifeModelResponseDto>(url, response =>
            {
                var rank    = 1;
                var factory = new LifemodelNodeFactory();
                foreach (var model in response.life_model_list)
                {
                    var obj  = factory.Create();
                    var node = obj.GetComponent <LifemodelNode>();
                    node.Init(rank++, model);
                    obj.transform.SetParent(_contents);
                    obj.transform.localScale = Vector3.one;
                }
            }, error =>
            {
                var factory = new DialogFactory();
                var dialog  = factory.Create().GetComponent <Dialog>();
                dialog.Show(DialogType.AgreeOnly, error);
            }));
        }
        private void Awake()
        {
            var factory = new LifemodelNodeFactory();
            var url     = NetworkManager.Instance.GetMethod(MethodType.GetModelUser);

            StartCoroutine(NetworkManager.Instance.WebRequest.Get <ModelUsersResponseDto>(url, response =>
            {
                foreach (var model in response.life_model_list)
                {
                    var obj  = factory.Create();
                    var node = obj.GetComponent <LifemodelNode>();
                    node.Init(model);
                    obj.transform.SetParent(_contents);
                    obj.transform.localScale = Vector3.one;
                }
            }));
            _close.onClick.AddListener(() =>
            {
                SceneManager.LoadScene("Menu");
            });
        }