-
-
Save udasan/b98c871ff11fd3c58971b4c07d12b0da to your computer and use it in GitHub Desktop.
Unity Serialized propety()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>Propety</Title> | |
<Author>izm</Author> | |
<Description>AccessCache</Description> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
<SnippetType>SurroundsWith</SnippetType> | |
</SnippetTypes> | |
<Shortcut>props</Shortcut> | |
</Header> | |
<Snippet> | |
<Declarations> | |
<Literal> | |
<ID>Tooltip</ID> | |
<Default>Description Here</Default> | |
</Literal> | |
<Literal> | |
<ID>target</ID> | |
<Default>target</Default> | |
</Literal> | |
<Literal> | |
<ID>Component</ID> | |
<Default>Transform</Default> | |
</Literal> | |
<Literal> | |
<ID>Name</ID> | |
<Default>Name</Default> | |
</Literal> | |
</Declarations> | |
<Code Kind="any" Language="CSharp"><![CDATA[[SerializeField] | |
[Tooltip("$Tooltip$")] | |
private $Component$ _$target$; | |
public $Component$ $target$ | |
{ | |
get { | |
if(_$target$ ==null){ | |
_$target$= GameObject.Find("$Name$").GetComponent<$Component$>(); | |
} | |
return this._$target$; } | |
set { this._$target$ = value; } | |
}]]></Code> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
izm 氏の neon-izm/Unity.snippet をちょっと修正させていただきました。