private void ChangeCamera(int actionID, int poseID, Actor actor) { Dictionary <int, ActAnimFlagData> dictionary; ActAnimFlagData actAnimFlagData; if (!Singleton <Resources> .Instance.Action.AgentActionFlagTable.TryGetValue(actionID, out dictionary) || !dictionary.TryGetValue(poseID, out actAnimFlagData)) { return; } switch (actAnimFlagData.attitudeID) { case 0: ADV.ChangeADVCamera(actor); break; case 1: ADV.ChangeADVCameraDiagonal(actor); break; default: ADV.ChangeADVFixedAngleCamera(actor, actAnimFlagData.attitudeID); break; } }
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); }