Skip to content

Commit e868836

Browse files
committed
Call AirshipAwake in actual Awake method
1 parent 17d10cf commit e868836

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Editor/AirshipComponentEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ private void DrawScriptBindingProperties(AirshipComponent binding) {
302302

303303
GUI.enabled = true;
304304

305-
if (newScript == null) {
305+
if (newScript == null && !Application.isPlaying) {
306306
EditorGUILayout.Space(5);
307307

308308
var rect = GUILayoutUtility.GetLastRect();

Runtime/Code/Luau/AirshipComponent.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ public static AirshipComponent Create(GameObject go, AirshipScript script, LuauC
8383

8484
private void Awake() {
8585
Init();
86+
87+
if (thread == IntPtr.Zero || !LuauCore.IsReady) return;
88+
InvokeAirshipLifecycle(AirshipComponentUpdateType.AirshipAwake);
8689
}
8790

8891
public void Init() {
@@ -177,7 +180,6 @@ private void AwakeAirshipComponent() {
177180
}
178181

179182
LuauPlugin.LuauInitializeAirshipComponent(context, thread, AirshipBehaviourRootV2.GetId(gameObject), _airshipComponentId, propertyDtos);
180-
InvokeAirshipLifecycle(AirshipComponentUpdateType.AirshipAwake); // TODO: Maybe move this to the actual Awake method?
181183
}
182184

183185
private void Start() {

0 commit comments

Comments
 (0)