public static void Attach(KScreen screen) { if (screen == null || screen.name == "SimpleInfoScreen") { return; } DraggablePanel panel = screen.FindOrAddUnityComponent <DraggablePanel>(); if (panel == null) { return; } panel.Screen = screen; var rect = panel.GetComponentInParent <RectTransform>(); if (rect == null) { return; } panel.DefaultPosition = rect.anchoredPosition; State.Common.Logger.LogDebug("Attached to KScreen", screen.displayName); }
// TODO: call when position is set by game public static void SetPositionFromFile(KScreen screen) { DraggablePanel panel = screen.FindOrAddUnityComponent <DraggablePanel>(); if (panel != null && panel.LoadPosition(out Vector2 newPosition)) { panel.SetPosition(newPosition); } }
public static void Attach(KScreen screen) { DraggablePanel panel = screen.FindOrAddUnityComponent <DraggablePanel>(); if (panel == null) { return; } panel.Screen = screen; }
public static void Attach(KScreen screen) { DraggablePanel panel = screen.FindOrAddUnityComponent <DraggablePanel>(); if (panel == null) { return; } panel.Screen = screen; if (Debugging) { Debug.Log("DraggablePanel: Attached to KScreen" + screen.displayName); } }
// TODO: call when position is set by game public static void SetPositionFromFile(KScreen screen) { DraggablePanel panel = screen.FindOrAddUnityComponent <DraggablePanel>(); if (panel == null) { State.Common.Logger.LogDebug("Can't FindOrAddUnityComponent"); return; } if (panel.LoadPosition(out Vector2 newPosition)) { panel.SetPosition(newPosition); State.Common.Logger.Log($"Loaded position: {newPosition} for {screen.name}"); } }
// TODO: call when position is set by game public static void SetPositionFromFile(KScreen screen) { if (Debugging) { Debug.Log("DraggablePanel: SetPositionFromFile enter"); } DraggablePanel panel = screen.FindOrAddUnityComponent <DraggablePanel>(); if (panel != null) { if (panel.LoadPosition(out Vector2 newPosition)) { panel.SetPosition(newPosition); Debug.Log("DraggablePanel: Loaded position: " + newPosition); } } else if (Debugging) { Debug.Log("DraggablePanel: Can't FindOrAddUnityComponent"); } }
public static void Attach(KScreen screen) { var draggable = screen.FindOrAddUnityComponent <DraggablePanel>(); draggable.Screen = screen; }