示例#1
0
        public override void Do()
        {
            base.Do();
            Text.Data data = new Text.Data(this.args);
            this.scenario.fontColorKey = data.name;
            if (data.name != string.Empty)
            {
                data.name = this.scenario.ReplaceText(data.name);
            }
            if (data.text != string.Empty)
            {
                data.text = this.scenario.ReplaceText(data.text);
            }
            TextScenario.CurrentCharaData currentCharaData = this.scenario.currentCharaData;
            if (currentCharaData.isSkip || Manager.Config.GameData.NextVoiceStop)
            {
                this.scenario.VoicePlay((List <TextScenario.IVoice[]>)null, (Action)null, (Action)null);
            }
            currentCharaData.isSkip = false;
            this.scenario.captionSystem.SetName(data.name);
            this.scenario.captionSystem.SetText(data.text, false);
            string str = (string)null;

            switch (data.colorKey)
            {
            case "[H]":
                str = MapUIContainer.CharaNameColor(this.scenario.currentChara?.data?.actor);
                break;

            case "[P]":
                str = MapUIContainer.CharaNameColor(this.scenario.player?.actor);
                break;

            case "[M]":
                Actor actor = (Actor)this.scenario.currentChara?.data?.merchantActor;
                if (Object.op_Equality((Object)actor, (Object)null))
                {
                    List <TextScenario.ParamData> heroineList = this.scenario.heroineList;
                    actor = heroineList != null?heroineList.FirstOrDefault <TextScenario.ParamData>((Func <TextScenario.ParamData, bool>)(p => Object.op_Inequality((Object)p.merchantActor, (Object)null)))?.actor : (Actor)null;
                }
                str = MapUIContainer.CharaNameColor(actor);
                break;
            }
            if (str != null)
            {
                data.name = str;
            }
            this.scenario.TextLogCall(data, (IReadOnlyCollection <TextScenario.IVoice[]>)currentCharaData.voiceList);
            this.next = new Text.Next(this.scenario);
        }
        public virtual void OnStart()
        {
            AgentActor agent = this.Agent;

            agent.EventKey     = EventType.Sleep;
            agent.CurrentPoint = agent.TargetInSightActionPoint;
            agent.SetActiveOnEquipedItem(false);
            agent.ChaControl.setAllLayerWeight(0.0f);
            agent.ElectNextPoint();
            agent.CurrentPoint.SetActiveMapItemObjs(false);
            ActionPointInfo actionPointInfo1 = agent.TargetInSightActionPoint.GetActionPointInfo(agent);

            agent.Animation.ActionPointInfo = actionPointInfo1;
            ActionPointInfo actionPointInfo2 = actionPointInfo1;
            Transform       t    = ((Component)agent.CurrentPoint).get_transform().FindLoop(actionPointInfo2.baseNullName)?.get_transform() ?? ((Component)agent.CurrentPoint).get_transform();
            GameObject      loop = ((Component)agent.CurrentPoint).get_transform().FindLoop(actionPointInfo2.recoveryNullName);

            agent.Animation.RecoveryPoint = loop?.get_transform();
            int eventId = actionPointInfo2.eventID;

            agent.ActionID = eventId;
            int index  = eventId;
            int poseId = actionPointInfo2.poseID;

            agent.PoseID = poseId;
            int       poseID = poseId;
            PlayState info   = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[index][poseID];

            agent.CurrentPoint.DestroyByproduct(index, poseID);
            ActorAnimInfo animInfo = agent.Animation.LoadActionState(index, poseID, info);

            agent.LoadActionFlag(index, poseID);
            agent.DeactivateNavMeshAgent();
            agent.Animation.StopAllAnimCoroutine();
            agent.Animation.PlayInAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, animInfo.inFadeOutTime, animInfo.layer);
            this._onActionPlayDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>)agent.AnimationAgent.OnEndActionAsObservable(), 1), (System.Action <M0>)(_ =>
            {
                agent.Animation.StopAllAnimCoroutine();
                agent.Animation.PlayOutAnimation(animInfo.outEnableBlend, animInfo.outBlendSec, animInfo.layer);
            }));
            if (animInfo.hasAction)
            {
                this._onActionPlayDisposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)agent.AnimationAgent.OnActionPlayAsObservable(), (System.Action <M0>)(_ => agent.Animation.PlayActionAnimation(animInfo.layer)));
            }
            this._onCompleteActionDisposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)agent.AnimationAgent.OnCompleteActionAsObservable(), (System.Action <M0>)(_ => this.Complete()));
            agent.CurrentPoint.SetSlot((Actor)agent);
            agent.SetStand(t, info.MainStateInfo.InStateInfo.EnableFade, info.MainStateInfo.InStateInfo.FadeSecond, info.DirectionType);
            if (animInfo.isLoop)
            {
                agent.SetCurrentSchedule(animInfo.isLoop, actionPointInfo2.actionName, 100, 200, animInfo.hasAction, true);
                if (agent.AgentData.ScheduleEnabled)
                {
                    Actor.BehaviorSchedule schedule = agent.Schedule;
                    schedule.enabled                = agent.AgentData.ScheduleEnabled;
                    schedule.elapsedTime            = agent.AgentData.ScheduleElapsedTime;
                    schedule.duration               = agent.AgentData.ScheduleDuration;
                    agent.Schedule                  = schedule;
                    agent.AgentData.ScheduleEnabled = false;
                }
            }
            MapUIContainer.AddSystemLog(string.Format("{0}が寝ました", (object)MapUIContainer.CharaNameColor((Actor)agent)), true);
        }