Exemplo n.º 1
0
 //初期化
 internal void Init(AdvScenarioPlayer scenarioPlayer, string name, AdvScenarioThread parent)
 {
     this.ScenarioPlayer = scenarioPlayer;
     this.threadName     = name;
     this.ParenetThread  = parent;
     IsMainThread        = (parent == null);
 }
Exemplo n.º 2
0
 internal void DoRandomEnd(AdvEngine engine, AdvScenarioThread thread)
 {
     if (!string.IsNullOrEmpty(jumpLabel))
     {
         thread.JumpManager.ClearOnJump();
         thread.JumpManager.RegistoreLabel(jumpLabel);
     }
 }
Exemplo n.º 3
0
        //サブスレッドを開始
        internal void StartSubThread(string label)
        {
            AdvScenarioThread subTread = this.gameObject.AddComponent <AdvScenarioThread>();

            subTread.Init(ScenarioPlayer, label, this);
            SubThreadList.Add(subTread);
            subTread.StartScenario(label, 0, false);
        }
Exemplo n.º 4
0
 void Complete(ImageEffectBase imageEffect, AdvScenarioThread thread)
 {
     if (inverse)
     {
         imageEffect.enabled = false;
     }
     OnComplete(thread);
 }
Exemplo n.º 5
0
 void Complete(ImageEffectBase imageEffect, AdvScenarioThread thread)
 {
     if (inverse)
     {
         //                imageEffect.enabled = false;
         UnityEngine.Object.DestroyImmediate(imageEffect);
     }
     OnComplete(thread);
 }
Exemplo n.º 6
0
        protected override void OnStart(AdvEngine engine, AdvScenarioThread thread)
        {
            GameObject go = engine.EffectManager.FindTarget(this);

            if (go == null)
            {
                Debug.LogError(RowData.ToErrorString(this.TargetName + " is not found"));
                OnComplete(thread);
                return;
            }
            OnStartEffect(go, engine, thread);
        }
Exemplo n.º 7
0
 //エフェクト開始時のコールバック
 protected override void OnStartEffect(GameObject target, AdvEngine engine, AdvScenarioThread thread)
 {
     this.Fade = target.GetComponentInChildren <IAdvFadeSkippable>(true);
     if (Fade == null)
     {
         Debug.LogError("Can't find [ " + this.TargetName + " ]");
         OnComplete(thread);
     }
     else
     {
         OnStartFade(target, engine, thread);
     }
 }
Exemplo n.º 8
0
        protected override void OnStart(AdvEngine engine, AdvScenarioThread thread)
        {
            GameObject target = engine.EffectManager.FindTarget(this);

            if (target == null)
            {
                Debug.LogError(base.RowData.ToErrorString(this.TargetName + " is not found"));
                this.OnComplete(thread);
            }
            else
            {
                this.OnStartEffect(target, engine, thread);
            }
        }
Exemplo n.º 9
0
        //エフェクト開始時のコールバック
        protected override void OnStartEffect(GameObject target, AdvEngine engine, AdvScenarioThread thread)
        {
            IAdvFade fade = target.GetComponentInChildren <IAdvFade>(true);

            if (fade == null)
            {
                Debug.LogError("Can't find [ " + this.TargetName + " ]");
                OnComplete(thread);
            }
            else
            {
                fade.RuleFadeIn(engine, data, () => OnComplete(thread));
            }
        }
Exemplo n.º 10
0
        protected override void OnStartEffect(GameObject target, AdvEngine engine, AdvScenarioThread thread)
        {
            Camera camera = target.GetComponentInChildren <Camera>(true);

            ImageEffectBase imageEffect;
            bool            alreadyEnabled;

            ImageEffectUtil.TryGetComonentCreateIfMissing(ImageEffectType.ColorFade.ToString(), out imageEffect, out alreadyEnabled, camera.gameObject);
            ColorFade colorFade = imageEffect as ColorFade;
            float     start, end;

            if (inverse)
            {
                //画面全体のフェードイン(つまりカメラのカラーフェードアウト)
                start = colorFade.color.a;
                end   = 0;
            }
            else
            {
                //画面全体のフェードアウト(つまりカメラのカラーフェードイン)
                //colorFade.Strengthで、すでにフェードされているのでそちらの値をつかう
                start = alreadyEnabled ? colorFade.Strength : 0;
                end   = this.color.a;
            }
            imageEffect.enabled = true;

            colorFade.color = color;

            Timer timer = camera.gameObject.AddComponent <Timer>();

            timer.AutoDestroy = true;
            timer.StartTimer(
                engine.Page.ToSkippedTime(this.time),
                (x) =>
            {
                colorFade.Strength = x.GetCurve(start, end);
            },
                (x) =>
            {
                OnComplete(thread);
                if (inverse)
                {
                    imageEffect.enabled = false;
                    imageEffect.RemoveComponentMySelf();
                }
            });
        }
Exemplo n.º 11
0
        //エフェクト開始時のコールバック
        protected override void OnStartEffect(GameObject target, AdvEngine engine, AdvScenarioThread thread)
        {
            if (!string.IsNullOrEmpty(tweenData.ErrorMsg))
            {
                Debug.LogError(tweenData.ErrorMsg);
                OnComplete(thread);
                return;
            }
            AdvITweenPlayer player    = target.AddComponent <AdvITweenPlayer>();
            float           skipSpeed = engine.Page.CheckSkip() ? engine.Config.SkipSpped : 0;

            player.Init(tweenData, IsUnder2DSpace(target), engine.GraphicManager.PixelsToUnits, skipSpeed, (x) => OnComplete(thread));
            player.Play();
            if (player.IsEndlessLoop)
            {
//				waitType = EffectWaitType.Add;
            }
        }
Exemplo n.º 12
0
        //エフェクト開始時のコールバック
        protected override void OnStartEffect(GameObject target, AdvEngine engine, AdvScenarioThread thread)
        {
            if (target != null)
            {
                LetterBoxCamera camera = target.GetComponentInChildren <LetterBoxCamera>();

                //現在の倍率
                float zoom0 = camera.Zoom2D;
                //目標の倍率
                float zoomTo = isEmptyZoom ? zoom0 : zoom;

                //現在の中心点、今の倍率が1の場合は目標の中心点と同じで扱う(無駄な補間を入れないため)
                Vector2 center0 = (zoom0 == 1) ? zoomCenter : camera.Zoom2DCenter;
                //目標の中心点
                Vector2 centerTo = isEmptyZoomCenter ? center0 : zoomCenter;
                Timer             = target.AddComponent <Timer>();
                Timer.AutoDestroy = true;
                Timer.StartTimer(
                    engine.Page.ToSkippedTime(this.time),
                    engine.Time.Unscaled,
                    (x) =>
                {
                    float zoom1     = Timer.GetCurve(zoom0, zoomTo);
                    Vector2 center1 = Timer.GetCurve(center0, centerTo);
                    camera.SetZoom2D(zoom1, center1);
                },
                    (x) =>
                {
                    //倍率1倍なら一応中心点を戻しておく
                    if (zoomTo == 1)
                    {
                        camera.Zoom2DCenter = Vector2.zero;
                    }
                    OnComplete(thread);
                }
                    );
            }
            else
            {
                //記述ミス、タゲーットが見つからない
                Debug.LogError(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.NotFoundTweenGameObject, "SpriteCamera"));
                OnComplete(thread);
            }
        }
Exemplo n.º 13
0
        //エフェクト開始時のコールバック
        protected override void OnStartEffect(GameObject target, AdvEngine engine, AdvScenarioThread thread)
        {
            AdvAnimationData animationData = engine.DataManager.SettingDataManager.AnimationSetting.Find(animationName);

            if (animationData == null)
            {
                Debug.LogError(RowData.ToErrorString("Animation " + animationName + " is not found"));
                OnComplete(thread);
                return;
            }

            AnimationPlayer             = target.AddComponent <AdvAnimationPlayer>();
            AnimationPlayer.AutoDestory = true;
            AnimationPlayer.EnableSave  = EnableSave;
            AnimationPlayer.Play(animationData.Clip, engine.Page.SkippedSpeed,
                                 () =>
            {
                OnComplete(thread);
            });
        }
 protected override void OnStartEffect(GameObject target, AdvEngine engine, AdvScenarioThread thread)
 {
        internal void DoRandomEnd(AdvScenarioThread thread, AdvEngine engine)
        {
            SubRoutineInfo calledInfo = new SubRoutineInfo(engine, this.returnLabel, this.scenarioLabel, this.subroutineCommandIndex);

            thread.JumpManager.RegistoreSubroutine(this.jumpLabel, calledInfo);
        }
Exemplo n.º 16
0
 //フェード開始
 protected override void OnStartFade(GameObject target, AdvEngine engine, AdvScenarioThread thread)
 {
     Fade.RuleFadeOut(engine, this.TransitionArgs, () => OnComplete(thread));
 }
Exemplo n.º 17
0
        //エフェクト開始時のコールバック
        protected override void OnStartEffect(GameObject target, AdvEngine engine, AdvScenarioThread thread)
        {
            Camera          camera = target.GetComponentInChildren <Camera>(true);
            ImageEffectBase imageEffect;
            bool            alreadyEnabled;

            if (!ImageEffectUtil.TryGetComonentCreateIfMissing(imageEffectType, out imageEffect, out alreadyEnabled, camera.gameObject))
            {
                Complete(imageEffect, thread);
                return;
            }

            if (!inverse)
            {
                imageEffect.enabled = true;
            }

            bool enableAnimation   = !string.IsNullOrEmpty(animationName);
            bool enableFadeStregth = imageEffect is IImageEffectStrength;

            if (!enableFadeStregth && !enableAnimation)
            {
                Complete(imageEffect, thread);
                return;
            }

            if (enableFadeStregth)
            {
                IImageEffectStrength fade = imageEffect as IImageEffectStrength;
                float start = inverse ? fade.Strength : 0;
                float end   = inverse ? 0 : 1;
                Timer timer = camera.gameObject.AddComponent <Timer>();
                timer.AutoDestroy = true;
                timer.StartTimer(
                    engine.Page.ToSkippedTime(this.time),
                    engine.Time.Unscaled,
                    (x) =>
                {
                    fade.Strength = x.GetCurve(start, end);
                },
                    (x) =>
                {
                    if (!enableAnimation)
                    {
                        Complete(imageEffect, thread);
                    }
                });
            }

            if (enableAnimation)
            {
                //アニメーションの適用
                AdvAnimationData animationData = engine.DataManager.SettingDataManager.AnimationSetting.Find(animationName);
                if (animationData == null)
                {
                    Debug.LogError(RowData.ToErrorString("Animation " + animationName + " is not found"));
                    Complete(imageEffect, thread);
                    return;
                }

                AdvAnimationPlayer player = camera.gameObject.AddComponent <AdvAnimationPlayer>();
                player.AutoDestory = true;
                player.EnableSave  = true;
                player.Play(animationData.Clip, engine.Page.SkippedSpeed,
                            () =>
                {
                    Complete(imageEffect, thread);
                });
            }
        }
Exemplo n.º 18
0
 //開始時のコールバック
 protected override void OnStart(AdvEngine engine, AdvScenarioThread thread)
 {
     waitEndTime = engine.Time.Time + (engine.Page.CheckSkip() ? time / engine.Config.SkipSpped : time);
     Engine      = engine;
     Thread      = thread;
 }
Exemplo n.º 19
0
 protected abstract void OnStartEffect(GameObject target, AdvEngine engine, AdvScenarioThread thread);
Exemplo n.º 20
0
        protected override void OnStartEffect(GameObject target, AdvEngine engine, AdvScenarioThread thread)
        {
            Camera camera = target.GetComponentInChildren <Camera>(true);

            float                start, end;
            ImageEffectBase      imageEffect    = null;
            IImageEffectStrength effectStrength = null;

            if (string.IsNullOrEmpty(ruleImage))
            {
                bool alreadyEnabled;
                bool ruleEnabled = camera.gameObject.GetComponent <RuleFade>();
                if (ruleEnabled)
                {
                    camera.gameObject.SafeRemoveComponent <RuleFade>();
                }
                ImageEffectUtil.TryGetComonentCreateIfMissing(ImageEffectType.ColorFade.ToString(), out imageEffect, out alreadyEnabled, camera.gameObject);
                effectStrength = imageEffect as IImageEffectStrength;
                ColorFade colorFade = imageEffect as ColorFade;
                if (inverse)
                {
                    //画面全体のフェードイン(つまりカメラのカラーフェードアウト)
                    //					start = colorFade.color.a;
                    start = (ruleEnabled) ? 1 : colorFade.color.a;
                    end   = 0;
                }
                else
                {
                    //画面全体のフェードアウト(つまりカメラのカラーフェードイン)
                    //colorFade.Strengthで、すでにフェードされているのでそちらの値をつかう
                    start = alreadyEnabled ? colorFade.Strength : 0;
                    end   = this.color.a;
                }
                colorFade.enabled = true;
                colorFade.color   = color;
            }
            else
            {
                bool alreadyEnabled;
                camera.gameObject.SafeRemoveComponent <ColorFade>();
                ImageEffectUtil.TryGetComonentCreateIfMissing(ImageEffectType.RuleFade.ToString(), out imageEffect, out alreadyEnabled, camera.gameObject);
                effectStrength = imageEffect as IImageEffectStrength;
                RuleFade ruleFade = imageEffect as RuleFade;
                ruleFade.ruleTexture = engine.EffectManager.FindRuleTexture(ruleImage);
                ruleFade.vague       = vague;
                if (inverse)
                {
                    start = 1;
                    end   = 0;
                }
                else
                {
                    start = alreadyEnabled ? ruleFade.Strength : 0;
                    end   = 1;
                }
                ruleFade.enabled = true;
                ruleFade.color   = color;
            }

            Timer timer = camera.gameObject.AddComponent <Timer>();

            timer.AutoDestroy = true;
            timer.StartTimer(
                engine.Page.ToSkippedTime(this.time),
                engine.Time.Unscaled,
                (x) =>
            {
                effectStrength.Strength = x.GetCurve(start, end);
            },
                (x) =>
            {
                OnComplete(thread);
                if (inverse)
                {
                    imageEffect.enabled = false;
                    imageEffect.RemoveComponentMySelf();
                }
            });
        }
 protected abstract void OnStart(AdvEngine engine, AdvScenarioThread thread);
 internal virtual void OnComplete(AdvScenarioThread thread)
 {
     thread.WaitManager.CompleteCommand(this);
 }
Exemplo n.º 23
0
 public void OnEffectFinalize()
 {
     Engine = null;
     Thread = null;
 }
Exemplo n.º 24
0
 //開始時のコールバック
 protected override void OnStart(AdvEngine engine, AdvScenarioThread thread)
 {
     Engine = engine;
 }