Exemplo n.º 1
0
        bool CheckPlaySe(AdvPage page)
        {
            if (Disable)
            {
                return(false);
            }
            if (page.CurrentTextLength == lastCharacterCount)
            {
                return(false);
            }

            switch (type)
            {
            case Type.Time:
                if (page.Engine.Time.Time - lastTime > intervalTime)
                {
                    return(true);
                }
                break;

            case Type.CharacterCount:
                if (page.CurrentTextLength >= lastCharacterCount + intervalCount)
                {
                    return(true);
                }
                break;
            }
            return(false);
        }
Exemplo n.º 2
0
        //強調表示(グレーアウト無視)するか
        bool IsLightingCharacter(AdvPage page, AdvGraphicLayer layer)
        {
            //しゃべっているキャラ
            if ((Mask & LightingMask.Talking) == LightingMask.Talking)
            {
                if (layer.DefaultObject.name == page.CharacterLabel)
                {
                    return(true);
                }
            }

            //ページ内の新規キャラ
            if ((Mask & LightingMask.NewCharacerInPage) == LightingMask.NewCharacerInPage)
            {
                if (pageBeginLayer.Find(x => (x != null && x.DefaultObject != null) && (x.DefaultObject.name == layer.DefaultObject.name)) == null)
                {
                    return(true);
                }
            }

            //名前指定のあるキャラ
            if (NoGrayoutCharacters.Exists(x => x == layer.DefaultObject.name))
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 3
0
        AudioClip GetSe(AdvPage page)
        {
            //キャラごとにSEを変える場合はキャラクターラベルを使う
            SoundInfo info = soundInfoList.Find(x => x.key == page.CharacterLabel);

            return((info != null) ? info.sound : defaultSound);
        }
Exemplo n.º 4
0
 //テキストに変更があった場合
 protected virtual void OnChangeText(AdvPage page)
 {
     if (!TyrSetIcon(page))
     {
         targetObject = null;
         HideIcon();
     }
 }
Exemplo n.º 5
0
 internal void PageTextChange(AdvPage page)
 {
     this.Text           = page.TextData;
     this.NameText       = page.NameText;
     this.CharacterLabel = page.CharacterLabel;
     this.TextLength     = page.CurrentTextLength;
     this.MessageWindow.OnTextChanged(this);
 }
Exemplo n.º 6
0
 private void OnChangeText(AdvPage page)
 {
     if (!this.TyrSetIcon(page))
     {
         this.targetObject = null;
         this.HideIcon();
     }
 }
Exemplo n.º 7
0
 void OnUpdateSendChar(AdvPage page)
 {
     //テキストの文字送り音を鳴らす
     if (CheckPlaySe(page))
     {
         AudioClip sound = GetSe(page);
         if (sound != null)
         {
             SoundManager.GetInstance().PlaySe(sound);
             lastCharacterCount = page.CurrentTextLength;
             lastTime           = page.Engine.Time.Time;
         }
     }
 }
Exemplo n.º 8
0
 //ページの冒頭
 void OnBeginPage(AdvPage page)
 {
     this.pageBeginLayer = page.Engine.GraphicManager.CharacterManager.AllGraphicsLayers();
     if (this.mask == 0)
     {
         //表示なしなのでリセット
         if (isChanged)
         {
             foreach (AdvGraphicLayer layer in pageBeginLayer)
             {
                 ChangeColor(layer, MainColor);
             }
             isChanged = false;
         }
     }
 }
 //ページの冒頭
 void OnBeginPage(AdvPage page)
 {
     this.pageBeinGraphics = page.Engine.GraphicManager.CharacterManager.AllGraphics();
     if (this.mask == 0)
     {
         //表示なしなのでリセット
         if (isChanged)
         {
             foreach (AdvGraphicObject obj in pageBeinGraphics)
             {
                 ChangeColor(obj, MainColor);
             }
             isChanged = false;
         }
     }
 }
        //強調表示(グレーアウト無視)するか
        bool IsLightingCharacter(AdvPage page, AdvGraphicObject obj)
        {
            //しゃべっているキャラ
            if ((Mask & LightingMask.Talking) == LightingMask.Talking)
            {
                if (obj.name == page.CharacterLabel)
                {
                    return(true);
                }
            }

            //ページ内の新規キャラ
            if ((Mask & LightingMask.NewCharacerInPage) == LightingMask.NewCharacerInPage)
            {
                if (pageBeinGraphics.Find(x => (x != null) && (x.name == obj.name)) == null)
                {
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 11
0
        //テキストに変更があった場合
        void OnChangeText(AdvPage page)
        {
            if (this.mask == 0)
            {
                return;
            }
            isChanged = true;
            AdvEngine engine = page.Engine;

            //テキストのみ表示で、前のキャラをそのまま表示
            if (string.IsNullOrEmpty(page.CharacterLabel) && (Mask & LightingMask.NoChanageIfTextOnly) == LightingMask.NoChanageIfTextOnly)
            {
                return;
            }

            List <AdvGraphicLayer> layers = engine.GraphicManager.CharacterManager.AllGraphicsLayers();

            foreach (AdvGraphicLayer layer in layers)
            {
                ChangeColor(layer, IsLightingCharacter(page, layer) ? MainColor : SubColor);
            }
        }
Exemplo n.º 12
0
 private bool CheckPlaySe(AdvPage page)
 {
     this.Disable = !this.engine.Config.IsPlayingTextSound;
     if (!this.Disable)
     {
         if (page.CurrentTextLength == this.lastCharacterCount)
         {
             return(false);
         }
         Type type = this.type;
         if (type != Type.Time)
         {
             if ((type == Type.CharacterCount) && (page.CurrentTextLength >= (this.lastCharacterCount + this.intervalCount)))
             {
                 return(true);
             }
         }
         else if ((Time.get_time() - this.lastTime) > this.intervalTime)
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 13
0
        //テキストに変更があった場合
        protected virtual bool TyrSetIcon(AdvPage page)
        {
            this.targetObject = null;
            AdvCharacterInfo info = page.CharacterInfo;

            if (info == null || info.Graphic == null || info.Graphic.Main == null)
            {
                return(false);
            }

            AdvGraphicInfo          graphic     = info.Graphic.Main;
            AdvCharacterSettingData settingData = graphic.SettingData as AdvCharacterSettingData;

            if (settingData == null)
            {
                return(false);
            }

            AdvCharacterSettingData.IconInfo iconInfo = settingData.Icon;
            if (iconInfo.IconType == AdvCharacterSettingData.IconInfo.Type.None)
            {
                return(false);
            }

            this.targetObject = Engine.GraphicManager.FindObject(info.Label);

            switch (iconInfo.IconType)
            {
            case AdvCharacterSettingData.IconInfo.Type.IconImage:
                SetIconImage(iconInfo.File);
                return(true);

            case AdvCharacterSettingData.IconInfo.Type.DicingPattern:
                SetIconDicingPattern(iconInfo.File, iconInfo.IconSubFileName);
                return(true);

            case AdvCharacterSettingData.IconInfo.Type.RectImage:
                IconGraphicType type = ParseIconGraphicType(graphic, info.Label);
                switch (type)
                {
                case IconGraphicType.Default:
                    SetIconRectImage(graphic, iconInfo.IconRect);
                    return(true);

                case IconGraphicType.Dicing:
                    SetIconDicing(graphic, iconInfo.IconRect);
                    return(true);

                case IconGraphicType.RenderTexture:
                    SetIconRenderTexture(iconInfo.IconRect);
                    return(true);

                case IconGraphicType.NotSupport:
                default:
                    return(false);
                }

            case AdvCharacterSettingData.IconInfo.Type.None:
            default:
                return(false);
            }
        }
Exemplo n.º 14
0
 //テキストが変わった
 internal void OnPageTextChange(AdvPage page)
 {
     CurrentWindow.PageTextChange(page);
     OnTextChange.Invoke(this);
 }
Exemplo n.º 15
0
 void OnBeginPage(AdvPage page)
 {
     lastTime           = 0;
     lastCharacterCount = -intervalCount;
 }
Exemplo n.º 16
0
 private AudioClip GetSe(AdvPage page)
 {