예제 #1
0
        private VContentsChild CoroutineShowContent(App.Model.MContent content, Vector3 position)
        {
            GameObject obj = Instantiate(contentsChild);

            obj.transform.SetParent(contentPanel);
            obj.transform.SetAsFirstSibling();
            VContentsChild vContentsChild = obj.GetComponent <VContentsChild>(); vContentsChild.name = content.content_id.ToString();

            if (content.type == ContentType.character)
            {
                obj.transform.localPosition = position;
                obj.transform.localScale    = new Vector3(0.001f, 0.001f, 1f);
                obj.transform.eulerAngles   = Vector3.zero;
                MCharacter mCharacter = new MCharacter();
                mCharacter.CharacterId = content.content_id;
                vCard.gameObject.SetActive(true);
                vCard.transform.localPosition = Vector3.zero;
                vCard.transform.eulerAngles   = Vector3.zero;
                vCard.transform.localScale    = Vector3.zero;
                vCard.BindingContext          = mCharacter.ViewModel;
                vCard.UpdateView();

                seqCard = new Sequence();
                seqCard.Insert(0f, HOTween.To(vCard.transform, 0.5f, new TweenParms()
                                              .Prop("eulerAngles", new Vector3(0, 0, 360f))
                                              .Prop("localScale", Vector3.one, false).OnComplete(() => {
                    seqCard.Pause();
                })));
                seqCard.Insert(0.5f, HOTween.To(vCard.transform, 0.3f, new TweenParms()
                                                .Prop("localPosition", position)
                                                .Prop("eulerAngles", new Vector3(0.001f, 0.001f, 1f))
                                                .Prop("localScale", new Vector3(120f / 240f, 120f / 360f, 1f), false).OnComplete(() => {
                    vCard.gameObject.SetActive(false);
                    obj.transform.localScale = Vector3.one;
                    seqCard.Kill();
                    seqCard = null;
                    vContentsChild.showComplete = true;
                })));
                seqCard.Play();
            }
            else
            {
                obj.transform.localPosition = Vector3.zero;
                obj.transform.localScale    = Vector3.zero;
                obj.transform.eulerAngles   = Vector3.zero;
                HOTween.To(obj.transform, 0.6f, new TweenParms()
                           .Prop("eulerAngles", new Vector3(0, 0, 360f))
                           .Prop("localPosition", position)
                           .Prop("localScale", Vector3.one)
                           .OnComplete(() => {
                    vContentsChild.showComplete = true;
                }));
            }
            vContentsChild.showComplete = false;
            vContentsChild.UpdateView(content);
            return(vContentsChild);
        }
예제 #2
0
 private IEnumerator CoroutineShowContents(App.Model.MContent[] contents)
 {
     for (int i = 0; i < contents.Length; i++)
     {
         App.Model.MContent content        = contents[i];
         VContentsChild     vContentsChild = CoroutineShowContent(content, contents.Length == 1 ? Vector3.zero : positions[i].localPosition);
         while (!vContentsChild.showComplete)
         {
             yield return(new WaitForEndOfFrame());
         }
         yield return(new WaitForEndOfFrame());
     }
     isComplete = true;
 }