Skip to content

Commit 15876e9

Browse files
committed
Merge branch 'main' of github.com:easy-games/airship
2 parents 30d8287 + 11a6361 commit 15876e9

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

Editor/TypescriptServices/Editor/TypescriptStatusbar.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ namespace Airship.Editor {
88
[InitializeOnLoad]
99
public class TypescriptStatusbar {
1010
static TypescriptStatusbar() {
11-
12-
11+
#if AIRSHIP_PLAYER
12+
return;
13+
#endif
14+
if (!TypescriptServices.IsValidEditor) return;
1315
EditorApplication.delayCall += MountStatusbar;
1416
}
1517

Editor/TypescriptServices/TypescriptServices.cs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#if UNITY_EDITOR
2+
using System;
23
using System.Collections;
4+
using System.Linq;
35
using Editor;
46
using Editor.EditorInternal;
57
using Editor.Packages;
@@ -24,13 +26,21 @@ public void Modify() {
2426
/// Main static class for handling the TypeScript services
2527
/// </summary>
2628
public static class TypescriptServices {
29+
/// <summary>
30+
/// Returns true if this is a valid editor window to run TSS in
31+
/// </summary>
32+
public static bool IsValidEditor =>
33+
!ClonesManager.IsClone() &&
34+
!Environment.GetCommandLineArgs().Contains("--virtual-project-clone");
35+
2736
[InitializeOnLoadMethod]
2837
public static void OnLoad() {
29-
var tags = CurrentPlayer.ReadOnlyTags();
30-
var isCloneOrMPPM = tags.Length > 0 || ClonesManager.IsClone();
31-
38+
#if AIRSHIP_PLAYER
39+
Debug.LogWarning("[TypescriptServices] Skipped, in Airship Player mode");
40+
return;
41+
#endif
3242
// If a server or clone - ignore
33-
if (isCloneOrMPPM) return;
43+
if (!IsValidEditor) return;
3444
EditorApplication.delayCall += OnLoadDeferred;
3545

3646
EditorApplication.playModeStateChanged += PlayModeStateChanged;

0 commit comments

Comments
 (0)