WindowRotator.cs ウィンドウをぐるぐる回す using UnityEngine; using System; using System.Runtime.InteropServices; public class WindowRotator : MonoBehaviour { [DllImport("user32.dll")] static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWIA, int x, int y, int cx, int cy, uint uFlags); [DllImport("user32.dll")] static extern IntPtr GetActiveWindow(); IntPtr hWnd; void Awake() { hWnd = GetActiveWindow(); } void Update() { int x = (int)(200f + 100f * Mathf.Cos(Time.time)); int y = (int)(200f + 100f * Mathf.Sin(Time.time)); SetWindowPos(hWnd, IntPtr.Zero, x, y, 0, 0, 0x4015); } } ウィンドウが勝手に移動