Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
ComponentPlayer.cs
浏览该文件的文档.
1using Engine;
4
5namespace Game {
8
10
12
14
16
17 public bool m_aimHintIssued;
18
19 public static string fName = "ComponentPlayer";
20
21 public double m_lastActionTime;
22
24
25 public Ray3? m_aim;
26
27 public bool m_isAimBlocked;
28
29 public bool m_isDigBlocked;
30
31 public bool m_doAimBlockLook = true; //手机端在执行Aim操作的时候,允许旋转屏幕,比如RYSH的喝水、武器的格挡
32
33 public bool m_allowAddLookOrder = true;
34
35 public double? m_aimStartTime;
36
37 public double AimDuration {
38 get {
39 if (m_aimStartTime.HasValue) {
40 return m_subsystemTime.GameTime - m_aimStartTime.Value;
41 }
42 return -1;
43 }
44 }
45
46 public PlayerData PlayerData { get; set; }
47
48 public GameWidget GameWidget => PlayerData.GameWidget;
49
50 public ContainerWidget GuiWidget => PlayerData.GameWidget.GuiWidget;
51
52 public ViewWidget ViewWidget => PlayerData.GameWidget.ViewWidget;
53
54 public ComponentGui ComponentGui { get; set; }
55
56 public ComponentInput ComponentInput { get; set; }
57
59
61
63
64 public ComponentMiner ComponentMiner { get; set; }
65
66 public ComponentRider ComponentRider { get; set; }
67
68 public ComponentSleep ComponentSleep { get; set; }
69
71
73
74 public ComponentFlu ComponentFlu { get; set; }
75
76 public ComponentLevel ComponentLevel { get; set; }
77
79
81 // ReSharper disable UnusedAutoPropertyAccessor.Global
82 get;
83 // ReSharper restore UnusedAutoPropertyAccessor.Global
84 set;
85 }
86
88
90
92 get {
93 m_dragHostWidget ??= GameWidget?.Children.Find<DragHostWidget>(false);
94 return m_dragHostWidget;
95 }
96 }
97
98 public virtual void DealWithPlayerInteract(int priorityUse,
99 int priorityPlace,
100 int priorityInteract,
101 PlayerInput playerInput,
102 TerrainRaycastResult? terrainRaycastResult,
103 MovingBlocksRaycastResult? movingBlocksRaycastResult,
104 out bool flag) {
105 bool dealed = false;
106 for (int t = 0; t < 3 && !dealed; t++) {
107 int maxPriority = -1;
108 if (maxPriority < priorityUse) {
109 maxPriority = priorityUse;
110 }
111 if (maxPriority < priorityPlace) {
112 maxPriority = priorityPlace;
113 }
114 if (maxPriority < priorityInteract) {
115 maxPriority = priorityInteract;
116 }
117 if (maxPriority <= 0) {
118 break;
119 }
120 if (maxPriority == priorityUse /* && !dealed*/) {
121 if (playerInput.Interact.HasValue) {
122 dealed = ComponentMiner.Use(playerInput.Interact.Value);
123 }
124 priorityUse = -2;
125 }
126 if (maxPriority == priorityInteract
127 && !dealed) {
128 if (movingBlocksRaycastResult.HasValue) {
129 dealed = ComponentMiner.Interact(movingBlocksRaycastResult.Value);
130 }
131 else if (terrainRaycastResult.HasValue) {
132 dealed = ComponentMiner.Interact(terrainRaycastResult.Value);
133 }
134 priorityInteract = -2;
135 }
136 if (maxPriority == priorityPlace
137 && !dealed) {
138 if (terrainRaycastResult.HasValue) {
139 dealed = ComponentMiner.Place(terrainRaycastResult.Value);
140 }
141 priorityPlace = -2;
142 }
143 }
144 if (dealed) {
145 m_subsystemTerrain.TerrainUpdater.RequestSynchronousUpdate();
146 flag = true;
147 m_isAimBlocked = true;
148 return;
149 }
150 flag = false;
151 }
152
153 public virtual void Update(float dt) {
154 PlayerInput playerInput = ComponentInput.PlayerInput;
155 if (ComponentInput.IsControlledByTouch
156 && m_aim.HasValue
157 && m_doAimBlockLook) {
158 playerInput.Look = Vector2.Zero;
159 }
160 if (ComponentMiner.Inventory != null) {
161 int max = ComponentGui.ShortInventoryWidget.m_inventory is ComponentCreativeInventory
162 ? ComponentGui.ShortInventoryWidget.MaxVisibleSlotsCountInCreative
163 : ComponentGui.ShortInventoryWidget.MaxVisibleSlotsCount;
164 ComponentMiner.Inventory.ActiveSlotIndex = SettingsManager.ShortInventoryLooping
165 ? (ComponentMiner.Inventory.ActiveSlotIndex + playerInput.ScrollInventory + max) % max//加上max再取模,防止出现负数结果
166 : ComponentMiner.Inventory.ActiveSlotIndex + playerInput.ScrollInventory;
167 if (playerInput.SelectInventorySlot.HasValue) {
168 ComponentMiner.Inventory.ActiveSlotIndex = Math.Clamp(playerInput.SelectInventorySlot.Value, 0, max - 1);
169 }
170 }
171 ComponentMount mount = ComponentRider.Mount;
172 if (mount != null) {
173 ComponentSteedBehavior componentSteedBehavior = mount.Entity.FindComponent<ComponentSteedBehavior>();
174 ComponentBoat componentBoat = mount.Entity.FindComponent<ComponentBoat>();
175 if (componentSteedBehavior != null) {
176 bool skipVanilla_h = false;
178 "OnPlayerControlSteed",
179 loader => {
180 loader.OnPlayerControlSteed(this, skipVanilla_h, out bool skipVanilla);
181 skipVanilla_h |= skipVanilla;
182 return false;
183 }
184 );
185 if (!skipVanilla_h) {
186 if (playerInput.Move.Z > 0.5f
188 m_subsystemAudio.PlayRandomSound(
189 PlayerData.PlayerClass == PlayerClass.Male ? "Audio/Creatures/MaleYellFast" : "Audio/Creatures/FemaleYellFast",
190 0.75f,
191 0f,
192 ComponentBody.Position,
193 2f,
194 false
195 );
196 componentSteedBehavior.SpeedOrder = 1;
197 m_speedOrderBlocked = true;
198 }
199 else if (playerInput.Move.Z < -0.5f
201 m_subsystemAudio.PlayRandomSound(
202 PlayerData.PlayerClass == PlayerClass.Male ? "Audio/Creatures/MaleYellSlow" : "Audio/Creatures/FemaleYellSlow",
203 0.75f,
204 0f,
205 ComponentBody.Position,
206 2f,
207 false
208 );
209 componentSteedBehavior.SpeedOrder = -1;
210 m_speedOrderBlocked = true;
211 }
212 else if (MathF.Abs(playerInput.Move.Z) <= 0.25f) {
213 m_speedOrderBlocked = false;
214 }
215 componentSteedBehavior.TurnOrder = playerInput.Move.X;
216 componentSteedBehavior.JumpOrder = playerInput.Jump ? 1 : 0;
217 ComponentLocomotion.LookOrder = new Vector2(playerInput.Look.X, 0f);
218 }
219 }
220 else if (componentBoat != null) {
221 bool skipVanilla_h = false;
223 "OnPlayerControlBoat",
224 loader => {
225 loader.OnPlayerControlBoat(this, skipVanilla_h, out bool skipVanilla);
226 skipVanilla_h |= skipVanilla;
227 return false;
228 }
229 );
230 if (!skipVanilla_h) {
231 componentBoat.TurnOrder = playerInput.Move.X;
232 componentBoat.MoveOrder = playerInput.Move.Z;
233 ComponentLocomotion.LookOrder = new Vector2(playerInput.Look.X, 0f);
234 ComponentCreatureModel.RowLeftOrder = playerInput.Move.X < -0.2f || playerInput.Move.Z > 0.2f;
235 ComponentCreatureModel.RowRightOrder = playerInput.Move.X > 0.2f || playerInput.Move.Z > 0.2f;
236 }
237 }
238 else {
239 bool skipVanilla_h = false;
241 "OnPlayerControlOtherMount",
242 loader => {
243 loader.OnPlayerControlOtherMount(this, skipVanilla_h, out bool skipVanilla);
244 skipVanilla_h |= skipVanilla;
245 return false;
246 }
247 );
248 }
249 }
250 else {
251 bool skipVanilla_h = false;
253 "OnPlayerControlWalk",
254 loader => {
255 loader.OnPlayerControlWalk(this, skipVanilla_h, out bool skipVanilla);
256 skipVanilla_h |= skipVanilla;
257 return false;
258 }
259 );
260 if (!skipVanilla_h) {
262 ? 0.66f * new Vector2(playerInput.CrouchMove.X, playerInput.CrouchMove.Z)
263 : new Vector2(playerInput.Move.X, playerInput.Move.Z);
264 ComponentLocomotion.FlyOrder = new Vector3(0f, playerInput.Move.Y, 0f);
265 ComponentLocomotion.TurnOrder = playerInput.Look * new Vector2(1f, 0f);
266 ComponentLocomotion.JumpOrder = MathUtils.Max(playerInput.Jump ? 1 : 0, ComponentLocomotion.JumpOrder);
267 }
268 }
270 ComponentLocomotion.LookOrder += playerInput.Look * (SettingsManager.FlipVerticalAxis ? new Vector2(0f, -1f) : new Vector2(0f, 1f));
273 }
274 int num = Terrain.ExtractContents(ComponentMiner.ActiveBlockValue);
275 Block block = BlocksManager.Blocks[num];
276 bool flag = false;
277 if (playerInput.Interact.HasValue) {
278 double timeIntervalLastActionTime = 0.33;
279 TerrainRaycastResult? terrainRaycastResult = ComponentMiner.Raycast<TerrainRaycastResult>(
280 playerInput.Interact.Value,
282 );
283 MovingBlocksRaycastResult? movingBlocksRaycastResult = ComponentMiner.Raycast<MovingBlocksRaycastResult>(
284 playerInput.Interact.Value,
286 );
287 int priorityUse = block.GetPriorityUse(ComponentMiner.ActiveBlockValue, ComponentMiner);
288 int priorityPlace = 0;
289 int priorityInteract = 0;
290 if (movingBlocksRaycastResult.HasValue) {
291 int raycastValue = movingBlocksRaycastResult.Value.MovingBlock?.Value ?? 0;
292 if (raycastValue != 0) {
293 priorityInteract = BlocksManager.Blocks[Terrain.ExtractContents(raycastValue)]
294 .GetPriorityInteract(raycastValue, ComponentMiner);
295 }
296 }
297 else if (terrainRaycastResult.HasValue) {
298 int raycastValue = terrainRaycastResult.Value.Value;
299 priorityPlace = block.GetPriorityPlace(ComponentMiner.ActiveBlockValue, ComponentMiner);
300 priorityInteract = BlocksManager.Blocks[Terrain.ExtractContents(raycastValue)].GetPriorityInteract(raycastValue, ComponentMiner);
301 }
303 "OnPlayerInputInteract",
304 loader => {
305 // ReSharper disable AccessToModifiedClosure
306 loader.OnPlayerInputInteract(
307 this,
308 ref flag,
309 ref timeIntervalLastActionTime,
310 ref priorityUse,
311 ref priorityInteract,
312 ref priorityPlace
313 );
314 // ReSharper restore AccessToModifiedClosure
315 return false;
316 }
317 );
318 if (!flag
319 && m_subsystemTime.GameTime - m_lastActionTime > timeIntervalLastActionTime) {
320 //处理三者的关系,优先级最高的优先执行
322 priorityUse,
323 priorityPlace,
324 priorityInteract,
325 playerInput,
326 terrainRaycastResult,
327 movingBlocksRaycastResult,
328 out flag
329 );
330 m_lastActionTime = timeIntervalLastActionTime;
331 }
332 }
333 float timeIntervalAim = m_subsystemGameInfo.WorldSettings.GameMode == GameMode.Creative ? 0.1f : 1.4f;
334 if (playerInput.Aim.HasValue) {
335 bool skipVanilla_h = false;
337 "UpdatePlayerInputAim",
338 loader => {
339 loader.UpdatePlayerInputAim(this, true, ref flag, ref timeIntervalAim, skipVanilla_h, out bool skip);
340 skipVanilla_h |= skip;
341 return false;
342 }
343 );
344 if (!skipVanilla_h
345 && block.IsAimable_(ComponentMiner.ActiveBlockValue)
346 && m_subsystemTime.GameTime - m_lastActionTime > timeIntervalAim) {
347 if (!m_isAimBlocked) {
348 Ray3 value = playerInput.Aim.Value;
349 Vector3 vector = GameWidget.ActiveCamera.WorldToScreen(value.Position + value.Direction, Matrix.Identity);
350 Point2 size = Window.Size;
351 if (vector.X >= size.X * 0.02f
352 && vector.X < size.X * 0.98f
353 && vector.Y >= size.Y * 0.02f
354 && vector.Y < size.Y * 0.98f) {
355 m_aim = value;
356 m_aimStartTime ??= m_subsystemTime.GameTime;
357 if (ComponentMiner.Aim(value, AimState.InProgress)) {
358 ComponentMiner.Aim(m_aim.Value, AimState.Cancelled);
359 m_aim = null;
360 m_aimStartTime = null;
361 m_isAimBlocked = true;
362 }
363 else if (!m_aimHintIssued
364 && Time.PeriodicEvent(1.0, 0.0)) {
366 Time.RealTime + 3.0,
367 delegate {
368 if (!m_aimHintIssued
369 && m_aim.HasValue
370 && !ComponentBody.IsCrouching) {
371 m_aimHintIssued = true;
372 ComponentGui.DisplaySmallMessage(LanguageControl.Get(fName, 1), Color.White, true, true);
373 }
374 }
375 );
376 }
377 }
378 else if (m_aim.HasValue) {
379 ComponentMiner.Aim(m_aim.Value, AimState.Cancelled);
380 m_aim = null;
381 m_aimStartTime = null;
382 m_isAimBlocked = true;
383 }
384 }
385 }
386 }
387 else {
388 m_isAimBlocked = false;
389 bool skipVanilla_h = false;
391 "UpdatePlayerInputAim",
392 loader => {
393 loader.UpdatePlayerInputAim(this, false, ref flag, ref timeIntervalAim, skipVanilla_h, out bool skip);
394 skipVanilla_h |= skip;
395 return false;
396 }
397 );
398 if (!skipVanilla_h
399 && m_aim.HasValue) {
400 ComponentMiner.Aim(m_aim.Value, AimState.Completed);
401 m_aim = null;
402 m_aimStartTime = null;
404 }
405 }
406 flag |= m_aim.HasValue;
407 if (playerInput.Hit.HasValue) {
408 bool skipVanilla_ = false;
409 double timeIntervalHit = 0.33;
410 float meleeAttackRange = 2f;
411 ModsManager.HookAction(
412 "OnPlayerInputHit",
413 loader => {
414 loader.OnPlayerInputHit(this, ref flag, ref timeIntervalHit, ref meleeAttackRange, skipVanilla_, out bool skip);
415 skipVanilla_ |= skip;
416 return false;
417 }
418 );
419 if (!skipVanilla_
420 && !flag
421 && m_subsystemTime.GameTime - m_lastActionTime > timeIntervalHit
422 && block.GetMeleeHitProbability(ComponentMiner.ActiveBlockValue) > 0
423 && meleeAttackRange > 0) {
424 BodyRaycastResult? bodyRaycastResult = ComponentMiner.Raycast<BodyRaycastResult>(
425 playerInput.Hit.Value,
426 RaycastMode.Interaction,
427 reach: meleeAttackRange
428 );
429 if (bodyRaycastResult.HasValue) {
430 flag = true;
431 m_isDigBlocked = true;
432 if (Vector3.Distance(bodyRaycastResult.Value.HitPoint(), ComponentCreatureModel.EyePosition) <= meleeAttackRange) {
433 ComponentMiner.Hit(
434 bodyRaycastResult.Value.ComponentBody,
435 bodyRaycastResult.Value.HitPoint(),
436 playerInput.Hit.Value.Direction
437 );
438 }
439 }
440 }
441 }
442 double timeIntervalDig = 0.33;
443 if (m_subsystemGameInfo.WorldSettings.GameMode == GameMode.Creative) {
444 timeIntervalDig = SettingsManager.CreativeDigTime;
445 }
446 if (playerInput.Dig.HasValue) {
447 bool skipVanilla_ = false;
448 ModsManager.HookAction(
449 "UpdatePlayerInputDig",
450 loader => {
451 loader.UpdatePlayerInputDig(this, true, ref flag, ref timeIntervalDig, skipVanilla_, out bool skip);
452 skipVanilla_ |= skip;
453 return false;
454 }
455 );
456 if (!skipVanilla_
457 && !flag
459 && m_subsystemTime.GameTime - m_lastActionTime > timeIntervalDig) {
460 TerrainRaycastResult? terrainRaycastResult2 = ComponentMiner.Raycast<TerrainRaycastResult>(
461 playerInput.Dig.Value,
462 RaycastMode.Digging
463 );
464 if (terrainRaycastResult2.HasValue
465 && ComponentMiner.Dig(terrainRaycastResult2.Value)) {
467 m_subsystemTerrain.TerrainUpdater.RequestSynchronousUpdate();
468 }
469 }
470 }
471 if (!playerInput.Dig.HasValue) {
472 m_isDigBlocked = false;
473 bool skipVanilla_ = false;
474 ModsManager.HookAction(
475 "UpdatePlayerInputDig",
476 loader => {
477 loader.UpdatePlayerInputDig(this, false, ref flag, ref timeIntervalDig, skipVanilla_, out bool skip);
478 skipVanilla_ |= skip;
479 return false;
480 }
481 );
482 }
483 if (playerInput.Drop
484 && ComponentMiner.Inventory != null) {
485 bool skipVanilla_ = false;
486 ModsManager.HookAction(
487 "UpdatePlayerInputDrop",
488 loader => {
489 loader.OnPlayerInputDrop(this, skipVanilla_, out bool skip);
490 skipVanilla_ |= skip;
491 return false;
492 }
493 );
494 if (!skipVanilla_) {
495 IInventory inventory = ComponentMiner.Inventory;
496 int slotValue = inventory.GetSlotValue(inventory.ActiveSlotIndex);
497 int num3 = inventory.RemoveSlotItems(
498 count: inventory.GetSlotCount(inventory.ActiveSlotIndex),
499 slotIndex: inventory.ActiveSlotIndex
500 );
501 if (slotValue != 0
502 && num3 != 0) {
503 Vector3 position = ComponentBody.Position
504 + new Vector3(0f, ComponentBody.StanceBoxSize.Y * 0.66f, 0f)
505 + 0.25f * ComponentBody.Matrix.Forward;
506 Vector3 value2 = 8f * Matrix.CreateFromQuaternion(ComponentCreatureModel.EyeRotation).Forward;
507 m_subsystemPickables.AddPickable(slotValue, num3, position, value2, null, Entity);
508 }
509 }
510 }
511 if (!playerInput.PickBlockType.HasValue || flag) {
512 return;
513 }
514 if (ComponentMiner.Inventory is not ComponentCreativeInventory componentCreativeInventory) {
515 return;
516 }
517 TerrainRaycastResult? terrainRaycastResult3 = ComponentMiner.Raycast<TerrainRaycastResult>(
518 playerInput.PickBlockType.Value,
519 RaycastMode.Digging,
520 true,
521 false,
522 false
523 );
524 if (!terrainRaycastResult3.HasValue) {
525 return;
526 }
527 int value3 = terrainRaycastResult3.Value.Value;
528 value3 = Terrain.ReplaceLight(value3, 0);
529 int num4 = Terrain.ExtractContents(value3);
530 Block block2 = BlocksManager.Blocks[num4];
531 int num5 = 0;
532 IEnumerable<int> creativeValues = block2.GetCreativeValues();
533 if (block2.GetCreativeValues().Contains(value3)) {
534 num5 = value3;
535 }
536 if (num5 == 0
537 && !block2.IsNonDuplicable_(value3)) {
538 List<BlockDropValue> list = new();
539 block2.GetDropValues(m_subsystemTerrain, value3, 0, int.MaxValue, list, out bool _);
540 if (list.Count > 0
541 && list[0].Count > 0) {
542 num5 = list[0].Value;
543 }
544 }
545 if (num5 == 0) {
546 num5 = creativeValues.FirstOrDefault();
547 }
548 if (num5 == 0) {
549 return;
550 }
551 int num6 = -1;
552 for (int i = 0; i < 10; i++) {
553 if (componentCreativeInventory.GetSlotCapacity(i, num5) > 0
554 && componentCreativeInventory.GetSlotCount(i) > 0
555 && componentCreativeInventory.GetSlotValue(i) == num5) {
556 num6 = i;
557 break;
558 }
559 }
560 if (num6 < 0) {
561 for (int j = 0; j < 10; j++) {
562 if (componentCreativeInventory.GetSlotCapacity(j, num5) > 0
563 && (componentCreativeInventory.GetSlotCount(j) == 0 || componentCreativeInventory.GetSlotValue(j) == 0)) {
564 num6 = j;
565 break;
566 }
567 }
568 }
569 if (num6 < 0) {
570 num6 = componentCreativeInventory.ActiveSlotIndex;
571 }
572 componentCreativeInventory.RemoveSlotItems(num6, int.MaxValue);
573 componentCreativeInventory.AddSlotItems(num6, num5, 1);
574 componentCreativeInventory.ActiveSlotIndex = num6;
575 ComponentGui.DisplaySmallMessage(block2.GetDisplayName(m_subsystemTerrain, value3), Color.White, false, false);
576 m_subsystemAudio.PlaySound("Audio/UI/ButtonClick", 1f, 0f, 0f, 0f);
577 }
578
579 public override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap) {
580 base.Load(valuesDictionary, idToEntityMap);
581 m_subsystemGameInfo = Project.FindSubsystem<SubsystemGameInfo>(true);
582 m_subsystemTime = Project.FindSubsystem<SubsystemTime>(true);
583 m_subsystemAudio = Project.FindSubsystem<SubsystemAudio>(true);
584 m_subsystemPickables = Project.FindSubsystem<SubsystemPickables>(true);
585 m_subsystemTerrain = Project.FindSubsystem<SubsystemTerrain>(true);
586 ComponentGui = Entity.FindComponent<ComponentGui>(true);
587 ComponentInput = Entity.FindComponent<ComponentInput>(true);
591 ComponentMiner = Entity.FindComponent<ComponentMiner>(true);
592 ComponentRider = Entity.FindComponent<ComponentRider>(true);
593 ComponentSleep = Entity.FindComponent<ComponentSleep>(true);
594 ComponentVitalStats = Entity.FindComponent<ComponentVitalStats>(true);
595 ComponentSickness = Entity.FindComponent<ComponentSickness>(true);
596 ComponentFlu = Entity.FindComponent<ComponentFlu>(true);
597 ComponentLevel = Entity.FindComponent<ComponentLevel>(true);
598 ComponentClothing = Entity.FindComponent<ComponentClothing>(true);
600 int playerIndex = valuesDictionary.GetValue<int>("PlayerIndex");
601 SubsystemPlayers subsystemPlayers = Project.FindSubsystem<SubsystemPlayers>(true);
602 if(PlayerData == null)
603 PlayerData = subsystemPlayers.m_playersData.First(d => d.PlayerIndex == playerIndex);
604 }
605
606 public override void Save(ValuesDictionary valuesDictionary, EntityToIdMap entityToIdMap) {
607 base.Save(valuesDictionary, entityToIdMap);
608 valuesDictionary.SetValue("PlayerIndex", PlayerData.PlayerIndex);
609 }
610 }
611}
Engine.Color Color
Engine.Vector3 Vector3
static int Max(int x1, int x2)
static double RealTime
定义 Time.cs:38
static void QueueTimeDelayedExecution(double time, Action action)
定义 Time.cs:69
static bool PeriodicEvent(double period, double offset)
定义 Time.cs:63
static Point2 Size
virtual int GetPriorityPlace(int value, ComponentMiner componentMiner)
virtual bool IsAimable_(int value)
virtual int GetPriorityUse(int value, ComponentMiner componentMiner)
virtual int GetPriorityInteract(int value, ComponentMiner componentMiner)
ComponentCreatureModel ComponentCreatureModel
ComponentLocomotion ComponentLocomotion
bool Aim(Ray3 aim, AimState state)
ComponentScreenOverlays ComponentScreenOverlays
ComponentSickness ComponentSickness
override void Save(ValuesDictionary valuesDictionary, EntityToIdMap entityToIdMap)
virtual void Update(float dt)
ComponentClothing ComponentClothing
virtual void DealWithPlayerInteract(int priorityUse, int priorityPlace, int priorityInteract, PlayerInput playerInput, TerrainRaycastResult? terrainRaycastResult, MovingBlocksRaycastResult? movingBlocksRaycastResult, out bool flag)
SubsystemGameInfo m_subsystemGameInfo
override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
SubsystemTerrain m_subsystemTerrain
SubsystemPickables m_subsystemPickables
ComponentVitalStats ComponentVitalStats
ComponentAimingSights ComponentAimingSights
ComponentBlockHighlight ComponentBlockHighlight
ComponentOuterClothingModel ComponentOuterClothingModel
static int ExtractContents(int value)
ValuesDictionary ValuesDictionary
Component FindComponent(Type type, string name, bool throwOnError)
static void HookAction(string HookName, Func< ModLoader, bool > action)
执行Hook
static Color White
static readonly Matrix Identity
Vector3 Position
定义 Ray3.cs:3
Vector3 Direction
定义 Ray3.cs:5
static readonly Vector2 Zero
static float Distance(Vector3 v1, Vector3 v2)