Skip to content

Instantly share code, notes, and snippets.

@GhatSmith
Last active October 11, 2018 23:20
Show Gist options
  • Save GhatSmith/45a07ac758fe876bd81367bd42bf8724 to your computer and use it in GitHub Desktop.
Save GhatSmith/45a07ac758fe876bd81367bd42bf8724 to your computer and use it in GitHub Desktop.
Visual Studio snippet for Unity Editor dependent compilation
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>#ifEditor</Title>
<Shortcut>#ifEditor</Shortcut>
<Description>Code snippet for #if UNITY_EDITOR</Description>
<Author>Ghat Smith</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>expression</ID>
<ToolTip>Preprocessor expression to evaluate</ToolTip>
<Default>UNITY_EDITOR</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[#if $expression$
$selected$ $end$
#endif]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment