gg.easy.airship 0.1.2139 → 0.1.2140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -645,10 +645,9 @@ public class ScriptBindingEditor : UnityEditor.Editor {
645
645
  private void RenderArrayElement(Rect rect, SerializedProperty arraySerializedProperty, SerializedProperty itemInfo, int index, AirshipComponentPropertyType elementType, SerializedProperty serializedElement, SerializedProperty arrayModified, SerializedProperty objectRefs, [CanBeNull] Type objectType, out string errorReason) {
646
646
  var label = $"Element {index}";
647
647
  errorReason = "";
648
+ var arrayType = itemInfo.FindPropertyRelative("type");
648
649
  switch (elementType) {
649
650
  case AirshipComponentPropertyType.AirshipString: {
650
- var arrayType = itemInfo.FindPropertyRelative("type");
651
-
652
651
  if (arrayType.stringValue == "StringEnum") {
653
652
  var tsEnum = AirshipEditorInfo.Enums.GetEnum(arraySerializedProperty.FindPropertyRelative("refPath").stringValue);
654
653
  DrawCustomStringEnumDropdown(new GUIContent(label), tsEnum, serializedElement, arrayModified, rect);
@@ -664,6 +663,19 @@ public class ScriptBindingEditor : UnityEditor.Editor {
664
663
 
665
664
  break;
666
665
  }
666
+ case AirshipComponentPropertyType.AirshipPod:
667
+ if (arrayType.stringValue == "Color") {
668
+ var currentValue = serializedElement.stringValue != "" ? JsonUtility.FromJson<Color>(serializedElement.stringValue) : default;
669
+ var newValue = EditorGUI.ColorField(rect, label, currentValue);
670
+ if (newValue != currentValue)
671
+ {
672
+ serializedElement.stringValue = JsonUtility.ToJson(newValue);
673
+ arrayModified.boolValue = true;
674
+ }
675
+ break;
676
+ }
677
+ errorReason = $"Pod type not yet supported in Airship Array ({arrayType.stringValue})";
678
+ break;
667
679
  case AirshipComponentPropertyType.AirshipBoolean:
668
680
  var boolOld = serializedElement.stringValue != "0";
669
681
  var boolNew = EditorGUI.Toggle(rect, label, boolOld);
@@ -681,8 +693,6 @@ public class ScriptBindingEditor : UnityEditor.Editor {
681
693
  }
682
694
  break;
683
695
  case AirshipComponentPropertyType.AirshipInt: {
684
- var arrayType = itemInfo.FindPropertyRelative("type");
685
-
686
696
  if (arrayType.stringValue == "IntEnum") {
687
697
  var tsEnum = AirshipEditorInfo.Enums.GetEnum(arraySerializedProperty.FindPropertyRelative("refPath").stringValue);
688
698
  DrawCustomIntEnumDropdown(new GUIContent(label), tsEnum, serializedElement, arrayModified, rect);
@@ -233,24 +233,24 @@ using Object = UnityEngine.Object;
233
233
  var compileFileList = CompiledFileQueue.ToArray();
234
234
 
235
235
  foreach (var file in compileFileList) {
236
- var outFileHash = TypescriptProjectsService.Project.GetOutputFileHash(file);
237
-
238
- if (artifacts.TryGetScriptAssetDataFromPath(PosixPath.ToPosix(file), out var data)) {
239
- if (outFileHash != data.metadata.compiledHash) {
240
- AssetDatabase.ImportAsset(file, ImportAssetOptions.Default);
241
- data.metadata.compiledHash = outFileHash;
242
- modifiedDatabase = true;
243
- }
244
- }
245
- else {
246
- var scriptData = artifacts.GetOrCreateScriptAssetData(AssetDatabase.LoadAssetAtPath<AirshipScript>(file));
247
- scriptData.metadata = new TypescriptCompilerMetadata() {
248
- compiledHash = outFileHash
249
- };
236
+ // var outFileHash = TypescriptProjectsService.Project.GetOutputFileHash(file);
237
+ //
238
+ // if (artifacts.TryGetScriptAssetDataFromPath(PosixPath.ToPosix(file), out var data)) {
239
+ // if (string.IsNullOrEmpty(outFileHash) || string.IsNullOrEmpty(data.metadata.compiledHash) || outFileHash != data.metadata.compiledHash) {
240
+ // AssetDatabase.ImportAsset(file, ImportAssetOptions.Default);
241
+ // data.metadata.compiledHash = outFileHash;
242
+ // modifiedDatabase = true;
243
+ // }
244
+ // }
245
+ // else {
246
+ // var scriptData = artifacts.GetOrCreateScriptAssetData(AssetDatabase.LoadAssetAtPath<AirshipScript>(file));
247
+ // scriptData.metadata = new TypescriptCompilerMetadata() {
248
+ // compiledHash = outFileHash
249
+ // };
250
250
 
251
251
  AssetDatabase.ImportAsset(file, ImportAssetOptions.Default);
252
- modifiedDatabase = true;
253
- }
252
+ // modifiedDatabase = true;
253
+ // }
254
254
  }
255
255
 
256
256
  AssetDatabase.Refresh();
@@ -70,7 +70,7 @@ namespace Code.Bootstrap {
70
70
  var assetVersionInt = Int32.Parse(this.assetVersion);
71
71
  if (this.packageType == AirshipPackageType.Game) {
72
72
  // folders to delete
73
- var folders = Directory.GetDirectories(Application.persistentDataPath, "Games")
73
+ var folders = Directory.GetDirectories(Path.Join(Application.persistentDataPath, "Games"))
74
74
  .Where((path) => path.Contains(this.id + "_v"))
75
75
  .Where((path) => {
76
76
  try {
@@ -345,7 +345,7 @@ public class SystemRoot : Singleton<SystemRoot> {
345
345
 
346
346
  // Shader Variant Collections
347
347
  if (!preWarmedCoreShaders && RunCore.IsClient()) {
348
- #if !UNITY_IOS && !UNITY_ANDROID && !UNITY_EDITOR
348
+ #if !UNITY_IOS && !UNITY_ANDROID && AIRSHIP_PLAYER
349
349
  preWarmedCoreShaders = true;
350
350
  string[] collections = new[] {
351
351
  "MainMenu",
@@ -0,0 +1,11 @@
1
+ using System;
2
+ using UnityEngine;
3
+
4
+ [LuauAPI]
5
+ public class MinMaxCurveAPI : BaseLuaAPIClass
6
+ {
7
+ public override Type GetAPIType()
8
+ {
9
+ return typeof(ParticleSystem.MinMaxCurve);
10
+ }
11
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: a131bb02680e4e1f8365b29ded9cc9a6
3
+ timeCreated: 1749083306
@@ -24,8 +24,6 @@ namespace Code.Player.Character.NetworkedMovement
24
24
 
25
25
  [SerializeField] public NetworkAnimator? networkAnimator;
26
26
  public AnimationEventListener? animationEvents;
27
- public ParticleSystem? sprintVfx;
28
- public ParticleSystem? jumpPoofVfx;
29
27
 
30
28
  [Header("Variables")] public float minAirborneTime = .25f;
31
29
  public float particleMaxDistance = 25f;
@@ -59,19 +57,8 @@ namespace Code.Player.Character.NetworkedMovement
59
57
  private float lastGroundedTime = 0;
60
58
  private bool grounded = false;
61
59
 
62
- private void Awake()
63
- {
64
- if (this.sprintVfx)
65
- {
66
- sprintVfx.Stop();
67
- }
68
-
69
- if (this.jumpPoofVfx)
70
- {
71
- jumpPoofVfx.Stop();
72
- }
73
-
74
- // // Make a new instance of the animator override controller
60
+ private void Awake() {
61
+ // Make a new instance of the animator override controller
75
62
  if (!this.animatorOverride)
76
63
  {
77
64
  if (this.animator.runtimeAnimatorController is AnimatorOverrideController over)
@@ -130,19 +117,6 @@ namespace Code.Player.Character.NetworkedMovement
130
117
  SetState(new CharacterAnimationSyncData());
131
118
  }
132
119
 
133
- private void OnDisable()
134
- {
135
- if (sprintVfx)
136
- {
137
- sprintVfx.Stop();
138
- }
139
-
140
- if (jumpPoofVfx)
141
- {
142
- jumpPoofVfx.Stop();
143
- }
144
- }
145
-
146
120
  public bool IsInParticleDistance()
147
121
  {
148
122
  return true;
@@ -262,26 +236,10 @@ namespace Code.Player.Character.NetworkedMovement
262
236
  animator.SetBool("Sprinting",
263
237
  !syncedState.crouching && (syncedState.sprinting || syncedState.state == CharacterState.Sprinting));
264
238
 
265
- if (syncedState.jumping)
266
- {
239
+ if (syncedState.jumping) {
267
240
  SetTrigger("Jump");
268
241
  }
269
242
 
270
- if (sprintVfx)
271
- {
272
- if (newState == CharacterState.Sprinting)
273
- {
274
- if (this.IsInParticleDistance() && !sprintVfx.isPlaying)
275
- {
276
- sprintVfx.Play();
277
- }
278
- }
279
- else
280
- {
281
- sprintVfx.Stop();
282
- }
283
- }
284
-
285
243
  if (this.firstPerson)
286
244
  {
287
245
  animator.SetLayerWeight(0, 0);
@@ -294,24 +252,8 @@ namespace Code.Player.Character.NetworkedMovement
294
252
  //print("Set state: " + currentState);
295
253
  }
296
254
 
297
- [HideFromTS]
298
- public void OnCharacterMovementDisabled()
299
- {
300
- if (this.sprintVfx)
301
- {
302
- sprintVfx.Stop();
303
- }
304
-
305
- if (this.jumpPoofVfx)
306
- {
307
- jumpPoofVfx.Stop();
308
- }
309
- }
310
-
311
- private void SetTrigger(string trigger)
312
- {
313
- if (networkAnimator != null)
314
- {
255
+ private void SetTrigger(string trigger) {
256
+ if (networkAnimator != null) {
315
257
  networkAnimator.SetTrigger(trigger);
316
258
  return;
317
259
  }
@@ -196,7 +196,13 @@ namespace Code.Player {
196
196
  return;
197
197
  }
198
198
 
199
+ var startPollingTime = Time.time;
200
+ var sentFailedToReadyMsg = false;
199
201
  while (!conn.isAuthenticated || !conn.isReady) {
202
+ if (!sentFailedToReadyMsg && (Time.time - startPollingTime) > 10) {
203
+ sentFailedToReadyMsg = true;
204
+ Debug.LogError($"Failed to setup player for connection id {conn.connectionId}: isAuthenticated={conn.isAuthenticated} isReady={conn.isReady}");
205
+ }
200
206
  // print($"Waiting for {conn.connectionId} to be ready.");
201
207
  await Awaitable.NextFrameAsync();
202
208
  }
@@ -442,10 +442,11 @@ namespace VoxelWorldStuff {
442
442
  /// need quick collision changes that don't intend to persist.
443
443
  /// </summary>
444
444
  public void WriteTemporaryCollision(Vector3 position, bool hasCollision) {
445
+ var centerOfPos = Vector3Int.FloorToInt(position) + Vector3.one / 2;
445
446
  if (hasCollision) {
446
- VoxelWorldCollision.MakeCollider(this, Vector3Int.FloorToInt(position) + Vector3.one / 2, Vector3Int.one);
447
+ VoxelWorldCollision.MakeCollider(this, centerOfPos, Vector3Int.one);
447
448
  } else {
448
- VoxelWorldCollision.RemoveSingleVoxelCollision(this, position);
449
+ VoxelWorldCollision.RemoveSingleVoxelCollision(this, centerOfPos);
449
450
  }
450
451
  }
451
452
 
@@ -235,9 +235,6 @@ namespace VoxelWorldStuff {
235
235
 
236
236
  public static void RemoveSingleVoxelCollision(Chunk chunk, Vector3 pos) {
237
237
  var chunkGO = chunk.GetGameObject();
238
- // var worldPosition = chunk.chunkKey * VoxelWorld.chunkSize + pos;
239
- // Debug.Log("World position is " + worldPosition);
240
- Debug.DrawLine(pos - Vector3.one / 3, pos + Vector3.one / 3, Color.blue, 25);
241
238
  var resultCount = Physics.OverlapBoxNonAlloc(pos, Vector3.one / 3, chunkOverlapResults, chunkGO.transform.rotation, 1 << chunkGO.layer, QueryTriggerInteraction.Ignore);
242
239
  if (resultCount == 0) return; // Already no collider here
243
240
 
@@ -251,7 +248,11 @@ namespace VoxelWorldStuff {
251
248
  var minCorner = (bcCenter - bcSize / 2);
252
249
  var posRelativeToSize = Vector3Int.FloorToInt(pos - minCorner);
253
250
 
254
- Debug.Log($"Splitting! posRelativeToSize={posRelativeToSize} bcSize={bcSize} minCorner={minCorner} bcCenter={bcCenter}");
251
+ // Debug.Log($"Splitting! posRelativeToSize={posRelativeToSize} bcSize={bcSize} minCorner={minCorner} bcCenter={bcCenter}");
252
+
253
+ var bcComp = new GameObject("ComponentTrue");
254
+ bcComp.transform.localScale = bcSize;
255
+ bcComp.transform.position = bcCenter;
255
256
 
256
257
  // Create 6 new colliders split off
257
258
  if (posRelativeToSize.x > 0) {
@@ -266,22 +267,22 @@ namespace VoxelWorldStuff {
266
267
  }
267
268
  if (posRelativeToSize.y > 0) {
268
269
  var size = new Vector3(1, posRelativeToSize.y, bcSize.z);
269
- var center = new Vector3(bcCenter.x, minCorner.y + posRelativeToSize.y / 2f, bcCenter.z);
270
+ var center = new Vector3(minCorner.x + posRelativeToSize.x + 0.5f, minCorner.y + posRelativeToSize.y / 2f, bcCenter.z);
270
271
  MakeCollider(chunk, center, Vector3Int.FloorToInt(size));
271
272
  }
272
273
  if (posRelativeToSize.y < bcSize.y - 1) {
273
274
  var size = new Vector3(1, bcSize.y - posRelativeToSize.y - 1, bcSize.z);
274
- var center = new Vector3(bcCenter.x, minCorner.y + (posRelativeToSize.y + 1) + (bcSize.y - (posRelativeToSize.y + 1)) / 2, bcCenter.z);
275
+ var center = new Vector3(minCorner.x + posRelativeToSize.x + 0.5f, minCorner.y + (posRelativeToSize.y + 1) + (bcSize.y - (posRelativeToSize.y + 1)) / 2, bcCenter.z);
275
276
  MakeCollider(chunk, center, Vector3Int.FloorToInt(size));
276
277
  }
277
278
  if (posRelativeToSize.z > 0) {
278
279
  var size = new Vector3(1, 1, posRelativeToSize.z);
279
- var center = new Vector3(bcCenter.x, bcCenter.y, minCorner.z + posRelativeToSize.z / 2f);
280
+ var center = new Vector3(minCorner.x + posRelativeToSize.x + 0.5f, minCorner.y + posRelativeToSize.y + 0.5f, minCorner.z + posRelativeToSize.z / 2f);
280
281
  MakeCollider(chunk, center, Vector3Int.FloorToInt(size));
281
282
  }
282
283
  if (posRelativeToSize.z < bcSize.z - 1) {
283
284
  var size = new Vector3(1, 1, bcSize.z - posRelativeToSize.z - 1);
284
- var center = new Vector3(bcCenter.x, bcCenter.y, minCorner.z + (posRelativeToSize.z + 1) + (bcSize.z - (posRelativeToSize.z + 1)) / 2);
285
+ var center = new Vector3(minCorner.x + posRelativeToSize.x + 0.5f, minCorner.y + posRelativeToSize.y + 0.5f, minCorner.z + (posRelativeToSize.z + 1) + (bcSize.z - (posRelativeToSize.z + 1)) / 2);
285
286
  MakeCollider(chunk, center, Vector3Int.FloorToInt(size));
286
287
  }
287
288
  Object.Destroy(bc);
@@ -426,7 +426,7 @@ Canvas:
426
426
  m_OverrideSorting: 0
427
427
  m_OverridePixelPerfect: 0
428
428
  m_SortingBucketNormalizedSize: 0
429
- m_VertexColorAlwaysGammaSpace: 0
429
+ m_VertexColorAlwaysGammaSpace: 1
430
430
  m_AdditionalShaderChannelsFlag: 25
431
431
  m_UpdateRectTransformForStandalone: 0
432
432
  m_SortingLayerID: 0
@@ -2686,7 +2686,7 @@ GameObject:
2686
2686
  - component: {fileID: 845665600302246255}
2687
2687
  - component: {fileID: 2176320651782205306}
2688
2688
  m_Layer: 5
2689
- m_Name: InputField
2689
+ m_Name: DevConsoleInputField
2690
2690
  m_TagString: Untagged
2691
2691
  m_Icon: {fileID: 0}
2692
2692
  m_NavMeshLayer: 0
@@ -2765,7 +2765,7 @@ MonoBehaviour:
2765
2765
  m_Name:
2766
2766
  m_EditorClassIdentifier:
2767
2767
  m_Navigation:
2768
- m_Mode: 3
2768
+ m_Mode: 0
2769
2769
  m_WrapAround: 0
2770
2770
  m_SelectOnUp: {fileID: 0}
2771
2771
  m_SelectOnDown: {fileID: 0}
@@ -624,10 +624,8 @@ namespace Airship.DevConsole
624
624
  /// <summary>
625
625
  /// Open the dev console - making it visible.
626
626
  /// </summary>
627
- internal void OpenConsole()
628
- {
629
- if (!_init && (!ConsoleIsEnabled || ConsoleIsShowing))
630
- {
627
+ internal void OpenConsole() {
628
+ if (!_init && (!ConsoleIsEnabled || ConsoleIsShowing)) {
631
629
  return;
632
630
  }
633
631
 
@@ -644,6 +642,7 @@ namespace Airship.DevConsole
644
642
  // _canvasGroup.blocksRaycasts = true;
645
643
  this.canvas.enabled = true;
646
644
  ConsoleIsShowing = true;
645
+ this._inputField.gameObject.SetActive(true);
647
646
  _focusInputField = true;
648
647
 
649
648
  if (this.firstOpen) {
@@ -658,26 +657,27 @@ namespace Airship.DevConsole
658
657
  /// <summary>
659
658
  /// Close the dev console - hiding it in the background.
660
659
  /// </summary>
661
- public void CloseConsole()
662
- {
663
- if (!_init && (!ConsoleIsEnabled || !ConsoleIsShowing))
664
- {
660
+ public void CloseConsole() {
661
+ if (!_init && (!ConsoleIsEnabled || !ConsoleIsShowing)) {
665
662
  return;
666
663
  }
667
664
 
665
+ ConsoleIsShowing = false;
668
666
 
669
667
  // _canvasGroup.alpha = 0f;
670
668
  // _canvasGroup.interactable = false;
671
669
  // _canvasGroup.blocksRaycasts = false;
672
670
  this.canvas.enabled = false;
673
- ConsoleIsShowing = false;
671
+ this._inputField.gameObject.SetActive(false);
674
672
  _repositioning = false;
675
673
  _resizing = false;
676
674
  _focusInputField = false;
677
- if (_inputField.isFocused && EventSystem.current != null)
678
- {
675
+ _inputField.textComponent.alignment = TextAnchor.MiddleLeft;
676
+
677
+ if (EventSystem.current != null) {
678
+ // if (_inputField.isFocused)
679
+ print("setting to null");
679
680
  EventSystem.current.SetSelectedGameObject(null);
680
- this._inputField.textComponent.alignment = TextAnchor.MiddleLeft;
681
681
  }
682
682
 
683
683
  DevConsole.InvokeOnConsoleClosed();
@@ -1384,8 +1384,8 @@ namespace Airship.DevConsole
1384
1384
  }
1385
1385
 
1386
1386
  // Force the input field to be focused by the event system
1387
- if (_focusInputField && !Application.isMobilePlatform)
1388
- {
1387
+ if (_focusInputField && !Application.isMobilePlatform) {
1388
+ Debug.Log("Selecting input field.");
1389
1389
  EventSystem.current.SetSelectedGameObject(_inputField.gameObject);
1390
1390
  _focusInputField = false;
1391
1391
  }
Binary file
@@ -1045,7 +1045,7 @@ namespace Mirror
1045
1045
  // the players object for example.
1046
1046
  public static bool Ready()
1047
1047
  {
1048
- // Debug.Log($"NetworkClient.Ready() called with active scene: " + SceneManager.GetActiveScene().name);
1048
+ Debug.Log($"NetworkClient.Ready() called with active scene: " + SceneManager.GetActiveScene().name);
1049
1049
  if (ready)
1050
1050
  {
1051
1051
  Debug.LogError("NetworkClient is already ready. It shouldn't be called twice.");
@@ -1155,7 +1155,7 @@ namespace Mirror
1155
1155
  {
1156
1156
  // debug message is very important. if we ever break anything then
1157
1157
  // it's very obvious to notice.
1158
- //Debug.Log("Finished loading scene in client-only mode.");
1158
+ Debug.Log("Finished loading scene in client-only mode.");
1159
1159
 
1160
1160
  if (clientReadyConnection != null)
1161
1161
  {
@@ -1165,6 +1165,7 @@ namespace Mirror
1165
1165
 
1166
1166
  if (NetworkClient.isConnected)
1167
1167
  OnClientSceneChanged();
1168
+ else Debug.LogWarning("Not sending client ready: not connected");
1168
1169
  }
1169
1170
 
1170
1171
  /// <summary>
@@ -1529,6 +1530,8 @@ namespace Mirror
1529
1530
  public virtual void OnClientSceneChanged()
1530
1531
  {
1531
1532
  // always become ready.
1533
+ if (!NetworkClient.connection.isAuthenticated) Debug.LogWarning("Not sending client ready: not authenticated");
1534
+ if (NetworkClient.ready) Debug.LogWarning("Not sending client ready: already ready");
1532
1535
  if (NetworkClient.connection.isAuthenticated && !NetworkClient.ready) NetworkClient.Ready();
1533
1536
 
1534
1537
  // Only call AddPlayer for normal scene changes, not additive load/unload
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gg.easy.airship",
3
- "version": "0.1.2139",
3
+ "version": "0.1.2140",
4
4
  "displayName": "Airship",
5
5
  "unity": "2021.3",
6
6
  "unityRelease": "12f1",