Skip to content

Instantly share code, notes, and snippets.

@HassakuTb
Created July 17, 2018 07:12
Show Gist options
  • Save HassakuTb/dc4851279da447dc6efd58b2bebcb1e9 to your computer and use it in GitHub Desktop.
Save HassakuTb/dc4851279da447dc6efd58b2bebcb1e9 to your computer and use it in GitHub Desktop.
CS Snippet GetComponent
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>getcomp</Title>
<Shortcut>getcomp</Shortcut>
<Description>dependency injection using Get Component</Description>
<Author></Author>
</Header>
<Snippet>
<Declarations>
<Literal Editable="true">
<ID>type</ID>
<ToolTip>type of component</ToolTip>
<Default>Button</Default></Literal>
<Literal Editable="true">
<ID>var</ID>
<ToolTip>Variable name</ToolTip>
<Default>button</Default></Literal>
</Declarations>
<Code Language="csharp"><![CDATA[$end$$var$ = GetComponent<$type$>();]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment