Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug "Argument 1 may not be passed with the 'ref' keyword"

Discussion in 'Visual Scripting' started by CatCentral, Jun 13, 2023.

  1. CatCentral

    CatCentral

    Joined:
    Aug 15, 2022
    Posts:
    3
    I was attempting to use "Move Main Window To" but I got that error message, here's the alleged incorrect code.
    Code (CSharp):
    1. // UnityEngine.Screen.MoveMainWindowTo
    2.         [global::UnityEngine.Scripting.PreserveAttribute()]
    3.         public static void UnityEngine_Screen_MoveMainWindowTo()
    4.         {
    5.             global::UnityEngine.DisplayInfo arg0 = default(global::UnityEngine.DisplayInfo);
    6.             global::UnityEngine.Vector2Int arg1 = default(global::UnityEngine.Vector2Int);
    7.             global::UnityEngine.Screen.MoveMainWindowTo(ref arg0, arg1);
    8.             global::Unity.VisualScripting.ReflectionInvoker optimized = new global::Unity.VisualScripting.ReflectionInvoker(default(global::System.Reflection.MethodInfo));
    9.             optimized.Invoke(default(object[]));
    10.         }
     
  2. Halfspacer

    Halfspacer

    Joined:
    Sep 13, 2014
    Posts:
    23