public void ResetEquipEventItem(EquipEventItemInfo itemInfo) { if (this.EquipedItem != null) { if (itemInfo != null) { if (this.EquipedItem.EventItemID == itemInfo.EventItemID) { if (this.EquipedItem.AsGameObject.get_activeSelf()) { return; } this.EquipedItem.AsGameObject.SetActive(true); } else { this.ReleaseEquipedEventItem(); this.LoadEquipedEventItem(itemInfo); } } else { this.ReleaseEquipedEventItem(); } } else { if (itemInfo == null) { return; } this.LoadEquipedEventItem(itemInfo); } }
protected abstract void LoadEquipedEventItem(EquipEventItemInfo eventItemInfo);
public virtual void OnStart() { AgentActor agent = this.Agent; if (agent.EquipedItem != null) { ItemCache equipedItem = agent.EquipedItem; if (equipedItem.EventItemID == Singleton <Resources> .Instance.LocomotionProfile.ObonEventItemID) { return; } ItemIDKeyPair umbrellaId = Singleton <Resources> .Instance.CommonDefine.ItemIDDefine.UmbrellaID; EquipEventItemInfo equipEventItemInfo = Singleton <Resources> .Instance.GameInfo.CommonEquipEventItemTable[umbrellaId.categoryID][umbrellaId.itemID]; if (equipedItem.EventItemID == equipEventItemInfo.EventItemID) { return; } } ((Task)this).OnStart(); agent.StopNavMeshAgent(); agent.ChangeStaticNavMeshAgentAvoidance(); int id = agent.AgentData.SickState.ID; this._info = (PlayState)null; Dictionary <int, Dictionary <int, PlayState> > agentActionAnimTable = Singleton <Resources> .Instance.Animation.AgentActionAnimTable; AgentProfile.PoseIDCollection poseIdTable = Singleton <Resources> .Instance.AgentProfile.PoseIDTable; PoseKeyPair?nullable = new PoseKeyPair?(); switch (id) { case 0: nullable = new PoseKeyPair?(poseIdTable.CoughID); break; case 4: nullable = new PoseKeyPair?(poseIdTable.StandHurtID); break; default: if ((double)agent.AgentData.StatsTable[2] <= 0.0) { nullable = new PoseKeyPair?(poseIdTable.StandHurtID); break; } switch (Singleton <Manager.Map> .Instance.Simulator.Temperature) { case Temperature.Hot: nullable = new PoseKeyPair?(poseIdTable.ColdPoseID); break; case Temperature.Cold: nullable = new PoseKeyPair?(poseIdTable.ColdPoseID); break; } break; } if (!nullable.HasValue) { return; } this._info = agentActionAnimTable[nullable.Value.postureID][nullable.Value.poseID]; if (this._info == null) { return; } agent.Animation.LoadEventKeyTable(nullable.Value.postureID, nullable.Value.poseID); this._layer = this._info.Layer; this._inEnableFade = this._info.MainStateInfo.InStateInfo.EnableFade; this._inFadeTime = this._info.MainStateInfo.InStateInfo.FadeSecond; agent.Animation.OnceActionStates.Clear(); if (!this._info.MainStateInfo.InStateInfo.StateInfos.IsNullOrEmpty <PlayState.Info>()) { foreach (PlayState.Info stateInfo in this._info.MainStateInfo.InStateInfo.StateInfos) { agent.Animation.OnceActionStates.Add(stateInfo); } } agent.Animation.OutStates.Clear(); if (!this._info.MainStateInfo.OutStateInfo.StateInfos.IsNullOrEmpty <PlayState.Info>()) { foreach (PlayState.Info stateInfo in this._info.MainStateInfo.OutStateInfo.StateInfos) { agent.Animation.OutStates.Enqueue(stateInfo); } } agent.Animation.PlayOnceActionAnimation(this._inEnableFade, this._inFadeTime, this._layer); this._onEndActionDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (Action <M0>)(_ => { agent.Animation.StopAllAnimCoroutine(); agent.Animation.PlayOutAnimation(this._outEnableFade, this._outFadeTime, this._layer); })); }