Beispiel #1
0
        // 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);
            }
        }
Beispiel #2
0
        // 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}");
            }
        }
Beispiel #3
0
        // 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");
            }
        }