Skip to content

Commit

Permalink
Add an error for when a referenced script does not have an UdonSharpB…
Browse files Browse the repository at this point in the history
…ehaviour defined

- This was causing issues further down the line after compiling
  • Loading branch information
MerlinVR committed Sep 6, 2020
1 parent b400682 commit a525ab5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Assets/UdonSharp/Editor/UdonSharpClassVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public override void VisitCompilationUnit(CompilationUnitSyntax node)
}

classDefinition.methodDefinitions = methodVisitor.definedMethods;

if (classCount == 0)
throw new System.Exception($"No UdonSharpBehaviour class found in script file, you must define an UdonSharpBehaviour class in a script referenced by and UdonSharpProgramAsset");
}

public override void VisitClassDeclaration(ClassDeclarationSyntax node)
Expand Down

0 comments on commit a525ab5

Please sign in to comment.