Esempio n. 1
0
        public void AddLabel(string label, bool activeFromStart, int distance, PromptPlacementHandler promptHandler)
        {
            m_PromptHandler = promptHandler;
            m_PromptHandler.SetHeight(PromptPlacementHandler.PromptType.InputPrompt, m_CanvasTransform.sizeDelta.y);

            if (m_LabelDictionary.ContainsKey(label))
            {
                var labelInfo = m_LabelDictionary[label];
                labelInfo.Active |= activeFromStart;
                labelInfo.Distances.Add(distance);
            }
            else
            {
                m_LabelDictionary.Add(label, new LabelInfo()
                {
                    Active    = activeFromStart,
                    Distances = new List <int> {
                        distance
                    }
                });
            }

            if (activeFromStart)
            {
                m_Text.text = label;
            }

            m_CanvasTransform.localScale = GetActiveLabelsCount() > 0 ? Vector3.one : Vector3.zero;
        }
Esempio n. 2
0
        public int AddSpeech(List <BubbleInfo> speechBubbleInfos, float pause, bool repeat, Action <int> SpeechFinished, bool activeFromStart, PromptPlacementHandler promptHandler)
        {
            m_PromptHandler = promptHandler;

            m_Speeches.Add(new SpeechInfo()
            {
                SpeechBubbleInfos = speechBubbleInfos,
                Id     = m_NextSpeechId,
                Pause  = pause,
                Repeat = repeat,
                Active = activeFromStart
            });

            OnSpeechFinished += SpeechFinished;

            if (activeFromStart && GetActiveSpeechCount() == 1)
            {
                Activate(m_NextSpeechId);
            }

            return(m_NextSpeechId++);
        }