Exemple #1
0
        protected override void OnAwake(PlayerActor player)
        {
            player.EventKey = EventType.StorageIn;
            if (Object.op_Inequality((Object)player.CurrentPoint, (Object)null))
            {
                this._chestAnimation = (ChestAnimation)((Component)player.CurrentPoint).GetComponent <ChestAnimation>();
                if (Object.op_Inequality((Object)this._chestAnimation, (Object)null))
                {
                    this._chestAnimation.PlayInAnimation();
                }
            }
            ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndInAnimation, 1), (Action <M0>)(_ => MapUIContainer.SetActiveItemBoxUI(true)), (Action)(() => ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndMenu, 1), (Action <M0>)(_ =>
            {
                MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.InvokeAcception);
                player.Controller.ChangeState("Normal");
            }))));
            Singleton <Input> .Instance.ReserveState(Input.ValidType.UI);

            Singleton <Input> .Instance.SetupState();

            ActorAnimInfo animInfo = player.Animation.AnimInfo;

            animInfo.outEnableBlend   = true;
            animInfo.outBlendSec      = 0.0f;
            player.Animation.AnimInfo = animInfo;
        }
Exemple #2
0
        public virtual void OnStart()
        {
            ((Task)this).OnStart();
            this.Merchant.SetActiveOnEquipedItem(false);
            this.Merchant.ChaControl.setAllLayerWeight(0.0f);
            this.prevIsTalkable       = this.Merchant.Talkable;
            this.isLooking            = false;
            this.isNearPlayer         = false;
            this.distanceToPlayer     = float.MaxValue;
            this.onActionPlay         = (Subject <Unit>)null;
            this.onEndAction          = (Subject <Unit>)null;
            this.animInfo             = new ActorAnimInfo();
            this.recoveryPoint        = (Transform)null;
            this.CurrentMerchantPoint = this.TargetInSightMerchantPoint;
            if (Object.op_Equality((Object)this.CurrentMerchantPoint, (Object)null))
            {
                return;
            }
            this.Merchant.SetPointIDInfo(this.CurrentMerchantPoint);
            Tuple <MerchantPointInfo, Transform, Transform> eventInfo = this.CurrentMerchantPoint.GetEventInfo(this.stateType);
            Transform t = eventInfo.Item2;

            this.recoveryPoint = eventInfo.Item3;
            if (this.Merchant.Talkable != eventInfo.Item1.isTalkable)
            {
                this.Merchant.Talkable = eventInfo.Item1.isTalkable;
            }
            this.isLooking = eventInfo.Item1.isLooking;
            this.actionID  = eventInfo.Item1.eventID;
            this.poseID    = eventInfo.Item1.poseID;
            Dictionary <int, PlayState> dictionary;
            PlayState info;

            if (!Singleton <Resources> .Instance.Animation.MerchantOnlyActionAnimStateTable.TryGetValue(this.actionID, out dictionary) || !dictionary.TryGetValue(this.poseID, out info))
            {
                return;
            }
            this.animInfo = this.Merchant.Animation.LoadActionState(this.actionID, this.poseID, info);
            this.Merchant.ActivateNavMeshObstacle(t.get_position());
            this.Merchant.Animation.StopAllAnimCoroutine();
            this.Merchant.Animation.PlayInAnimation(this.animInfo.inEnableBlend, this.animInfo.inBlendSec, this.animInfo.inFadeOutTime, this.animInfo.layer);
            this.onEndAction = new Subject <Unit>();
            ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>(Observable.TakeUntilDestroy <Unit>((IObservable <M0>) this.onEndAction, ((Component)this.Merchant).get_gameObject()), 1), (System.Action <M0>)(_ => this.Merchant.Animation.PlayOutAnimation(this.animInfo.outEnableBlend, this.animInfo.outBlendSec, this.animInfo.layer)));
            if (this.animInfo.hasAction)
            {
                ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>(Observable.TakeUntilDestroy <Unit>((IObservable <M0>) this.onActionPlay, ((Component)this.Merchant).get_gameObject()), 1), (System.Action <M0>)(_ => this.Merchant.Animation.PlayActionAnimation(this.animInfo.layer)));
            }
            this.Merchant.CurrentMerchantPoint.SetStand(this.Merchant, t, this.animInfo.inEnableBlend, this.animInfo.inFadeOutTime, this.animInfo.directionType, (System.Action)null);
            if (!this.isLooking)
            {
                return;
            }
            if (this.lookingDisposable != null)
            {
                this.lookingDisposable.Dispose();
            }
            this.lookingDisposable = ObservableExtensions.Subscribe <long>(Observable.Where <long>(Observable.TakeUntilDestroy <long>((IObservable <M0>)Observable.EveryUpdate(), ((Component)this.Merchant).get_gameObject()), (Func <M0, bool>)(_ => ((Behaviour)this.Merchant).get_isActiveAndEnabled())), (System.Action <M0>)(_ => this.LookAtPlayer()));
        }
Exemple #3
0
        protected override void OnAwake(PlayerActor player)
        {
            player.EventKey = AIProject.EventType.Search;
            player.SetActiveOnEquipedItem(false);
            player.ChaControl.setAllLayerWeight(0.0f);
            ValueTuple <int, string> valueTuple;

            AIProject.Definitions.Action.NameTable.TryGetValue(AIProject.EventType.Search, out valueTuple);
            int             index = (int)valueTuple.Item1;
            ActionPointInfo outInfo;

            if (player.CurrentPoint is TutorialSearchActionPoint)
            {
                outInfo = (player.CurrentPoint as TutorialSearchActionPoint).GetPlayerActionPointInfo();
            }
            else
            {
                player.CurrentPoint.TryGetPlayerActionPointInfo(AIProject.EventType.Search, out outInfo);
            }
            int poseId = outInfo.poseID;

            player.PoseID = poseId;
            int        _poseID = poseId;
            Transform  t       = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.baseNullName)?.get_transform() ?? ((Component)player.CurrentPoint).get_transform();
            GameObject loop    = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.recoveryNullName);

            player.Animation.RecoveryPoint = loop?.get_transform();
            PlayState playState = Singleton <Resources> .Instance.Animation.PlayerActionAnimTable[(int)player.ChaControl.sex][index][_poseID];

            player.Animation.LoadEventKeyTable(index, outInfo.poseID);
            player.LoadEventItems(playState);
            player.LoadEventParticles(index, outInfo.poseID);
            player.Animation.InitializeStates(playState.MainStateInfo.InStateInfo.StateInfos, playState.MainStateInfo.OutStateInfo.StateInfos, playState.MainStateInfo.AssetBundleInfo);
            ActorAnimInfo actorAnimInfo = new ActorAnimInfo()
            {
                layer          = playState.Layer,
                inEnableBlend  = playState.MainStateInfo.InStateInfo.EnableFade,
                inBlendSec     = playState.MainStateInfo.InStateInfo.FadeSecond,
                inFadeOutTime  = playState.MainStateInfo.FadeOutTime,
                outEnableBlend = playState.MainStateInfo.OutStateInfo.EnableFade,
                outBlendSec    = playState.MainStateInfo.OutStateInfo.FadeSecond,
                directionType  = playState.DirectionType,
                endEnableBlend = playState.EndEnableBlend,
                endBlendSec    = playState.EndBlendRate
            };

            player.Animation.AnimInfo = actorAnimInfo;
            ActorAnimInfo animInfo = actorAnimInfo;

            player.DeactivateNavMeshAgent();
            player.IsKinematic = true;
            player.Animation.PlayInAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, animInfo.inFadeOutTime, animInfo.layer);
            ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (System.Action <M0>)(_ => player.Animation.PlayOutAnimation(animInfo.outEnableBlend, animInfo.outBlendSec, animInfo.layer)));
            player.SetStand(t, animInfo.inEnableBlend, animInfo.inBlendSec, animInfo.directionType);
            player.CameraControl.Mode = CameraMode.ActionFreeLook;
            player.CameraControl.SetShotTypeForce(ShotType.Near);
            player.CameraControl.LoadActionCameraFile(index, _poseID, (Transform)null);
        }
Exemple #4
0
        protected override void OnRelease(PlayerActor player)
        {
            player.ClearItems();
            player.ClearParticles();
            ActorAnimInfo animInfo = player.Animation.AnimInfo;

            player.SetStand(player.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, animInfo.directionType);
            player.Animation.RefsActAnimInfo = true;
        }
Exemple #5
0
        protected override void OnAwake(PlayerActor player)
        {
            player.EventKey = AIProject.EventType.DoorOpen;
            player.SetActiveOnEquipedItem(false);
            player.ChaControl.setAllLayerWeight(0.0f);
            ValueTuple <int, string> valueTuple;

            AIProject.Definitions.Action.NameTable.TryGetValue(AIProject.EventType.DoorOpen, out valueTuple);
            int             index1 = (int)valueTuple.Item1;
            ActionPointInfo outInfo;

            player.CurrentPoint.TryGetPlayerActionPointInfo(AIProject.EventType.DoorOpen, out outInfo);
            player.CurrentPoint.SetBookingUser((Actor)player);
            int poseId = outInfo.poseID;

            player.PoseID = poseId;
            int           index2        = poseId;
            PlayState     info          = Singleton <Resources> .Instance.Animation.PlayerActionAnimTable[(int)player.ChaControl.sex][index1][index2];
            ActorAnimInfo actorAnimInfo = new ActorAnimInfo()
            {
                layer          = info.Layer,
                inEnableBlend  = info.MainStateInfo.InStateInfo.EnableFade,
                inBlendSec     = info.MainStateInfo.InStateInfo.FadeSecond,
                outEnableBlend = info.MainStateInfo.OutStateInfo.EnableFade,
                outBlendSec    = info.MainStateInfo.OutStateInfo.FadeSecond,
                directionType  = info.DirectionType,
                endEnableBlend = info.EndEnableBlend,
                endBlendSec    = info.EndBlendRate
            };

            player.Animation.AnimInfo = actorAnimInfo;
            ActorAnimInfo animInfo = actorAnimInfo;

            if (player.PlayerController.PrevStateName != "Onbu")
            {
                Transform  t    = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.baseNullName)?.get_transform() ?? ((Component)player.CurrentPoint).get_transform();
                GameObject loop = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.recoveryNullName);
                player.Animation.RecoveryPoint = loop?.get_transform();
                player.Animation.InitializeStates(info.MainStateInfo.InStateInfo.StateInfos, info.MainStateInfo.OutStateInfo.StateInfos, info.MainStateInfo.AssetBundleInfo);
                player.Animation.LoadAnimatorIfNotEquals(info);
                player.Animation.PlayInAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, info.MainStateInfo.FadeOutTime, animInfo.layer);
                ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (System.Action <M0>)(_ => player.Animation.PlayOutAnimation(animInfo.outEnableBlend, animInfo.outBlendSec, animInfo.layer)));
                player.SetStand(t, info.MainStateInfo.InStateInfo.EnableFade, info.MainStateInfo.InStateInfo.FadeSecond, info.DirectionType);
            }
            player.Animation.LoadSEEventKeyTable(outInfo.eventID, outInfo.poseID);
            if (!Object.op_Inequality((Object)player.CurrentPoint, (Object)null))
            {
                return;
            }
            this._doorAnimation = (DoorAnimation)((Component)player.CurrentPoint).GetComponent <DoorAnimation>();
            if (!Object.op_Inequality((Object)this._doorAnimation, (Object)null))
            {
                return;
            }
            this._doorAnimation.Load(info.MainStateInfo.InStateInfo.StateInfos);
            this._doorAnimation.PlayAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, info.MainStateInfo.FadeOutTime, animInfo.layer);
        }
Exemple #6
0
        protected override void OnAwake(PlayerActor player)
        {
            this.minimapUI = Singleton <MapUIContainer> .Instance.MinimapUI;
            this.input     = Singleton <Input> .Instance;
            this.dt        = 0.0f;
            this.minimapUI.OpenAllMap(this.minimapUI.VisibleMode);
            Singleton <MapUIContainer> .Instance.MinimapUI.VisibleMode = 1;
            MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
            Singleton <Input> .Instance.ReserveState(Input.ValidType.UI);

            Singleton <Input> .Instance.SetupState();

            this.minimapUI.FromHomeMenu = false;
            Singleton <MapUIContainer> .Instance.MinimapUI.WarpProc = (MiniMapControler.OnWarp)(x =>
            {
                Singleton <MapUIContainer> .Instance.MinimapUI.AllMapClosedAction = (Action)(() => {});
                string prevStateName = player.PlayerController.PrevStateName;
                Singleton <Manager.Map> .Instance.WarpToBasePoint(x, (Action)(() =>
                {
                    if (prevStateName == "Onbu")
                    {
                        player.Controller.ChangeState("Onbu");
                    }
                    else
                    {
                        player.Controller.ChangeState("Normal");
                    }
                    player.Controller.ChangeState("Idle");
                    GC.Collect();
                    if (this.minimapUI.prevVisibleMode != 0 || !Manager.Config.GameData.MiniMap)
                    {
                        return;
                    }
                    this.minimapUI.OpenMiniMap();
                }), (Action)(() =>
                {
                    if (prevStateName == "Onbu")
                    {
                        player.Controller.ChangeState("Onbu");
                    }
                    else
                    {
                        player.Controller.ChangeState("Normal");
                    }
                    Singleton <Input> .Instance.ReserveState(Input.ValidType.Action);
                    Singleton <Input> .Instance.SetupState();
                    Singleton <Manager.Map> .Instance.Player.SetScheduledInteractionState(true);
                    Singleton <Manager.Map> .Instance.Player.ReleaseInteraction();
                }));
                Singleton <MapUIContainer> .Instance.MinimapUI.WarpProc = (MiniMapControler.OnWarp)null;
            });
            ActorAnimInfo animInfo = player.Animation.AnimInfo;

            animInfo.outEnableBlend   = true;
            animInfo.outBlendSec      = 0.0f;
            player.Animation.AnimInfo = animInfo;
        }
        protected override void OnRelease(PlayerActor player)
        {
            player.CurrentEventPoint = (EventPoint)null;
            if (!this._initSuccess)
            {
                return;
            }
            ActorAnimInfo animInfo = player.Animation.AnimInfo;

            player.SetStand(player.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, animInfo.directionType);
            player.Animation.RefsActAnimInfo = true;
        }
Exemple #8
0
        protected override void OnRelease(PlayerActor player)
        {
            player.ClearItems();
            player.ClearParticles();
            if (Object.op_Inequality((Object)player.CurrentPoint, (Object)null))
            {
                player.CurrentPoint.SetActiveMapItemObjs(true);
            }
            ActorAnimInfo animInfo = player.Animation.AnimInfo;

            player.SetStand(player.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, animInfo.directionType);
        }
Exemple #9
0
 private void OnStart(PlayerActor player)
 {
     MapUIContainer.RefreshCommands(0, player.SleepCommandInfos);
     MapUIContainer.CommandList.CancelEvent = (System.Action)(() =>
     {
         Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Cancel);
         ActorAnimInfo animInfo = player.Animation.AnimInfo;
         player.SetStand(player.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, animInfo.directionType);
         player.Animation.RecoveryPoint   = (Transform)null;
         player.Animation.RefsActAnimInfo = true;
         player.Controller.ChangeState("Normal");
         player.ReleaseCurrentPoint();
         if (Object.op_Inequality((Object)player.PlayerController.CommandArea, (Object)null))
         {
             ((Behaviour)player.PlayerController.CommandArea).set_enabled(true);
         }
         MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.InvokeAcception);
         player.ActivateNavMeshAgent();
         player.IsKinematic = false;
         MapUIContainer.SetActiveCommandList(false);
     });
     MapUIContainer.SetActiveCommandList(true, "睡眠");
     this._onEndActionDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (System.Action <M0>)(__ =>
     {
         Dictionary <int, Dictionary <int, Dictionary <int, PlayState> > > playerActionAnimTable = Singleton <Resources> .Instance.Animation.PlayerActionAnimTable;
         PoseKeyPair wakeupPoseId = Singleton <Resources> .Instance.PlayerProfile.PoseIDData.WakeupPoseID;
         PlayState info           = playerActionAnimTable[(int)player.ChaControl.sex][wakeupPoseId.postureID][wakeupPoseId.poseID];
         player.Animation.StopAllAnimCoroutine();
         player.Animation.InitializeStates(info);
         player.ActivateNavMeshAgent();
         player.IsKinematic     = false;
         ActorAnimInfo animInfo = player.Animation.AnimInfo;
         player.SetStand(player.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, 0);
         player.Animation.PlayInAnimation(info.MainStateInfo.InStateInfo.EnableFade, info.MainStateInfo.InStateInfo.FadeSecond, info.MainStateInfo.FadeOutTime, info.Layer);
         player.CameraControl.Mode = CameraMode.Normal;
         player.CameraControl.RecoverShotType();
         player.CameraControl.EnabledInput = true;
     }));
     this._onEndInAnimDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndInAnim, 1), (System.Action <M0>)(__ =>
     {
         ActorAnimInfo animInfo = player.Animation.AnimInfo;
         player.SetStand(player.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, animInfo.directionType);
         player.Animation.RefsActAnimInfo = true;
         player.Controller.ChangeState("Normal");
         player.ReleaseCurrentPoint();
         if (Object.op_Inequality((Object)player.PlayerController.CommandArea, (Object)null))
         {
             ((Behaviour)player.PlayerController.CommandArea).set_enabled(true);
         }
         MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.InvokeAcception);
     }));
 }
Exemple #10
0
        protected override void OnRelease(PlayerActor player)
        {
            ActorAnimInfo animInfo = player.Animation.AnimInfo;

            if (Object.op_Inequality((Object)player.CurrentPoint, (Object)null) && player.CurrentPoint.RemoveBooking((Actor)player))
            {
                player.CurrentPoint.SetImpossible(false, (Actor)player);
                CommandArea commandArea = player.PlayerController.CommandArea;
                commandArea.RemoveConsiderationObject((ICommandable)player.CurrentPoint);
                commandArea.RefreshCommands();
            }
            player.SetStand(player.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, animInfo.directionType);
            player.Animation.RefsActAnimInfo = true;
        }
Exemple #11
0
        protected override void OnRelease(PlayerActor player)
        {
            Vector3 locatedPosition = player.CurrentPoint.LocatedPosition;

            locatedPosition.y = ((Component)player.Locomotor).get_transform().get_position().y;
            RaycastHit raycastHit;

            Physics.Raycast(locatedPosition, Vector3.op_Multiply(Vector3.get_down(), 10f), ref raycastHit);
            locatedPosition.y = ((RaycastHit) ref raycastHit).get_point().y;
            ((Component)player.Locomotor).get_transform().set_position(locatedPosition);
            ActorAnimInfo animInfo = player.Animation.AnimInfo;

            player.SetStand(player.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, animInfo.directionType);
            player.ClearParticles();
            player.Partner?.ClearParticles();
            player.SetActiveOnEquipedItem(true);
        }
Exemple #12
0
        protected override void OnRelease(PlayerActor player)
        {
            if (Object.op_Inequality((Object)player.CurrentPoint, (Object)null) && player.CurrentPoint.RemoveBooking((Actor)player))
            {
                player.CurrentPoint.SetImpossible(false, (Actor)player);
                CommandArea commandArea = player.PlayerController.CommandArea;
                commandArea.RemoveConsiderationObject((ICommandable)player.CurrentPoint);
                commandArea.RefreshCommands();
            }
            player.Animation.ResetDefaultAnimatorController();
            int           index     = (int)AIProject.Definitions.Action.NameTable[AIProject.EventType.DoorOpen].Item1;
            ActorAnimInfo animInfo  = player.Animation.AnimInfo;
            PlayState     playState = Singleton <Resources> .Instance.Animation.PlayerActionAnimTable[(int)player.ChaControl.sex][index][player.PoseID];

            player.SetStand(player.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, playState.DirectionType);
            player.Animation.RefsActAnimInfo = true;
        }
Exemple #13
0
        protected override void OnAwake(PlayerActor player)
        {
            MapUIContainer.SetActiveRefrigeratorUI(true);
            Singleton <Input> .Instance.ReserveState(Input.ValidType.UI);

            Singleton <Input> .Instance.SetupState();

            player.SetScheduledInteractionState(false);
            player.ReleaseInteraction();
            MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
            ActorAnimInfo animInfo = player.Animation.AnimInfo;

            animInfo.outEnableBlend   = true;
            animInfo.outBlendSec      = 0.0f;
            player.Animation.AnimInfo = animInfo;
            ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndMenu, 1), (Action <M0>)(_ => player.Controller.ChangeState("Kitchen")));
        }
        protected override void OnRelease(PlayerActor player)
        {
            player.CurrentEventPoint = (EventPoint)null;
            if (!this._initSuccess)
            {
                return;
            }
            ActorAnimInfo animInfo = player.Animation.AnimInfo;

            player.SetStand(player.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, animInfo.directionType);
            player.Animation.RefsActAnimInfo = true;
            if (!player.OldEnabledHoldingHand)
            {
                return;
            }
            ((Behaviour)player.HandsHolder).set_enabled(true);
            player.OldEnabledHoldingHand = false;
        }
Exemple #15
0
        protected override void OnAwake(PlayerActor player)
        {
            player.SetActiveOnEquipedItem(false);
            player.ChaControl.setAllLayerWeight(0.0f);
            player.ChaControl.visibleAll = false;
            MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
            player.SetScheduledInteractionState(false);
            player.ReleaseInteraction();
            ActorAnimInfo animInfo = player.Animation.AnimInfo;

            animInfo.outBlendSec      = 0.0f;
            animInfo.outEnableBlend   = true;
            player.Animation.AnimInfo = animInfo;
            if (!Object.op_Inequality((Object)player.CommCompanion, (Object)null))
            {
                return;
            }
            player.CommCompanion.Animation.BeginIgnoreExpression();
            player.CommCompanion.Animation.BeginIgnoreVoice();
        }
 public void MotionPlay(ADV.Commands.Base.Motion.Data motion, bool isCrossFade)
 {
     if (isCrossFade)
     {
         this.scenario.CrossFadeStart();
     }
     if (!motion.pair.HasValue)
     {
         if (this._motionOverride.Setting(this.chaCtrl.animBody, motion.assetBundleName, motion.assetName, motion.overrideAssetBundleName, motion.overrideAssetName, motion.stateName, true))
         {
             Info.Anime.Play play = this.scenario.info.anime.play;
             this._motionOverride.isCrossFade        = play.isCrossFade;
             this._motionOverride.layers             = motion.layerNo;
             this._motionOverride.transitionDuration = play.transitionDuration;
             this._motionOverride.normalizedTime     = play.normalizedTime;
             this._motionOverride.Play(this.chaCtrl.animBody);
         }
         IKMotion ikMotion = this.ikMotion;
         bool     enabled  = ((Behaviour)this.data.actor.Animation).get_enabled();
         ikMotion.use = !enabled;
         ikMotion.motionIK.enabled = enabled;
         ikMotion.Setting(this.chaCtrl, motion.ikAssetBundleName, motion.ikAssetName, motion.stateName, false);
         this._yureMotion.Setting(this.chaCtrl, motion.shakeAssetBundleName, motion.shakeAssetName, motion.stateName, false);
     }
     else
     {
         int   postureId = motion.pair.Value.postureID;
         int   poseId    = motion.pair.Value.poseID;
         Actor actor     = this.data.actor;
         actor.ActionID = postureId;
         actor.PoseID   = poseId;
         PlayState autoPlayState = this.GetAutoPlayState();
         if (autoPlayState == null)
         {
             return;
         }
         actor.Animation.StopAllAnimCoroutine();
         ActorAnimInfo actorAnimInfo = actor.Animation.LoadActionState(postureId, poseId, autoPlayState);
         actor.Animation.PlayInAnimation(actorAnimInfo.inEnableBlend, actorAnimInfo.inBlendSec, autoPlayState.MainStateInfo.FadeOutTime, actorAnimInfo.layer);
     }
 }
Exemple #17
0
        protected override void OnAwake(PlayerActor player)
        {
            DoorPoint currentPoint = player.CurrentPoint as DoorPoint;

            if (Object.op_Inequality((Object)currentPoint, (Object)null))
            {
                DoorPoint.OpenPattern openState = currentPoint.OpenState;
                currentPoint.SetOpenState(DoorPoint.OpenPattern.Close, true);
                this._doorAnimation = (DoorAnimation)((Component)currentPoint).GetComponent <DoorAnimation>();
                if (Object.op_Inequality((Object)this._doorAnimation, (Object)null))
                {
                    this._doorAnimation.PlayCloseAnimation(openState);
                }
                currentPoint.SetBookingUser((Actor)player);
            }
            ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (Action <M0>)(_ => this.Elapsed(player)));
            ActorAnimInfo animInfo = player.Animation.AnimInfo;

            animInfo.outEnableBlend   = true;
            animInfo.outBlendSec      = 0.0f;
            player.Animation.AnimInfo = animInfo;
        }
Exemple #18
0
        public virtual void OnStart()
        {
            if (this.prevTalkable = this.Merchant.Talkable)
            {
                this.Merchant.Talkable = false;
            }
            ((Task)this).OnStart();
            if (Object.op_Equality((Object)this.CurrentPoint, (Object)null))
            {
                return;
            }
            this.Merchant.SetActiveOnEquipedItem(false);
            this.Merchant.ChaControl.setAllLayerWeight(0.0f);
            this.Merchant.IsActionMoving = true;
            ActionPointInfo outInfo;

            this.CurrentPoint.TryGetAgentActionPointInfo(this.Merchant.EventKey, out outInfo);
            GameObject loop1 = ((Component)this.CurrentPoint).get_transform().FindLoop(outInfo.baseNullName);
            Transform  t     = !Object.op_Equality((Object)loop1, (Object)null) ? loop1.get_transform() : ((Component)this.CurrentPoint).get_transform();
            GameObject loop2 = ((Component)this.CurrentPoint).get_transform().FindLoop(outInfo.recoveryNullName);

            this.recoveryPoint = !Object.op_Inequality((Object)loop2, (Object)null) ? (Transform)null : loop2.get_transform();
            this.actionID      = outInfo.eventID;
            this.poseID        = outInfo.poseID;
            this.animInfo      = this.Merchant.Animation.LoadActionState(this.actionID, this.poseID, Singleton <Resources> .Instance.Animation.MerchantCommonActionAnimStateTable[this.actionID][this.poseID]);
            this.Merchant.ActivateNavMeshObstacle(this.Merchant.Position);
            this.Merchant.Animation.StopAllAnimCoroutine();
            this.Merchant.Animation.PlayInAnimation(this.animInfo.inEnableBlend, this.animInfo.inBlendSec, this.animInfo.inFadeOutTime, this.animInfo.layer);
            ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this.onEndAction, 1), (System.Action <M0>)(_ => this.Merchant.Animation.PlayOutAnimation(this.animInfo.outEnableBlend, this.animInfo.outBlendSec, this.animInfo.layer)));
            if (this.animInfo.hasAction)
            {
                ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this.onActionPlay, 1), (System.Action <M0>)(_ => this.Merchant.Animation.PlayActionAnimation(this.animInfo.layer)));
            }
            this.CurrentPoint.SetSlot((Actor)this.Merchant);
            this.Merchant.SetStand(t, this.animInfo.inEnableBlend, this.animInfo.inBlendSec, this.animInfo.directionType);
        }
Exemple #19
0
 private void StartEventSeq(PlayerActor player)
 {
     if (Object.op_Inequality((Object)this._agent, (Object)null))
     {
         DevicePoint devicePoint = player.CurrentDevicePoint;
         AgentData   agentData   = Singleton <Game> .Instance.WorldData.AgentTable[devicePoint.ID];
         AgentActor  agent       = this._agent;
         if (agentData.PlayEnterScene)
         {
             return;
         }
         agentData.PlayEnterScene = true;
         int           personality    = agent.ChaControl.fileParam.personality;
         PoseKeyPair   appearId       = Singleton <Resources> .Instance.AgentProfile.PoseIDTable.AppearIDList[personality];
         PlayState     playState      = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[appearId.postureID][appearId.poseID];
         ActorAnimInfo actorAnimInfo1 = new ActorAnimInfo()
         {
             layer          = playState.Layer,
             inEnableBlend  = playState.MainStateInfo.InStateInfo.EnableFade,
             inBlendSec     = playState.MainStateInfo.InStateInfo.FadeSecond,
             outEnableBlend = playState.MainStateInfo.OutStateInfo.EnableFade,
             outBlendSec    = playState.MainStateInfo.OutStateInfo.FadeSecond,
             directionType  = playState.DirectionType,
             endEnableBlend = playState.EndEnableBlend,
             endBlendSec    = playState.EndBlendRate
         };
         agent.Animation.AnimInfo = actorAnimInfo1;
         ActorAnimInfo   actorAnimInfo2  = actorAnimInfo1;
         AssetBundleInfo assetBundleInfo = playState.MainStateInfo.AssetBundleInfo;
         agent.ChangeAnimator((string)assetBundleInfo.assetbundle, (string)assetBundleInfo.asset);
         float  shapeBodyValue      = agent.ChaControl.GetShapeBodyValue(0);
         string heightParameterName = Singleton <Resources> .Instance.DefinePack.AnimatorParameter.HeightParameterName;
         agent.Animation.Animator.SetFloat(heightParameterName, shapeBodyValue);
         this._locator.SetFloat(heightParameterName, shapeBodyValue);
         agent.Animation.LoadEventKeyTable(appearId.postureID, appearId.poseID);
         agent.LoadEventItems(playState);
         agent.LoadEventParticles(appearId.postureID, appearId.poseID);
         agent.Animation.InitializeStates(playState.MainStateInfo.InStateInfo.StateInfos, playState.MainStateInfo.OutStateInfo.StateInfos, playState.MainStateInfo.AssetBundleInfo);
         Transform basePoint = devicePoint.PivotPoint;
         agent.Position = basePoint.get_position();
         agent.Rotation = basePoint.get_rotation();
         agent.Animation.PlayInLocoAnimation(actorAnimInfo2.inEnableBlend, actorAnimInfo2.inBlendSec, actorAnimInfo2.layer);
         devicePoint.PlayInAnimation();
         this._locator.set_speed(1f);
         this.PlayCameraAnimation(this._locator, personality);
         ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (System.Action <M0>)(__ =>
         {
             this.packData.Init();
             this.openData.FindLoad("0", agent.AgentData.param.charaID, 6);
             this.packData.SetParam((IParams)agent.AgentData, (IParams)player.PlayerData);
             this.packData.onComplete = (System.Action)(() =>
             {
                 if (agent.IsEvent)
                 {
                     agent.IsEvent = false;
                 }
                 if (!Manager.Config.GraphicData.CharasEntry[agent.ID])
                 {
                     this.packData.Release();
                     Singleton <Manager.ADV> .Instance.Captions.EndADV((System.Action)null);
                     devicePoint.PlayOutAnimation();
                     this.PlayCloseSE(player, basePoint);
                     ObservableExtensions.Subscribe <Unit>((IObservable <M0>)MapUIContainer.StartFade(FadeCanvas.PanelType.Blackout, (global::FadeType)0, 1f, true), (System.Action <M0>)(_ => {}), (System.Action)(() =>
                     {
                         Singleton <Manager.Map> .Instance.RemoveAgent(agent);
                         agent = (AgentActor)null;
                         ObservableExtensions.Subscribe <Unit>((IObservable <M0>)MapUIContainer.StartFade(FadeCanvas.PanelType.Blackout, (global::FadeType)1, 1f, true), (System.Action <M0>)(_ => {}), (System.Action)(() => this.Elapsed(player)));
                     }));
                 }
                 else
                 {
                     this.packData.Release();
                     Singleton <Manager.ADV> .Instance.Captions.EndADV((System.Action)null);
                     this.Elapsed(player);
                     devicePoint.PlayOutAnimation();
                     this.PlayCloseSE(player, basePoint);
                 }
             });
             Singleton <MapUIContainer> .Instance.OpenADV(this.openData, (IPack)this.packData);
         }));
     }
     else
     {
         ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (System.Action <M0>)(__ =>
         {
             player.CurrentDevicePoint = (DevicePoint)null;
             player.PlayerController.CommandArea.UpdateCollision(player);
             player.Controller.ChangeState("Normal");
         }));
     }
 }
Exemple #20
0
 protected override void OnAwake(PlayerActor player)
 {
     player.EventKey = (EventType)0;
     player.SetActiveOnEquipedItem(false);
     player.ChaControl.setAllLayerWeight(0.0f);
     if (player.PlayerController.PrevStateName != "Onbu")
     {
         Resources   instance   = Singleton <Resources> .Instance;
         PoseKeyPair menuPoseId = instance.PlayerProfile.PoseIDData.MenuPoseID;
         PlayState   playState  = instance.Animation.PlayerActionAnimTable[(int)player.ChaControl.sex][menuPoseId.postureID][menuPoseId.poseID];
         player.Animation.LoadEventKeyTable(menuPoseId.postureID, menuPoseId.poseID);
         if (player.ChaControl.visibleAll)
         {
             player.LoadEventItems(playState);
             player.LoadEventParticles(menuPoseId.postureID, menuPoseId.poseID);
         }
         player.Animation.InitializeStates(playState);
         ActorAnimInfo actorAnimInfo = new ActorAnimInfo()
         {
             layer          = playState.Layer,
             inEnableBlend  = playState.MainStateInfo.InStateInfo.EnableFade,
             inBlendSec     = playState.MainStateInfo.InStateInfo.FadeSecond,
             outEnableBlend = playState.MainStateInfo.OutStateInfo.EnableFade,
             outBlendSec    = playState.MainStateInfo.OutStateInfo.FadeSecond,
             directionType  = playState.DirectionType,
             isLoop         = playState.MainStateInfo.IsLoop,
             endEnableBlend = playState.EndEnableBlend,
             endBlendSec    = playState.EndBlendRate
         };
         player.Animation.AnimInfo = actorAnimInfo;
         ActorAnimInfo animInfo = actorAnimInfo;
         player.OldEnabledHoldingHand = ((Behaviour)player.HandsHolder).get_enabled();
         if (player.OldEnabledHoldingHand)
         {
             ((Behaviour)player.HandsHolder).set_enabled(false);
             if (player.HandsHolder.EnabledHolding)
             {
                 player.HandsHolder.EnabledHolding = false;
             }
         }
         MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
         player.Animation.StopAllAnimCoroutine();
         player.Animation.PlayInLocoAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, animInfo.layer);
         ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndMenu, 1), (Action <M0>)(_ => player.Animation.PlayOutAnimation(animInfo.outEnableBlend, animInfo.outBlendSec, animInfo.layer)));
         this._onEndOutAnimDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndOutAnimation, 1), (Action <M0>)(_ =>
         {
             if (this._onEndInputDisposable != null)
             {
                 this._onEndInputDisposable.Dispose();
             }
             this.EndState(player);
         }));
     }
     ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndInAnimation, 1), (Action <M0>)(_ => MapUIContainer.SetActiveSystemMenuUI(true)));
     this._onEndInputDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndInput, 1), (Action <M0>)(_ =>
     {
         if (this._onEndOutAnimDisposable != null)
         {
             this._onEndOutAnimDisposable.Dispose();
         }
         this.EndState(player);
     }));
 }
Exemple #21
0
        protected override void OnAwake(PlayerActor player)
        {
            player.EventKey = (EventType)0;
            player.SetActiveOnEquipedItem(false);
            player.ChaControl.setAllLayerWeight(0.0f);
            Resources   instance   = Singleton <Resources> .Instance;
            PoseKeyPair leftPoseId = instance.PlayerProfile.PoseIDData.LeftPoseID;
            PlayState   info       = instance.Animation.PlayerActionAnimTable[(int)player.ChaControl.sex][leftPoseId.postureID][leftPoseId.poseID];

            player.Animation.InitializeStates(info);
            ActorAnimInfo actorAnimInfo1 = new ActorAnimInfo()
            {
                layer          = info.Layer,
                inEnableBlend  = info.MainStateInfo.InStateInfo.EnableFade,
                inBlendSec     = info.MainStateInfo.InStateInfo.FadeSecond,
                outEnableBlend = info.MainStateInfo.OutStateInfo.EnableFade,
                outBlendSec    = info.MainStateInfo.OutStateInfo.FadeSecond,
                directionType  = info.DirectionType,
                isLoop         = info.MainStateInfo.IsLoop,
                endEnableBlend = info.EndEnableBlend,
                endBlendSec    = info.EndBlendRate
            };

            player.Animation.AnimInfo = actorAnimInfo1;
            ActorAnimInfo actorAnimInfo2 = actorAnimInfo1;

            this._hasAction = info.ActionInfo.hasAction;
            if (this._hasAction)
            {
                this._loopStateName     = info.MainStateInfo.InStateInfo.StateInfos.GetElement <PlayState.Info>(info.MainStateInfo.InStateInfo.StateInfos.Length - 1).stateName;
                this._randomCount       = info.ActionInfo.randomCount;
                this._oldNormalizedTime = 0.0f;
            }
            bool enabled = ((Behaviour)player.HandsHolder).get_enabled();

            player.OldEnabledHoldingHand = enabled;
            if (enabled)
            {
                ((Behaviour)player.HandsHolder).set_enabled(false);
                if (player.HandsHolder.EnabledHolding)
                {
                    player.HandsHolder.EnabledHolding = false;
                }
            }
            player.Animation.StopAllAnimCoroutine();
            player.Animation.PlayInLocoAnimation(actorAnimInfo2.inEnableBlend, actorAnimInfo2.inBlendSec, actorAnimInfo2.layer);
            ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndInput, 1), (Action <M0>)(__ =>
            {
                player.CameraControl.CrossFade.FadeStart(-1f);
                if (player.Animation.PlayingInLocoAnimation)
                {
                    player.Animation.StopInLocoAnimCoroutine();
                }
                if (player.Animation.PlayingActAnimation)
                {
                    player.Animation.StopActionAnimCoroutine();
                }
                player.CameraControl.Mode = CameraMode.Normal;
                player.Controller.ChangeState("Normal");
                MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.InvokeAcception);
            }));
        }
Exemple #22
0
        protected override void OnAwake(PlayerActor player)
        {
            player.EventKey = AIProject.EventType.Break;
            player.SetActiveOnEquipedItem(false);
            player.ChaControl.setAllLayerWeight(0.0f);
            player.CurrentPoint.SetActiveMapItemObjs(false);
            int             index = (int)AIProject.Definitions.Action.NameTable[AIProject.EventType.Break].Item1;
            ActionPointInfo outInfo;

            player.CurrentPoint.TryGetPlayerActionPointInfo(AIProject.EventType.Break, out outInfo);
            int poseId = outInfo.poseID;

            player.PoseID = poseId;
            int        _poseID = poseId;
            Transform  t       = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.baseNullName)?.get_transform() ?? ((Component)player.CurrentPoint).get_transform();
            GameObject loop    = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.recoveryNullName);

            player.Animation.RecoveryPoint = loop?.get_transform();
            PlayState info = Singleton <Resources> .Instance.Animation.PlayerActionAnimTable[(int)player.ChaControl.sex][index][_poseID];

            player.Animation.LoadEventKeyTable(index, outInfo.poseID);
            player.LoadEventItems(info);
            player.LoadEventParticles(index, outInfo.poseID);
            player.Animation.InitializeStates(info);
            ActorAnimInfo actorAnimInfo1 = new ActorAnimInfo()
            {
                layer          = info.Layer,
                inEnableBlend  = info.MainStateInfo.InStateInfo.EnableFade,
                inBlendSec     = info.MainStateInfo.InStateInfo.FadeSecond,
                outEnableBlend = info.MainStateInfo.OutStateInfo.EnableFade,
                outBlendSec    = info.MainStateInfo.OutStateInfo.FadeSecond,
                directionType  = info.DirectionType,
                isLoop         = info.MainStateInfo.IsLoop,
                endEnableBlend = info.EndEnableBlend,
                endBlendSec    = info.EndBlendRate
            };

            player.Animation.AnimInfo = actorAnimInfo1;
            ActorAnimInfo animInfo = actorAnimInfo1;

            player.DeactivateNavMeshAgent();
            player.IsKinematic = true;
            this._hasAction    = info.ActionInfo.hasAction;
            if (this._hasAction)
            {
                this._loopStateName     = info.MainStateInfo.InStateInfo.StateInfos.GetElement <PlayState.Info>(info.MainStateInfo.InStateInfo.StateInfos.Length - 1).stateName;
                this._randomCount       = info.ActionInfo.randomCount;
                this._oldNormalizedTime = 0.0f;
            }
            player.Animation.PlayInAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, info.MainStateInfo.FadeOutTime, animInfo.layer);
            ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (System.Action <M0>)(_ => player.Animation.PlayOutAnimation(animInfo.outEnableBlend, animInfo.outBlendSec, animInfo.layer)));
            ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onElapseTime, 1), (System.Action <M0>)(_ =>
            {
                if (info.SubStateInfos.IsNullOrEmpty <PlayState.PlayStateInfo>())
                {
                    return;
                }
                player.Animation.InStates.Clear();
                PlayState.PlayStateInfo element = info.SubStateInfos.GetElement <PlayState.PlayStateInfo>(Random.Range(0, info.SubStateInfos.Count));
                foreach (PlayState.Info stateInfo in element.InStateInfo.StateInfos)
                {
                    player.Animation.InStates.Enqueue(stateInfo);
                }
                ActorAnimInfo actorAnimInfo2 = new ActorAnimInfo()
                {
                    layer          = info.Layer,
                    inEnableBlend  = element.InStateInfo.EnableFade,
                    inBlendSec     = element.InStateInfo.FadeSecond,
                    outEnableBlend = element.OutStateInfo.EnableFade,
                    outBlendSec    = element.OutStateInfo.FadeSecond,
                    directionType  = info.DirectionType,
                    isLoop         = element.IsLoop
                };
                player.Animation.AnimInfo    = actorAnimInfo2;
                ActorAnimInfo actorAnimInfo3 = actorAnimInfo2;
                player.Animation.AnimABInfo  = info.MainStateInfo.AssetBundleInfo;
                player.Animation.PlayInAnimation(actorAnimInfo3.inEnableBlend, actorAnimInfo3.inBlendSec, element.FadeOutTime, actorAnimInfo3.layer);
            }));
            Transform transform = player.CurrentPoint.SetSlot((Actor)player).Item1;

            player.SetStand(t, animInfo.inEnableBlend, animInfo.inBlendSec, animInfo.directionType);
            player.CameraControl.Mode = CameraMode.ActionFreeLook;
            player.CameraControl.SetShotTypeForce(ShotType.Near);
            player.CameraControl.LoadActionCameraFile(index, _poseID, (Transform)null);
            MapUIContainer.StorySupportUI.Close();
            ObservableExtensions.Subscribe <long>((IObservable <M0>)Observable.Timer(TimeSpan.FromMilliseconds(1000.0)), (System.Action <M0>)(_ =>
            {
                Sprite sprite;
                Singleton <Resources> .Instance.itemIconTables.ActionIconTable.TryGetValue(Singleton <Resources> .Instance.PlayerProfile.CommonActionIconID, out sprite);
                MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.CancelAcception);
                MapUIContainer.CommandLabel.CancelCommand = new CommandLabel.CommandInfo()
                {
                    Text             = "立ち上がる",
                    Icon             = sprite,
                    TargetSpriteInfo = (CommandTargetSpriteInfo)null,
                    Transform        = (Transform)null,
                    Event            = (System.Action)(() =>
                    {
                        MapUIContainer.CommandLabel.CancelCommand = (CommandLabel.CommandInfo)null;
                        MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
                        ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => player.Controller.State.End((Actor)player)), false), 1), (System.Action <M0>)(__ =>
                        {
                            player.PlayerController.ChangeState("Normal");
                            player.CameraControl.Mode = CameraMode.Normal;
                            MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.InvokeAcception);
                            MapUIContainer.StorySupportUI.Open();
                        }));
                    })
                };
            }));
        }
Exemple #23
0
        private void ActivateTransfer(PlayerActor player, Actor partner)
        {
            EquipEventItemInfo itemInfo = (EquipEventItemInfo)null;
            PlayState          info1;

            this.LoadLocomotionAnimation(player, out info1, ref itemInfo);
            player.ResetEquipEventItem(itemInfo);
            partner.Position = player.Position;
            partner.Rotation = player.Rotation;
            int               onbuStateId       = Singleton <Resources> .Instance.DefinePack.AnimatorState.OnbuStateID;
            PlayState         info2             = Singleton <Resources> .Instance.Animation.PlayerLocomotionStateTable[(int)player.ChaControl.sex][onbuStateId];
            ActorAnimation    animation1        = player.Animation;
            ActorAnimation    animation2        = partner.Animation;
            AnimatorStateInfo animatorStateInfo = animation1.Animator.GetCurrentAnimatorStateInfo(0);

            if (info1 != null)
            {
                animation1.InitializeStates(info1);
                animation2.InitializeStates(info2);
                bool flag = false;
                foreach (PlayState.Info stateInfo in info1.MainStateInfo.InStateInfo.StateInfos)
                {
                    if (((AnimatorStateInfo) ref animatorStateInfo).get_shortNameHash() == stateInfo.ShortNameStateHash)
                    {
                        flag = true;
                        break;
                    }
                }
                if (flag)
                {
                    if (info1.MaskStateInfo.layer > 0)
                    {
                        if ((double)animation1.Animator.GetLayerWeight(info1.MaskStateInfo.layer) == 0.0)
                        {
                            flag = false;
                        }
                    }
                    else
                    {
                        for (int index = 1; index < animation1.Animator.get_layerCount(); ++index)
                        {
                            if ((double)animation1.Animator.GetLayerWeight(index) > 0.0)
                            {
                                flag = false;
                                break;
                            }
                        }
                    }
                }
                if (flag)
                {
                    animation1.InStates.Clear();
                    animation1.OutStates.Clear();
                    animation1.ActionStates.Clear();
                    animation2.InStates.Clear();
                    animation2.OutStates.Clear();
                    animation2.ActionStates.Clear();
                }
                else
                {
                    int layer = info1.Layer;
                    if (animation1.RefsActAnimInfo)
                    {
                        animation1.StopAllAnimCoroutine();
                        animation1.PlayInLocoAnimation(animation1.AnimInfo.outEnableBlend, animation1.AnimInfo.outBlendSec, layer);
                        animation2.StopAllAnimCoroutine();
                        animation2.PlayInLocoAnimation(animation1.AnimInfo.outEnableBlend, animation1.AnimInfo.outBlendSec, layer);
                        animation1.RefsActAnimInfo = false;
                    }
                    else
                    {
                        bool  enableFade = info1.MainStateInfo.InStateInfo.EnableFade;
                        float fadeSecond = info1.MainStateInfo.InStateInfo.FadeSecond;
                        animation1.StopAllAnimCoroutine();
                        animation1.PlayInLocoAnimation(enableFade, fadeSecond, layer);
                        animation2.StopAllAnimCoroutine();
                        animation2.PlayInLocoAnimation(enableFade, fadeSecond, layer);
                    }
                }
            }
            else
            {
                for (int index = 1; index < animation1.Animator.get_layerCount(); ++index)
                {
                    animation1.Animator.SetLayerWeight(index, 0.0f);
                }
                animation1.InitializeStates(info2);
                animation2.InitializeStates(info2);
                int layer = info2.Layer;
                if (animation1.RefsActAnimInfo)
                {
                    animation1.StopAllAnimCoroutine();
                    animation1.PlayInLocoAnimation(animation1.AnimInfo.endEnableBlend, animation1.AnimInfo.endBlendSec, layer);
                    animation2.StopAllAnimCoroutine();
                    animation2.PlayInLocoAnimation(animation1.AnimInfo.inEnableBlend, animation1.AnimInfo.inBlendSec, layer);
                    animation1.RefsActAnimInfo = false;
                }
                else
                {
                    ActorAnimInfo actorAnimInfo1 = new ActorAnimInfo()
                    {
                        layer         = info2.Layer,
                        inEnableBlend = info2.MainStateInfo.InStateInfo.EnableFade,
                        inBlendSec    = info2.MainStateInfo.InStateInfo.FadeSecond
                    };
                    player.Animation.AnimInfo = actorAnimInfo1;
                    ActorAnimInfo actorAnimInfo2 = actorAnimInfo1;
                    bool          inEnableBlend  = actorAnimInfo2.inEnableBlend;
                    float         inBlendSec     = actorAnimInfo2.inBlendSec;
                    animation1.StopAllAnimCoroutine();
                    animation1.PlayInLocoAnimation(inEnableBlend, inBlendSec, layer);
                    animation2.StopAllAnimCoroutine();
                    animation2.PlayInLocoAnimation(inEnableBlend, inBlendSec, layer);
                }
            }
            if (player.NavMeshAgent.get_isStopped())
            {
                player.NavMeshAgent.set_isStopped(false);
            }
            if (!player.IsKinematic)
            {
                return;
            }
            player.IsKinematic = false;
        }
Exemple #24
0
        protected override void OnAwake(PlayerActor player)
        {
            player.EventKey = AIProject.EventType.Eat;
            player.SetActiveOnEquipedItem(false);
            player.ChaControl.setAllLayerWeight(0.0f);
            MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
            Singleton <Manager.Input> .Instance.ReserveState(Manager.Input.ValidType.UI);

            Singleton <Manager.Input> .Instance.SetupState();

            ObservableExtensions.Subscribe <long>((IObservable <M0>)Observable.Timer(TimeSpan.FromSeconds(1.0)), (System.Action <M0>)(_ =>
            {
                MapUIContainer.RefreshCommands(0, player.DateEatCommandInfos);
                MapUIContainer.SetActiveCommandList(true, "食事");
                MapUIContainer.CommandList.CancelEvent = (System.Action)null;
            }));
            int type = (int)AIProject.Definitions.Action.NameTable[AIProject.EventType.Eat].Item1;
            DateActionPointInfo outInfo;

            player.CurrentPoint.TryGetPlayerDateActionPointInfo(player.ChaControl.sex, AIProject.EventType.Eat, out outInfo);
            AgentActor partner = player.Partner as AgentActor;
            int        poseIda = outInfo.poseIDA;

            player.PoseID = poseIda;
            int index   = poseIda;
            int poseIdb = outInfo.poseIDB;

            partner.PoseID = poseIdb;
            int        poseIDB = poseIdb;
            Transform  t1      = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.baseNullNameA)?.get_transform() ?? ((Component)player.CurrentPoint).get_transform();
            Transform  t2      = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.baseNullNameB)?.get_transform() ?? ((Component)player.CurrentPoint).get_transform();
            GameObject loop1   = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.recoveryNullNameA);

            player.Animation.RecoveryPoint = loop1?.get_transform();
            GameObject loop2 = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.recoveryNullNameB);

            player.Partner.Animation.RecoveryPoint = loop2?.get_transform();
            PlayState playState1 = Singleton <Resources> .Instance.Animation.PlayerActionAnimTable[(int)player.ChaControl.sex][type][index];

            player.Animation.LoadEventKeyTable(type, outInfo.poseIDA);
            player.LoadEventItems(playState1);
            player.LoadEventParticles(type, outInfo.poseIDA);
            player.Animation.InitializeStates(playState1);
            partner.Animation.LoadEventKeyTable(type, outInfo.poseIDB);
            PlayState playState2 = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[type][outInfo.poseIDB];

            partner.LoadEventItems(playState2);
            partner.LoadEventParticles(type, outInfo.poseIDB);
            partner.Animation.InitializeStates(playState2);
            ActorAnimInfo actorAnimInfo1 = new ActorAnimInfo()
            {
                layer          = playState1.Layer,
                inEnableBlend  = playState1.MainStateInfo.InStateInfo.EnableFade,
                inBlendSec     = playState1.MainStateInfo.InStateInfo.FadeSecond,
                outEnableBlend = playState1.MainStateInfo.OutStateInfo.EnableFade,
                outBlendSec    = playState1.MainStateInfo.OutStateInfo.FadeSecond,
                directionType  = playState1.DirectionType,
                isLoop         = playState1.MainStateInfo.IsLoop,
                endEnableBlend = playState1.EndEnableBlend,
                endBlendSec    = playState1.EndBlendRate
            };

            player.Animation.AnimInfo = actorAnimInfo1;
            ActorAnimInfo actorAnimInfo2 = actorAnimInfo1;
            ActorAnimInfo actorAnimInfo3 = new ActorAnimInfo()
            {
                layer          = playState2.Layer,
                inEnableBlend  = playState2.MainStateInfo.InStateInfo.EnableFade,
                inBlendSec     = playState2.MainStateInfo.InStateInfo.FadeSecond,
                outEnableBlend = playState2.MainStateInfo.OutStateInfo.EnableFade,
                outBlendSec    = playState2.MainStateInfo.OutStateInfo.FadeSecond,
                directionType  = playState1.DirectionType,
                isLoop         = playState1.MainStateInfo.IsLoop,
                endEnableBlend = playState1.EndEnableBlend,
                endBlendSec    = playState1.EndBlendRate,
                loopMinTime    = playState2.MainStateInfo.LoopMin,
                loopMaxTime    = playState2.MainStateInfo.LoopMax,
                hasAction      = playState2.ActionInfo.hasAction
            };

            partner.Animation.AnimInfo = actorAnimInfo3;
            ActorAnimInfo actorAnimInfo4 = actorAnimInfo3;
            List <int>    intList        = ListPool <int> .Get();

            foreach (KeyValuePair <int, Dictionary <int, int> > foodDateEventItem in Singleton <Resources> .Instance.Map.FoodDateEventItemList)
            {
                foreach (KeyValuePair <int, int> keyValuePair in foodDateEventItem.Value)
                {
                    if (keyValuePair.Value != -1)
                    {
                        intList.Add(keyValuePair.Value);
                    }
                }
            }
            int num = -1;

            if (!intList.IsNullOrEmpty <int>())
            {
                num = intList.GetElement <int>(Random.Range(0, intList.Count));
            }
            ListPool <int> .Release(intList);

            ActionItemInfo eventItemInfo;

            if (Singleton <Resources> .Instance.Map.EventItemList.TryGetValue(num, out eventItemInfo))
            {
                string     rootParentName = Singleton <Resources> .Instance.LocomotionProfile.RootParentName;
                GameObject gameObject1    = player.LoadEventItem(num, rootParentName, false, eventItemInfo);
                if (Object.op_Inequality((Object)gameObject1, (Object)null))
                {
                    foreach (Renderer componentsInChild in (Renderer[])gameObject1.GetComponentsInChildren <Renderer>(true))
                    {
                        componentsInChild.set_enabled(true);
                    }
                }
                GameObject gameObject2 = partner.LoadEventItem(num, rootParentName, false, eventItemInfo);
                if (Object.op_Inequality((Object)gameObject2, (Object)null))
                {
                    foreach (Renderer componentsInChild in (Renderer[])gameObject2.GetComponentsInChildren <Renderer>(true))
                    {
                        componentsInChild.set_enabled(true);
                    }
                }
            }
            player.DeactivateNavMeshAgent();
            player.IsKinematic = true;
            partner.SetActiveOnEquipedItem(false);
            partner.ChaControl.setAllLayerWeight(0.0f);
            partner.DeactivateNavMeshAgent();
            partner.IsKinematic = true;
            this._hasAction     = playState1.ActionInfo.hasAction;
            if (this._hasAction)
            {
                this._loopStateName     = playState1.MainStateInfo.InStateInfo.StateInfos.GetElement <PlayState.Info>(playState1.MainStateInfo.InStateInfo.StateInfos.Length - 1).stateName;
                this._randomCount       = playState1.ActionInfo.randomCount;
                this._oldNormalizedTime = 0.0f;
            }
            player.Animation.PlayInAnimation(actorAnimInfo2.inEnableBlend, actorAnimInfo2.inBlendSec, playState1.MainStateInfo.FadeOutTime, actorAnimInfo2.layer);
            player.SetStand(t1, playState1.MainStateInfo.InStateInfo.EnableFade, playState1.MainStateInfo.InStateInfo.FadeSecond, playState1.DirectionType);
            partner.Animation.PlayInAnimation(actorAnimInfo4.inEnableBlend, actorAnimInfo4.inBlendSec, playState2.MainStateInfo.FadeOutTime, actorAnimInfo4.layer);
            partner.SetStand(t2, playState2.MainStateInfo.InStateInfo.EnableFade, playState2.MainStateInfo.InStateInfo.FadeSecond, actorAnimInfo4.layer);
            ObservableExtensions.Subscribe <long>(Observable.Take <long>(Observable.Skip <long>((IObservable <M0>)Observable.EveryLateUpdate(), 1), 1), (System.Action <M0>)(_ => this.ChangeCamera(type, poseIDB, (Actor)partner)));
            player.OldEnabledHoldingHand = ((Behaviour)player.HandsHolder).get_enabled();
            if (!player.OldEnabledHoldingHand)
            {
                return;
            }
            ((Behaviour)player.HandsHolder).set_enabled(false);
            if (!player.HandsHolder.EnabledHolding)
            {
                return;
            }
            player.HandsHolder.EnabledHolding = false;
        }
Exemple #25
0
        private void ActivateTransferImmediate(PlayerActor player, Actor partner)
        {
            EquipEventItemInfo itemInfo = (EquipEventItemInfo)null;
            PlayState          info;

            this.LoadLocomotionAnimation(player, out info, ref itemInfo);
            player.ResetEquipEventItem(itemInfo);
            partner.Position = player.Position;
            partner.Rotation = player.Rotation;
            int            onbuStateId = Singleton <Resources> .Instance.DefinePack.AnimatorState.OnbuStateID;
            PlayState      playState   = Singleton <Resources> .Instance.Animation.PlayerLocomotionStateTable[(int)player.ChaControl.sex][onbuStateId];
            ActorAnimation animation1  = player.Animation;
            ActorAnimation animation2  = partner.Animation;

            animation1.InStates.Clear();
            animation1.OutStates.Clear();
            animation1.ActionStates.Clear();
            partner.Animation.InStates.Clear();
            partner.Animation.OutStates.Clear();
            partner.Animation.ActionStates.Clear();
            PlayState.Info element1 = playState.MainStateInfo.InStateInfo.StateInfos.GetElement <PlayState.Info>(playState.MainStateInfo.InStateInfo.StateInfos.Length - 1);
            if (info != null)
            {
                PlayState.Info element2 = info.MainStateInfo.InStateInfo.StateInfos.GetElement <PlayState.Info>(info.MainStateInfo.InStateInfo.StateInfos.Length - 1);
                player.Animation.InStates.Enqueue(element2);
                if (!info.MainStateInfo.OutStateInfo.StateInfos.IsNullOrEmpty <PlayState.Info>())
                {
                    foreach (PlayState.Info stateInfo in info.MainStateInfo.OutStateInfo.StateInfos)
                    {
                        player.Animation.OutStates.Enqueue(stateInfo);
                    }
                }
                partner.Animation.InStates.Enqueue(element1);
                if (!playState.MainStateInfo.OutStateInfo.StateInfos.IsNullOrEmpty <PlayState.Info>())
                {
                    foreach (PlayState.Info stateInfo in playState.MainStateInfo.OutStateInfo.StateInfos)
                    {
                        partner.Animation.OutStates.Enqueue(stateInfo);
                    }
                }
                ActorAnimInfo animInfo = player.Animation.AnimInfo;
                int           layer    = info.Layer;
                player.Animation.StopAllAnimCoroutine();
                player.Animation.PlayInLocoAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, layer);
                partner.Animation.StopAllAnimCoroutine();
                partner.Animation.PlayInLocoAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, layer);
            }
            else
            {
                for (int index = 1; index < animation1.Animator.get_layerCount(); ++index)
                {
                    animation1.Animator.SetLayerWeight(index, 0.0f);
                }
                player.Animation.InStates.Enqueue(element1);
                if (!playState.MainStateInfo.OutStateInfo.StateInfos.IsNullOrEmpty <PlayState.Info>())
                {
                    foreach (PlayState.Info stateInfo in playState.MainStateInfo.OutStateInfo.StateInfos)
                    {
                        player.Animation.OutStates.Enqueue(stateInfo);
                    }
                }
                partner.Animation.InStates.Enqueue(element1);
                if (!playState.MainStateInfo.OutStateInfo.StateInfos.IsNullOrEmpty <PlayState.Info>())
                {
                    foreach (PlayState.Info stateInfo in playState.MainStateInfo.OutStateInfo.StateInfos)
                    {
                        partner.Animation.OutStates.Enqueue(stateInfo);
                    }
                }
                ActorAnimInfo animInfo = player.Animation.AnimInfo;
                int           layer    = playState.Layer;
                player.Animation.StopAllAnimCoroutine();
                player.Animation.PlayInLocoAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, layer);
                partner.Animation.StopAllAnimCoroutine();
                partner.Animation.PlayInLocoAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, layer);
            }
            if (player.NavMeshAgent.get_isStopped())
            {
                player.NavMeshAgent.set_isStopped(false);
            }
            if (!player.IsKinematic)
            {
                return;
            }
            player.IsKinematic = false;
        }
Exemple #26
0
        protected override void OnAwake(PlayerActor player)
        {
            player.EventKey = AIProject.EventType.Search;
            player.SetActiveOnEquipedItem(false);
            player.ChaControl.setAllLayerWeight(0.0f);
            MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
            ValueTuple <int, string> valueTuple;

            AIProject.Definitions.Action.NameTable.TryGetValue(AIProject.EventType.Search, out valueTuple);
            int index = (int)valueTuple.Item1;
            DateActionPointInfo outInfo;

            player.CurrentPoint.TryGetPlayerDateActionPointInfo(player.ChaControl.sex, AIProject.EventType.Search, out outInfo);
            int poseIda = outInfo.poseIDA;

            player.PoseID = poseIda;
            int        _poseID = poseIda;
            Transform  t       = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.baseNullNameA)?.get_transform() ?? ((Component)player.CurrentPoint).get_transform();
            GameObject loop    = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.recoveryNullNameA);

            player.Animation.RecoveryPoint = loop?.get_transform();
            PlayState playState = Singleton <Resources> .Instance.Animation.PlayerActionAnimTable[(int)player.ChaControl.sex][index][_poseID];

            player.Animation.LoadEventKeyTable(index, outInfo.poseIDA);
            player.LoadEventItems(playState);
            player.LoadEventParticles(index, outInfo.poseIDA);
            player.Animation.InitializeStates(playState);
            ActorAnimInfo actorAnimInfo1 = new ActorAnimInfo()
            {
                layer          = playState.Layer,
                inEnableBlend  = playState.MainStateInfo.InStateInfo.EnableFade,
                inBlendSec     = playState.MainStateInfo.InStateInfo.FadeSecond,
                outEnableBlend = playState.MainStateInfo.OutStateInfo.EnableFade,
                outBlendSec    = playState.MainStateInfo.OutStateInfo.FadeSecond,
                directionType  = playState.DirectionType,
                isLoop         = playState.MainStateInfo.IsLoop,
                endEnableBlend = playState.EndEnableBlend,
                endBlendSec    = playState.EndBlendRate
            };

            player.Partner.Animation.AnimInfo = actorAnimInfo1;
            ActorAnimInfo actorAnimInfo2 = actorAnimInfo1;

            player.Animation.AnimInfo = actorAnimInfo2;
            ActorAnimInfo animInfo = actorAnimInfo2;

            player.SetActiveOnEquipedItem(false);
            player.ChaControl.setAllLayerWeight(0.0f);
            player.DeactivateNavMeshAgent();
            player.IsKinematic = true;
            player.Animation.PlayInAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, playState.MainStateInfo.FadeOutTime, animInfo.layer);
            player.SetStand(t, playState.MainStateInfo.InStateInfo.EnableFade, playState.MainStateInfo.InStateInfo.FadeSecond, playState.DirectionType);
            ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (System.Action <M0>)(_ => player.Animation.PlayOutAnimation(animInfo.outEnableBlend, animInfo.outBlendSec, animInfo.layer)));
            player.OldEnabledHoldingHand = ((Behaviour)player.HandsHolder).get_enabled();
            if (player.OldEnabledHoldingHand)
            {
                ((Behaviour)player.HandsHolder).set_enabled(false);
                player.HandsHolder.Weight = 0.0f;
                if (player.HandsHolder.EnabledHolding)
                {
                    player.HandsHolder.EnabledHolding = false;
                }
            }
            player.CameraControl.Mode = CameraMode.ActionFreeLook;
            player.CameraControl.SetShotTypeForce(ShotType.Near);
            player.CameraControl.LoadActionCameraFile(index, _poseID, (Transform)null);
        }
 protected override void OnAwake(PlayerActor player)
 {
     this._eventPoint = player.CurrentEventPoint;
     if (Object.op_Equality((Object)this._eventPoint, (Object)null))
     {
         this.ErrorEnd(player, "イベントポイント持っていないのにバルブ扉を開こうとした");
     }
     else
     {
         if (Object.op_Equality((Object)this._eventPoint, (Object)EventPoint.GetTargetPoint()))
         {
             EventPoint.SetTargetID(-1, -1);
         }
         HarborDoorAnimation component = (HarborDoorAnimation)((Component)this._eventPoint).GetComponent <HarborDoorAnimation>();
         if (Object.op_Equality((Object)component, (Object)null))
         {
             this.ErrorEnd(player, "イベントポイントからHarborDoorAnimationが取得できなかった");
         }
         else
         {
             this._prevAcceptionState = MapUIContainer.CommandLabel.Acception;
             if (this._prevAcceptionState != CommandLabel.AcceptionState.None)
             {
                 MapUIContainer.CommandLabel.Acception = CommandLabel.AcceptionState.None;
             }
             this._animData  = component.AnimData;
             player.EventKey = EventType.DoorOpen;
             this._poseInfo  = component.PoseInfo;
             player.SetActiveOnEquipedItem(false);
             player.ChaControl.setAllLayerWeight(0.0f);
             Transform t = component.BasePoint ?? ((Component)this._eventPoint).get_transform();
             player.Animation.RecoveryPoint = component.RecoveryPoint;
             int sex       = (int)player.ChaControl.sex;
             int postureId = this._poseInfo.postureID;
             int poseId    = this._poseInfo.poseID;
             this._info = Singleton <Resources> .Instance.Animation.PlayerActionAnimTable[sex][postureId][poseId];
             ActorAnimInfo actorAnimInfo = new ActorAnimInfo()
             {
                 layer          = this._info.Layer,
                 inEnableBlend  = this._info.MainStateInfo.InStateInfo.EnableFade,
                 inBlendSec     = this._info.MainStateInfo.InStateInfo.FadeSecond,
                 outEnableBlend = this._info.MainStateInfo.OutStateInfo.EnableFade,
                 outBlendSec    = this._info.MainStateInfo.OutStateInfo.FadeSecond,
                 directionType  = this._info.DirectionType,
                 endEnableBlend = this._info.EndEnableBlend,
                 endBlendSec    = this._info.EndBlendRate
             };
             player.Animation.AnimInfo = actorAnimInfo;
             ActorAnimInfo animInfo = actorAnimInfo;
             player.Animation.LoadSEEventKeyTable(postureId, poseId);
             player.Animation.InitializeStates(this._info.MainStateInfo.InStateInfo.StateInfos, this._info.MainStateInfo.OutStateInfo.StateInfos, this._info.MainStateInfo.AssetBundleInfo);
             player.Animation.PlayInAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, this._info.MainStateInfo.FadeOutTime, animInfo.layer);
             ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (Action <M0>)(_ => player.Animation.PlayOutAnimation(animInfo.outEnableBlend, animInfo.outBlendSec, animInfo.layer)));
             player.DeactivateNavMeshAgent();
             player.IsKinematic = true;
             player.SetStand(t, this._info.MainStateInfo.InStateInfo.EnableFade, this._info.MainStateInfo.InStateInfo.FadeSecond, this._info.DirectionType);
             if (Object.op_Inequality((Object)this._animData, (Object)null))
             {
                 this._animData.AnimEndAction = (Action)(() => this._animData.PlayOpenIdleAnimation(false, 0.0f, 0.0f, 0));
                 this._animData.PlayToOpenAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, this._info.MainStateInfo.FadeOutTime, animInfo.layer);
             }
             ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onComplete, 1), (Action <M0>)(_ =>
             {
                 if (this._animData is AreaOpenLinkedHarborDoorAnimData)
                 {
                     Singleton <Manager.Map> .Instance.SetOpenAreaState((this._animData as AreaOpenLinkedHarborDoorAnimData).AreaOpenID, true);
                 }
                 if (this._eventPoint.GroupID == 1)
                 {
                     switch (this._eventPoint.PointID)
                     {
                     case 2:
                         Manager.Map.ForcedSetTutorialProgress(26);
                         break;
                     }
                 }
                 if (this._prevAcceptionState != MapUIContainer.CommandLabel.Acception)
                 {
                     MapUIContainer.CommandLabel.Acception = this._prevAcceptionState;
                 }
                 player.ActivateNavMeshAgent();
                 player.PlayerController.ChangeState("Normal");
             }));
             player.CameraControl.Mode = CameraMode.ActionFreeLook;
             player.CameraControl.SetShotTypeForce(ShotType.Near);
             player.CameraControl.LoadActionCameraFile(postureId, poseId, (Transform)null);
             player.OldEnabledHoldingHand = ((Behaviour)player.HandsHolder).get_enabled();
             if (player.OldEnabledHoldingHand)
             {
                 ((Behaviour)player.HandsHolder).set_enabled(false);
                 player.HandsHolder.Weight = 0.0f;
                 if (player.HandsHolder.EnabledHolding)
                 {
                     player.HandsHolder.EnabledHolding = false;
                 }
             }
             this._initSuccess = true;
         }
     }
 }
Exemple #28
0
        protected override void OnAwake(PlayerActor player)
        {
            player.EventKey = AIProject.EventType.Break;
            player.SetActiveOnEquipedItem(false);
            player.ChaControl.setAllLayerWeight(0.0f);
            int index = (int)AIProject.Definitions.Action.NameTable[AIProject.EventType.Break].Item1;
            DateActionPointInfo outInfo;

            player.CurrentPoint.TryGetPlayerDateActionPointInfo(player.ChaControl.sex, AIProject.EventType.Break, out outInfo);
            int poseIda = outInfo.poseIDA;

            player.PoseID = poseIda;
            int        _poseID   = poseIda;
            Transform  transform = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.baseNullNameA)?.get_transform() ?? ((Component)player.CurrentPoint).get_transform();
            Transform  t         = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.baseNullNameB)?.get_transform() ?? ((Component)player.CurrentPoint).get_transform();
            GameObject loop1     = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.recoveryNullNameA);

            player.Animation.RecoveryPoint = loop1?.get_transform();
            GameObject loop2 = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.recoveryNullNameB);

            player.Partner.Animation.RecoveryPoint = loop2?.get_transform();
            PlayState info = Singleton <Resources> .Instance.Animation.PlayerActionAnimTable[(int)player.ChaControl.sex][index][_poseID];

            player.Animation.LoadEventKeyTable(index, outInfo.poseIDA);
            player.LoadEventItems(info);
            player.LoadEventParticles(index, outInfo.poseIDA);
            player.Animation.InitializeStates(info);
            Actor partner = player.Partner;

            partner.Animation.LoadEventKeyTable(index, outInfo.poseIDB);
            PlayState playState = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[index][outInfo.poseIDB];

            partner.LoadEventItems(playState);
            partner.LoadEventParticles(index, outInfo.poseIDB);
            partner.Animation.InitializeStates(playState);
            ActorAnimInfo actorAnimInfo1 = new ActorAnimInfo()
            {
                layer          = info.Layer,
                inEnableBlend  = info.MainStateInfo.InStateInfo.EnableFade,
                inBlendSec     = info.MainStateInfo.InStateInfo.FadeSecond,
                outEnableBlend = info.MainStateInfo.OutStateInfo.EnableFade,
                outBlendSec    = info.MainStateInfo.OutStateInfo.FadeSecond,
                directionType  = info.DirectionType,
                isLoop         = info.MainStateInfo.IsLoop,
                endEnableBlend = info.EndEnableBlend,
                endBlendSec    = info.EndBlendRate
            };

            player.Animation.AnimInfo = actorAnimInfo1;
            ActorAnimInfo actorAnimInfo2 = actorAnimInfo1;
            ActorAnimInfo actorAnimInfo3 = new ActorAnimInfo()
            {
                layer          = playState.Layer,
                inEnableBlend  = playState.MainStateInfo.InStateInfo.EnableFade,
                inBlendSec     = playState.MainStateInfo.InStateInfo.FadeSecond,
                outEnableBlend = playState.MainStateInfo.OutStateInfo.EnableFade,
                outBlendSec    = playState.MainStateInfo.OutStateInfo.FadeSecond,
                directionType  = info.DirectionType,
                isLoop         = info.MainStateInfo.IsLoop,
                loopMinTime    = playState.MainStateInfo.LoopMin,
                loopMaxTime    = playState.MainStateInfo.LoopMax,
                hasAction      = playState.ActionInfo.hasAction
            };

            partner.Animation.AnimInfo = actorAnimInfo3;
            ActorAnimInfo actorAnimInfo4 = actorAnimInfo3;

            player.DeactivateNavMeshAgent();
            player.IsKinematic = true;
            partner.SetActiveOnEquipedItem(false);
            partner.ChaControl.setAllLayerWeight(0.0f);
            partner.DeactivateNavMeshAgent();
            partner.IsKinematic = true;
            this._hasAction     = info.ActionInfo.hasAction;
            if (this._hasAction)
            {
                this._loopStateName     = info.MainStateInfo.InStateInfo.StateInfos.GetElement <PlayState.Info>(info.MainStateInfo.InStateInfo.StateInfos.Length - 1).stateName;
                this._randomCount       = info.ActionInfo.randomCount;
                this._oldNormalizedTime = 0.0f;
            }
            ((MonoBehaviour)player).StopAllCoroutines();
            player.Animation.PlayInAnimation(actorAnimInfo2.inEnableBlend, actorAnimInfo2.inBlendSec, info.MainStateInfo.FadeOutTime, actorAnimInfo2.layer);
            player.SetStand(transform, info.MainStateInfo.InStateInfo.EnableFade, info.MainStateInfo.InStateInfo.FadeSecond, info.DirectionType);
            ((MonoBehaviour)partner).StopAllCoroutines();
            partner.Animation.PlayInAnimation(actorAnimInfo4.inEnableBlend, actorAnimInfo4.inBlendSec, playState.MainStateInfo.FadeOutTime, actorAnimInfo4.layer);
            partner.SetStand(t, playState.MainStateInfo.InStateInfo.EnableFade, playState.MainStateInfo.InStateInfo.FadeSecond, actorAnimInfo4.layer);
            ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onElapseTime, 1), (System.Action <M0>)(_ =>
            {
                if (info.SubStateInfos.IsNullOrEmpty <PlayState.PlayStateInfo>())
                {
                    return;
                }
                player.Animation.InStates.Clear();
                foreach (PlayState.Info stateInfo in info.SubStateInfos.GetElement <PlayState.PlayStateInfo>(Random.Range(0, info.SubStateInfos.Count)).InStateInfo.StateInfos)
                {
                    player.Animation.InStates.Enqueue(stateInfo);
                }
            }));
            player.OldEnabledHoldingHand = ((Behaviour)player.HandsHolder).get_enabled();
            if (player.OldEnabledHoldingHand)
            {
                ((Behaviour)player.HandsHolder).set_enabled(false);
                if (player.HandsHolder.EnabledHolding)
                {
                    player.HandsHolder.EnabledHolding = false;
                }
            }
            player.CameraControl.Mode = CameraMode.ActionFreeLook;
            player.CameraControl.SetShotTypeForce(ShotType.Near);
            player.CameraControl.LoadActionCameraFile(index, _poseID, transform);
            Sprite actionIcon;

            Singleton <Resources> .Instance.itemIconTables.ActionIconTable.TryGetValue(Singleton <Resources> .Instance.PlayerProfile.CommonActionIconID, out actionIcon);

            ObservableExtensions.Subscribe <long>((IObservable <M0>)Observable.Timer(TimeSpan.FromSeconds(1.0)), (System.Action <M0>)(_ =>
            {
                MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.CancelAcception);
                MapUIContainer.CommandLabel.CancelCommand = new CommandLabel.CommandInfo()
                {
                    Text             = "立ち上がる",
                    Icon             = actionIcon,
                    TargetSpriteInfo = (CommandTargetSpriteInfo)null,
                    Transform        = (Transform)null,
                    Event            = (System.Action)(() =>
                    {
                        MapUIContainer.CommandLabel.CancelCommand = (CommandLabel.CommandInfo)null;
                        MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
                        ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => player.Controller.State.End((Actor)player)), false), 1), (System.Action <M0>)(__ =>
                        {
                            player.PlayerController.ChangeState("Normal");
                            player.CameraControl.Mode = CameraMode.Normal;
                            player.CameraControl.RecoverShotType();
                            MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.InvokeAcception);
                            AgentActor agentPartner = player.AgentPartner;
                            agentPartner.ActivateNavMeshAgent();
                            agentPartner.SetActiveOnEquipedItem(true);
                            ActorAnimInfo animInfo = agentPartner.Animation.AnimInfo;
                            agentPartner.SetStand(agentPartner.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, animInfo.directionType);
                            if (player.OldEnabledHoldingHand)
                            {
                                ((Behaviour)player.HandsHolder).set_enabled(true);
                                player.OldEnabledHoldingHand = false;
                            }
                            agentPartner.BehaviorResources.ChangeMode(Desire.ActionType.Date);
                        }));
                    })
                };
            }));
        }
        protected override void OnAwake(PlayerActor player)
        {
            player.EventKey = AIProject.EventType.Sleep;
            player.SetActiveOnEquipedItem(false);
            player.ChaControl.setAllLayerWeight(0.0f);
            Singleton <Manager.Input> .Instance.ReserveState(Manager.Input.ValidType.UI);

            Singleton <Manager.Input> .Instance.SetupState();

            MapUIContainer.SetVisibleHUDExceptStoryUI(false);
            MapUIContainer.StorySupportUI.Close();
            ObservableExtensions.Subscribe <long>((IObservable <M0>)Observable.Timer(TimeSpan.FromMilliseconds(1000.0)), (System.Action <M0>)(_ => this.OnStart(player)));
            int eventID = (int)AIProject.Definitions.Action.NameTable[AIProject.EventType.Sleep].Item1;
            DateActionPointInfo apInfo;

            player.CurrentPoint.TryGetPlayerDateActionPointInfo(player.ChaControl.sex, AIProject.EventType.Sleep, out apInfo);
            int poseIda = apInfo.poseIDA;

            player.PoseID = poseIda;
            int        index = poseIda;
            Transform  t1    = ((Component)player.CurrentPoint).get_transform().FindLoop(apInfo.baseNullNameA)?.get_transform() ?? ((Component)player.CurrentPoint).get_transform();
            Transform  t2    = ((Component)player.CurrentPoint).get_transform().FindLoop(apInfo.baseNullNameB)?.get_transform() ?? ((Component)player.CurrentPoint).get_transform();
            GameObject loop1 = ((Component)player.CurrentPoint).get_transform().FindLoop(apInfo.recoveryNullNameA);

            player.Animation.RecoveryPoint = loop1?.get_transform();
            GameObject     loop2      = ((Component)player.CurrentPoint).get_transform().FindLoop(apInfo.recoveryNullNameB);
            ActorAnimation animation  = player.Partner.Animation;
            Transform      transform1 = loop2?.get_transform();

            player.Partner.Animation.RecoveryPoint = transform1;
            Transform transform2 = transform1;

            animation.RecoveryPoint = transform2;
            PlayState playState1 = Singleton <Resources> .Instance.Animation.PlayerActionAnimTable[(int)player.ChaControl.sex][eventID][index];

            player.Animation.LoadEventKeyTable(eventID, apInfo.poseIDA);
            player.LoadEventItems(playState1);
            player.LoadEventParticles(eventID, apInfo.poseIDA);
            player.Animation.InitializeStates(playState1);
            Actor partner = player.Partner;

            partner.Animation.LoadEventKeyTable(eventID, apInfo.poseIDB);
            PlayState playState2 = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[eventID][apInfo.poseIDB];

            partner.LoadEventItems(playState2);
            partner.LoadEventParticles(eventID, apInfo.poseIDB);
            partner.Animation.InitializeStates(playState2);
            ActorAnimInfo actorAnimInfo1 = new ActorAnimInfo()
            {
                layer          = playState1.Layer,
                inEnableBlend  = playState1.MainStateInfo.InStateInfo.EnableFade,
                inBlendSec     = playState1.MainStateInfo.InStateInfo.FadeSecond,
                outEnableBlend = playState1.MainStateInfo.OutStateInfo.EnableFade,
                outBlendSec    = playState1.MainStateInfo.OutStateInfo.FadeSecond,
                directionType  = playState1.DirectionType,
                isLoop         = playState1.MainStateInfo.IsLoop
            };

            player.Partner.Animation.AnimInfo = actorAnimInfo1;
            ActorAnimInfo actorAnimInfo2 = actorAnimInfo1;

            player.Animation.AnimInfo = actorAnimInfo2;
            ActorAnimInfo actorAnimInfo3 = actorAnimInfo2;
            ActorAnimInfo actorAnimInfo4 = new ActorAnimInfo()
            {
                layer          = playState2.Layer,
                inEnableBlend  = playState2.MainStateInfo.InStateInfo.EnableFade,
                inBlendSec     = playState2.MainStateInfo.InStateInfo.FadeSecond,
                outEnableBlend = playState2.MainStateInfo.OutStateInfo.EnableFade,
                outBlendSec    = playState2.MainStateInfo.OutStateInfo.FadeSecond,
                directionType  = playState2.DirectionType,
                isLoop         = playState2.MainStateInfo.IsLoop,
                loopMinTime    = playState1.MainStateInfo.LoopMin,
                loopMaxTime    = playState1.MainStateInfo.LoopMax,
                hasAction      = playState1.ActionInfo.hasAction
            };

            partner.Animation.AnimInfo = actorAnimInfo4;
            ActorAnimInfo actorAnimInfo5 = actorAnimInfo4;

            player.DeactivateNavMeshAgent();
            player.IsKinematic = true;
            partner.SetActiveOnEquipedItem(false);
            partner.ChaControl.setAllLayerWeight(0.0f);
            partner.DeactivateNavMeshAgent();
            partner.IsKinematic = true;
            this._hasAction     = playState1.ActionInfo.hasAction;
            if (this._hasAction)
            {
                this._loopStateName     = playState1.MainStateInfo.InStateInfo.StateInfos.GetElement <PlayState.Info>(playState1.MainStateInfo.InStateInfo.StateInfos.Length - 1).stateName;
                this._randomCount       = playState1.ActionInfo.randomCount;
                this._oldNormalizedTime = 0.0f;
            }
            player.Animation.PlayInAnimation(actorAnimInfo3.inEnableBlend, actorAnimInfo3.inBlendSec, playState1.MainStateInfo.FadeOutTime, actorAnimInfo3.layer);
            player.SetStand(t1, playState1.MainStateInfo.InStateInfo.EnableFade, playState1.MainStateInfo.InStateInfo.FadeSecond, playState1.DirectionType);
            partner.Animation.PlayInAnimation(actorAnimInfo3.inEnableBlend, actorAnimInfo3.inBlendSec, playState2.MainStateInfo.FadeOutTime, actorAnimInfo3.layer);
            partner.SetStand(t2, actorAnimInfo5.inEnableBlend, actorAnimInfo5.inBlendSec, actorAnimInfo3.layer);
            ObservableExtensions.Subscribe <long>(Observable.Take <long>(Observable.Skip <long>((IObservable <M0>)Observable.EveryLateUpdate(), 1), 1), (System.Action <M0>)(_ =>
            {
                if (apInfo.pointID == 501)
                {
                    ADV.ChangeADVFixedAngleCamera((Actor)player, 5);
                }
                else
                {
                    if (apInfo.pointID != 500)
                    {
                        return;
                    }
                    ADV.ChangeADVFixedAngleCamera(partner, 5);
                }
            }));
            bool enabled = ((Behaviour)player.HandsHolder).get_enabled();

            player.OldEnabledHoldingHand = enabled;
            if (enabled)
            {
                ((Behaviour)player.HandsHolder).set_enabled(false);
                if (player.HandsHolder.EnabledHolding)
                {
                    player.HandsHolder.EnabledHolding = false;
                }
            }
            player.CameraControl.SetShotTypeForce(ShotType.Near);
        }