Пример #1
0
	IEnumerator Sequence(ConversationData data)
	{
		for (int i = 0; i<data.list.Count; ++i)
		{
			SpeakerData sd = data.list[i];

			ConversationPanel currentPanel = (sd.anchor == TextAnchor.UpperLeft || sd.anchor == TextAnchor.MiddleLeft || sd.anchor == TextAnchor.LowerLeft) ? leftPanel : rightPanel;
			IEnumerator presenter = currentPanel.Display(sd);
			presenter.MoveNext();

			string show, hide;
			if (sd.anchor == TextAnchor.UpperLeft || sd.anchor == TextAnchor.UpperCenter || sd.anchor == TextAnchor.UpperRight)
			{
				show = ShowTop;
				hide = HideTop;
			}
			else
			{
				show = ShowBottom;
				hide = HideBottom;
			}

			currentPanel.panel.SetPosition(hide, false);
			MovePanel(currentPanel, show);

			yield return null;
			while (presenter.MoveNext())
				yield return null;

			MovePanel(currentPanel, hide);
            transition.completedEvent += delegate (object sender, EventArgs e) {
                conversation.MoveNext();
<<<<<<< HEAD
            };
Пример #2
0
 public void ShowConversationPanel()
 {
     if (!Cutscene)
     {
         ConversationPanel.SetActive(true);
     }
 }
Пример #3
0
        private void SetConversationPanel(TcpSignalizationClient client)
        {
            ConversationPanel conversationPanel = new ConversationPanel(client);

            conversationPanel.OnConversationFinish += ConversationPanel_OnConversationFinish;
            SetPanel(conversationPanel);
        }
Пример #4
0
 public void HideConversationPanel()
 {
     if (!Cutscene)
     {
         ConversationPanel.SetActive(false);
     }
 }
Пример #5
0
    IEnumerator RunConversation(int id)
    {
        OnScreenText.SetActive(true);

        while (true)
        {
            ConversationItem item = ConversationFactory.Instance.ItemForID(currentID);
            yield return(StartCoroutine("RunConversationItem", item));

            if (item.responseIDs == null)
            {
                // Conversation is over
                currentCompletionHandler(true);
                break;
            }

            if (item.responseIDs.Length == 1)
            {
                currentID = item.responseIDs[0];
                continue;
            }

            // Show the conversation responses and wait until we start the next conversation
            conversationPanel = (GameObject)Instantiate(conversationPanelPrefab);
            conversationPanel.transform.SetParent(transform);

            ConversationPanel panel = conversationPanel.GetComponent <ConversationPanel>();
            panel.SetResponses(this, item);

            break;
        }

        OnScreenText.SetActive(false);
    }
Пример #6
0
    IEnumerator Sequence(ConversationData data)
    {
        for (int i = 0; i < data.list.Count; ++i)
        {
            SpeakerData sd = data.list[i];

            ConversationPanel currentPanel =
                (sd.anchor == TextAnchor.UpperLeft ||
                 sd.anchor == TextAnchor.MiddleLeft || sd.anchor ==
                 TextAnchor.LowerLeft) ? leftPanel : rightPanel;

            IEnumerator presenter = currentPanel.Display(sd);
            presenter.MoveNext();

            string show, hide;
            if (sd.anchor == TextAnchor.UpperLeft ||
                sd.anchor == TextAnchor.UpperCenter ||
                sd.anchor == TextAnchor.UpperRight)
            {
                show = ShowTop;
                hide = HideTop;
            }
            else
            {
                show = ShowBottom;
                hide = HideBottom;
            }

            currentPanel.panel.SetPosition(hide, false);
            MovePanel(currentPanel, show);

            yield return(null);

            while (presenter.MoveNext())
            {
                yield return(null);
            }

            MovePanel(currentPanel, hide);

            this.AddObserver(
                delegate(object sender, object args)
            {
                conversation.MoveNext();
            },
                Notifications.CONVERSATION_COMPLETED
                );

            yield return(null);
        }

        canvas.gameObject.SetActive(false);
        //if (completeEvent != null)
        //completeEvent(this, EventArgs.Empty);

        this.PostNotification(Notifications.CONVERSATION_COMPLETED);
    }
Пример #7
0
    /// <summary>
    /// Loops over all the speakers in a conversation, in a nested loop, iterates over each
    /// speaker's messages via another IEnumerator from the current panel
    /// </summary>
    /// <param name="data">ConversationData</param>
    IEnumerator Sequence(ConversationData data)
    {
        for (int i = 0; i < data.speakerDataList.Count; i++)
        {
            SpeakerData sd = data.speakerDataList[i];

            ConversationPanel currentPanel = (sd.anchor == TextAnchor.UpperLeft ||
                                              sd.anchor == TextAnchor.MiddleLeft || sd.anchor == TextAnchor.LowerLeft) ?
                                             leftPanel : rightPanel;
            IEnumerator presenter = currentPanel.Display(sd);
            presenter.MoveNext();

            string show, hide;
            if (sd.anchor == TextAnchor.UpperLeft || sd.anchor == TextAnchor.UpperCenter ||
                sd.anchor == TextAnchor.UpperRight)
            {
                show = ShowTop;
                hide = HideTop;
            }
            else
            {
                show = ShowBottom;
                hide = HideBottom;
            }

            currentPanel.panel.SetPosition(hide, false);
            MovePanel(currentPanel, show);

            yield return(null);     // Pause in the sequence

            while (presenter.MoveNext())
            {
                yield return(null);
            }

            MovePanel(currentPanel, hide);
            transition.easingControl.completedEvent += delegate(object sender, EventArgs e) {
                conversation.MoveNext();
            };

            yield return(null);      // Pause in the sequence
        }

        canvas.gameObject.SetActive(false);
        if (completeEvent != null)
        {
            completeEvent(this, EventArgs.Empty);
        }
    }
Пример #8
0
        public IEnumerator Introduction()
        {
            var MainCamera = Camera.main;

            if (showIntroduction)
            {
                Camera.main.enabled = false;
            }



            StartCoroutine(Caapora.instance.CharacterMovement("left", 10));

            yield return(new WaitForSeconds(3f));

            StartCoroutine(Caapora.instance.ShakePlayer());

            yield return(new WaitForSeconds(1f));

            //  txtBallonConversation.instance.ActiveBallon(true);

            StartCoroutine(CaaporaConversation.AnimateFrase());


            StartCoroutine(UIInterface.hideAndShowObject(GameObject.Find("Informacoes"), 3));

            yield return(new WaitForSeconds(3f));

            StartCoroutine(UIInterface.showAndHideObject(GameObject.Find("Informacoes"), 3));


            StartCoroutine(UIInterface.hideAndShowObject(GameObject.Find("CanvasGUIContainer"), 7));



            StartCoroutine(moverCamera("down"));
            yield return(new WaitForSeconds(10f));

            MainCamera.enabled = true;


            // player.GetComponent<Animator>().SetTrigger("CaaporaIdle");


            ConversationPanel.ActivePanel(true);
            StartCoroutine(CaaporaConversation.AnimateFrase());
        }
Пример #9
0
        IEnumerator RemoveBalloon()
        {
            yield return(new WaitForSeconds(2));

            ConversationPanel.ActivePanel(false);
        }
Пример #10
0
 void MovePanel(ConversationPanel obj, string pos)
 {
     transition = obj.panel.SetPosition(pos, true);
     transition.easingControl.duration = 0.5f;
     transition.easingControl.equation = EasingEquations.EaseOutQuad;
 }
    IEnumerator Sequence(ConversationData data)
    {
        // 해당 대화 이벤트에서 서로 주고받는
        // 대화 수 만큼 반복문을 돌림.
        for (int i = 0; i < data.list.Count; ++i)
        {
            // 대사마다 필요한 정보를 차례대로 불러온다.
            SpeakerData sd = data.list[i];

            // 대화상자의 위치를 지정한다. (왼쪽대화상자? 오른쪽 대화상자?)
            // 오른쪽은 Player, 왼쪽은 상대방
            ConversationPanel currentPanel
                = (sd.anchor == TextAnchor.UpperLeft || sd.anchor == TextAnchor.MiddleLeft || sd.anchor == TextAnchor.LowerLeft) ? leftPanel : rightPanel;

            // ConversationPanel.Display 는
            // 대사 내용, 아바타 이미지, 화살표 연출 여부 등을
            // 처리한다.
            IEnumerator presenter = currentPanel.Display(sd);

            // Display 코루틴 재생
            // MoveNext() 는  yield return 을 받기 전까지만 재생시킨다.
            presenter.MoveNext();

            string show, hide;

            // 어떤 키값으로 UI 연출을 할 것인지 체크
            if (sd.anchor == TextAnchor.UpperLeft || sd.anchor == TextAnchor.UpperCenter || sd.anchor == TextAnchor.UpperRight)
            {
                show = ShowTop;
                hide = HideTop;
            }
            else
            {
                show = ShowBottom;
                hide = HideBottom;
            }

            // 처음 대화 상자가 나오면 아래에서 위로 올라오는 연출이
            // 진행된다.
            currentPanel.panel.SetPosition(hide, false);
            MovePanel(currentPanel, show);

            // MoveNext(); 를 다시 전달 받기 전에는
            // 아래 코드를 진행하지 않는다.
            yield return(null);

            // currentPanel.Display(sd);
            // 전달받은 SpeakerData의 모든 대화 내용을
            // 하나씩 출력하고 멈추고
            // 다시 MoveNext()가 호출될때까지 기다리는 것을
            // 반복한다.
            while (presenter.MoveNext())
            {
                yield return(null);
            }


            // 대사 내용이 종료되면
            // 해당 대화 상자를 아래로 내리는 연출을 진행한다.
            MovePanel(currentPanel, hide);

            // EasingControl의 completedEvent 이벤트에 델리게이트를 등록시킨다.
            transition.completedEvent += delegate(object sender, EventArgs e) {
                conversation.MoveNext();
            };


            yield return(null);
        }

        // 모든 대사가 종료되면 canvas를 비활성화
        canvas.gameObject.SetActive(false);

        // completedEvent 에 등록된
        // 델리게이트를 호출한다. (*씬을 바꾸는 함수가 등록될 예정)
        if (completeEvent != null)
        {
            completeEvent(this, EventArgs.Empty);
        }
    }
Пример #12
0
 public static void sendMessage(ConversationPanel conversation, string message)
 {
     //todo(jasin) make this a buttonx
     if (message == "/challenge")
     {
         Network.challenge(conversation.partner);
         return;
     }
     Network.sendTell(conversation.partner, message);
     conversation.appendLine("you: " + message);
 }
Пример #13
0
        public static ConversationPanel getConversation(string user)
        {
            ConversationPanel p = null;

            if (conv.ContainsKey(user) && !conv[user].isClosed())
            {
                p = (ConversationPanel)conv[user].getContent();
            }
            else
            {
                conv.Remove(user);
                p = new ConversationPanel(user);
                conv.Add(user, GUI.showWindow(p));
            }

            return p;
        }
Пример #14
0
    // Use this for initialization


    void Awake()
    {
        // Acessar atributos da classe pelos metodos estaticos
        instance = this;
    }
Пример #15
0
 void MovePanel(ConversationPanel obj, string pos)
 {
     transition = obj.panel.SetPosition (pos, true);
     transition.duration = 0.5f;
     transition.equation = EasingEquations.EaseOutQuad;
 }