fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string[] objNames = new string[]{"GO1","GO2"};
  8. GameObject[] arrayGO = new GameObject[objNames.Length];
  9. for (int i=0; i<objNames.Length; i++) {
  10. arrayGO[i] = gameobject.Find(objNames[i]);
  11. }
  12. }
  13. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(8,3): error CS0246: The type or namespace name `GameObject' could not be found. Are you missing an assembly reference?
prog.cs(10,17): error CS0103: The name `gameobject' does not exist in the current context
prog.cs(10,4): error CS0841: A local variable `arrayGO' cannot be used before it is declared
Compilation failed: 3 error(s), 0 warnings
stdout
Standard output is empty