public override void OnStart() { this.prevEventKey = this.Merchant.EventKey; this.Merchant.EventKey = EventType.DoorOpen; OffMeshLinkData currentOffMeshLinkData = this.Merchant.NavMeshAgent.get_currentOffMeshLinkData(); DoorPoint component1 = (DoorPoint)((Component)((OffMeshLinkData) ref currentOffMeshLinkData).get_offMeshLink()).GetComponent <DoorPoint>(); this.isDoorOpen = !((OffMeshLinkData) ref currentOffMeshLinkData).get_activated() || Object.op_Equality((Object)component1, (Object)null) || component1.IsOpen; this.CurrentPoint = !this.isDoorOpen ? (ActionPoint)component1 : (ActionPoint)null; if (this.isDoorOpen) { this.Merchant.EventKey = this.prevEventKey; } base.OnStart(); if (!Object.op_Inequality((Object)this.CurrentPoint, (Object)null)) { return; } DoorAnimation component2 = (DoorAnimation)((Component)this.CurrentPoint).GetComponent <DoorAnimation>(); if (!Object.op_Inequality((Object)component2, (Object)null)) { return; } ActionPointInfo outInfo; this.CurrentPoint.TryGetAgentActionPointInfo(EventType.DoorOpen, out outInfo); PlayState playState = Singleton <Resources> .Instance.Animation.MerchantCommonActionAnimStateTable[outInfo.eventID][outInfo.poseID]; component2.Load(playState.MainStateInfo.InStateInfo.StateInfos); component2.PlayAnimation(this.animInfo.inEnableBlend, this.animInfo.inBlendSec, this.animInfo.inFadeOutTime, this.animInfo.layer); }
protected override void OnCompletedStateTask() { if (Object.op_Equality((Object)this.CurrentPoint, (Object)null)) { return; } DoorPoint currentPoint = this.CurrentPoint as DoorPoint; if (currentPoint.OpenType == DoorPoint.OpenTypeState.Right) { currentPoint.SetOpenState(DoorPoint.OpenPattern.OpenRight, true); } else { currentPoint.SetOpenState(DoorPoint.OpenPattern.OpenLeft, true); } }
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; }
private void Elapsed(PlayerActor player) { DoorPoint currentPoint = player.CurrentPoint as DoorPoint; if (Object.op_Inequality((Object)currentPoint, (Object)null)) { if (currentPoint.OpenType == DoorPoint.OpenTypeState.Right || currentPoint.OpenType == DoorPoint.OpenTypeState.Right90) { currentPoint.SetOpenState(DoorPoint.OpenPattern.OpenRight, true); } else { currentPoint.SetOpenState(DoorPoint.OpenPattern.OpenLeft, true); } } player.PlayerController.CommandArea.RefreshCommands(); if (Object.op_Inequality((Object)player.CurrentPoint, (Object)null)) { player.CurrentPoint.RemoveBooking((Actor)player); CommandArea commandArea = player.PlayerController.CommandArea; commandArea.RemoveConsiderationObject((ICommandable)player.CurrentPoint); commandArea.RefreshCommands(); } if (player.PlayerController.PrevStateName == "Onbu") { player.Controller.ChangeState(player.PlayerController.PrevStateName); } else if (player.PlayerController.PrevStateName == "Follow") { player.PlayerController.ChangeState("Follow"); } else { player.Controller.ChangeState("Normal"); } }