示例#1
0
        protected void CreateDialogChoices()
        {
            if (Conv.Continues)
            {
                float           offset    = 0.0f;
                float           fadeDelay = 0.05f;
                List <Exchange> RunningOutgoingChoices = Conv.RunningOutgoingChoices;
                List <GUIConversationBubble> choices   = new List <GUIConversationBubble> ();
                foreach (Exchange outgoingChoice in RunningOutgoingChoices)
                {
                    GameObject            newPlayerDialogChoiceGameObject = NGUITools.AddChild(PlayerDialogChoicesParent, PlayerDialogChoicePrototype);
                    GUIPlayerDialogChoice playerDialogChoice = newPlayerDialogChoiceGameObject.GetComponent <GUIPlayerDialogChoice> ();

                    playerDialogChoice.Choice = outgoingChoice;
                    playerDialogChoice.ChoiceButtonMessage.target       = gameObject;
                    playerDialogChoice.ChoiceButtonMessage.functionName = "MakeDialogChoice";
                    playerDialogChoice.gameObject.name = "Choice_" + outgoingChoice.Name;

                    GUIConversationBubble bubble = playerDialogChoice.GetComponent <GUIConversationBubble> ();
                    bubble.FadedColor          = (outgoingChoice.NumTimesChosen > 0);
                    bubble.FadeDelay           = fadeDelay;
                    bubble.EnableAutomatically = false;
                    playerDialogChoice.Offset  = offset;
                    bubble.SetProps(outgoingChoice.CleanPlayerDialog, Colors.Get.ConversationPlayerBackground, Colors.Get.ConversationPlayerOption);
                    offset    -= bubble.Height;
                    fadeDelay += 0.05f;
                    choices.Add(bubble);
                }
                PlayerDialogChoicesScrollbar.scrollValue = 0.0f;
                PlayerDialogChoicesScrollbar.ForceUpdate();
                StartCoroutine(WaitForDialogChoicesToBeReady(choices));
            }
        }
示例#2
0
        protected void CreateNextPageChoice()
        {
            GameObject            newPlayerDialogChoiceGameObject = NGUITools.AddChild(PlayerDialogChoicesParent, PlayerDialogChoicePrototype);
            GUIPlayerDialogChoice playerDialogChoice = newPlayerDialogChoiceGameObject.GetComponent <GUIPlayerDialogChoice> ();

            playerDialogChoice.Choice = null;
            playerDialogChoice.ChoiceButtonMessage.target       = gameObject;
            playerDialogChoice.ChoiceButtonMessage.functionName = "MakeDialogChoice";
            playerDialogChoice.gameObject.name         = "Choice_" + (-1).ToString();
            playerDialogChoice.transform.localPosition = new Vector3(0f, -250f, 0f);

            GUIConversationBubble bubble = playerDialogChoice.GetComponent <GUIConversationBubble> ();

            bubble.EnableAutomatically = true;
            bubble.FadedColor          = false;
            bubble.FadeDelay           = 0.05f;
            bubble.SetProps("(More)", Colors.Get.ConversationPlayerBackground, Colors.Get.ConversationPlayerOption);
            playerDialogChoice.Offset = 0.0f;
        }