public override void OnStart() { AgentActor agent = this.Agent; agent.EventKey = EventType.DoorOpen; OffMeshLinkData currentOffMeshLinkData = agent.NavMeshAgent.get_currentOffMeshLinkData(); DoorPoint component1 = (DoorPoint)((Component)((OffMeshLinkData) ref currentOffMeshLinkData).get_offMeshLink()).GetComponent <DoorPoint>(); agent.TargetInSightActionPoint = (ActionPoint)component1; this._actionMotion = new PoseKeyPair() { postureID = -1, poseID = -1 }; base.OnStart(); if (!Object.op_Inequality((Object)agent.CurrentPoint, (Object)null)) { return; } DoorAnimation component2 = (DoorAnimation)((Component)agent.CurrentPoint).GetComponent <DoorAnimation>(); if (!Object.op_Inequality((Object)component2, (Object)null)) { return; } ActionPointInfo actionPointInfo = agent.Animation.ActionPointInfo; PlayState playState = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[actionPointInfo.eventID][actionPointInfo.poseID]; component2.Load(playState.MainStateInfo.InStateInfo.StateInfos); ActorAnimInfo animInfo = agent.Animation.AnimInfo; component2.PlayAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, playState.MainStateInfo.FadeOutTime, animInfo.layer); }
protected override void OnStart() { DoorPoint component = (DoorPoint)((Component)this).GetComponent <DoorPoint>(); component.ObstacleInOpenRight = this._obstacleInOpenRight; component.ObstacleInOpenLeft = this._obstacleInOpenLeft; component.ObstacleInClose = this._obstacleInClose; }
protected override void OnStart() { this._data = DoorObstacleData.Table.get_Item(this._id); DoorPoint component = (DoorPoint)((Component)this).GetComponent <DoorPoint>(); component.ObstacleInOpenRight = this._data.OpenRight; component.ObstacleInOpenLeft = this._data.OpenLeft; component.ObstacleInClose = this._data.Close; }
protected override void OnCompletedStateTask() { DoorPoint currentPoint = this.Agent.CurrentPoint as DoorPoint; if (currentPoint.OpenType == DoorPoint.OpenTypeState.Right || currentPoint.OpenType == DoorPoint.OpenTypeState.Right90) { currentPoint.SetOpenState(DoorPoint.OpenPattern.OpenRight, true); } else { currentPoint.SetOpenState(DoorPoint.OpenPattern.OpenLeft, true); } }
protected override void OnCompletedStateTask() { DoorPoint currentPoint = this.Agent.CurrentPoint as DoorPoint; if (Object.op_Equality((Object)currentPoint, (Object)null)) { return; } if (currentPoint.OpenType == DoorPoint.OpenTypeState.Right || currentPoint.OpenType == DoorPoint.OpenTypeState.Right90) { currentPoint.SetOpenState(DoorPoint.OpenPattern.OpenRight, true); } else { currentPoint.SetOpenState(DoorPoint.OpenPattern.OpenLeft, true); } }
protected override void OnStart() { this._animator = DoorAnimData.Table.get_Item(this._id); if (!Object.op_Inequality((Object)this._animator, (Object)null)) { return; } this._animator.set_runtimeAnimatorController(Singleton <Resources> .Instance.Animation.GetItemAnimator(this._animatorID)); this._animator.Play(Singleton <Resources> .Instance.CommonDefine.ItemAnims.DoorDefaultState, 0, 0.0f); if (!Object.op_Inequality((Object)(this._linkedDoorPoint = (DoorPoint)((Component)this).GetComponent <DoorPoint>()), (Object)null)) { return; } ObservableExtensions.Subscribe <Unit>(Observable.TakeUntilDestroy <Unit>(Observable.TakeUntilDestroy <Unit>((IObservable <M0>)ObservableTriggerExtensions.OnEnableAsObservable((Component)this._animator), (Component)this._linkedDoorPoint), (Component)this), (Action <M0>)(_ => { if (!Singleton <Resources> .IsInstance()) { return; } CommonDefine.ItemAnimGroup itemAnims = Singleton <Resources> .Instance.CommonDefine.ItemAnims; string self = (string)null; switch (this._linkedDoorPoint.OpenState) { case DoorPoint.OpenPattern.Close: self = itemAnims.DoorCloseLoopState; break; case DoorPoint.OpenPattern.OpenRight: self = itemAnims.DoorOpenIdleRight; break; case DoorPoint.OpenPattern.OpenLeft: self = itemAnims.DoorOpenIdleLeft; break; } if (self.IsNullOrEmpty()) { return; } this._animator.Play(self, 0, 0.0f); })); }
public override void OnStart() { this._unchangeParamState = true; AgentActor agent = this.Agent; this._prevEventKey = agent.EventKey; agent.EventKey = EventType.DoorOpen; OffMeshLinkData currentOffMeshLinkData = agent.NavMeshAgent.get_currentOffMeshLinkData(); DoorPoint component1 = (DoorPoint)((Component)((OffMeshLinkData) ref currentOffMeshLinkData).get_offMeshLink()).GetComponent <DoorPoint>(); this._prevTargetPoint = agent.TargetInSightActionPoint; this._isDoorOpen = !((OffMeshLinkData) ref currentOffMeshLinkData).get_activated() || Object.op_Equality((Object)component1, (Object)null) || component1.IsOpen; if (this._isDoorOpen) { agent.EventKey = this._prevEventKey; } else { agent.TargetInSightActionPoint = (ActionPoint)component1; base.OnStart(); if (!Object.op_Inequality((Object)agent.CurrentPoint, (Object)null)) { return; } DoorAnimation component2 = (DoorAnimation)((Component)agent.CurrentPoint).GetComponent <DoorAnimation>(); if (!Object.op_Inequality((Object)component2, (Object)null)) { return; } ActionPointInfo actionPointInfo = agent.Animation.ActionPointInfo; PlayState playState = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[actionPointInfo.eventID][actionPointInfo.poseID]; component2.Load(playState.MainStateInfo.InStateInfo.StateInfos); ActorAnimInfo animInfo = agent.Animation.AnimInfo; component2.PlayAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, playState.MainStateInfo.FadeOutTime, animInfo.layer); } }
protected override void InitSub() { this._offMeshLink = (OffMeshLink)((Component)this).GetComponent <OffMeshLink>(); this.DoorAnimation = (DoorAnimation)((Component)this).GetComponent <DoorAnimation>(); CommonDefine.CommonIconGroup icon = Singleton <Resources> .Instance.CommonDefine.Icon; EventType playerEventMask = Singleton <Resources> .Instance.DefinePack.MapDefines.PlayerEventMask; List <CommandLabel.CommandInfo> toRelease1 = ListPool <CommandLabel.CommandInfo> .Get(); List <CommandLabel.CommandInfo> toRelease2 = ListPool <CommandLabel.CommandInfo> .Get(); foreach (KeyValuePair <EventType, Tuple <int, string, System.Action <PlayerActor, ActionPoint> > > keyValuePair in ActionPoint.LabelTable) { KeyValuePair <EventType, Tuple <int, string, System.Action <PlayerActor, ActionPoint> > > pair = keyValuePair; DoorPoint doorPoint = this; if (this._playerEventType.Contains(pair.Key) && playerEventMask.Contains(pair.Key) && AIProject.Definitions.Action.NameTable.TryGetValue(pair.Key, out ValueTuple <int, string> _)) { ActionPointInfo actionPointInfo = this._playerInfos.Find((Predicate <ActionPointInfo>)(x => x.eventTypeMask == pair.Key)); string actionName = actionPointInfo.actionName; Sprite sprite; Singleton <Resources> .Instance.itemIconTables.ActionIconTable.TryGetValue(actionPointInfo.iconID, out sprite); Transform transform = ((Component)this).get_transform().FindLoop(actionPointInfo.labelNullName)?.get_transform() ?? ((Component)this).get_transform(); if (pair.Key == EventType.DoorOpen) { toRelease1.Add(new CommandLabel.CommandInfo() { Text = actionName, Icon = sprite, IsHold = false, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = transform, Event = (System.Action)(() => pair.Value.Item3(Singleton <Manager.Map> .Instance.Player, (ActionPoint)doorPoint)) }); if (actionPointInfo.doorOpenType > -1) { this._openType = (DoorPoint.OpenTypeState)actionPointInfo.doorOpenType; } } else if (pair.Key == EventType.DoorClose) { toRelease2.Add(new CommandLabel.CommandInfo() { Text = actionName, Icon = sprite, IsHold = false, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = transform, Event = (System.Action)(() => pair.Value.Item3(Singleton <Manager.Map> .Instance.Player, (ActionPoint)doorPoint)) }); if (actionPointInfo.doorOpenType > -1) { this._openType = (DoorPoint.OpenTypeState)actionPointInfo.doorOpenType; } } } } this._openingLabels = toRelease1.ToArray(); this._closingLabels = toRelease2.ToArray(); ListPool <CommandLabel.CommandInfo> .Release(toRelease1); ListPool <CommandLabel.CommandInfo> .Release(toRelease2); List <CommandLabel.CommandInfo> toRelease3 = ListPool <CommandLabel.CommandInfo> .Get(); List <CommandLabel.CommandInfo> toRelease4 = ListPool <CommandLabel.CommandInfo> .Get(); foreach (KeyValuePair <EventType, Tuple <int, string, System.Action <PlayerActor, ActionPoint> > > keyValuePair in ActionPoint.SickLabelTable) { KeyValuePair <EventType, Tuple <int, string, System.Action <PlayerActor, ActionPoint> > > pair = keyValuePair; DoorPoint doorPoint = this; if (this._playerEventType.Contains(pair.Key) && AIProject.Definitions.Action.NameTable.TryGetValue(pair.Key, out ValueTuple <int, string> _)) { ActionPointInfo actionPointInfo = this._playerInfos.Find((Predicate <ActionPointInfo>)(x => x.eventTypeMask == pair.Key)); string actionName = actionPointInfo.actionName; Sprite sprite; Singleton <Resources> .Instance.itemIconTables.ActionIconTable.TryGetValue(actionPointInfo.iconID, out sprite); Transform transform = ((Component)this).get_transform().FindLoop(actionPointInfo.labelNullName)?.get_transform() ?? ((Component)this).get_transform(); if (pair.Key == EventType.DoorOpen) { toRelease3.Add(new CommandLabel.CommandInfo() { Text = actionName, Icon = sprite, IsHold = false, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = transform, Event = (System.Action)(() => pair.Value.Item3(Singleton <Manager.Map> .Instance.Player, (ActionPoint)doorPoint)) }); if (actionPointInfo.doorOpenType > -1) { this._openType = (DoorPoint.OpenTypeState)actionPointInfo.doorOpenType; } } else if (pair.Key == EventType.DoorClose) { toRelease4.Add(new CommandLabel.CommandInfo() { Text = actionName, Icon = sprite, IsHold = false, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = transform, Event = (System.Action)(() => pair.Value.Item3(Singleton <Manager.Map> .Instance.Player, (ActionPoint)doorPoint)) }); if (actionPointInfo.doorOpenType > -1) { this._openType = (DoorPoint.OpenTypeState)actionPointInfo.doorOpenType; } } } } this._sickOpeningLabels = toRelease3.ToArray(); this._sickClosingLabels = toRelease4.ToArray(); ListPool <CommandLabel.CommandInfo> .Release(toRelease3); ListPool <CommandLabel.CommandInfo> .Release(toRelease4); }