public void VoicePlay0()
        {
            int count = backlogItemList.Count;

            if (count < 1)
            {
                return;
            }
            BacklogItem item          = backlogItemList[0];
            string      characterName = item.name;
            string      index         = item.voiceIndex;

            if (!string.IsNullOrEmpty(index))
            {
                AudioClip clip = resourceManager.Get <AudioClip>(index);
                musicManager.VoicePlay(characterName, clip, index);
            }
        }
Esempio n. 2
0
        public void Push(BacklogItem item)
        {
            int index = (head + 1) % capacity;

            if (count < capacity)
            {
                if (count != index)   // index == 0, count == 0, count will increase
                {
                    throw new System.Exception("BacklogManager Push");
                }
                count++; // count == index + 1
                BacklogItemList.Add(item);
            }
            else
            {
                BacklogItemList[index] = item;
            }
            head = index;
        }
Esempio n. 3
0
        public void Push(string voiceIndex, string contextIndex, string imageIndex, string name)
        {
            BacklogItem item = new BacklogItem(voiceIndex, contextIndex, imageIndex, name);

            Push(item);
        }
        protected override void LoadData()
        {
            name2.text    = "";
            name1.text    = "";
            name0.text    = "";
            context2.text = "";
            context1.text = "";
            context0.text = "";
            voice2.SetActive(false);
            voice1.SetActive(false);
            voice0.SetActive(false);
            count = backlogManager.Count;
            backlogItemList.Clear();
            int         index = head;
            string      name = null, contextIndex = null, viIndex = null;
            string      context = null;
            BacklogItem item    = null;

            if (index >= count)
            {
                voice0.SetActive(false);
                name0.text    = "";
                context0.text = "";
                return;
            }
            item = backlogManager.Seek(index);
            backlogItemList.Add(item);
            name         = item.name;
            viIndex      = item.voiceIndex;
            contextIndex = item.contextIndex;
            if (!string.IsNullOrEmpty(contextIndex))
            {
                context = resourceManager.Get <string>(contextIndex);
            }
            else
            {
                context = "";
            }
            if (string.IsNullOrEmpty(viIndex))
            {
                voice0.SetActive(false);
            }
            else
            {
                voice0.SetActive(true);
            }
            name0.text = name == null || name.Equals(constData.ChoiceBacklogItemName) ? "" : name;
            if (name != null && name.Equals(constData.ChoiceBacklogItemName))
            {
                context0.text = "      > " + context + " <";
            }
            else
            {
                context0.text = context;
            }

            index++;
            if (index >= count)
            {
                voice1.SetActive(false);
                name1.text    = "";
                context1.text = "";
                return;
            }
            item = backlogManager.Seek(index);
            backlogItemList.Add(item);
            name         = item.name;
            viIndex      = item.voiceIndex;
            contextIndex = item.contextIndex;
            if (!string.IsNullOrEmpty(contextIndex))
            {
                context = resourceManager.Get <string>(contextIndex);
            }
            else
            {
                context = "";
            }
            if (string.IsNullOrEmpty(viIndex))
            {
                voice1.SetActive(false);
            }
            else
            {
                voice1.SetActive(true);
            }
            name1.text = name == null || name.Equals(constData.ChoiceBacklogItemName) ? "" : name;
            if (name != null && name.Equals(constData.ChoiceBacklogItemName))
            {
                context1.text = "      > " + context + " <";
            }
            else
            {
                context1.text = context;
            }

            index++;
            if (index >= count)
            {
                voice2.SetActive(false);
                name2.text    = "";
                context2.text = "";
                return;
            }
            item = backlogManager.Seek(index);
            backlogItemList.Add(item);
            name         = item.name;
            viIndex      = item.voiceIndex;
            contextIndex = item.contextIndex;
            if (!string.IsNullOrEmpty(contextIndex))
            {
                context = resourceManager.Get <string>(contextIndex);
            }
            else
            {
                context = "";
            }
            if (string.IsNullOrEmpty(viIndex))
            {
                voice2.SetActive(false);
            }
            else
            {
                voice2.SetActive(true);
            }
            name2.text = name == null || name.Equals(constData.ChoiceBacklogItemName) ? "" : name;
            if (name != null && name.Equals(constData.ChoiceBacklogItemName))
            {
                context2.text = "      > " + context + " <";
            }
            else
            {
                context2.text = context;
            }
        }