protected override void Start() { if (DevicePointAnimData.AnimatorItemTable.TryGetValue(this._id, ref this._animator)) { this._animator.set_runtimeAnimatorController(Singleton <Resources> .Instance.Animation.GetItemAnimator(Singleton <Resources> .Instance.CommonDefine.ItemAnims.PodAnimatorID)); } if (Object.op_Equality((Object)this._commandBasePoint, (Object)null)) { this._commandBasePoint = ((Component)this).get_transform().FindLoop(Singleton <Resources> .Instance.DefinePack.MapDefines.CommandTargetName)?.get_transform() ?? ((Component)this).get_transform(); } if (Object.op_Equality((Object)this._pivotPoint, (Object)null)) { this._pivotPoint = ((Component)this).get_transform().FindLoop(Singleton <Resources> .Instance.DefinePack.MapDefines.DevicePointPivotTargetName)?.get_transform() ?? ((Component)this).get_transform(); } if (this._recoverPoints.IsNullOrEmpty <Transform>() || this._recoverPoints.Count < 4) { this._recoverPoints.Clear(); foreach (string recoveryTargetName in Singleton <Resources> .Instance.DefinePack.MapDefines.DevicePointRecoveryTargetNames) { GameObject loop = ((Component)this).get_transform().FindLoop(recoveryTargetName); if (Object.op_Inequality((Object)loop, (Object)null)) { this._recoverPoints.Add(loop.get_transform()); } } } if (Object.op_Equality((Object)this._playerRecoverPoint, (Object)null)) { this._playerRecoverPoint = ((Component)this).get_transform().FindLoop(Singleton <Resources> .Instance.DefinePack.MapDefines.DevicePointPlayerRecoveryTargetName)?.get_transform(); } base.Start(); CommonDefine.CommonIconGroup icon = Singleton <Resources> .Instance.CommonDefine.Icon; DefinePack.MapGroup mapDefines = Singleton <Resources> .Instance.DefinePack.MapDefines; Sprite sprite; Singleton <Resources> .Instance.itemIconTables.ActionIconTable.TryGetValue(Singleton <Resources> .Instance.CommonDefine.Icon.DeviceIconID, out sprite); Transform transform = ((Component)this).get_transform().FindLoop(mapDefines.DevicePointLabelTargetName)?.get_transform() ?? ((Component)this).get_transform(); this._labels = new CommandLabel.CommandInfo[1] { new CommandLabel.CommandInfo() { Text = "データ端末", Icon = sprite, IsHold = true, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = transform, Condition = (Func <PlayerActor, bool>)null, Event = (Action)(() => { Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.BootDevice); MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None); Singleton <Manager.Map> .Instance.Player.CurrentDevicePoint = this; Singleton <Manager.Map> .Instance.Player.StashData(); Singleton <Manager.Map> .Instance.Player.Controller.ChangeState("DeviceMenu"); }) } }; }
protected override void Start() { if (Object.op_Equality((Object)this._commandBasePoint, (Object)null)) { this._commandBasePoint = ((Component)this).get_transform().FindLoop(Singleton <Resources> .Instance.DefinePack.MapDefines.CommandTargetName)?.get_transform() ?? ((Component)this).get_transform(); } CommonDefine.CommonIconGroup icon = Singleton <Resources> .Instance.CommonDefine.Icon; DefinePack.MapGroup mapDefines = Singleton <Resources> .Instance.DefinePack.MapDefines; Sprite sprite; Singleton <Resources> .Instance.itemIconTables.ActionIconTable.TryGetValue(Singleton <Resources> .Instance.CommonDefine.Icon.ShipIconID, out sprite); Transform transform = ((Component)this).get_transform().FindLoop(mapDefines.ShipPointLabelTargetName)?.get_transform() ?? ((Component)this).get_transform(); this._labels = new CommandLabel.CommandInfo[1] { new CommandLabel.CommandInfo() { Text = "船", Icon = sprite, IsHold = true, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = transform, Condition = (Func <PlayerActor, bool>)null, Event = (Action)(() => { MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None); Singleton <Manager.Map> .Instance.Player.Controller.ChangeState("ShipMenu"); }) } }; }
private void InitializeCommandLabels() { if (this._labels != null) { return; } Resources instance = Singleton <Resources> .Instance; CommonDefine.CommonIconGroup icon = instance.CommonDefine.Icon; int jukeBoxIconId = instance.CommonDefine.Icon.JukeBoxIconID; Sprite sprite; instance.itemIconTables.ActionIconTable.TryGetValue(jukeBoxIconId, out sprite); int index = !Singleton <GameSystem> .IsInstance() ? 0 : Singleton <GameSystem> .Instance.languageInt; List <string> source; instance.Map.EventPointCommandLabelTextTable.TryGetValue(17, out source); this._labels = new CommandLabel.CommandInfo[1] { new CommandLabel.CommandInfo() { Text = source.GetElement <string>(index), Icon = sprite, IsHold = true, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = this.LabelPoint, Condition = (Func <PlayerActor, bool>)null, Event = (Action)(() => { PlayerActor player = !Singleton <Manager.Map> .IsInstance() ? (PlayerActor)null : Singleton <Manager.Map> .Instance.Player; if (!Object.op_Inequality((Object)player, (Object)null)) { return; } player.CurrentjukePoint = this; MapUIContainer.SetVisibleHUD(false); player.PlayerController.ChangeState("Idle"); MapUIContainer.JukeBoxUI.ClosedAction = (Action)(() => { MapUIContainer.SetVisibleHUD(true); player.PlayerController.ChangeState("Normal"); }); MapUIContainer.SetActiveJukeBoxUI(true); }) } }; }
private void InitializeCommandLabels() { if (!Singleton <Resources> .IsInstance()) { return; } Resources instance = Singleton <Resources> .Instance; CommonDefine.CommonIconGroup icon = instance.CommonDefine.Icon; int guideCancelId = instance.CommonDefine.Icon.GuideCancelID; Sprite sprite; instance.itemIconTables.InputIconTable.TryGetValue(guideCancelId, out sprite); Dictionary <int, List <string> > commandLabelTextTable = instance.Map.EventPointCommandLabelTextTable; int index = !Singleton <GameSystem> .IsInstance() ? 0 : Singleton <GameSystem> .Instance.languageInt; List <string> source; commandLabelTextTable.TryGetValue(15, out source); this._onLabels = new CommandLabel.CommandInfo[1] { new CommandLabel.CommandInfo() { Text = source.GetElement <string>(index), Icon = sprite, IsHold = true, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = this._labelPoint, Condition = (Func <PlayerActor, bool>)null, Event = (Action)(() => this.Switch(true)) } }; commandLabelTextTable.TryGetValue(16, out source); this._offLabels = new CommandLabel.CommandInfo[1] { new CommandLabel.CommandInfo() { Text = source.GetElement <string>(index), Icon = sprite, IsHold = true, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = this._labelPoint, Condition = (Func <PlayerActor, bool>)null, Event = (Action)(() => this.Switch(false)) } }; }
protected override void InitSub() { Tuple <int, string, Action <PlayerActor, ActionPoint> > pair; if (!ActionPoint.LabelTable.TryGetValue(EventType.Search, out pair)) { return; } Resources instance = Singleton <Resources> .Instance; CommonDefine.CommonIconGroup icon = instance.CommonDefine.Icon; Dictionary <int, List <string> > commandLabelTextTable = instance.Map.EventPointCommandLabelTextTable; int index = !Singleton <GameSystem> .IsInstance() ? 0 : Singleton <GameSystem> .Instance.languageInt; List <string> source; commandLabelTextTable.TryGetValue(this._textID, out source); string str = source.GetElement <string>(index) ?? string.Empty; Sprite sprite = (Sprite)null; Singleton <Resources> .Instance.itemIconTables.ActionIconTable.TryGetValue(this._iconID, out sprite); Transform transform = ((Component)this).get_transform().FindLoop(this._labelNullName)?.get_transform() ?? ((Component)this).get_transform(); this._labels = new CommandLabel.CommandInfo[1] { new CommandLabel.CommandInfo() { Text = str, Icon = sprite, IsHold = true, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = transform, Condition = (Func <PlayerActor, bool>)null, Event = (Action)(() => { Action <PlayerActor, ActionPoint> action = pair.Item3; if (action == null) { return; } action(Singleton <Manager.Map> .Instance.Player, (ActionPoint)this); }) } }; }
protected override void InitSub() { CommonDefine.CommonIconGroup icon = Singleton <Resources> .Instance.CommonDefine.Icon; EventType playerEventMask = Singleton <Resources> .Instance.DefinePack.MapDefines.PlayerEventMask; List <CommandLabel.CommandInfo> toRelease1 = 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; WarpPoint warpPoint = 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); this._tableID = actionPointInfo.searchAreaID; Transform transform = ((Component)this).get_transform().FindLoop(actionPointInfo.labelNullName)?.get_transform() ?? ((Component)this).get_transform(); toRelease1.Add(new CommandLabel.CommandInfo() { Text = actionName, Icon = sprite, IsHold = true, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = transform, Condition = (Func <PlayerActor, bool>)(x => warpPoint.CanAccess()), ErrorText = (Func <PlayerActor, string>)(x => warpPoint.ErrorText()), Event = (System.Action)(() => pair.Value.Item3(Singleton <Manager.Map> .Instance.Player, (ActionPoint)warpPoint)) }); } } this._labels = toRelease1.ToArray(); ListPool <CommandLabel.CommandInfo> .Release(toRelease1); for (int key = 0; key < 2; ++key) { List <CommandLabel.CommandInfo> toRelease2 = ListPool <CommandLabel.CommandInfo> .Get(); foreach (KeyValuePair <EventType, Tuple <int, string, System.Action <PlayerActor, ActionPoint> > > keyValuePair in ActionPoint.DateLabelTable) { KeyValuePair <EventType, Tuple <int, string, System.Action <PlayerActor, ActionPoint> > > pair = keyValuePair; WarpPoint warpPoint = this; List <DateActionPointInfo> dateActionPointInfoList; if (this._playerDateEventType[key].Contains(pair.Key) && AIProject.Definitions.Action.NameTable.TryGetValue(pair.Key, out ValueTuple <int, string> _) && this._playerDateInfos.TryGetValue(key, out dateActionPointInfoList)) { DateActionPointInfo dateActionPointInfo = dateActionPointInfoList.Find((Predicate <DateActionPointInfo>)(x => x.eventTypeMask == pair.Key)); string actionName = dateActionPointInfo.actionName; Sprite sprite; Singleton <Resources> .Instance.itemIconTables.ActionIconTable.TryGetValue(dateActionPointInfo.iconID, out sprite); Transform transform = ((Component)this).get_transform().FindLoop(dateActionPointInfo.labelNullName)?.get_transform() ?? ((Component)this).get_transform(); toRelease2.Add(new CommandLabel.CommandInfo() { Text = actionName, Icon = sprite, IsHold = true, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = transform, Condition = (Func <PlayerActor, bool>)(x => warpPoint.CanAccess()), ErrorText = (Func <PlayerActor, string>)(x => warpPoint.ErrorText()), Event = (System.Action)(() => pair.Value.Item3(Singleton <Manager.Map> .Instance.Player, (ActionPoint)warpPoint)) }); } } this._dateLabels[key] = toRelease2.ToArray(); ListPool <CommandLabel.CommandInfo> .Release(toRelease2); } List <CommandLabel.CommandInfo> toRelease3 = 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; WarpPoint warpPoint = 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(); toRelease3.Add(new CommandLabel.CommandInfo() { Text = pair.Value.Item2, Icon = sprite, IsHold = true, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = transform, Condition = (Func <PlayerActor, bool>)(x => warpPoint.CanAccess()), ErrorText = (Func <PlayerActor, string>)(x => warpPoint.ErrorText()), Event = (System.Action)(() => pair.Value.Item3(Singleton <Manager.Map> .Instance.Player, (ActionPoint)warpPoint)) }); } } this._sickLabels = toRelease3.ToArray(); ListPool <CommandLabel.CommandInfo> .Release(toRelease3); if (!this._playerInfos.IsNullOrEmpty <ActionPointInfo>() && this._playerInfos.Exists((Predicate <ActionPointInfo>)(x => x.eventTypeMask == EventType.Warp)) || !this._agentEventType.Contains(EventType.Warp)) { return; } this._tableID = this._agentInfos.Find((Predicate <ActionPointInfo>)(x => x.eventTypeMask == EventType.Warp)).searchAreaID; }
protected override void InitSub() { CommonDefine.CommonIconGroup icon = Singleton <Resources> .Instance.CommonDefine.Icon; EventType playerEventMask = Singleton <Resources> .Instance.DefinePack.MapDefines.PlayerEventMask; List <CommandLabel.CommandInfo> toRelease1 = 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; SearchActionPoint searchActionPoint = 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; if (pair.Key == EventType.Search) { if (actionPointInfo.searchAreaID > -1) { this._tableID = actionPointInfo.searchAreaID; } if (actionPointInfo.gradeValue > -1 && actionPointInfo.gradeValue > this._grade) { this._grade = actionPointInfo.gradeValue; } Dictionary <int, int> dictionary; if (Singleton <Resources> .Instance.itemIconTables.EquipmentIconTable.TryGetValue(this._tableID, out dictionary)) { int key; if (dictionary.TryGetValue(this._grade, out key)) { Singleton <Resources> .Instance.itemIconTables.ActionIconTable.TryGetValue(key, out sprite); } else { sprite = (Sprite)null; } } else { sprite = (Sprite)null; } } else { 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(); toRelease1.Add(new CommandLabel.CommandInfo() { Text = actionName, Icon = sprite, IsHold = pair.Key == EventType.Search, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = transform, Condition = (Func <PlayerActor, bool>)(x => closure_0.CanAction(x, pair.Key, actionPointInfo.searchAreaID)), ErrorText = (Func <PlayerActor, string>)(x => closure_0.ErrorText(x, pair.Key, actionPointInfo.searchAreaID)), CoolTimeFillRate = (Func <float>)(() => { AIProject.SaveData.Environment.SearchActionInfo searchActionInfo; if (!Singleton <Game> .Instance.Environment.SearchActionLockTable.TryGetValue(closure_0.RegisterID, out searchActionInfo)) { return(0.0f); } EnvironmentProfile environmentProfile = Singleton <Manager.Map> .Instance.EnvironmentProfile; return(searchActionInfo.Count < environmentProfile.SearchCount ? 0.0f : 1f - searchActionInfo.ElapsedTime / environmentProfile.SearchCoolTimeDuration); }), Event = (System.Action)(() => pair.Value.Item3(Singleton <Manager.Map> .Instance.Player, (ActionPoint)closure_0)) }); } } this._labels = toRelease1.ToArray(); ListPool <CommandLabel.CommandInfo> .Release(toRelease1); for (int key1 = 0; key1 < 2; ++key1) { List <CommandLabel.CommandInfo> toRelease2 = ListPool <CommandLabel.CommandInfo> .Get(); foreach (KeyValuePair <EventType, Tuple <int, string, System.Action <PlayerActor, ActionPoint> > > keyValuePair in ActionPoint.DateLabelTable) { KeyValuePair <EventType, Tuple <int, string, System.Action <PlayerActor, ActionPoint> > > pair = keyValuePair; SearchActionPoint searchActionPoint = this; List <DateActionPointInfo> dateActionPointInfoList; if (this._playerDateEventType[key1].Contains(pair.Key) && AIProject.Definitions.Action.NameTable.TryGetValue(pair.Key, out ValueTuple <int, string> _) && this._playerDateInfos.TryGetValue(key1, out dateActionPointInfoList)) { DateActionPointInfo actionPointInfo = dateActionPointInfoList.Find((Predicate <DateActionPointInfo>)(x => x.eventTypeMask == pair.Key)); string actionName = actionPointInfo.actionName; Sprite sprite; if (pair.Key == EventType.Search) { if (actionPointInfo.searchAreaID > -1) { this._tableID = actionPointInfo.searchAreaID; } if (actionPointInfo.gradeValue > -1 && actionPointInfo.gradeValue > this._grade) { this._grade = actionPointInfo.gradeValue; } Dictionary <int, int> dictionary; if (Singleton <Resources> .Instance.itemIconTables.EquipmentIconTable.TryGetValue(this._tableID, out dictionary)) { int key2; if (dictionary.TryGetValue(this._grade, out key2)) { Singleton <Resources> .Instance.itemIconTables.ActionIconTable.TryGetValue(key2, out sprite); } else { sprite = (Sprite)null; } } else { sprite = (Sprite)null; } } else { 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(); toRelease2.Add(new CommandLabel.CommandInfo() { Text = actionName, Icon = sprite, IsHold = pair.Key == EventType.Search, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = transform, Condition = (Func <PlayerActor, bool>)(x => closure_1.CanAction(x, pair.Key, actionPointInfo.searchAreaID)), ErrorText = (Func <PlayerActor, string>)(x => closure_1.ErrorText(x, pair.Key, actionPointInfo.searchAreaID)), CoolTimeFillRate = (Func <float>)(() => { AIProject.SaveData.Environment.SearchActionInfo searchActionInfo; if (!Singleton <Game> .Instance.Environment.SearchActionLockTable.TryGetValue(closure_1.RegisterID, out searchActionInfo)) { return(0.0f); } EnvironmentProfile environmentProfile = Singleton <Manager.Map> .Instance.EnvironmentProfile; return(searchActionInfo.Count < environmentProfile.SearchCount ? 0.0f : 1f - searchActionInfo.ElapsedTime / environmentProfile.SearchCoolTimeDuration); }), Event = (System.Action)(() => pair.Value.Item3(Singleton <Manager.Map> .Instance.Player, (ActionPoint)closure_1)) }); } } this._dateLabels[key1] = toRelease2.ToArray(); ListPool <CommandLabel.CommandInfo> .Release(toRelease2); } List <CommandLabel.CommandInfo> toRelease3 = 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; SearchActionPoint searchActionPoint = this; if (this._playerEventType.Contains(pair.Key) && playerEventMask.Contains(pair.Key) && AIProject.Definitions.Action.NameTable.TryGetValue(pair.Key, out ValueTuple <int, string> _)) { toRelease3.Add(new CommandLabel.CommandInfo() { Text = pair.Value.Item2, Icon = (Sprite)null, IsHold = false, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = ((Component)this).get_transform(), Event = (System.Action)(() => pair.Value.Item3(Singleton <Manager.Map> .Instance.Player, (ActionPoint)searchActionPoint)) }); } } this._sickLabels = toRelease3.ToArray(); ListPool <CommandLabel.CommandInfo> .Release(toRelease3); if (!this._playerInfos.IsNullOrEmpty <ActionPointInfo>() && this._playerInfos.Exists((Predicate <ActionPointInfo>)(x => x.eventTypeMask == EventType.Search)) || !this._agentEventType.Contains(EventType.Search)) { return; } this._tableID = this._agentInfos.Find((Predicate <ActionPointInfo>)(x => x.eventTypeMask == EventType.Search)).searchAreaID; }
protected override void Start() { if (Object.op_Equality((Object)this._commandBasePoint, (Object)null)) { this._commandBasePoint = ((Component)this).get_transform().FindLoop(Singleton <Resources> .Instance.DefinePack.MapDefines.CommandTargetName)?.get_transform() ?? ((Component)this).get_transform(); } base.Start(); CommonDefine.CommonIconGroup icon = Singleton <Resources> .Instance.CommonDefine.Icon; DefinePack.MapGroup mapDefines = Singleton <Resources> .Instance.DefinePack.MapDefines; string empty = string.Empty; int key = -1; string str; switch (this._kind) { case CraftPoint.CraftKind.Medicine: key = Singleton <Resources> .Instance.CommonDefine.Icon.MedicineCraftIconID; str = "薬台"; break; case CraftPoint.CraftKind.Pet: key = Singleton <Resources> .Instance.CommonDefine.Icon.PetCraftIcon; str = "ペット合成装置"; break; case CraftPoint.CraftKind.Recycling: key = Singleton <Resources> .Instance.CommonDefine.Icon.RecyclingCraftIcon; str = "リサイクル装置"; break; default: str = "????"; break; } Sprite sprite; Singleton <Resources> .Instance.itemIconTables.ActionIconTable.TryGetValue(key, out sprite); Transform transform = ((Component)this).get_transform().FindLoop(mapDefines.CraftPointLabelTargetName)?.get_transform() ?? ((Component)this).get_transform(); this._labels = new CommandLabel.CommandInfo[1] { new CommandLabel.CommandInfo() { Text = str, Icon = sprite, IsHold = true, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = transform, Condition = (Func <PlayerActor, bool>)null, Event = (Action)(() => { PlayerActor playerActor = !Singleton <Manager.Map> .IsInstance() ? (PlayerActor)null : Singleton <Manager.Map> .Instance.Player; if (!Object.op_Inequality((Object)playerActor, (Object)null)) { return; } playerActor.CurrentCraftPoint = this; playerActor.PlayerController.ChangeState("Craft"); }) } }; this.NavMeshPoints.Add(((Component)this).get_transform()); List <GameObject> gameObjectList = ListPool <GameObject> .Get(); ((Component)this).get_transform().FindLoopPrefix(gameObjectList, mapDefines.NavMeshTargetName); if (gameObjectList.IsNullOrEmpty <GameObject>()) { return; } using (List <GameObject> .Enumerator enumerator = gameObjectList.GetEnumerator()) { while (enumerator.MoveNext()) { this.NavMeshPoints.Add(enumerator.Current.get_transform()); } } }
protected override void Start() { if (Object.op_Equality((Object)this._commandBasePoint, (Object)null)) { this._commandBasePoint = ((Component)this).get_transform().FindLoop(Singleton <Resources> .Instance.DefinePack.MapDefines.CommandTargetName)?.get_transform() ?? ((Component)this).get_transform(); } if (Object.op_Equality((Object)this._warpPoint, (Object)null)) { this._warpPoint = ((Component)this).get_transform().FindLoop(Singleton <Resources> .Instance.DefinePack.MapDefines.BasePointWarpTargetName)?.get_transform() ?? ((Component)this).get_transform(); } if (Object.op_Equality((Object)this._housingCenter, (Object)null)) { this._housingCenter = ((Component)this).get_transform().FindLoop(Singleton <Resources> .Instance.DefinePack.MapDefines.HousingCenterTargetName)?.get_transform() ?? ((Component)this).get_transform(); } if (this._recoverPoints.IsNullOrEmpty <Transform>() || this._recoverPoints.Count < 4) { this._recoverPoints.Clear(); foreach (string recoveryTargetName in Singleton <Resources> .Instance.DefinePack.MapDefines.DevicePointRecoveryTargetNames) { GameObject loop = ((Component)this).get_transform().FindLoop(recoveryTargetName); if (Object.op_Inequality((Object)loop, (Object)null)) { this._recoverPoints.Add(loop.get_transform()); } } } Singleton <Manager.Map> .Instance.HousingRecoveryPointTable[this._id] = this._recoverPoints; if (this._isHousing) { Singleton <Manager.Map> .Instance.HousingPointTable[this._id] = this._housingCenter; } if (Singleton <Game> .Instance.WorldData.Cleared && this._id >= 3) { Singleton <Manager.Map> .Instance.SetBaseOpenState(this._id, true); } base.Start(); if (!this._isHousing) { return; } CommonDefine.CommonIconGroup icon = Singleton <Resources> .Instance.CommonDefine.Icon; DefinePack.MapGroup mapDefines = Singleton <Resources> .Instance.DefinePack.MapDefines; Sprite sprite; Singleton <Resources> .Instance.itemIconTables.ActionIconTable.TryGetValue(Singleton <Resources> .Instance.CommonDefine.Icon.BaseIconID, out sprite); Transform transform = ((Component)this).get_transform().FindLoop(mapDefines.BasePointLabelTargetName)?.get_transform() ?? ((Component)this).get_transform(); this._labels = new CommandLabel.CommandInfo[1] { new CommandLabel.CommandInfo() { Text = "拠点", Icon = sprite, IsHold = true, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = transform, Condition = (Func <PlayerActor, bool>)null, Event = (Action)(() => { if (Singleton <Manager.Map> .Instance.SetBaseOpenState(this._id, true)) { string str; if (Singleton <Resources> .Instance.itemIconTables.BaseName.TryGetValue(this._id, out str)) { MapUIContainer.AddSystemLog(string.Format("{0} に移動できるようになりました。", (object)str), true); } else { MapUIContainer.AddSystemLog(string.Format("拠点{0}に移動できるようになりました。", (object)this._id), true); } } if (Manager.Map.GetTutorialProgress() == 10) { Manager.Map.SetTutorialProgress(11); } MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None); Singleton <Manager.Map> .Instance.HousingID = this._id; Singleton <Manager.Map> .Instance.HousingAreaID = this._areaIDInHousing; Singleton <Manager.Map> .Instance.Player.Controller.ChangeState("BaseMenu"); }) } }; }
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); }
protected override void Start() { CommonDefine.CommonIconGroup icon = Singleton <Resources> .Instance.CommonDefine.Icon; DefinePack.MapGroup mapDefines = Singleton <Resources> .Instance.DefinePack.MapDefines; if (Object.op_Equality((Object)this._commandBasePoint, (Object)null)) { this._commandBasePoint = ((Component)this).get_transform().FindLoop(Singleton <Resources> .Instance.DefinePack.MapDefines.CommandTargetName)?.get_transform() ?? ((Component)this).get_transform(); } base.Start(); this.NavMeshPoints.Add(((Component)this).get_transform()); List <GameObject> gameObjectList = ListPool <GameObject> .Get(); ((Component)this).get_transform().FindLoopPrefix(gameObjectList, mapDefines.NavMeshTargetName); if (!gameObjectList.IsNullOrEmpty <GameObject>()) { using (List <GameObject> .Enumerator enumerator = gameObjectList.GetEnumerator()) { while (enumerator.MoveNext()) { this.NavMeshPoints.Add(enumerator.Current.get_transform()); } } } ListPool <GameObject> .Release(gameObjectList); Sprite sprite1; Singleton <Resources> .Instance.itemIconTables.ActionIconTable.TryGetValue(Singleton <Resources> .Instance.CommonDefine.Icon.FarmIconID, out sprite1); Sprite sprite2; Singleton <Resources> .Instance.itemIconTables.ActionIconTable.TryGetValue(Singleton <Resources> .Instance.CommonDefine.Icon.ChickenCoopIconID, out sprite2); Singleton <Resources> .Instance.itemIconTables.ActionIconTable.TryGetValue(Singleton <Resources> .Instance.CommonDefine.Icon.WellIconID, out Sprite _); Transform transform = ((Component)this).get_transform().FindLoop(mapDefines.FarmPointLabelTargetName)?.get_transform() ?? ((Component)this).get_transform(); if (this._farmKind == FarmPoint.FarmKind.Plant) { this._labels = new CommandLabel.CommandInfo[1] { new CommandLabel.CommandInfo() { Text = "畑", Icon = sprite1, IsHold = true, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = transform, Condition = (Func <PlayerActor, bool>)(x => this._farmKind == FarmPoint.FarmKind.Plant), Event = (Action)(() => { MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None); List <AIProject.SaveData.Environment.PlantInfo> plantInfoList1; if (!Singleton <Game> .Instance.Environment.FarmlandTable.TryGetValue(this._id, out plantInfoList1)) { List <AIProject.SaveData.Environment.PlantInfo> plantInfoList2 = new List <AIProject.SaveData.Environment.PlantInfo>(); Singleton <Game> .Instance.Environment.FarmlandTable[this._id] = plantInfoList2; plantInfoList1 = plantInfoList2; foreach (FarmSection harvestSection in this._harvestSections) { plantInfoList1.Add((AIProject.SaveData.Environment.PlantInfo)null); } } MapUIContainer.FarmlandUI.currentPlant = plantInfoList1; MapUIContainer.SetActiveFarmlandUI(true); Singleton <Manager.Map> .Instance.Player.Controller.ChangeState("Harvest"); }) } } } ; else if (this._farmKind == FarmPoint.FarmKind.ChickenCoop) { this._labels = new CommandLabel.CommandInfo[1] { new CommandLabel.CommandInfo() { Text = "鶏小屋", Icon = sprite2, IsHold = true, TargetSpriteInfo = icon.ActionSpriteInfo, Transform = transform, Condition = (Func <PlayerActor, bool>)(x => this._farmKind == FarmPoint.FarmKind.ChickenCoop), Event = (Action)(() => { PlayerActor playerActor = !Singleton <Manager.Map> .IsInstance() ? (PlayerActor)null : Singleton <Manager.Map> .Instance.Player; if (!Object.op_Inequality((Object)playerActor, (Object)null)) { return; } playerActor.CurrentFarmPoint = this; playerActor.PlayerController.ChangeState("ChickenCoopMenu"); }) } } } ; else if (this._farmKind != FarmPoint.FarmKind.Well) { ; } }